(window.webpackJsonp=window.webpackJsonp||[]).push([[183,5,7],{"+NIl":function(vt,et,ne){(function(ae){ae(ne("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function(J,D){"use strict";function Y(u,r){u.cmdState.push(r)}function F(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function U(u){var r=u.cmdState.pop();r&&r.closeBracket()}function W(u){for(var r=u.cmdState,d=r.length-1;d>=0;d--){var o=r[d];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function j(u,r,d){return function(){this.name=u,this.bracketNo=0,this.style=r,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=j("importmodule","tag",["string","builtin"]),k.documentclass=j("documentclass","tag",["","atom"]),k.usepackage=j("usepackage","tag",["atom"]),k.begin=j("begin","tag",["atom"]),k.end=j("end","tag",["atom"]),k.label=j("label","tag",["atom"]),k.ref=j("ref","tag",["atom"]),k.eqref=j("eqref","tag",["atom"]),k.cite=j("cite","tag",["atom"]),k.bibitem=j("bibitem","tag",["atom"]),k.Bibitem=j("Bibitem","tag",["atom"]),k.RBibitem=j("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(u,r){u.f=r}function m(u,r){var d;if(u.match(/^\\[a-zA-Z@]+/)){var o=u.current().slice(1);return d=k.hasOwnProperty(o)?k[o]:k.DEFAULT,d=new d,Y(r,d),I(r,f),d.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return I(r,function(l,p){return c(l,p,"\\]")}),"keyword";if(u.match("\\("))return I(r,function(l,p){return c(l,p,"\\)")}),"keyword";if(u.match("$$"))return I(r,function(l,p){return c(l,p,"$$")}),"keyword";if(u.match("$"))return I(r,function(l,p){return c(l,p,"$")}),"keyword";var s=u.next();if(s=="%")return u.skipToEnd(),"comment";if(s=="}"||s=="]"){if(d=F(r),d)d.closeBracket(s),I(r,f);else return"error";return"bracket"}else return s=="{"||s=="["?(d=k.DEFAULT,d=new d,Y(r,d),"bracket"):/\d/.test(s)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),d=W(r),d.name=="begin"&&(d.argument=u.current()),d.styleIdentifier())}function c(u,r,d){if(u.eatSpace())return null;if(d&&u.match(d))return I(r,m),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=u.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(u.skipToEnd(),"comment"):"error"}function f(u,r){var d=u.peek(),o;return d=="{"||d=="["?(o=F(r),o.openBracket(d),u.eat(d),I(r,m),"bracket"):/[ \t\r]/.test(d)?(u.eat(d),null):(I(r,m),U(r),m(u,r))}return{startState:function(){var u=D.inMathMode?function(r,d){return c(r,d)}:m;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,r){return r.f(u,r)},blankLine:function(u){u.f=m,u.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"+ua5":function(vt,et,ne){},"19Vz":function(vt,et,ne){(function(ae){ae(ne("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(j,k,I){var m=I&&I!=ae.Init;if(k&&!m)j.on("blur",F),j.on("change",U),j.on("swapDoc",U),ae.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){Y(j)}),U(j);else if(!k&&m){j.off("blur",F),j.off("change",U),j.off("swapDoc",U),ae.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),J(j);var c=j.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}k&&!j.hasFocus()&&F(j)});function J(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function D(j){J(j);var k=j.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=j.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var I=j.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),k.appendChild(I),j.display.lineSpace.insertBefore(k,j.display.lineSpace.firstChild)}function Y(j){setTimeout(function(){var k=!1,I=j.getInputField();I.nodeName=="TEXTAREA"?k=!I.value:j.lineCount()==1&&(k=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),k?D(j):J(j)},20)}function F(j){W(j)&&D(j)}function U(j){var k=j.getWrapperElement(),I=W(j);k.className=k.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?D(j):J(j)}function W(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(vt,et,ne){(function(ae){ae(ne("VrN/"))})(function(ae){"use strict";var J={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(Y,F){var U=Y.indentUnit,W={},j=F.htmlMode?J:D;for(var k in j)W[k]=j[k];for(var k in F)W[k]=F[k];var I,m;function c(h,_){function g(P){return _.tokenize=P,P(h,_)}var b=h.next();if(b=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?g(r("atom","]]>")):null:h.match("--")?g(r("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),g(d(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),_.tokenize=r("meta","?>"),"meta"):(I=h.eat("/")?"closeTag":"openTag",_.tokenize=f,"tag bracket");if(b=="&"){var M;return h.eat("#")?h.eat("x")?M=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):M=h.eatWhile(/[\d]/)&&h.eat(";"):M=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),M?"atom":"error"}else return h.eatWhile(/[^&<]/),null}c.isInText=!0;function f(h,_){var g=h.next();if(g==">"||g=="/"&&h.eat(">"))return _.tokenize=c,I=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return I="equals",null;if(g=="<"){_.tokenize=c,_.state=p,_.tagName=_.tagStart=null;var b=_.tokenize(h,_);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(g)?(_.tokenize=u(g),_.stringStartCol=h.column(),_.tokenize(h,_)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(h){var _=function(g,b){for(;!g.eol();)if(g.next()==h){b.tokenize=f;break}return"string"};return _.isInAttribute=!0,_}function r(h,_){return function(g,b){for(;!g.eol();){if(g.match(_)){b.tokenize=c;break}g.next()}return h}}function d(h){return function(_,g){for(var b;(b=_.next())!=null;){if(b=="<")return g.tokenize=d(h+1),g.tokenize(_,g);if(b==">")if(h==1){g.tokenize=c;break}else return g.tokenize=d(h-1),g.tokenize(_,g)}return"meta"}}function o(h,_,g){this.prev=h.context,this.tagName=_,this.indent=h.indented,this.startOfLine=g,(W.doNotIndent.hasOwnProperty(_)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function s(h){h.context&&(h.context=h.context.prev)}function l(h,_){for(var g;;){if(!h.context)return;if(g=h.context.tagName,!W.contextGrabbers.hasOwnProperty(g)||!W.contextGrabbers[g].hasOwnProperty(_))return;s(h)}}function p(h,_,g){return h=="openTag"?(g.tagStart=_.column(),R):h=="closeTag"?w:p}function R(h,_,g){return h=="word"?(g.tagName=_.current(),m="tag",A):W.allowMissingTagName&&h=="endTag"?(m="tag bracket",A(h,_,g)):(m="error",R)}function w(h,_,g){if(h=="word"){var b=_.current();return g.context&&g.context.tagName!=b&&W.implicitlyClosed.hasOwnProperty(g.context.tagName)&&s(g),g.context&&g.context.tagName==b||W.matchClosing===!1?(m="tag",x):(m="tag error",O)}else return W.allowMissingTagName&&h=="endTag"?(m="tag bracket",x(h,_,g)):(m="error",O)}function x(h,_,g){return h!="endTag"?(m="error",x):(s(g),p)}function O(h,_,g){return m="error",x(h,_,g)}function A(h,_,g){if(h=="word")return m="attribute",T;if(h=="endTag"||h=="selfcloseTag"){var b=g.tagName,M=g.tagStart;return g.tagName=g.tagStart=null,h=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(b)?l(g,b):(l(g,b),g.context=new o(g,b,M==g.indented)),p}return m="error",A}function T(h,_,g){return h=="equals"?E:(W.allowMissing||(m="error"),A(h,_,g))}function E(h,_,g){return h=="string"?y:h=="word"&&W.allowUnquoted?(m="string",A):(m="error",A(h,_,g))}function y(h,_,g){return h=="string"?y:A(h,_,g)}return{startState:function(h){var _={tokenize:c,state:p,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(_.baseIndent=h),_},token:function(h,_){if(!_.tagName&&h.sol()&&(_.indented=h.indentation()),h.eatSpace())return null;I=null;var g=_.tokenize(h,_);return(g||I)&&g!="comment"&&(m=null,_.state=_.state(I||g,h,_),m&&(g=m=="error"?g+" error":m)),g},indent:function(h,_,g){var b=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+U;if(b&&b.noIndent)return ae.Pass;if(h.tokenize!=f&&h.tokenize!=c)return g?g.match(/^(\s*)/)[0].length:0;if(h.tagName)return W.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+U*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/$/,blockCommentStart:"",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(h){h.state==E&&(h.state=A)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var _=[],g=h.context;g;g=g.prev)g.tagName&&_.push(g.tagName);return _.reverse()}}}),ae.defineMIME("text/xml","xml"),ae.defineMIME("application/xml","xml"),ae.mimeModes.hasOwnProperty("text/html")||ae.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"30zm":function(vt,et,ne){"use strict";var ae=ne("jCWc"),J=ne("kPKH"),D=ne("k1fw"),Y=ne("tJVT"),F=ne("PpiC"),U=ne("B9cy"),W=ne("Ol7k"),j=ne("lUTK"),k=ne("BvKs"),I=ne("q1tI"),m=ne.n(I),c=ne("Ty5D"),f=ne("55Ip"),u=ne("9kvl"),r=ne("m3rI"),d=ne("kzJb"),o=ne.n(d),s=k.a.SubMenu,l=W.a.Sider,p=W.a.Content,R=function(x){var O=x.messages,A=x.globalSetting,T=x.loading,E=x.user,y=x.dispatch,h=Object(F.a)(x,["messages","globalSetting","loading","user","dispatch"]),_=Object(c.i)(),g=E.userInfo,b=Object(c.h)(),M=O.tidingsList,P=O.privateMessage,K=O.unreadInfo,V=Object(I.useState)({per_page:10,page:1}),B=Object(Y.a)(V,2),C=B[0],$=B[1];Object(I.useEffect)(function(){ee()},[_.userId]);var ee=function(){y({type:"messages/unreadMessageInfo",payload:Object(D.a)(Object(D.a)({},C),_)})};return m.a.createElement(J.a,{flex:"264px"},m.a.createElement("aside",{className:o.a.userInfo},m.a.createElement("img",{className:"mt40",src:r.a.IMG_SERVER+"/images/"+(g==null?void 0:g.image_url)}),m.a.createElement("p",{className:"font24 mt10"},g==null?void 0:g.username),m.a.createElement("p",{className:"mt20"},g==null?void 0:g.user_identity)),m.a.createElement("ul",{className:o.a.navInfo},m.a.createElement(f.a,{to:"/messages/".concat(g==null?void 0:g.login,"/user_tidings")},m.a.createElement("li",{className:b.pathname.indexOf("user_tidings")>-1&&o.a.actived},"\u6D88\u606F",!!(K!=null&&K.unread_tiding_count)&&m.a.createElement("span",{className:o.a.newTip},K==null?void 0:K.unread_tiding_count))),m.a.createElement(f.a,{to:"/messages/".concat(g==null?void 0:g.login,"/private_messages")},m.a.createElement("li",{className:(b.pathname.indexOf("private_messages")>-1||b.pathname.indexOf("message_detail")>-1)&&o.a.actived},"\u79C1\u4FE1",!!(K!=null&&K.unread_message_count)&&m.a.createElement("span",{className:o.a.newTip},K==null?void 0:K.unread_message_count)))))};et.a=Object(u.a)(function(w){var x=w.messages,O=w.loading,A=w.user,T=w.globalSetting;return{messages:x,globalSetting:T,user:A,loading:O.effects}})(R)},"55Ip":function(vt,et,ne){"use strict";ne.d(et,"a",function(){return l});var ae=ne("Ty5D"),J=ne("dI71"),D=ne("q1tI"),Y=ne.n(D),F=ne("YS25"),U=ne("17x9"),W=ne.n(U),j=ne("wx14"),k=ne("zLVn"),I=ne("9R94"),m=function(E){Object(J.a)(y,E);function y(){for(var _,g=arguments.length,b=new Array(g),M=0;Mee&&(ee=C.line_indent_level));var re={mode:$,parent:C,last_token:C?C.last_token:new f(l.START_BLOCK,""),last_word:C?C.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ee,alignment:0,line_indent_level:C?C.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},V.prototype._reset=function(C){var $=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new c(this._options,$),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var ee=new d(C,this._options);return this._tokens=ee.tokenize(),C},V.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,$=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
`,$&&u.lineBreak.test($||"")&&(ee=$.match(u.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return C=this._output.get_code(ee),C},V.prototype.handle_token=function(C,$){C.type===l.START_EXPR?this.handle_start_expr(C):C.type===l.END_EXPR?this.handle_end_expr(C):C.type===l.START_BLOCK?this.handle_start_block(C):C.type===l.END_BLOCK?this.handle_end_block(C):C.type===l.WORD?this.handle_word(C):C.type===l.RESERVED?this.handle_word(C):C.type===l.SEMICOLON?this.handle_semicolon(C):C.type===l.STRING?this.handle_string(C):C.type===l.EQUALS?this.handle_equals(C):C.type===l.OPERATOR?this.handle_operator(C):C.type===l.COMMA?this.handle_comma(C):C.type===l.BLOCK_COMMENT?this.handle_block_comment(C,$):C.type===l.COMMENT?this.handle_comment(C,$):C.type===l.DOT?this.handle_dot(C):C.type===l.EOF?this.handle_eof(C):C.type===l.UNKNOWN?this.handle_unknown(C,$):this.handle_unknown(C,$)},V.prototype.handle_whitespace_and_comments=function(C,$){var ee=C.newlines,re=this._options.keep_array_indentation&&b(this._flags.mode);if(C.comments_before)for(var ue=C.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,$),this.handle_token(ue,$),ue=C.comments_before.next();if(re)for(var Te=0;Te0,$);else if(this._options.max_preserve_newlines&&ee>this._options.max_preserve_newlines&&(ee=this._options.max_preserve_newlines),this._options.preserve_newlines&&ee>1){this.print_newline(!1,$);for(var ye=1;ye0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},V.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},V.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},V.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},V.prototype.start_of_statement=function(C){var $=!1;return $=$||O(this._flags.last_token,["var","let","const"])&&C.type===l.WORD,$=$||x(this._flags.last_token,"do"),$=$||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&O(this._flags.last_token,B)&&!C.newlines,$=$||x(this._flags.last_token,"else")&&!(x(C,"if")&&!C.comments_before),$=$||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),$=$||this._flags.last_token.type===l.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==l.WORD&&C.type!==l.RESERVED,$=$||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),$?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,O(C,["do","for","if","while"])),!0):!1},V.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var $=h.Expression;if(C.text==="["){if(this._flags.last_token.type===l.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(C),this.set_mode($),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}$=h.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),p(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,$=h.ForInitializer):p(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,$=h.Conditional):p(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(p(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var re=this._tokens.peek(-4);O(ee,["async","function"])||ee.text==="*"&&O(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(re.text==="{"||re.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(C);(this._flags.last_token.type===l.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(p(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&p(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===l.START_BLOCK?this.print_newline():(this._flags.last_token.type===l.END_EXPR||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===l.COMMA)&&this.allow_wrap_or_preserved_newline(C,C.newlines),this.print_token(C),this.set_mode($),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},V.prototype.handle_end_expr=function(C){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===l.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(C),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},V.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var $=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):ee&&(p(ee.text,[":",","])&&p($.type,[l.STRING,l.WORD,l.RESERVED])||p($.text,["get","set","..."])&&p(ee.type,[l.WORD,l.RESERVED]))?p(this._last_last_text,["class","interface"])&&!p(ee.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===l.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):p(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!$.comments_before&&$.text==="}",ue=re&&this._flags.last_word==="function"&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var Te=0,ye=null;this._flags.inline_frame=!0;do if(Te+=1,ye=this._tokens.peek(Te-1),ye.newlines){this._flags.inline_frame=!1;break}while(ye.type!==l.EOF&&!(ye.type===l.END_BLOCK&&ye.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(ue||this._flags.last_token.type===l.EQUALS||O(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.COMMA)&&((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(this._flags.last_token.type===l.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},V.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===h.Statement;)this.restore_mode();var $=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!$?this._output.space_before_token=!0:this._options.brace_style==="expand"?$||this.print_newline():$||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(C)},V.prototype.handle_word=function(C){if(C.type===l.RESERVED){if(p(C.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)C.type=l.WORD;else if(C.text==="import"&&p(this._tokens.peek().text,["(","."]))C.type=l.WORD;else if(p(C.text,["as","from"])&&!this._flags.import_block)C.type=l.WORD;else if(this._flags.mode===h.ObjectLiteral){var $=this._tokens.peek();$.text===":"&&(C.type=l.WORD)}}if(this.start_of_statement(C)?O(this._flags.last_token,["var","let","const"])&&C.type===l.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!M(this._flags.mode)&&(this._flags.last_token.type!==l.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==l.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(x(C,"while")){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(C,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(C,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),x(C,"function")){(p(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(p(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===l.OPERATOR))&&(!this._output.just_added_blankline()&&!C.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,B)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(M(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var ee="NONE";if(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":O(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===h.BlockStatement?ee="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&M(this._flags.mode)?ee="SPACE":this._flags.last_token.type===l.STRING?ee="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.last_token.text==="*"&&(p(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&p(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===l.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),O(C,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ee="SPACE":ee="NEWLINE"),O(C,["else","catch","finally"]))if((!(this._flags.last_token.type===l.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ee==="NEWLINE"?O(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?(this._flags.last_token.type!==l.START_EXPR||!O(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(C,"if")&&x(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(C,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===l.WORD||C.previous.type===l.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===l.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(C,"from")&&(this._flags.import_block=!1))},V.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var $=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&x($,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},V.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===l.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===l.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},V.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},V.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(M(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)},V.prototype.handle_operator=function(C){var $=C.text==="*"&&(O(this._flags.last_token,["function","yield"])||p(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),ee=p(C.text,["-","+"])&&(p(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||p(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(C)){var re=!$;this.handle_whitespace_and_comments(C,re)}if(C.text==="*"&&this._flags.last_token.type===l.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===l.OPERATOR&&p(this._options.operator_position,y)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ue=!0,Te=!0,ye=!1;if(C.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,ye=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!$&&this._options.preserve_newlines&&p(C.text,s)){var be=C.text===":",we=be&&ye,xe=be&&!ye;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!xe,this.print_token(C),(!be||we)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!be||we?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case E.preserve_newline:xe||this.allow_wrap_or_preserved_newline(C),ue=!(this._output.just_added_newline()||xe),this._output.space_before_token=ue,this.print_token(C),this._output.space_before_token=!0;return}}if($){this.allow_wrap_or_preserved_newline(C),ue=!1;var me=this._tokens.peek();Te=me&&p(me.type,[l.WORD,l.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),ue=this._flags.last_token.type===l.START_BLOCK,Te=!1;else if(p(C.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),ue=!1,Te=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var se=O(this._flags.last_token,A)&&C.newlines;se&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(se,!0)}this._flags.last_token.text===";"&&M(this._flags.mode)&&(ue=!0),this._flags.last_token.type===l.RESERVED?ue=!0:this._flags.last_token.type===l.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===l.OPERATOR&&(ue=p(C.text,["--","-","++","+"])&&p(this._flags.last_token.text,["--","-","++","+"]),p(C.text,["+","-"])&&p(this._flags.last_token.text,["--","++"])&&(Te=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(C),this._output.space_before_token=Te},V.prototype.handle_block_comment=function(C,$){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,$),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,$)},V.prototype.print_block_commment=function(C,$){var ee=g(C.text),re,ue=!1,Te=!1,ye=C.whitespace_before,be=ye.length;if(this.print_newline(!1,$),this.print_token_line_indentation(C),this._output.add_token(ee[0]),this.print_newline(!1,$),ee.length>1){for(ee=ee.slice(1),ue=P(ee,"*"),Te=K(ee,ye),ue&&(this._flags.alignment=1),re=0;re=0;u--)if(this.__items[u].match(f))return!0;return!1},I.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(f){this.__items.push(f);var u=f.lastIndexOf(`
`);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},I.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function m(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}m.prototype.get_indent_size=function(f,u){var r=this.__base_string_length;return u=u||0,f<0&&(r=0),r+=f*this.__indent_size,r+=u,r},m.prototype.get_indent_string=function(f,u){var r=this.__base_string;return u=u||0,f<0&&(f=0,r=""),u+=f*this.__indent_size,this.__ensure_cache(u),r+=this.__cache[u],r},m.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var f=this.__cache.length,u=0,r="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,r=new Array(u+1).join(this.__indent_string)),f&&(r+=new Array(f+1).join(" ")),this.__cache.push(r)};function c(f,u){this.__indent_cache=new m(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},c.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return f!==`
`&&(r=r.replace(/[\n]/g,f)),r},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(f){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(f,u){for(var r=this.__lines.length-2;r>=0;){var d=this.__lines[r];if(d.is_empty())break;if(d.item(0).indexOf(f)!==0&&d.item(-1)!==u){this.__lines.splice(r+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},k.exports.Output=c},function(k){function I(m,c,f,u){this.type=m,this.text=c,this.comments_before=null,this.newlines=f||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=I},function(k,I){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",r="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+c+f+u+"])*";I.identifier=new RegExp(r+d,"g"),I.identifierStart=new RegExp(r),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+c+f+u+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(k,I,m){var c=m(6).Options,f=["before-newline","after-newline","preserve-newline"];function u(r){c.call(this,r,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),T=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";T=T.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),T="\\?\\.(?!\\d) "+T,T=T.replace(/ /g,"|");var E=new RegExp(T),y="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=y.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+h.join("|")+")$"),g,b=function(P,K){f.call(this,P,K),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var V=new o(this._input),B=new s(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(d.identifier).matching(d.identifierMatch),number:V.matching(w),punct:V.matching(E),comment:V.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:V.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:V.matching(//),include:V.starting_with(/#include/).until_after(d.lineBreak),shebang:V.starting_with(/#!/).until_after(d.lineBreak),xml:V.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};b.prototype=new f,b.prototype._is_comment=function(P){return P.type===p.COMMENT||P.type===p.BLOCK_COMMENT||P.type===p.UNKNOWN},b.prototype._is_opening=function(P){return P.type===p.START_BLOCK||P.type===p.START_EXPR},b.prototype._is_closing=function(P,K){return(P.type===p.END_BLOCK||P.type===p.END_EXPR)&&K&&(P.text==="]"&&K.text==="["||P.text===")"&&K.text==="("||P.text==="}"&&K.text==="{")},b.prototype._reset=function(){g=!1},b.prototype._get_next_token=function(P,K){var V=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(p.EOF,""):(V=V||this._read_non_javascript(B),V=V||this._read_string(B),V=V||this._read_word(P),V=V||this._read_singles(B),V=V||this._read_comment(B),V=V||this._read_regexp(B,P),V=V||this._read_xml(B,P),V=V||this._read_punctuation(),V=V||this._create_token(p.UNKNOWN,this._input.next()),V)},b.prototype._read_word=function(P){var K;if(K=this.__patterns.identifier.read(),K!=="")return K=K.replace(d.allLineBreaks,`
`),!(P.type===p.DOT||P.type===p.RESERVED&&(P.text==="set"||P.text==="get"))&&_.test(K)?(K==="in"||K==="of")&&(P.type===p.WORD||P.type===p.STRING)?this._create_token(p.OPERATOR,K):this._create_token(p.RESERVED,K):this._create_token(p.WORD,K);if(K=this.__patterns.number.read(),K!=="")return this._create_token(p.WORD,K)},b.prototype._read_singles=function(P){var K=null;return P==="("||P==="["?K=this._create_token(p.START_EXPR,P):P===")"||P==="]"?K=this._create_token(p.END_EXPR,P):P==="{"?K=this._create_token(p.START_BLOCK,P):P==="}"?K=this._create_token(p.END_BLOCK,P):P===";"?K=this._create_token(p.SEMICOLON,P):P==="."&&O.test(this._input.peek(1))?K=this._create_token(p.DOT,P):P===","&&(K=this._create_token(p.COMMA,P)),K&&this._input.next(),K},b.prototype._read_punctuation=function(){var P=this.__patterns.punct.read();if(P!=="")return P==="="?this._create_token(p.EQUALS,P):P==="?."?this._create_token(p.DOT,P):this._create_token(p.OPERATOR,P)},b.prototype._read_non_javascript=function(P){var K="";if(P==="#"){if(this._is_first_token()&&(K=this.__patterns.shebang.read(),K))return this._create_token(p.UNKNOWN,K.trim()+`
`);if(K=this.__patterns.include.read(),K)return this._create_token(p.UNKNOWN,K.trim()+`
`);P=this._input.next();var V="#";if(this._input.hasNext()&&this._input.testChar(x)){do P=this._input.next(),V+=P;while(this._input.hasNext()&&P!=="#"&&P!=="=");return P==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(V+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(V+="{}",this._input.next(),this._input.next())),this._create_token(p.WORD,V)}this._input.back()}else if(P==="<"&&this._is_first_token()){if(K=this.__patterns.html_comment_start.read(),K){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)K+=this._input.next();return g=!0,this._create_token(p.COMMENT,K)}}else if(g&&P==="-"&&(K=this.__patterns.html_comment_end.read(),K))return g=!1,this._create_token(p.COMMENT,K);return null},b.prototype._read_comment=function(P){var K=null;if(P==="/"){var V="";if(this._input.peek(1)==="*"){V=this.__patterns.block_comment.read();var B=R.get_directives(V);B&&B.ignore==="start"&&(V+=R.readIgnored(this._input)),V=V.replace(d.allLineBreaks,`
`),K=this._create_token(p.BLOCK_COMMENT,V),K.directives=B}else this._input.peek(1)==="/"&&(V=this.__patterns.comment.read(),K=this._create_token(p.COMMENT,V))}return K},b.prototype._read_string=function(P){if(P==="`"||P==="'"||P==='"'){var K=this._input.next();return this.has_char_escapes=!1,P==="`"?K+=this._read_string_recursive("`",!0,"${"):K+=this._read_string_recursive(P),this.has_char_escapes&&this._options.unescape_strings&&(K=M(K)),this._input.peek()===P&&(K+=this._input.next()),K=K.replace(d.allLineBreaks,`
`),this._create_token(p.STRING,K)}return null},b.prototype._allow_regexp_or_xml=function(P){return P.type===p.RESERVED&&l(P.text,["return","case","throw","else","do","typeof","yield"])||P.type===p.END_EXPR&&P.text===")"&&P.opened.previous.type===p.RESERVED&&l(P.opened.previous.text,["if","while","for"])||l(P.type,[p.COMMENT,p.START_EXPR,p.START_BLOCK,p.START,p.END_BLOCK,p.OPERATOR,p.EQUALS,p.EOF,p.SEMICOLON,p.COMMA])},b.prototype._read_regexp=function(P,K){if(P==="/"&&this._allow_regexp_or_xml(K)){for(var V=this._input.next(),B=!1,C=!1;this._input.hasNext()&&(B||C||this._input.peek()!==P)&&!this._input.testChar(d.newline);)V+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===P&&(V+=this._input.next(),V+=this._input.read(d.identifier)),this._create_token(p.STRING,V)}return null},b.prototype._read_xml=function(P,K){if(this._options.e4x&&P==="<"&&this._allow_regexp_or_xml(K)){var V="",B=this.__patterns.xml.read_match();if(B){for(var C=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),$=C.indexOf("{")===0,ee=0;B;){var re=!!B[1],ue=B[2],Te=!!B[B.length-1]||ue.slice(0,8)==="![CDATA[";if(!Te&&(ue===C||$&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--ee:++ee),V+=B[0],ee<=0)break;B=this.__patterns.xml.read_match()}return B||(V+=this._input.match(/[\s\S]*/g)[0]),V=V.replace(d.allLineBreaks,`
`),this._create_token(p.STRING,V)}}return null};function M(P){for(var K="",V=0,B=new c(P),C=null;B.hasNext();)if(C=B.match(/([\s]|[^\\]|\\\\)+/g),C&&(K+=C[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")C=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")C=B.match(/u([0-9A-Fa-f]{4})/g);else{K+="\\",B.hasNext()&&(K+=B.next());continue}if(!C)return P;if(V=parseInt(C[1],16),V>126&&V<=255&&C[0].indexOf("x")===0)return P;if(V>=0&&V<32){K+="\\"+C[0];continue}else V===34||V===39||V===92?K+="\\"+String.fromCharCode(V):K+=String.fromCharCode(V)}return K}b.prototype._read_string_recursive=function(P,K,V){var B,C;P==="'"?C=this.__patterns.single_quote:P==='"'?C=this.__patterns.double_quote:P==="`"?C=this.__patterns.template_text:P==="}"&&(C=this.__patterns.template_expression);for(var $=C.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===P||!K&&d.newline.test(ee)){this._input.back();break}else ee==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
`&&this._input.next(),ee+=this._input.next()):V&&(V==="${"&&ee==="$"&&this._input.peek()==="{"&&(ee+=this._input.next()),V===ee&&(P==="`"?ee+=this._read_string_recursive("}",K,"`"):ee+=this._read_string_recursive("`",K,"${"),this._input.hasNext()&&(ee+=this._input.next())));ee+=C.read(),$+=ee}return $},k.exports.Tokenizer=b,k.exports.TOKEN=p,k.exports.positionable_operators=A.slice(),k.exports.line_starters=y.slice()},function(k){var I=RegExp.prototype.hasOwnProperty("sticky");function m(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position=0&&c=0&&f=c.length&&this.__input.substring(f-c.length,f).toLowerCase()===c},k.exports.InputScanner=m},function(k,I,m){var c=m(8).InputScanner,f=m(3).Token,u=m(10).TokenStream,r=m(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(s,l){this._input=new c(s),this._options=l||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var s,l=new f(d.START,""),p=null,R=[],w=new u;l.type!==d.EOF;){for(s=this._get_next_token(l,p);this._is_comment(s);)w.add(s),s=this._get_next_token(l,p);w.isEmpty()||(s.comments_before=w,w=new u),s.parent=p,this._is_opening(s)?(R.push(p),p=s):p&&this._is_closing(s,p)&&(s.opened=p,p.closed=s,p=R.pop(),s.parent=p),s.previous=l,l.next=s,this.__tokens.add(s),l=s}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(s,l){this._readWhitespace();var p=this._input.read(/.+/g);return p?this._create_token(d.RAW,p):this._create_token(d.EOF,"")},o.prototype._is_comment=function(s){return!1},o.prototype._is_opening=function(s){return!1},o.prototype._is_closing=function(s,l){return!1},o.prototype._create_token=function(s,l){var p=new f(s,l,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return p},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=o,k.exports.TOKEN=d},function(k){function I(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position=0&&m/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new c,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(r){var d=this._create();return d._disabled[r]=!0,d._update(),d},u.prototype.read_options=function(r){var d=this._create();for(var o in f)d._disabled[o]=r.templating.indexOf(o)===-1;return d._update(),d},u.prototype.exclude=function(r){var d=this._create();return d._excluded[r]=!0,d._update(),d},u.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),r+=d,d=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},u.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},u.prototype._read_template=function(){var r="",d=this._input.peek();if(d==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(r=r||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},k.exports.TemplatablePattern=u}],U={};function W(k){var I=U[k];if(I!==void 0)return I.exports;var m=U[k]={exports:{}};return F[k](m,m.exports,W),m.exports}var j=W(0);D=j})();var Y=D;!(ae=[],J=function(){return{js_beautify:Y}}.apply(et,ae),J!==void 0&&(vt.exports=J))})()},"7Cbv":function(vt,et,ne){"use strict";var ae=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function D(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae(J)}var Y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function F(f){return typeof f=="string"&&Y.test(f)}for(var U=F,W=[],j=0;j<256;++j)W.push((j+256).toString(16).substr(1));function k(f){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(W[f[u+0]]+W[f[u+1]]+W[f[u+2]]+W[f[u+3]]+"-"+W[f[u+4]]+W[f[u+5]]+"-"+W[f[u+6]]+W[f[u+7]]+"-"+W[f[u+8]]+W[f[u+9]]+"-"+W[f[u+10]]+W[f[u+11]]+W[f[u+12]]+W[f[u+13]]+W[f[u+14]]+W[f[u+15]]).toLowerCase();if(!U(r))throw TypeError("Stringified UUID is invalid");return r}var I=k;function m(f,u,r){f=f||{};var d=f.random||(f.rng||D)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){r=r||0;for(var o=0;o<16;++o)u[r+o]=d[o];return u}return I(d)}var c=et.a=m},"7ahc":function(vt,et,ne){"use strict";ne.d(et,"a",function(){return R});var ae=ne("k1fw"),J=ne("0Owb"),D=ne("+L6B"),Y=ne("2/Rp"),F=ne("y8nQ"),U=ne("Vl3Y"),W=ne("tJVT"),j=ne("OaEy"),k=ne("2fM7"),I=ne("q1tI"),m=ne.n(I),c=ne("VrN/"),f=ne.n(c),u=ne("p77/"),r=ne.n(u),d=ne("c5Ni"),o=ne.n(d),s=k.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},p={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};et.b=function(w){var x=w.callback,O=w.onCancel,A=Object(I.useState)("python"),T=Object(W.a)(A,2),E=T[0],y=T[1];function h(g){y(p[g][1])}function _(g){x(g)}return m.a.createElement(U.a,Object(J.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),m.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(k.a,{onChange:h},Object.keys(p).map(function(g){return m.a.createElement(s,{key:g,value:g},p[g][0])}))),m.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(R,{mode:E})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(Y.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function R(w){var x=w.value,O=w.onChange,A=w.mode,T=w.options,E=T===void 0?{}:T,y=Object(I.useRef)(),h=Object(I.useState)(),_=Object(W.a)(h,2),g=_[0],b=_[1];return Object(I.useEffect)(function(){if(g){function M(P){var K=P.getValue();O&&O(K)}return g.on("change",M),function(){g.off("change",M)}}},[g,O]),Object(I.useEffect)(function(){g&&g.setOption("mode",A)},[g,A]),Object(I.useEffect)(function(){g&&((x!==g.getValue()||x==="")&&setTimeout(function(){g.setValue(x||" ")},300))},[g,x]),Object(I.useEffect)(function(){if(y.current&&!g){var M=f.a.fromTextArea(y.current,Object(ae.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));b(M)}},[y.current,g]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:y}))}},"8EBN":function(vt,et,ne){(function(ae){ae(ne("VrN/"))})(function(ae){"use strict";ae.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var J=0;J-1&&Y.substring(W+1,Y.length);if(j)return ae.findModeByExtension(j)},ae.findModeByName=function(Y){Y=Y.toLowerCase();for(var F=0;F=N.length?Z.slice(N.length):Z}).join(`
`)}var o=[],s=[""],l=new u.a.Renderer,p=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,s=[""]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(z,v,S,N){if(v>=z.length||z[v].level<=S)return v;var Z=z[v];N.push(""+Z.text+" "),v++;var G=[];return v=x(z,v,Z.level,G),G.length>0&&(N.push(""),G.forEach(function(fe){N.push(fe)}),N.push(" ")),N.push(" "),v=x(z,v,S,N),v}function O(){return x(o,0,0,s),s.push(" "),s.join("")}var A={heading:function(v){var S=p.exec(v);if(S)return{type:"heading",raw:S[0],depth:S[1].length,text:S[2]}},fences:function(v){var S=this.rules.block.fences.exec(v);if(S){var N=S[0],Z=d(N,S[3]||""),G=S[2]?S[2].trim():S[2];if(["latex","katex","math"].indexOf(G)>=0){var fe=y(),ke=Z;Z=fe,h[fe]={type:"block",expression:ke}}return{type:"code",raw:N,lang:G,text:Z}}}},T=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,y=function(){return"__special_katext_id_".concat(E++,"__")},h={};function _(){return h}function g(){E=0,h={}}function b(z){return z=z.replace(T,function(v,S){var N=y();return h[N]={type:"inline",expression:S},N}),z}var M=l.listitem;l.listitem=function(z){return M(b(z))};var P=l.paragraph;l.paragraph=function(z){return P(b(z))};var K=l.tablecell;l.tablecell=function(z,v){return K(b(z),v)},l.code=function(z,v,S){var N=(v||"").match(/\S*/)[0];return N?["latex","katex","math"].indexOf(N)>=0?"".concat(z,"
"):' ').concat(S?z:Object(r.escape)(z,!0),`
`):''+(S?z:Object(r.escape)(z,!0))+" "},l.heading=function(z,v,S){var N=this.options.headerPrefix+S.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:N,level:v,text:z}),"'+z+" "},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:A,renderer:l});var V=u.a,B=ne("SJMd"),C=ne("ulZh"),$=ne.n(C),ee=ne("m3rI"),re=ne("Oy/b"),ue=ne("p5ED"),Te=ne("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ye=function(z,v){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,N){S.__proto__=N}||function(S,N){for(var Z in N)Object.prototype.hasOwnProperty.call(N,Z)&&(S[Z]=N[Z])})(z,v)};function be(z,v){function S(){this.constructor=z}ye(z,v),z.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}function we(z,v,S,N){return new(S||(S=Promise))(function(Z,G){function fe(gt){try{Ze(N.next(gt))}catch(Fe){G(Fe)}}function ke(gt){try{Ze(N.throw(gt))}catch(Fe){G(Fe)}}function Ze(gt){var Fe;gt.done?Z(gt.value):(Fe=gt.value,Fe instanceof S?Fe:new S(function(Et){Et(Fe)})).then(fe,ke)}Ze((N=N.apply(z,v||[])).next())})}function xe(z,v){var S,N,Z,G,fe={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return G={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function ke(Ze){return function(gt){return function(Fe){if(S)throw new TypeError("Generator is already executing.");for(;fe;)try{if(S=1,N&&(Z=2&Fe[0]?N.return:Fe[0]?N.throw||((Z=N.return)&&Z.call(N),0):N.next)&&!(Z=Z.call(N,Fe[1])).done)return Z;switch(N=0,Z&&(Fe=[2&Fe[0],Z.value]),Fe[0]){case 0:case 1:Z=Fe;break;case 4:return fe.label++,{value:Fe[1],done:!1};case 5:fe.label++,N=Fe[1],Fe=[0];continue;case 7:Fe=fe.ops.pop(),fe.trys.pop();continue;default:if(!(Z=fe.trys,(Z=Z.length>0&&Z[Z.length-1])||Fe[0]!==6&&Fe[0]!==2)){fe=0;continue}if(Fe[0]===3&&(!Z||Fe[1]>Z[0]&&Fe[1] ',"select"),this.addActionButton(N,' ',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(N,' ',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(N,' ',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(N,' ',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(N,' ',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(N,' ',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(N,' ',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(G){var fe=document.createElement("div");fe.className=""+S.toolbarButtonStyleClass.name,fe.setAttribute("data-type-name",G.typeName),fe.innerHTML=G.icon,fe.addEventListener("click",function(){S.markerToolbarButtonClicked(fe,G)}),S.buttons.push(fe),S.markerButtons.push(fe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML=' ',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Z=document.createElement("div");Z.className=this.toolbarBlockStyleClass.name,Z.style.whiteSpace="nowrap",Z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Z),this.addActionButton(Z,' ',"render"),this.addActionButton(Z,' ',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},z.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},z.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var S=0;S0&&this.buttonClickListeners.forEach(function(N){return N("marker",S)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(v,S){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(N){return N("action",S)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},z.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},z.prototype.setActiveMarkerButton=function(v){var S=this.markerButtons.find(function(N){return N.getAttribute("data-type-name")===v});S&&this.setActiveButton(S)},z.prototype.setCurrentMarker=function(v){var S=this;this.currentMarker=v,this.buttons.filter(function(N){return/delete|notes/.test(N.getAttribute("data-action"))}).forEach(function(N){S.currentMarker===void 0?(N.style.fillOpacity="0.4",N.style.pointerEvents="none"):(N.style.fillOpacity="1",N.style.pointerEvents="all")})},z}(),Ue=function(){function z(v,S,N,Z){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=S,this.uiStyleSettings=N,this.styles=Z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return z.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new Oe("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Oe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Oe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Oe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Oe("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Oe("toolbox-panel-row_colors",`
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Oe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
padding: `+S+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Oe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Oe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ot("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ot("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},z.prototype.show=function(v){var S;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((S=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&S!==void 0?S:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(v){var S,N,Z=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((S=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&S!==void 0?S:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(G){var fe;G.uiStyleSettings=Z.uiStyleSettings;var ke=document.createElement("div");ke.className=Z.toolboxButtonStyleClass.name+" "+((fe=Z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&fe!==void 0?fe:Z.toolboxButtonStyleColorsClass.name),ke.innerHTML=G.icon,ke.title=G.title,ke.addEventListener("click",function(){Z.panelButtonClick(G)}),Z.panelButtons.push(ke),Z.buttonRow.appendChild(ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(v){var S=this,N=-1;if(v!==this.activePanel){N=this.panels.indexOf(v),this.panelRow.innerHTML="";var Z=v.getUi();Z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Z),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){S.displayMode==="inline"?S.panelRow.style.display="none":S.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(G,fe){var ke,Ze;G.className=S.toolboxButtonStyleClass.name+" "+(fe===N?""+((ke=S.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ke!==void 0?ke:S.toolboxActiveButtonStyleColorsClass.name):""+((Ze=S.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:S.toolboxButtonStyleColorsClass.name))})},z}(),Ge=function(z,v){this.title=z,this.icon=v},je=function(z){function v(S,N,Z,G){var fe=z.call(this,S,G||' ')||this;return fe.colors=[],fe.addTransparent=!1,fe.colorBoxes=[],fe.colors=N,fe.currentColor=Z,fe.setCurrentColor=fe.setCurrentColor.bind(fe),fe.getColorBox=fe.getColorBox.bind(fe),fe}return be(v,z),v.prototype.getUi=function(){var S=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.whiteSpace="nowrap",this.colors.forEach(function(Z){var G=S.getColorBox(Z);N.appendChild(G),S.colorBoxes.push(G)}),N},v.prototype.getColorBox=function(S){var N=this,Z=this.uiStyleSettings.toolbarHeight/4,G=this.uiStyleSettings.toolbarHeight-Z,fe=document.createElement("div");fe.style.display="inline-block",fe.style.boxSizing="content-box",fe.style.width=G-2+"px",fe.style.height=G-2+"px",fe.style.padding="1px",fe.style.marginRight="2px",fe.style.marginBottom="2px",fe.style.borderWidth="2px",fe.style.borderStyle="solid",fe.style.borderRadius=(G+2)/2+"px",fe.style.borderColor=S===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",fe.addEventListener("click",function(){N.setCurrentColor(S,fe)});var ke=document.createElement("div");return ke.style.display="inline-block",ke.style.width=G-2+"px",ke.style.height=G-2+"px",ke.style.backgroundColor=S,ke.style.borderRadius=G/2+"px",S==="transparent"&&(ke.style.fill=this.uiStyleSettings.toolboxAccentColor,ke.innerHTML=`
`),fe.appendChild(ke),fe},v.prototype.setCurrentColor=function(S,N){var Z=this;this.currentColor=S,this.colorBoxes.forEach(function(G){G.style.borderColor=G===N?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(S)},v}(Ge),Me=function(){function z(v,S,N){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=S,this.globalSettings=N,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(v){return!1},Object.defineProperty(z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},z.prototype.pointerDown=function(v,S){},z.prototype.dblClick=function(v,S){},z.prototype.manipulate=function(v){},z.prototype.pointerUp=function(v){this.stateChanged()},z.prototype.dispose=function(){},z.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},z.prototype.getState=function(){return{typeName:z.typeName,state:this.state,notes:this.notes}},z.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},z.prototype.scale=function(v,S){},z.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},z.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},z.typeName="MarkerBase",z}(),Pe=function(){function z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return z.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},z}(),ut=function(){function z(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},z}(),tt=function(){function z(){}return z.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},z.toSVGMatrix=function(v,S){return v.a=S.a,v.b=S.b,v.c=S.c,v.d=S.d,v.e=S.e,v.f=S.f,v},z}(),qe=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.left=0,G.top=0,G.width=0,G.height=0,G.defaultSize={x:50,y:20},G.offsetX=0,G.offsetY=0,G.rotationAngle=0,G.CB_DISTANCE=10,G._suppressMarkerCreateEvent=!1,G.container.transform.baseVal.appendItem(se.createTransform()),G.setupControlBox(),G}return be(v,z),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(S){this._visual=S;var N=se.createTransform();this._visual.transform.baseVal.appendItem(N)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(S){return!!z.prototype.ownsTarget.call(this,S)||!!(this.controlGrips.findGripByVisual(S)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(S))},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.state==="new"&&(this.left=S.x,this.top=S.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Z=this.unrotatePoint(S);if(this.manipulationStartX=Z.x,this.manipulationStartY=Z.y,this.offsetX=Z.x-this.left,this.offsetY=Z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(N),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N)){this.activeGrip=this.rotatorGrip;var G=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=G.x-this.width/2,this.top=G.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var fe=this.container.transform.baseVal.getItem(0);fe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(fe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(S){var N=this.state;z.prototype.pointerUp.call(this,S),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(S),this._state="select",N==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(S){this.visual.style.transform="translate("+S.x+"px, "+S.y+"px)"},v.prototype.manipulate=function(S){var N=this.unrotatePoint(S);this.state==="creating"?this.resize(S):this.state==="move"?(this.left=this.manipulationStartLeft+(N.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(N.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(N):this.state==="rotate"&&this.rotate(S)},v.prototype.resize=function(S){var N=this.manipulationStartLeft,Z=this.manipulationStartWidth,G=this.manipulationStartTop,fe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:N=this.manipulationStartLeft+S.x-this.manipulationStartX,Z=this.manipulationStartWidth+this.manipulationStartLeft-N;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Z=this.manipulationStartWidth+S.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:G=this.manipulationStartTop+S.y-this.manipulationStartY,fe=this.manipulationStartHeight+this.manipulationStartTop-G;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:fe=this.manipulationStartHeight+S.y-this.manipulationStartY}Z>=0?(this.left=N,this.width=Z):(this.left=N+Z,this.width=-Z),fe>=0?(this.top=G,this.height=fe):(this.top=G+fe,this.height=-fe),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(S){if(Math.abs(S.x-this.centerX)>.1){var N=Math.sign(S.x-this.centerX);this.rotationAngle=180*Math.atan((S.y-this.centerY)/(S.x-this.centerX))/Math.PI+90*N,this.applyRotation()}},v.prototype.applyRotation=function(){var S=this.container.transform.baseVal.getItem(0);S.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(S,0)},v.prototype.rotatePoint=function(S){if(this.rotationAngle===0)return S;var N=this.container.getCTM(),Z=se.createPoint(S.x,S.y);return{x:(Z=Z.matrixTransform(N)).x,y:Z.y}},v.prototype.unrotatePoint=function(S){if(this.rotationAngle===0)return S;var N=this.container.getCTM();N=N.inverse();var Z=se.createPoint(S.x,S.y);return{x:(Z=Z.matrixTransform(N)).x,y:Z.y}},v.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var S=se.createTransform();S.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(S),this.container.appendChild(this.controlBox),this.controlRect=se.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=se.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Pe,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var S=this.controlBox.transform.baseVal.getItem(0);S.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(S,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},v.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},v.prototype.createGrip=function(){var S=new ut;return S.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(S.visual),S},v.prototype.positionGrips=function(){var S=this.controlGrips.topLeft.GRIP_SIZE,N=-S/2,Z=N,G=(this.width+this.CB_DISTANCE)/2-S/2,fe=(this.height+this.CB_DISTANCE)/2-S/2,ke=this.height+this.CB_DISTANCE-S/2,Ze=this.width+this.CB_DISTANCE-S/2;this.positionGrip(this.controlGrips.topLeft.visual,N,Z),this.positionGrip(this.controlGrips.topCenter.visual,G,Z),this.positionGrip(this.controlGrips.topRight.visual,Ze,Z),this.positionGrip(this.controlGrips.centerLeft.visual,N,fe),this.positionGrip(this.controlGrips.centerRight.visual,Ze,fe),this.positionGrip(this.controlGrips.bottomLeft.visual,N,ke),this.positionGrip(this.controlGrips.bottomCenter.visual,G,ke),this.positionGrip(this.controlGrips.bottomRight.visual,Ze,ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,G,Z-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(S,N,Z){var G=S.transform.baseVal.getItem(0);G.setTranslate(N,Z),S.transform.baseVal.replaceItem(G,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:tt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:tt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},v.prototype.restoreState=function(S){z.prototype.restoreState.call(this,S);var N=S;this.left=N.left,this.top=N.top,this.width=N.width,this.height=N.height,this.rotationAngle=N.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,N.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,N.containerTransformMatrix))},v.prototype.scale=function(S,N){z.prototype.scale.call(this,S,N);var Z=this.rotatePoint({x:this.left,y:this.top}),G=this.unrotatePoint({x:Z.x*S,y:Z.y*N});this.left=G.x,this.top=G.y,this.width=this.width*S,this.height=this.height*N,this.adjustControlBox()},v}(Me),$e=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.createVisual=G.createVisual.bind(G),G}return be(v,z),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.visual)},v.prototype.createVisual=function(){this.visual=se.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.state==="new"&&(this.createVisual(),this.moveVisual(S),this._state="creating")},v.prototype.manipulate=function(S){z.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){z.prototype.resize.call(this,S),this.setSize()},v.prototype.setSize=function(){z.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(S){z.prototype.pointerUp.call(this,S),this.setSize()},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(S),this.stateChanged()},v.prototype.setFillColor=function(S){this.fillColor=S,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this))},v.prototype.restoreState=function(S){var N=S;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),z.prototype.restoreState.call(this,S),this.setSize()},v.prototype.scale=function(S,N){z.prototype.scale.call(this,S,N),this.setSize()},v.title="Rectangle marker",v}(qe),ft=function(z){function v(S,N,Z,G){var fe=z.call(this,S,G||' ')||this;return fe.widths=[],fe.widthBoxes=[],fe.widths=N,fe.currentWidth=Z,fe.setCurrentWidth=fe.setCurrentWidth.bind(fe),fe}return be(v,z),v.prototype.getUi=function(){var S=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.widths.forEach(function(Z){var G=document.createElement("div");G.style.display="flex",G.style.flexGrow="2",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=Z===S.currentWidth?S.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){S.setCurrentWidth(Z,G)}),N.appendChild(G);var fe=document.createElement("div");fe.innerText=Z.toString(),fe.style.marginRight="5px",G.appendChild(fe);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.display="flex",ke.style.alignItems="center";var Ze=document.createElement("hr");Ze.style.minWidth="20px",Ze.style.border="0px",Ze.style.borderTop=Z+"px solid "+S.uiStyleSettings.toolboxColor,Ze.style.flexGrow="2",ke.appendChild(Ze),G.appendChild(ke),S.widthBoxes.push(G)}),N},v.prototype.setCurrentWidth=function(S,N){var Z=this;this.currentWidth=S,this.widthBoxes.forEach(function(G){G.style.borderColor=G===N?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(Ge),nt=function(z){function v(S,N,Z,G){var fe=z.call(this,S,G||' ')||this;return fe.styles=[],fe.styleBoxes=[],fe.styles=N,fe.currentStyle=Z,fe.setCurrentStyle=fe.setCurrentStyle.bind(fe),fe}return be(v,z),v.prototype.getUi=function(){var S=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.styles.forEach(function(Z){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/S.styles.length-5+"%",G.style.borderColor=Z===S.currentStyle?S.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){S.setCurrentStyle(Z,G)}),N.appendChild(G);var fe=document.createElement("div");fe.style.minHeight="20px",fe.style.flexGrow="2",fe.style.overflow="hidden";var ke=`
`;fe.innerHTML=ke,G.appendChild(fe),S.styleBoxes.push(G)}),N},v.prototype.setCurrentStyle=function(S,N){var Z=this;this.currentStyle=S,this.styleBoxes.forEach(function(G){G.style.borderColor=G===N?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(Ge),Ye=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.strokeColor=Z.defaultColor,G.strokeWidth=Z.defaultStrokeWidth,G.strokeDasharray=Z.defaultStrokeDasharray,G.strokePanel=new je("Line color",Z.defaultColorSet,Z.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new ft("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new nt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return be(v,z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=z.prototype.getState.call(this);return S.typeName=v.typeName,S},v.typeName="FrameMarker",v.title="Frame marker",v.icon=' ',v}($e),Ae=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ct=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.x1=0,G.y1=0,G.x2=0,G.y2=0,G.defaultLength=50,G.manipulationStartX=0,G.manipulationStartY=0,G.manipulationStartX1=0,G.manipulationStartY1=0,G.manipulationStartX2=0,G.manipulationStartY2=0,G.setupControlBox(),G}return be(v,z),v.prototype.ownsTarget=function(S){return!!z.prototype.ownsTarget.call(this,S)||!(!this.grip1.ownsTarget(S)&&!this.grip2.ownsTarget(S))},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.manipulationStartX=S.x,this.manipulationStartY=S.y,this.state==="new"&&(this.x1=S.x,this.y1=S.y,this.x2=S.x,this.y2=S.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(N)?this.activeGrip=this.grip1:this.grip2.ownsTarget(N)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(S){var N=this.state;z.prototype.pointerUp.call(this,S),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(S),this._state="select",N==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(S){this.state==="creating"?this.resize(S):this.state==="move"?(this.x1=this.manipulationStartX1+S.x-this.manipulationStartX,this.y1=this.manipulationStartY1+S.y-this.manipulationStartY,this.x2=this.manipulationStartX2+S.x-this.manipulationStartX,this.y2=this.manipulationStartY2+S.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(S)},v.prototype.resize=function(S){switch(this.activeGrip){case this.grip1:this.x1=S.x,this.y1=S.y;break;case this.grip2:case void 0:this.x2=S.x,this.y2=S.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var S=new ut;return S.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(S.visual),S},v.prototype.positionGrips=function(){var S=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-S/2,this.y1-S/2),this.positionGrip(this.grip2.visual,this.x2-S/2,this.y2-S/2)},v.prototype.positionGrip=function(S,N,Z){var G=S.transform.baseVal.getItem(0);G.setTranslate(N,Z),S.transform.baseVal.replaceItem(G,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},z.prototype.getState.call(this))},v.prototype.restoreState=function(S){z.prototype.restoreState.call(this,S);var N=S;this.x1=N.x1,this.y1=N.y1,this.x2=N.x2,this.y2=N.y2},v.prototype.scale=function(S,N){z.prototype.scale.call(this,S,N),this.x1=this.x1*S,this.y1=this.y1*N,this.x2=this.x2*S,this.y2=this.y2*N,this.adjustVisual(),this.adjustControlBox()},v}(Me),Je=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.strokeColor=Z.defaultColor,G.strokeWidth=Z.defaultStrokeWidth,G.strokeDasharray=Z.defaultStrokeDasharray,G.strokePanel=new je("Line color",Z.defaultColorSet,Z.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new ft("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new nt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return be(v,z),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.visual&&S!==this.selectorLine&&S!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.adjustVisual(),this.colorChanged(S)},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.adjustVisual()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){z.prototype.restoreState.call(this,S);var N=S;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon=' ',v}(ct),Se=function(z){function v(S,N,Z,G){var fe=z.call(this,S,G||' ')||this;return fe.fonts=[],fe.fontBoxes=[],fe.fonts=N,fe.currentFont=Z,fe.setCurrentFont=fe.setCurrentFont.bind(fe),fe}return be(v,z),v.prototype.getUi=function(){var S=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.flexGrow="2",this.fonts.forEach(function(Z){var G=document.createElement("div");G.style.display="inline-block",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/S.fonts.length-5+"%",G.style.borderColor=Z===S.currentFont?S.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){S.setCurrentFont(Z,G)}),N.appendChild(G);var fe=document.createElement("div");fe.style.display="flex",fe.style.minHeight="20px",fe.style.flexGrow="2",fe.style.fontFamily=Z,fe.style.overflow="hidden";var ke=document.createElement("div");ke.style.whiteSpace="nowrap",ke.style.overflow="hidden",ke.style.textOverflow="ellipsis",ke.innerHTML="The quick brown fox jumps over the lazy dog",fe.appendChild(ke),G.appendChild(fe),S.fontBoxes.push(G)}),N},v.prototype.setCurrentFont=function(S,N){var Z=this;this.currentFont=S,this.fontBoxes.forEach(function(G){G.style.borderColor=G===N?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(Ge),Ne=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.color="transparent",G.padding=5,G.DEFAULT_TEXT="your text here",G.text=G.DEFAULT_TEXT,G.isMoved=!1,G.color=Z.defaultColor,G.fontFamily=Z.defaultFontFamily,G.defaultSize={x:100,y:30},G.setColor=G.setColor.bind(G),G.setFont=G.setFont.bind(G),G.renderText=G.renderText.bind(G),G.sizeText=G.sizeText.bind(G),G.textEditDivClicked=G.textEditDivClicked.bind(G),G.showTextEditor=G.showTextEditor.bind(G),G.setSize=G.setSize.bind(G),G.positionTextEditor=G.positionTextEditor.bind(G),G.colorPanel=new je("Color",Z.defaultColorSet,Z.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.fontFamilyPanel=new Se("Font",Z.defaultFontFamilies,Z.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G}return be(v,z),v.prototype.ownsTarget=function(S){if(z.prototype.ownsTarget.call(this,S)||S===this.visual||S===this.textElement||S===this.bgRectangle)return!0;var N=!1;return this.textElement.childNodes.forEach(function(Z){Z===S&&(N=!0)}),N},v.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.isMoved=!1,this.pointerDownPoint=S,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(S),this._state="creating")},v.prototype.renderText=function(){var S=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(N){S.textElement.appendChild(se.createTSpan(N.trim()===""?" ":N.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var S=this.textElement.getBBox(),N=1;if(S.width>0&&S.height>0){var Z=(1*this.width-this.width*this.padding*2/100)/S.width,G=(1*this.height-this.height*this.padding*2/100)/S.height;N=Math.min(Z,G)}return N},v.prototype.getTextPosition=function(S){var N=this.textElement.getBBox(),Z=0,G=0;return N.width>0&&N.height>0&&(Z=(this.width-N.width*S)/2,G=this.height/2-N.height*S/2),{x:Z,y:G}},v.prototype.sizeText=function(){var S=this.textElement.getBBox(),N=this.getTextScale(),Z=this.getTextPosition(N);Z.y-=S.y*N,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Z.x+"px, "+Z.y+"px) scale("+N+", "+N+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Z.x,Z.y),this.textElement.transform.baseVal.getItem(1).setScale(N,N))},v.prototype.manipulate=function(S){z.prototype.manipulate.call(this,S),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(S.x-this.pointerDownPoint.x)>5||Math.abs(S.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(S){z.prototype.resize.call(this,S),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(S){var N=this.state;N==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,S),this.setSize(),(N==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var S=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(N){N.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var N=Number.parseFloat(S.textEditor.style.fontSize);S.textEditor.clientWidth>=Number.parseInt(S.textEditor.style.maxWidth)&&N>.9;)N-=.1,S.textEditor.style.fontSize=Math.max(N,.9)+"em"}),this.textEditor.addEventListener("keyup",function(N){N.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(N){if(N.clipboardData){var Z=N.clipboardData.getData("text"),G=window.getSelection();if(!G.rangeCount)return!1;G.deleteFromDocument(),G.getRangeAt(0).insertNode(document.createTextNode(Z)),N.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){S.textEditDivClicked(S.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},v.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var S=this.getTextScale(),N=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Z=this.textElement.getBBox(),G={x:Z.width*S,y:Z.height*S};N.x-=G.x/2,N.y-=G.y/2,this.textEditor.style.top=N.y+"px",this.textEditor.style.left=N.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-N.x+"px",this.textEditor.style.fontSize=Math.max(16*S,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(S){this.text=S.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),z.prototype.deselect.call(this)},v.prototype.dblClick=function(S,N){z.prototype.dblClick.call(this,S,N),this.showTextEditor()},v.prototype.setColor=function(S){this.textElement&&se.setAttributes(this.textElement,[["fill",S]]),this.color=S,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(S)},v.prototype.setFont=function(S){this.textElement&&se.setAttributes(this.textElement,[["font-family",S]]),this.fontFamily=S,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){var N=S;this.color=N.color,this.fontFamily=N.fontFamily,this.padding=N.padding,this.text=N.text,this.createVisual(),z.prototype.restoreState.call(this,S),this.setSize()},v.prototype.scale=function(S,N){z.prototype.scale.call(this,S,N),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.icon=' ',v}(qe),ve=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.color="transparent",G.lineWidth=3,G.drawing=!1,G.pixelRatio=1,G.color=Z.defaultColor,G.lineWidth=Z.defaultStrokeWidth,G.pixelRatio=Z.freehandPixelRatio,G.setColor=G.setColor.bind(G),G.addCanvas=G.addCanvas.bind(G),G.finishCreation=G.finishCreation.bind(G),G.setLineWidth=G.setLineWidth.bind(G),G.colorPanel=new je("Color",Z.defaultColorSet,Z.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.lineWidthPanel=new ft("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),G.lineWidthPanel.onWidthChanged=G.setLineWidth,G}return be(v,z),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.visual&&S!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var S=se.createTransform();this.visual.transform.baseVal.appendItem(S),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(S,N){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(S.x,S.y),this.drawing=!0):z.prototype.pointerDown.call(this,S,N)},v.prototype.manipulate=function(S){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(S.x,S.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){z.prototype.resize.call(this,S),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(S){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,S)},v.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),z.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),z.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var S=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),N=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Z=N[0],G=N[1],fe=N[2],ke=N[3],Ze=!1,gt=0;gt0&&(Ze=!0,gtke&&(ke=gt),Fe>fe&&(fe=Fe));if(Ze){this.left=Z/this.pixelRatio,this.top=G/this.pixelRatio,this.width=(fe-Z)/this.pixelRatio,this.height=(ke-G)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=fe-Z,Et.height=ke-G,Et.getContext("2d").putImageData(this.canvasContext.getImageData(Z,G,fe-Z,ke-G),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(S){this.color=S,this.colorChanged(S)},v.prototype.setLineWidth=function(S){this.lineWidth=S},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){this.createVisual(),z.prototype.restoreState.call(this,S),this.drawingImgUrl=S.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(S,N){z.prototype.scale.call(this,S,N),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.icon=' ',v}(qe),de=function(z){function v(S,N,Z){var G=z.call(this,S,Z||' ')||this;return G.typeBoxes=[],G.currentType=N,G.setCurrentType=G.setCurrentType.bind(G),G}return be(v,z),v.prototype.getUi=function(){var S=this,N=document.createElement("div");N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2";for(var Z=function(ke){var Ze="both";switch(ke){case 0:Ze="both";break;case 1:Ze="start";break;case 2:Ze="end";break;case 3:Ze="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=Ze===G.currentType?G.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){S.setCurrentType(Ze,gt)}),N.appendChild(gt),Ze==="both"||Ze==="start"){var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.innerHTML=`
`,Fe.style.marginLeft="5px",gt.appendChild(Fe)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var Ht=document.createElement("hr");if(Ht.style.minWidth="20px",Ht.style.border="0px",Ht.style.borderTop="3px solid "+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee"),Ht.style.flexGrow="2",Et.appendChild(Ht),gt.appendChild(Et),Ze==="both"||Ze==="end"){var Zt=document.createElement("div");Zt.style.display="flex",Zt.style.alignItems="center",Zt.style.minHeight="20px",Zt.innerHTML=`
`,Zt.style.marginRight="5px",gt.appendChild(Zt)}G.typeBoxes.push(gt)},G=this,fe=0;fe<4;fe++)Z(fe);return N},v.prototype.setCurrentType=function(S,N){var Z=this;this.currentType=S,this.typeBoxes.forEach(function(G){G.style.borderColor=G===N?Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(Ge),pe=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.arrowType="end",G.arrowBaseHeight=10,G.arrowBaseWidth=10,G.getArrowPoints=G.getArrowPoints.bind(G),G.setArrowType=G.setArrowType.bind(G),G.arrowTypePanel=new de("Arrow type","end"),G.arrowTypePanel.onArrowTypeChanged=G.setArrowType,G}return be(v,z),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.arrow1&&S!==this.arrow2)},v.prototype.getArrowPoints=function(S,N){var Z=this.arrowBaseWidth+2*this.strokeWidth,G=this.arrowBaseHeight+2*this.strokeWidth;return S-Z/2+","+(N+G/2)+" "+S+","+(N-G/2)+" "+(S+Z/2)+","+(N+G/2)},v.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var S=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.arrow1.transform.baseVal.getItem(0);N.setRotate(S,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(N,0);var Z=this.arrow2.transform.baseVal.getItem(0);Z.setRotate(S+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Z,0)}},v.prototype.setArrowType=function(S){this.arrowType=S,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){z.prototype.restoreState.call(this,S);var N=S;this.arrowType=N.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon=' ',v}(Je),te=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.fillColor=Z.defaultFillColor,G.strokeWidth=0,G.fillPanel=new je("Color",Z.defaultColorSet,Z.defaultFillColor),G.fillPanel.onColorChanged=G.setFillColor,G}return be(v,z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=z.prototype.getState.call(this);return S.typeName=v.typeName,S},v.typeName="CoverMarker",v.title="Cover marker",v.icon=' ',v}($e),ie=function(z){function v(S,N,Z,G){var fe=z.call(this,S,G||' ')||this;return fe.opacities=[],fe.opacityBoxes=[],fe.opacities=N,fe.currentOpacity=Z,fe.setCurrentOpacity=fe.setCurrentOpacity.bind(fe),fe}return be(v,z),v.prototype.getUi=function(){var S=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",N.style.justifyContent="space-between",this.opacities.forEach(function(Z){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=Z===S.currentOpacity?S.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){S.setCurrentOpacity(Z,G)}),N.appendChild(G);var fe=document.createElement("div");fe.innerText=100*Z+"%",G.appendChild(fe),S.opacityBoxes.push(G)}),N},v.prototype.setCurrentOpacity=function(S,N){var Z=this;this.currentOpacity=S,this.opacityBoxes.forEach(function(G){G.style.borderColor=G===N?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(Ge),oe=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.setOpacity=G.setOpacity.bind(G),G.fillColor=Z.defaultHighlightColor,G.strokeWidth=0,G.opacity=Z.defaultHighlightOpacity,G.fillPanel=new je("Color",Z.defaultColorSet,G.fillColor),G.fillPanel.onColorChanged=G.setFillColor,G.opacityPanel=new ie("Opacity",Z.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return be(v,z),v.prototype.setOpacity=function(S){this.opacity=S,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=z.prototype.getState.call(this);return S.typeName=v.typeName,S},v.typeName="HighlightMarker",v.title="Highlight marker",v.icon=' ',v}(te),he=' ',ge=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.bgColor="transparent",G.tipPosition={x:0,y:0},G.tipBase1Position={x:0,y:0},G.tipBase2Position={x:0,y:0},G.tipMoving=!1,G.color=Z.defaultStrokeColor,G.bgColor=Z.defaultFillColor,G.fontFamily=Z.defaultFontFamily,G.defaultSize={x:100,y:30},G.setBgColor=G.setBgColor.bind(G),G.getTipPoints=G.getTipPoints.bind(G),G.positionTip=G.positionTip.bind(G),G.setTipPoints=G.setTipPoints.bind(G),G.colorPanel=new je("Text color",Z.defaultColorSet,G.color,' '),G.colorPanel.onColorChanged=G.setColor,G.bgColorPanel=new je("Fill color",Z.defaultColorSet,G.bgColor,he),G.bgColorPanel.onColorChanged=G.setBgColor,G.fontFamilyPanel=new Se("Font",Z.defaultFontFamilies,Z.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G.tipGrip=new ut,G.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),G.controlBox.appendChild(G.tipGrip.visual),G}return be(v,z),v.prototype.ownsTarget=function(S){return z.prototype.ownsTarget.call(this,S)||this.tipGrip.ownsTarget(S)||this.tip===S},v.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(S,N){this.state==="new"&&z.prototype.pointerDown.call(this,S,N),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(N)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,S,N)},v.prototype.pointerUp=function(S){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,S);else{var N=this.state==="creating";z.prototype.pointerUp.call(this,S),this.setTipPoints(N),this.positionTip()}},v.prototype.manipulate=function(S){if(this.tipMoving){var N=this.unrotatePoint(S);this.tipPosition={x:N.x-this.manipulationStartLeft,y:N.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,S)},v.prototype.setBgColor=function(S){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",S]]),se.setAttributes(this.tip,[["fill",S]])),this.bgColor=S,this.fillColorChanged(S)},v.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},v.prototype.setTipPoints=function(S){S===void 0&&(S=!1);var N=Math.min(this.height/2,15),Z=this.height/5;S&&(this.tipPosition={x:N+Z/2,y:this.height+20});var G=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?G ',v}(Ne),Ce=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.strokeColor=Z.defaultColor,G.strokeWidth=Z.defaultStrokeWidth,G.strokeDasharray=Z.defaultStrokeDasharray,G.fillColor=Z.defaultFillColor,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.setOpacity=G.setOpacity.bind(G),G.createVisual=G.createVisual.bind(G),G.strokePanel=new je("Line color",me(Z.defaultColorSet,["transparent"]),Z.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.fillPanel=new je("Fill color",me(Z.defaultColorSet,["transparent"]),G.fillColor,he),G.fillPanel.onColorChanged=G.setFillColor,G.strokeWidthPanel=new ft("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new nt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G.opacityPanel=new ie("Opacity",Z.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return be(v,z),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.visual)},v.prototype.createVisual=function(){this.visual=se.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.state==="new"&&(this.createVisual(),this.moveVisual(S),this._state="creating")},v.prototype.manipulate=function(S){z.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){z.prototype.resize.call(this,S),this.setSize()},v.prototype.setSize=function(){z.prototype.setSize.call(this),se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(S){z.prototype.pointerUp.call(this,S),this.setSize()},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(S),this.stateChanged()},v.prototype.setFillColor=function(S){this.fillColor=S,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(S),this.stateChanged()},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(S){this.opacity=S,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){var N=S;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),z.prototype.restoreState.call(this,S),this.setSize()},v.prototype.scale=function(S,N){z.prototype.scale.call(this,S,N),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.icon=' ',v}(qe),De=function(z){function v(S,N,Z){return z.call(this,S,N,Z)||this}return be(v,z),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.tip1&&S!==this.tip2)},v.prototype.createTips=function(){this.tip1=se.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=se.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var S=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.tip1.transform.baseVal.getItem(0);N.setRotate(S,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(N,0);var Z=this.tip2.transform.baseVal.getItem(0);Z.setRotate(S+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Z,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=z.prototype.getState.call(this);return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){z.prototype.restoreState.call(this,S),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.icon=' ',v}(Je),Ke=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.strokePanel.colors=Z.defaultColorSet,G.fillColor="transparent",G}return be(v,z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=z.prototype.getState.call(this);return S.typeName=v.typeName,S},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.icon=' ',v}(Ce),ht=function(){function z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),z.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},z.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},z.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},z}(),it=function(z){function v(S,N,Z){var G=z.call(this,S,N,Z)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.curveX=0,G.curveY=0,G.manipulationStartCurveX=0,G.manipulationStartCurveY=0,G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.positionGrips=G.positionGrips.bind(G),G.addControlGrips=G.addControlGrips.bind(G),G.adjustVisual=G.adjustVisual.bind(G),G.setupControlBox=G.setupControlBox.bind(G),G.resize=G.resize.bind(G),G.strokeColor=Z.defaultColor,G.strokeWidth=Z.defaultStrokeWidth,G.strokeDasharray=Z.defaultStrokeDasharray,G.strokePanel=new je("Line color",Z.defaultColorSet,Z.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new ft("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new nt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return be(v,z),v.prototype.ownsTarget=function(S){return!(!z.prototype.ownsTarget.call(this,S)&&S!==this.visual&&S!==this.selectorCurve&&S!==this.visibleCurve&&!this.curveGrip.ownsTarget(S))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(S,N){z.prototype.pointerDown.call(this,S,N),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=S.x,this.curveY=S.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(N)&&(this.activeGrip=this.curveGrip,this._state="resize")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){z.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,z.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){z.prototype.positionGrips.call(this);var S=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-S/2,this.curveY-S/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},v.prototype.manipulate=function(S){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+S.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+S.y-this.manipulationStartY),z.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){this.activeGrip===this.curveGrip&&(this.curveX=S.x,this.curveY=S.y),z.prototype.resize.call(this,S),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.adjustVisual(),this.colorChanged(S)},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.adjustVisual()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.adjustVisual()},v.prototype.scale=function(S,N){this.curveX=this.curveX*S,this.curveY=this.curveY*N,z.prototype.scale.call(this,S,N)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){z.prototype.restoreState.call(this,S);var N=S;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.curveX=N.curveX,this.curveY=N.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.icon=' ',v}(ct),mt=function(){function z(v,S){S===void 0&&(S=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=S}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),_t=function(z){function v(S,N,Z){var G=z.call(this,S,!1)||this;return G.dataUrl=N,G.state=Z,G}return be(v,z),v}(mt),Qe=function(z){function v(S,N,Z){Z===void 0&&(Z=!1);var G=z.call(this,S,Z)||this;return G.marker=N,G}return be(v,z),v}(mt),Ft=function(){function z(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return z.prototype.addEventListener=function(v,S){this[v].push(S)},z.prototype.removeEventListener=function(v,S){var N=this[v].indexOf(S);N>-1&&this[v].splice(N,1)},z}(),Ct=function(){function z(v){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ae,this._isOpen=!1,this.undoRedoManager=new ht,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=z.instanceCounter++,this.styles=new rt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(z.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ye,ve,pe,Ne,Ke,Ce,oe,ge,De,te,Je,it]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ye,ve,pe,Ne,Ce,oe,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ye,ve,pe,Ne,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var S=this;this._availableMarkerTypes.splice(0),v.forEach(function(N){if(typeof N=="string"){var Z=S.ALL_MARKER_TYPES.find(function(G){return G.typeName===N});Z!==void 0&&S._availableMarkerTypes.push(Z)}else S._availableMarkerTypes.push(N)})},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},z.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&He.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=He.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(S){return S(new mt(v))})},z.prototype.render=function(){return we(this,void 0,void 0,function(){var v;return xe(this,function(S){switch(S.label){case 0:return this.setCurrentMarker(),(v=new ze).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return S.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,S.sent()]}})})},z.prototype.close=function(v){var S=this;if(v===void 0&&(v=!1),this.isOpen){var N=!1;v||this.eventListeners.beforeclose.forEach(function(Z){var G=new mt(S,!0);Z(G),G.defaultPrevented&&(N=!0)}),N||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Z){return Z(new mt(S))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var v,S=[],N=0;Nthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,N=S ',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},z.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Le(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},z.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},z.prototype.toolbarButtonClicked=function(v,S){if(v==="marker"&&S!==void 0)this.createNewMarker(S);else if(v==="action")switch(S){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},z.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var S=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Z){var G=new Qe(v,v._currentMarker,!0);Z(G),G.defaultPrevented&&(S=!0)}),!S){var N=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Z){return Z(new Qe(v,N))})}}},z.prototype.clear=function(){var v=this,S=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(fe){var ke=new Qe(v,void 0,!0);fe(ke),ke.defaultPrevented&&(S=!0)}),!S)){this.setCurrentMarker();for(var N=function(fe){var ke=Z.markers[fe];Z.setCurrentMarker(Z.markers[fe]),Z._currentMarker.dispose(),Z.markerImage.removeChild(Z._currentMarker.container),Z.markers.splice(Z.markers.indexOf(Z._currentMarker),1),Z.eventListeners.markerdelete.forEach(function(Ze){return Ze(new Qe(v,ke))})},Z=this,G=this.markers.length-1;G>=0;G--)N(G);this.addUndoStep()}},Object.defineProperty(z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),z.prototype.showNotesEditor=function(){var v;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},z.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},z.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var S=this.getState(),N=this.undoRedoManager.getLastUndoStep();if(!N||N.width===S.width&&N.height===S.height){var Z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(S),Z1&&this.panTo({x:v.clientX,y:v.clientY}))},z.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},z.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},z.prototype.clientToLocalCoordinates=function(v,S){var N=this.markerImage.getBoundingClientRect();return{x:(v-N.left)/this.zoomLevel,y:(S-N.top)/this.zoomLevel}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},z.prototype.addLicenseKey=function(v){Re.addKey(v)},z.prototype.addEventListener=function(v,S){this.eventListeners.addEventListener(v,S)},z.prototype.removeEventListener=function(v,S){this.eventListeners.removeEventListener(v,S)},z.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),z.prototype.focus=function(){var v=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(S){return S(new mt(v))}))},z.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(S){return S(new mt(v))}))},z.instanceCounter=0,z}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Yt=function(z,v){return(Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,N){S.__proto__=N}||function(S,N){for(var Z in N)Object.prototype.hasOwnProperty.call(N,Z)&&(S[Z]=N[Z])})(z,v)};function $t(z,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function S(){this.constructor=z}Yt(z,v),z.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}function Lt(z,v,S,N){return new(S||(S=Promise))(function(Z,G){function fe(gt){try{Ze(N.next(gt))}catch(Fe){G(Fe)}}function ke(gt){try{Ze(N.throw(gt))}catch(Fe){G(Fe)}}function Ze(gt){var Fe;gt.done?Z(gt.value):(Fe=gt.value,Fe instanceof S?Fe:new S(function(Et){Et(Fe)})).then(fe,ke)}Ze((N=N.apply(z,v||[])).next())})}function di(z,v){var S,N,Z,G,fe={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return G={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function ke(Ze){return function(gt){return function(Fe){if(S)throw new TypeError("Generator is already executing.");for(;fe;)try{if(S=1,N&&(Z=2&Fe[0]?N.return:Fe[0]?N.throw||((Z=N.return)&&Z.call(N),0):N.next)&&!(Z=Z.call(N,Fe[1])).done)return Z;switch(N=0,Z&&(Fe=[2&Fe[0],Z.value]),Fe[0]){case 0:case 1:Z=Fe;break;case 4:return fe.label++,{value:Fe[1],done:!1};case 5:fe.label++,N=Fe[1],Fe=[0];continue;case 7:Fe=fe.ops.pop(),fe.trys.pop();continue;default:if(!(Z=fe.trys,(Z=Z.length>0&&Z[Z.length-1])||Fe[0]!==6&&Fe[0]!==2)){fe=0;continue}if(Fe[0]===3&&(!Z||Fe[1]>Z[0]&&Fe[1]0&&S>0){var N=new Ai(v,S),Z=N.ratio>=1?20:N.getHorizontalLength(20),G=N.ratio<1?20:N.getVerticalLength(20),fe=document.createElementNS("http://www.w3.org/2000/svg","svg");fe.setAttribute("xmlns","http://www.w3.org/2000/svg"),fe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(fe);var ke=Ve.createDefs();fe.appendChild(ke);var Ze=Ve.createElement("clipPath",[["id","text-bg-clip"]]);ke.appendChild(Ze);var gt=Ve.createPath(Ve.getHollowRectanglePath((24-Z)/2,(24-G)/2,Z,G,(24-Z)/2+2,(24-G)/2+2,Z-4,G-4));fe.appendChild(gt);var Fe=Ve.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Fe.appendChild(Ve.createTSpan(v+":"+S)),fe.appendChild(Fe);var Et=Fe.getBBox();Ve.setAttributes(Fe,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var Ht=Ve.createPath(Ve.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return Ze.appendChild(Ht),Ve.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(fe),fe.outerHTML}return' '},z}(),ii=function(z){function v(S,N,Z){var G=z.call(this,S,N)||this;return G.isDropdownOpen=!1,G.onClick=G.dropdownButtonClicked,G.dropdownButtons=Z,G}return $t(v,z),v.prototype.setupDropdown=function(){var S=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(N){N.className=S.className,N.colorsClassName=S.colorsClassName,S.dropdownBlock.appendChild(N.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},v.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},v.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},v.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},v.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},v.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},v}(Tt),Mt=function(){function z(v,S){this.GRIP_SIZE=10,this.color=v,this.fillColor=S,this.visual=Ve.createGroup(),this.visual.appendChild(Ve.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ve.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},z.prototype.setCenter=function(v,S){this.visual.childNodes.forEach(function(N){return Ve.setAttributes(N,[["cx",v.toString()],["cy",S.toString()]])})},z}(),Gi=function(){function z(v,S,N,Z){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=S,this.margin=N,this.container=Z,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(v){this._aspectRatio=v,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Ve.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),z.prototype.open=function(){var v=this;this.cropShadeElement=Ve.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ve.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var S=0;Sthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-S.height/2),Ve.setAttributes(this.cropRectElement,[["x",S.x.toString()],["y",S.y.toString()],["width",S.width.toString()],["height",S.height.toString()]]);var N=S.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(G,fe){var ke=S.y+N*(fe+1);Ve.setAttributes(G,[["x1",""+S.x],["y1",""+ke],["x2",""+(S.x+S.width)],["y2",""+ke]])});var Z=S.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(G,fe){var ke=S.x+Z*(fe+1);Ve.setAttributes(G,[["x1",""+ke],["y1",""+S.y],["x2",""+ke],["y2",""+(S.y+S.height)]])}),Ve.setAttributes(this.cropShadeElement,[["d",Ve.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,S.x,S.y,S.width,S.height)]]),this.topLeftGrip.setCenter(S.x,S.y),this.topRightGrip.setCenter(S.x+S.width,S.y),this.bottomLeftGrip.setCenter(S.x,S.y+S.height),this.bottomRightGrip.setCenter(S.x+S.width,S.y+S.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},z.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},z.prototype.clientToLocalCoordinates=function(v,S){var N=this.container.getBoundingClientRect();return{x:v-N.left+this.margin,y:S-N.top+this.margin}},z.prototype.onPointerDown=function(v){this.container.setPointerCapture(v.pointerId),this.previousPoint=this.clientToLocalCoordinates(v.clientX,v.clientY),this.cropRectElement===v.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(v.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(v.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(v.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(v.target)&&(this.activeGrip=this.bottomRightGrip)},z.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var S=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(S)}v.preventDefault()},z.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},z.prototype.move=function(v){var S=v.x-this.previousPoint.x,N=v.y-this.previousPoint.y;this.zoomFactor!==1&&(S=-S/this.zoomFactor,N=-N/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+S),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+N),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=v},z.prototype.resize=function(v){var S=Object.assign({},this.cropRect),N=v.x-this.previousPoint.x,Z=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:S.x+Nthis.canvasWidth*this.zoomFactor&&(N=this.canvasWidth*this.zoomFactor-S.width),S.width+=N}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(S.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(N),S.height=this.aspectRatio.getVerticalLength(S.width)):(S.y+=Z,S.height=this.cropRect.y+this.cropRect.height-S.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?S.height=this.aspectRatio.getVerticalLength(S.width):S.height+=Z}S.width<10&&(S.x=this.cropRect.x,S.width=10),S.height<10&&(S.y=this.cropRect.y,S.height=10),this.previousPoint=v,S.x>=this.margin&&S.y>=this.margin&&S.x-this.margin+S.width<=this.canvasWidth&&S.y-this.margin+S.height<=this.canvasHeight&&(this.cropRect=S,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var v=this.cropRect.x+this.cropRect.width/2,S=this.cropRect.y+this.cropRect.height/2,N=this.aspectRatio.getHorizontalLength(this.cropRect.height),Z=this.aspectRatio.getVerticalLength(this.cropRect.width);N/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=v-this.cropRect.width/2,this.cropRect.y=S-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},z.prototype.getRescaledRect=function(v,S,N,Z,G,fe){var ke=N/v,Ze=Z/S;return{x:(G.x-fe)*ke+fe,y:(G.y-fe)*Ze+fe,width:G.width*ke,height:G.height*Ze}},z.prototype.scaleCanvas=function(v,S){var N=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,S,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=S,this.onCropChange&&this.onCropChange(N),this.setCropRectangle(N)},z}(),$i=function(){function z(v){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=v,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(z.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),z.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},z.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},z.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},z.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Ve.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},z.prototype.positionScaleShape=function(){if(this.scaleShape){var v=this.scaleShape.transform.baseVal.getItem(0);v.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(v,0)}},z.prototype.getVisual=function(){var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("xmlns","http://www.w3.org/2000/svg"),v.setAttribute("width",this.width+"px"),v.setAttribute("height",this.height+"px"),v.setAttribute("viewBox","0 0 "+this.width+" "+this.height),v.style.flexShrink="0",document.body.appendChild(v);for(var S="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,N=1;N<=this.width/5+10;N++){var Z=N%5==0?this.height/3:this.height/6;S+="h4v"+-Z+"h1v"+Z}S+="v1H0Z",this.scaleShape=Ve.createPath(S);var G=Ve.createTransform();this.scaleShape.transform.baseVal.appendItem(G),v.appendChild(this.scaleShape),this.angleLabelElement=Ve.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ve.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var fe=Ve.createTSpan("");return fe.innerHTML="°",this.angleLabelElement.appendChild(fe),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},z}(),pn=function(){function z(){this.naturalSize=!1,this.imageType="image/png"}return z.prototype.rasterize=function(v,S,N,Z,G,fe,ke){var Ze=this;return new Promise(function(gt){var Fe=document.createElement("canvas");Fe.width=v.width.baseVal.value-2*Z,Fe.height=v.height.baseVal.value-2*Z;var Et=1,Ht=1;Ze.naturalSize===!0?(Et=S.naturalWidth/(v.width.baseVal.value-2*Z)/fe,Ht=S.naturalHeight/(v.height.baseVal.value-2*Z)/ke,Fe.width=S.naturalWidth/fe,Fe.height=S.naturalHeight/ke):Ze.width!==void 0&&Ze.height!==void 0&&(Et=Ze.width/N.width,Ht=Ze.height/N.height,Fe.width*=Et,Fe.height*=Ht);var Zt=Fe.getContext("2d");Zt.translate(Fe.width/2,Fe.height/2),Zt.rotate(G*Math.PI/180),Zt.scale(fe,ke),Zt.translate(-Fe.width/2,-Fe.height/2),Zt.drawImage(S,0,0,Fe.width,Fe.height);var Bi=document.createElement("canvas");Bi.width=N.width*Et,Bi.height=N.height*Ht,Bi.getContext("2d").putImageData(Zt.getImageData((N.x-Z)*Et,(N.y-Z)*Ht,N.width*Et,N.height*Ht),0,0),gt(Bi.toDataURL(Ze.imageType,Ze.imageQuality))})},z}(),We=function(){function z(v){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=z.instanceCounter++,this.styles=new St(this.instanceNo),this.target=v,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(v){this._gridLines=v,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(v){this._rotationAngle=v,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"aspectRatio",{get:function(){var v;return(v=this._aspectRatio)!==null&&v!==void 0?v:this.aspectRatios[0]},set:function(v){this._aspectRatio=v},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},z.prototype.show=function(){this.showUI(),this.open()},z.prototype.close=function(v){v===void 0&&(v=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),v||this.closeEventListeners.forEach(function(S){return S()}),this._isOpen=!1)},z.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},z.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},z.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},z.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},z.prototype.setupResizeObserver=function(){var v=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,S=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,N=S+2*this.CANVAS_MARGINv+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},z.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new qt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var S=new Kt;S.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(S);var N=[];this.aspectRatios.forEach(function(Ht){var Zt=new Tt(Ei.getIcon(Ht.horizontal,Ht.vertical),Ht.horizontal===0&&Ht.vertical===0?"FREE":Ht.horizontal+":"+Ht.vertical);Zt.onClick=function(){return v.ratioButtonClicked(Ht)},N.push(Zt)}),this.aspectRatioButton=new ii(Ei.getIcon(0,0),"Aspect ratio",N),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,S.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Z=new Tt(' ',"Toggle grid");Z.isActive=this.isGridVisible,Z.onClick=function(){v.isGridVisible=!v.isGridVisible,Z.isActive=v.isGridVisible},S.addButton(Z);var G=new Tt(' ',"Zoom to selection");if(G.isActive=this.zoomToCropEnabled,G.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,G.isActive=v.zoomToCropEnabled},S.addButton(G),!Ii.isLicensed){var fe=new lt;this.topToolbar.addElementBlock(fe);var ke=document.createElement("div");ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ze=document.createElement("a");Ze.style.color="currentColor",Ze.href="https://markerjs.com/products/cropro",Ze.target="_blank",Ze.innerHTML=' ',ke.appendChild(Ze),fe.addElement(ke)}var gt=new Kt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Fe=new Tt(' ',"OK");Fe.onClick=this.startRenderAndClose,gt.addButton(Fe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Fe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=new Tt(' ',"Close");Et.onClick=this.close,gt.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},z.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new qt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var S=new Kt;S.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(S);var N=new Tt(' ',"Rotate left");N.onClick=this.rotateLeftButtonClicked,S.addButton(N);var Z=new Tt(' ',"Rotate right");Z.onClick=this.rotateRightButtonClicked,S.addButton(Z);var G=new lt;G.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(G),this.straightener=new $i("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(gt){v.rotateBy(gt),v.straightener.angle=v.rotationAngle},G.addElement(this.straightener.getUI());var fe=new Kt;fe.minWidth=2*this.toolbarHeight+"px",fe.contentAlign="end",this.bottomToolbar.addButtonBlock(fe);var ke=new Tt(' ',"Flip horizontal");ke.onClick=this.flipHorizontallyButtonClicked,fe.addButton(ke);var Ze=new Tt(' ',"Flip vertical");Ze.onClick=this.flipVerticallyButtonClicked,fe.addButton(Ze)},z.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ei.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ai(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},z.prototype.restoreState=function(v){if(v){var S=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(S),this.cropRectChanged(S),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},z.prototype.clientToLocalCoordinates=function(v,S){var N=this.cropImage.getBoundingClientRect();return{x:v-N.left,y:S-N.top}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var v=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},z.prototype.rotateLeftButtonClicked=function(){var v=this.rotationAngle-90;this.rotationAngle%90!=0&&(v+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(v)},z.prototype.rotateRightButtonClicked=function(){var v=this.rotationAngle+90;this.rotationAngle%90!=0&&(v-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(v)},z.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},z.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},z.prototype.applyRotation=function(){var v=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var S=this.editingTargetRotationContainer.transform.baseVal.getItem(0);S.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(S,0);var N=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/N.width,this.imageHeight/N.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=v},z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},z.prototype.startRenderAndClose=function(){return Lt(this,void 0,void 0,function(){var v,S;return di(this,function(N){switch(N.label){case 0:return[4,this.render()];case 1:return v=N.sent(),S=this.getState(),this.renderEventListeners.forEach(function(Z){return Z(v,S)}),this.close(!0),[2]}})})},z.prototype.render=function(){return Lt(this,void 0,void 0,function(){var v;return di(this,function(S){switch(S.label){case 0:return(v=new pn).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Ve.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return S.sent(),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,S.sent()]}})})},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new It("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new It("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new It("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new It("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*v)+`px;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new It("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new It("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new It("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new It("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new It("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new It("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new It("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},z.instanceCounter=0,z}(),At=ne("8hTe"),mn=ne.n(At),gn=/]*>/g;function vn(z){var v=document.createElement("div");return v.innerHTML=z,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var yn=et.a=function(z){var v=z.value,S=v===void 0?"":v,N=z.edit,Z=N===void 0?!1:N,G=z.className,fe=z.showTextOnly,ke=z.showLines,Ze=z.replaces,gt=z.zoomImg,Fe=z.hasMask,Et=z.style,Ht=Et===void 0?{}:Et,Zt=z.stylesPrev,Bi=Zt===void 0?{}:Zt,xi=String(S),Ti=Object(I.useRef)(),Qi=Object(I.useRef)(),Dn=Object(I.useState)(""),ci=Object(W.a)(Dn,2),zi=ci[0],ln=ci[1],un=Object(I.useState)("office"),ji=Object(W.a)(un,2),kn=ji[0],_n=ji[1],Kn=function(){var Wt=new We(Qi.current);Wt.displayMode="popup",Wt.addRenderEventListener(function(){var yi=Object(U.a)(k.a.mark(function Pt(si){var Vt;return k.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return Ti.current.style.display="none",fi.next=3,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si}});case 3:Vt=fi.sent,Vt!=null&&Vt.id&&Ze(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return fi.stop()}},Pt)}));return function(Pt){return yi.apply(this,arguments)}}()),Wt.show()},Vn=function(){var Wt=new Ct(Qi.current);Wt.settings.displayMode="popup",Wt.addEventListener("render",function(){var yi=Object(U.a)(k.a.mark(function Pt(si){var Vt;return k.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:if(Ti.current.style.display="none",!Qi.current){fi.next=6;break}return fi.next=4,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si.dataUrl}});case 4:Vt=fi.sent,Vt!=null&&Vt.id&&Ze(Qi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return fi.stop()}},Pt)}));return function(Pt){return yi.apply(this,arguments)}}()),Wt.show(),window.markerArea=Wt},Ji=Object(I.useMemo)(function(){Ti.current&&(Ti.current.style.zIndex=-1);try{var ri=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Wt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;xi=xi.replace(ri,"("+ee.a.API_SERVER+"/api/attachments/").replace(Wt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(yi,'"'+ee.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(nn){}var Pt=V(xi),si=_();if(xi.match(/\[TOC\]/)&&(Pt=Pt.replace("[TOC]
",O()),R()),Pt=Pt.replace(/(__special_katext_id_\d+__)/g,function(nn,fi){var Oi=si[fi],Xn=Oi.type,xn=Oi.expression;return Object(re.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),Pt=Pt.replace(/▁/g,"\u2581\u2581\u2581"),g(),fe){var Vt=document.createElement("div");return Vt.innerHTML=Pt,Vt.innerText}return setTimeout(function(){return dr()},500),Pt},[xi]),Xi=Object(I.useRef)();w.WebkitLineClamp=ke,ke&&(Ht=Object(F.a)(Object(F.a)({},Ht),w));function bn(ri){var Wt=ri.target;if(Wt.tagName.toUpperCase()==="IMG"){if(gt){var yi=Wt.getAttribute("src");ln(yi),_n("image")}}else if(Wt.tagName.toUpperCase()==="A"){var Pt=Wt.getAttribute("href");if(Pt.indexOf("office")>-1)ri.preventDefault(),ln(Pt),_n("office");else if(Pt.indexOf("application/pdf")>-1)ri.preventDefault(),ln(Pt),_n("pdf");else if(Pt.indexOf("text/html")>-1)ri.preventDefault(),ln(Pt),_n("html");else if(Pt.startsWith("#")){ri.preventDefault();var si=document.getElementById(Pt.replace("#",""));si&&si.scrollIntoView(!0)}}}var dr=function(){var Wt,yi=(Wt=Xi.current)===null||Wt===void 0?void 0:Wt.querySelectorAll("video");yi==null||yi.forEach(function(Pt){if(Pt.oncontextmenu=function(){return!1},Pt.src.indexOf(".m3u8")>-1&&!Pt.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var si=new $.a;si.loadSource(Pt.src),si.attachMedia(Pt)}}})};Object(I.useEffect)(function(){if(Xi.current&&Ji&&(Ji.match(gn)&&window.PR.prettyPrint()),Xi.current)return Xi.current.addEventListener("click",bn),function(){Xi.current.removeEventListener("click",bn),g(),R()}},[Ji,Xi.current,bn]);var En=function(Wt){if(!Z)return;Wt.target.nodeName==="IMG"?(Ti.current.style.zIndex=1,Ti.current.style.display="flex",Ti.current.style.width=Wt.target.clientWidth+"px",Ti.current.style.height=Wt.target.clientHeight+"px",Ti.current.style.top=Wt.target.offsetTop+"px",Ti.current.style.left=Wt.target.offsetLeft+"px",Qi.current.src=Wt.target.getAttribute("src")):Ti.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Xi,style:Object(F.a)({},Ht),className:"".concat(G||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Ji}}),m.a.createElement("div",{ref:Ti,className:mn.a.button},m.a.createElement(J.a,null,m.a.createElement(Y.a,{onClick:function(){return Kn()}},"\u88C1\u526A"),m.a.createElement(Y.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:Qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(ue.a,{close:!0,data:zi,type:zi!=null&&zi.length?kn:"",style:Object(F.a)({},Bi),onClose:function(){return ln("")}}))}},"9VGf":function(vt,et,ne){"use strict";ne.d(et,"a",function(){return D});var ae=ne("q1tI"),J=ne.n(ae);function D(Y,F){var U=Object(ae.useRef)();Object(ae.useEffect)(function(){U.current=Y}),Object(ae.useEffect)(function(){function W(){U.current()}if(F!==null){var j=setInterval(W,F);return function(){return clearInterval(j)}}},[F])}},BU3w:function(vt,et,ne){"use strict";ne.d(et,"a",function(){return U});var ae=ne("MNnm"),J="rc-util-key";function D(W){if(W.attachTo)return W.attachTo;var j=document.querySelector("head");return j||document.body}function Y(W){var j,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ae.a)())return null;var I=document.createElement("style");if((j=k.csp)===null||j===void 0?void 0:j.nonce){var m;I.nonce=(m=k.csp)===null||m===void 0?void 0:m.nonce}I.innerHTML=W;var c=D(k),f=c.firstChild;return k.prepend&&c.prepend?c.prepend(I):k.prepend&&f?c.insertBefore(I,f):c.appendChild(I),I}var F=new Map;function U(W,j){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=D(k);if(!F.has(I)){var m=Y("",k),c=m.parentNode;F.set(I,c),c.removeChild(m)}var f=Array.from(F.get(I).children).find(function(s){return s.tagName==="STYLE"&&s[J]===j});if(f){var u,r;if(((u=k.csp)===null||u===void 0?void 0:u.nonce)&&f.nonce!==((r=k.csp)===null||r===void 0?void 0:r.nonce)){var d;f.nonce=(d=k.csp)===null||d===void 0?void 0:d.nonce}return f.innerHTML!==W&&(f.innerHTML=W),f}var o=Y(W,k);return o[J]=j,o}},Bd2K:function(vt,et,ne){(function(ae){ae(ne("VrN/"),ne("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(k,I,m){if(m!=ae.Init&&m&&k.removeKeyMap("autoCloseTags"),!I)return;var c={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(c["'/'"]=function(f){return U(f)}),(typeof I!="object"||I.whenOpening!==!1)&&(c["'>'"]=function(f){return Y(f)}),k.addKeyMap(c)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Y(k){if(k.getOption("disableInput"))return ae.Pass;for(var I=k.listSelections(),m=[],c=k.getOption("autoCloseTags"),f=0;fu.ch&&(l=l.slice(0,l.length-r.end+u.ch));var x=l.toLowerCase();if(!l||r.type=="string"&&(r.end!=u.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&s.close||r.string.indexOf("/")==u.ch-r.start-1||R&&W(R,x)>-1||j(k,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(o)||[],l,u,!0))return ae.Pass;var O=typeof c=="object"&&c.emptyTags;if(O&&W(O,l)>-1){m[f]={text:"/>",newPos:ae.Pos(u.line,u.ch+2)};continue}var A=w&&W(w,x)>-1;m[f]={indent:A,text:">"+(A?`
`:"")+""+l+">",newPos:A?ae.Pos(u.line+1,0):ae.Pos(u.line,u.ch+1)}}for(var T=typeof c=="object"&&c.dontIndentOnAutoClose,f=I.length-1;f>=0;f--){var E=m[f];k.replaceRange(E.text,I[f].head,I[f].anchor,"+insert");var y=k.listSelections().slice(0);y[f]={head:E.newPos,anchor:E.newPos},k.setSelections(y),!T&&E.indent&&(k.indentLine(E.newPos.line,null,!0),k.indentLine(E.newPos.line+1,null,!0))}}function F(k,I){for(var m=k.listSelections(),c=[],f=I?"/":"",u=k.getOption("autoCloseTags"),r=typeof u=="object"&&u.dontIndentOnSlash,d=0;d"&&(R+=">"),c[d]=R}if(k.replaceSelections(c),m=k.listSelections(),!r)for(var d=0;d=0&&I[o]==m;o--)++d;c=r.to;for(var o=1;o0){for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:"",I=[],m=0;mve.length)&&(de=ve.length);for(var pe=0,te=new Array(de);pe=ve.length?{done:!0}:{done:!1,value:ve[te++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return pe=ve[Symbol.iterator](),pe.next.bind(pe)}function U(ve,de){return de={exports:{}},ve(de,de.exports),de.exports}var W=U(function(ve){function de(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function pe(te){ve.exports.defaults=te}ve.exports={defaults:de(),getDefaults:de,changeDefaults:pe}}),j=W.defaults,k=W.getDefaults,I=W.changeDefaults,m=/[&<>"']/,c=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(de){return r[de]};function o(ve,de){if(de){if(m.test(ve))return ve.replace(c,d)}else if(f.test(ve))return ve.replace(u,d);return ve}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(ve){return ve.replace(s,function(de,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var p=/(^|[^\[])\^/g;function R(ve,de){ve=ve.source||ve,de=de||"";var pe={replace:function(ie,oe){return oe=oe.source||oe,oe=oe.replace(p,"$1"),ve=ve.replace(ie,oe),pe},getRegex:function(){return new RegExp(ve,de)}};return pe}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(ve,de,pe){if(ve){var te;try{te=decodeURIComponent(l(pe)).replace(w,"").toLowerCase()}catch(ie){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}de&&!x.test(pe)&&(pe=h(de,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ie){return null}return pe}var A={},T=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(ve,de){A[" "+ve]||(T.test(ve)?A[" "+ve]=ve+"/":A[" "+ve]=M(ve,"/",!0)),ve=A[" "+ve];var pe=ve.indexOf(":")===-1;return de.substring(0,2)==="//"?pe?de:ve.replace(E,"$1")+de:de.charAt(0)==="/"?pe?de:ve.replace(y,"$1")+de:ve+de}var _={exec:function(){}};function g(ve){for(var de=1,pe,te;de=0&&ge[De]==="\\";)Ce=!Ce;return Ce?"|":" |"}),te=pe.split(/ \|/),ie=0;if(te.length>de)te.splice(de);else for(;te.length=te.length?ie.slice(te.length):ie}).join(`
`)}var ye=function(){function ve(pe){this.options=pe||B}var de=ve.prototype;return de.space=function(te){var ie=this.rules.block.newline.exec(te);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},de.code=function(te,ie){var oe=this.rules.block.code.exec(te);if(oe){var he=ie[ie.length-1];if(he&&he.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var ge=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:C(ge,`
`)}}},de.fences=function(te){var ie=this.rules.block.fences.exec(te);if(ie){var oe=ie[0],he=Te(oe,ie[3]||"");return{type:"code",raw:oe,lang:ie[2]?ie[2].trim():ie[2],text:he}}},de.heading=function(te){var ie=this.rules.block.heading.exec(te);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},de.nptable=function(te){var ie=this.rules.block.nptable.exec(te);if(ie){var oe={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(oe.header.length===oe.align.length){var he=oe.align.length,ge;for(ge=0;ge ?/gm,"");return{type:"blockquote",raw:ie[0],text:oe}}},de.list=function(te){var ie=this.rules.block.list.exec(te);if(ie){for(var oe=ie[0],he=ie[2],ge=he.length>1,Ce=he[he.length-1]===")",De={type:"list",raw:oe,ordered:ge,start:ge?+he.slice(0,-1):"",loose:!1,items:[]},Ke=ie[0].match(this.rules.block.item),ht=!1,it,mt,_t,Qe,Ft,Ct,Yt,$t=Ke.length,Lt=0;Lt<$t;Lt++)it=Ke[Lt],oe=it,mt=it.length,it=it.replace(/^ *([*+-]|\d+[.)]) */,""),~it.indexOf(`
`)&&(mt-=it.length,it=this.options.pedantic?it.replace(/^ {1,4}/gm,""):it.replace(new RegExp("^ {1,"+mt+"}","gm"),"")),Lt!==$t-1&&(_t=this.rules.block.bullet.exec(Ke[Lt+1])[0],(ge?_t.length===1||!Ce&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==he)&&(Qe=Ke.slice(Lt+1).join(`
`),De.raw=De.raw.substring(0,De.raw.length-Qe.length),Lt=$t-1)),Ft=ht||/\n\n(?!\s*$)/.test(it),Lt!==$t-1&&(ht=it.charAt(it.length-1)===`
`,Ft||(Ft=ht)),Ft&&(De.loose=!0),Ct=/^\[[ xX]\] /.test(it),Yt=void 0,Ct&&(Yt=it[1]!==" ",it=it.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:oe,task:Ct,checked:Yt,loose:Ft,text:it});return De}},de.html=function(te){var ie=this.rules.block.html.exec(te);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},de.def=function(te){var ie=this.rules.block.def.exec(te);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var oe=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:ie[0],href:ie[2],title:ie[3]}}},de.table=function(te){var ie=this.rules.block.table.exec(te);if(ie){var oe={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(oe.header.length===oe.align.length){oe.raw=ie[0];var he=oe.align.length,ge;for(ge=0;ge/i.test(he[0])&&(ie=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:ie,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ee(he[0]):he[0]}},de.link=function(te){var ie=this.rules.inline.link.exec(te);if(ie){var oe=re(ie[2],"()");if(oe>-1){var he=ie[0].indexOf("!")===0?5:4,ge=he+ie[1].length+oe;ie[2]=ie[2].substring(0,oe),ie[0]=ie[0].substring(0,ge).trim(),ie[3]=""}var Ce=ie[2],De="";if(this.options.pedantic){var Ke=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);Ke?(Ce=Ke[1],De=Ke[3]):De=""}else De=ie[3]?ie[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var ht=ue(ie,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},ie[0]);return ht}},de.reflink=function(te,ie){var oe;if((oe=this.rules.inline.reflink.exec(te))||(oe=this.rules.inline.nolink.exec(te))){var he=(oe[2]||oe[1]).replace(/\s+/g," ");if(he=ie[he.toLowerCase()],!he||!he.href){var ge=oe[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Ce=ue(oe,he,oe[0]);return Ce}},de.strong=function(te,ie,oe){oe===void 0&&(oe="");var he=this.rules.inline.strong.start.exec(te);if(he&&(!he[1]||he[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*te.length);var ge=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Ce;(he=ge.exec(ie))!=null;)if(Ce=this.rules.inline.strong.middle.exec(ie.slice(0,he.index+3)),Ce)return{type:"strong",raw:te.slice(0,Ce[0].length),text:te.slice(2,Ce[0].length-2)}}},de.em=function(te,ie,oe){oe===void 0&&(oe="");var he=this.rules.inline.em.start.exec(te);if(he&&(!he[1]||he[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*te.length);var ge=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Ce;(he=ge.exec(ie))!=null;)if(Ce=this.rules.inline.em.middle.exec(ie.slice(0,he.index+2)),Ce)return{type:"em",raw:te.slice(0,Ce[0].length),text:te.slice(1,Ce[0].length-1)}}},de.codespan=function(te){var ie=this.rules.inline.code.exec(te);if(ie){var oe=ie[2].replace(/\n/g," "),he=/[^ ]/.test(oe),ge=oe.startsWith(" ")&&oe.endsWith(" ");return he&&ge&&(oe=oe.substring(1,oe.length-1)),oe=ee(oe,!0),{type:"codespan",raw:ie[0],text:oe}}},de.br=function(te){var ie=this.rules.inline.br.exec(te);if(ie)return{type:"br",raw:ie[0]}},de.del=function(te){var ie=this.rules.inline.del.exec(te);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},de.autolink=function(te,ie){var oe=this.rules.inline.autolink.exec(te);if(oe){var he,ge;return oe[2]==="@"?(he=ee(this.options.mangle?ie(oe[1]):oe[1]),ge="mailto:"+he):(he=ee(oe[1]),ge=he),{type:"link",raw:oe[0],text:he,href:ge,tokens:[{type:"text",raw:he,text:he}]}}},de.url=function(te,ie){var oe;if(oe=this.rules.inline.url.exec(te)){var he,ge;if(oe[2]==="@")he=ee(this.options.mangle?ie(oe[0]):oe[0]),ge="mailto:"+he;else{var Ce;do Ce=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Ce!==oe[0]);he=ee(oe[0]),oe[1]==="www."?ge="http://"+he:ge=he}return{type:"link",raw:oe[0],text:he,href:ge,tokens:[{type:"text",raw:he,text:he}]}}},de.inlineText=function(te,ie,oe){var he=this.rules.inline.text.exec(te);if(he){var ge;return ie?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ee(he[0]):he[0]:ge=ee(this.options.smartypants?oe(he[0]):he[0]),{type:"text",raw:he[0],text:ge}}},ve}(),be=V.noopTest,we=V.edit,xe=V.merge,me={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:be,table:be,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=we(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=we(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=we(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",me._comment=//,me.html=we(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=we(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.blockquote=we(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=xe({},me),me.gfm=xe({},me.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),me.gfm.nptable=we(me.gfm.nptable).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.gfm.table=we(me.gfm.table).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.pedantic=xe({},me.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:be,paragraph:we(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:be,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:be,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=we(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=we(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=we(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=we(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=we(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=we(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=we(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=we(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=we(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=we(se._blockSkip,"g").getRegex(),se.overlapSkip=we(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,se.autolink=we(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=we(se.tag).replace("comment",me._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=we(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=we(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=we(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=xe({},se),se.pedantic=xe({},se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=xe({},se.normal,{escape:we(se.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(te="x"+te.toString(16)),de+=""+te+";";return de}var Le=function(){function ve(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||ze,this.options.tokenizer=this.options.tokenizer||new ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:He.normal,inline:rt.normal};this.options.pedantic?(te.block=He.pedantic,te.inline=rt.pedantic):this.options.gfm&&(te.block=He.gfm,this.options.breaks?te.inline=rt.breaks:te.inline=rt.gfm),this.tokenizer.rules=te}ve.lex=function(te,ie){var oe=new ve(ie);return oe.lex(te)};var de=ve.prototype;return de.lex=function(te){return te=te.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(te,ie,oe){ie===void 0&&(ie=[]),oe===void 0&&(oe=!0),te=te.replace(/^ +$/gm,"");for(var he,ge,Ce,De;te;){if(he=this.tokenizer.space(te)){te=te.substring(he.raw.length),he.type&&ie.push(he);continue}if(he=this.tokenizer.code(te,ie)){te=te.substring(he.raw.length),he.type?ie.push(he):(De=ie[ie.length-1],De.raw+=`
`+he.raw,De.text+=`
`+he.text);continue}if(he=this.tokenizer.fences(te)){te=te.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.heading(te)){te=te.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.nptable(te)){te=te.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.hr(te)){te=te.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.blockquote(te)){te=te.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],oe),ie.push(he);continue}if(he=this.tokenizer.list(te)){for(te=te.substring(he.raw.length),Ce=he.items.length,ge=0;ge0)for(;(Ke=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)ht.includes(Ke[0].slice(Ke[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ke=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Ce=this.tokenizer.escape(te)){te=te.substring(Ce.raw.length),ie.push(Ce);continue}if(Ce=this.tokenizer.tag(te,oe,he)){te=te.substring(Ce.raw.length),oe=Ce.inLink,he=Ce.inRawBlock,ie.push(Ce);continue}if(Ce=this.tokenizer.link(te)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,he)),ie.push(Ce);continue}if(Ce=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,he)),ie.push(Ce);continue}if(Ce=this.tokenizer.strong(te,De,ge)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],oe,he),ie.push(Ce);continue}if(Ce=this.tokenizer.em(te,De,ge)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],oe,he),ie.push(Ce);continue}if(Ce=this.tokenizer.codespan(te)){te=te.substring(Ce.raw.length),ie.push(Ce);continue}if(Ce=this.tokenizer.br(te)){te=te.substring(Ce.raw.length),ie.push(Ce);continue}if(Ce=this.tokenizer.del(te)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],oe,he),ie.push(Ce);continue}if(Ce=this.tokenizer.autolink(te,Oe)){te=te.substring(Ce.raw.length),ie.push(Ce);continue}if(!oe&&(Ce=this.tokenizer.url(te,Oe))){te=te.substring(Ce.raw.length),ie.push(Ce);continue}if(Ce=this.tokenizer.inlineText(te,he,ot)){te=te.substring(Ce.raw.length),ge=Ce.raw.slice(-1),ie.push(Ce);continue}if(te){var it="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return ie},J(ve,null,[{key:"rules",get:function(){return{block:He,inline:rt}}}]),ve}(),Ue=W.defaults,Ge=V.cleanUrl,je=V.escape,Me=function(){function ve(pe){this.options=pe||Ue}var de=ve.prototype;return de.code=function(te,ie,oe){var he=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(te,he);ge!=null&&ge!==te&&(oe=!0,te=ge)}return he?''+(oe?te:je(te,!0))+`
`:""+(oe?te:je(te,!0))+`
`},de.blockquote=function(te){return`
`+te+`
`},de.html=function(te){return te},de.heading=function(te,ie,oe,he){return this.options.headerIds?"
`:""+te+"
`},de.hr=function(){return this.options.xhtml?`
`:`
`},de.list=function(te,ie,oe){var he=ie?"ol":"ul",ge=ie&&oe!==1?' start="'+oe+'"':"";return"<"+he+ge+`>
`+te+""+he+`>
`},de.listitem=function(te){return""+te+`
`},de.checkbox=function(te){return" "},de.paragraph=function(te){return""+te+`
`},de.table=function(te,ie){return ie&&(ie=""+ie+" "),`
`},de.tablerow=function(te){return`
`+te+`
`},de.tablecell=function(te,ie){var oe=ie.header?"th":"td",he=ie.align?"<"+oe+' align="'+ie.align+'">':"<"+oe+">";return he+te+""+oe+`>
`},de.strong=function(te){return""+te+" "},de.em=function(te){return""+te+" "},de.codespan=function(te){return""+te+""},de.br=function(){return this.options.xhtml?" ":" "},de.del=function(te){return""+te+""},de.link=function(te,ie,oe){if(te=Ge(this.options.sanitize,this.options.baseUrl,te),te===null)return oe;var he='"+oe+" ",he},de.image=function(te,ie,oe){if(te=Ge(this.options.sanitize,this.options.baseUrl,te),te===null)return oe;var he=' ":">",he},de.text=function(te){return te},ve}(),Pe=function(){function ve(){}var de=ve.prototype;return de.strong=function(te){return te},de.em=function(te){return te},de.codespan=function(te){return te},de.del=function(te){return te},de.html=function(te){return te},de.text=function(te){return te},de.link=function(te,ie,oe){return""+oe},de.image=function(te,ie,oe){return""+oe},de.br=function(){return""},ve}(),ut=function(){function ve(){this.seen={}}var de=ve.prototype;return de.slug=function(te){var ie=te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var oe=ie;do this.seen[oe]++,ie=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},ve}(),tt=W.defaults,qe=V.unescape,$e=function(){function ve(pe){this.options=pe||tt,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new ut}ve.parse=function(te,ie){var oe=new ve(ie);return oe.parse(te)};var de=ve.prototype;return de.parse=function(te,ie){ie===void 0&&(ie=!0);var oe="",he,ge,Ce,De,Ke,ht,it,mt,_t,Qe,Ft,Ct,Yt,$t,Lt,di,Ii,Ve,St=te.length;for(he=0;he0&&Lt.tokens[0].type==="text"?(Lt.tokens[0].text=Ve+" "+Lt.tokens[0].text,Lt.tokens[0].tokens&&Lt.tokens[0].tokens.length>0&&Lt.tokens[0].tokens[0].type==="text"&&(Lt.tokens[0].tokens[0].text=Ve+" "+Lt.tokens[0].tokens[0].text)):Lt.tokens.unshift({type:"text",text:Ve}):$t+=Ve),$t+=this.parse(Lt.tokens,Yt),_t+=this.renderer.listitem($t,Ii,di);oe+=this.renderer.list(_t,Ft,Ct);continue}case"html":{oe+=this.renderer.html(Qe.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Qe.tokens));continue}case"text":{for(_t=Qe.tokens?this.parseInline(Qe.tokens):Qe.text;he+1An error occurred:
"+Ye(Ce.message+"",!0)+" ";throw Ce}}Se.options=Se.setOptions=function(ve){return ft(Se.defaults,ve),ct(Se.defaults),Se},Se.getDefaults=Ae,Se.defaults=Je,Se.use=function(ve){var de=ft({},ve);if(ve.renderer&&function(){var te=Se.defaults.renderer||new Me,ie=function(ge){var Ce=te[ge];te[ge]=function(){for(var De=arguments.length,Ke=new Array(De),ht=0;ht`,triples:"",explode:"[]{}"},D=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(r,d,o){o&&o!=ae.Init&&(r.removeKeyMap(F),r.state.closeBrackets=null),d&&(U(Y(d,"pairs")),r.state.closeBrackets=d,r.addKeyMap(F))});function Y(r,d){return d=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[d]!=null?r[d]:J[d]}var F={Backspace:k,Enter:I};function U(r){for(var d=0;d=0;l--){var R=s[l].head;r.replaceRange("",D(R.line,R.ch-1),D(R.line,R.ch+1),"+delete")}}function I(r){var d=j(r),o=d&&Y(d,"explode");if(!o||r.getOption("disableInput"))return ae.Pass;for(var s=r.listSelections(),l=0;l0;return{anchor:new D(r.anchor.line,r.anchor.ch+(d?-1:1)),head:new D(r.head.line,r.head.ch+(d?1:-1))}}function c(r,d){var o=j(r);if(!o||r.getOption("disableInput"))return ae.Pass;var s=Y(o,"pairs"),l=s.indexOf(d);if(l==-1)return ae.Pass;for(var p=Y(o,"closeBefore"),R=Y(o,"triples"),w=s.charAt(l+1)==d,x=r.listSelections(),O=l%2==0,A,T=0;T=0&&r.getRange(y,D(y.line,y.ch+3))==d+d+d?h="skipThree":h="skip";else if(w&&y.ch>1&&R.indexOf(d)>=0&&r.getRange(D(y.line,y.ch-2),y)==d+d){if(y.ch>2&&/\bstring/.test(r.getTokenTypeAt(D(y.line,y.ch-2))))return ae.Pass;h="addFour"}else if(w){var g=y.ch==0?" ":r.getRange(D(y.line,y.ch-1),y);if(!ae.isWordChar(_)&&g!=d&&!ae.isWordChar(g))h="both";else return ae.Pass}else if(O&&(_.length===0||/\s/.test(_)||p.indexOf(_)>-1))h="both";else return ae.Pass;if(!A)A=h;else if(A!=h)return ae.Pass}var b=l%2?s.charAt(l-1):d,M=l%2?d:s.charAt(l+1);r.operation(function(){if(A=="skip")r.execCommand("goCharRight");else if(A=="skipThree")for(var P=0;P<3;P++)r.execCommand("goCharRight");else if(A=="surround"){for(var K=r.getSelections(),P=0;P=0)continue;if(!Object.prototype.hasOwnProperty.call(c,r))continue;u[r]=c[r]}return u}function j(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}function k(c,f){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:c}function I(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);c.prototype=Object.create(f&&f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(c,f):c.__proto__=f)}var m=function(c){I(f,c);function f(u){j(this,f);var r=k(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,u));return r.scrollListener=r.scrollListener.bind(r),r.eventListenerOptions=r.eventListenerOptions.bind(r),r.mousewheelListener=r.mousewheelListener.bind(r),r}return ae(f,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var r=this.getParentElement(this.scrollComponent);r.scrollTop=r.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var r=!1,d={get passive(){r=!0}};try{document.addEventListener("test",null,d),document.removeEventListener("test",null,d)}catch(o){}return r}},{key:"eventListenerOptions",value:function(){var r=this.props.useCapture;return this.isPassiveSupported()&&(r={useCapture:this.props.useCapture,passive:!0}),r}},{key:"setDefaultLoader",value:function(r){this.defaultLoader=r}},{key:"detachMousewheelListener",value:function(){var r=window;this.props.useWindow===!1&&(r=this.scrollComponent.parentNode),r.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var r=window;this.props.useWindow===!1&&(r=this.getParentElement(this.scrollComponent)),r.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),r.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(r){var d=this.props.getScrollParent&&this.props.getScrollParent();return d!=null?d:r&&r.parentNode}},{key:"filterProps",value:function(r){return r}},{key:"attachScrollListener",value:function(){var r=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!r)return;var d=window;this.props.useWindow===!1&&(d=r),d.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),d.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),d.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(r){r.deltaY===1&&!this.isPassiveSupported()&&r.preventDefault()}},{key:"scrollListener",value:function(){var r=this.scrollComponent,d=window,o=this.getParentElement(r),s=void 0;if(this.props.useWindow){var l=document.documentElement||document.body.parentNode||document.body,p=d.pageYOffset!==void 0?d.pageYOffset:l.scrollTop;this.props.isReverse?s=p:s=this.calculateOffset(r,p)}else this.props.isReverse?s=o.scrollTop:s=r.scrollHeight-o.scrollTop-o.clientHeight;s1&&arguments[1]!==void 0?arguments[1]:1,pe=Pe.length,te=0;te1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(C).map(function(ee,re){if(!F.isValidElement(ee)||!ee.type)return null;var ue=ee.type.isSelectOptGroup,Te=ee.key,ye=ee.props,be=ye.children,we=Object(W.a)(ye,["children"]);return $||!ue?A(ee):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Te===null?re:Te,"__"),label:Te},we),{},{options:T(be)})}).filter(function(ee){return ee})}var E=ne("2Qr1"),y=ne("qNPg"),h=ne("U8pU"),_=ne("Kwbf"),g=ne("WKfj");function b(C){var $=C.mode,ee=C.options,re=C.children,ue=C.backfill,Te=C.allowClear,ye=C.placeholder,be=C.getInputElement,we=C.showSearch,xe=C.onSearch,me=C.defaultOpen,se=C.autoFocus,Re=C.labelInValue,ze=C.value,He=C.inputValue,rt=C.optionLabelProp,ot=$==="multiple"||$==="tags",Oe=we!==void 0?we:ot||$==="combobox",Le=ee||T(re);if(Object(_.a)($!=="tags"||Le.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var Ue=Le.some(function(Me){return Me.options?Me.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(_.a)(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)($!=="combobox"||!rt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)($==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(_.a)($==="combobox"||!be,"`getInputElement` only work with `combobox` mode."),Object(_.b)($!=="combobox"||!be||!Te||!ye,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xe&&!Oe&&$!=="combobox"&&$!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!me||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ze!=null){var Ge=Object(g.d)(ze);Object(_.a)(!Re||Ge.every(function(Me){return Object(h.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!ot||Array.isArray(ze),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var je=null;Object(O.a)(re).some(function(Me){if(!F.isValidElement(Me)||!Me.type)return!1;var Pe=Me.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var ut=Object(O.a)(Me.props.children).every(function(tt){return!F.isValidElement(tt)||!Me.type||tt.type.isSelectOption?!0:(je=tt.type,!1)});return!ut}return je=Pe,!0}),je&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(je.displayName||je.name||je,"`.")),Object(_.a)(He===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=b,P=Object(y.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:T,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:M,fillOptionsWithMissingValue:E.a}),K=function(C){Object(D.a)(ee,C);var $=Object(Y.a)(ee);function ee(){var re;return Object(ae.a)(this,ee),re=$.apply(this,arguments),re.selectRef=F.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(J.a)(ee,[{key:"render",value:function(){return F.createElement(P,Object.assign({ref:this.selectRef},this.props))}}]),ee}(F.Component);K.Option=p,K.OptGroup=w;var V=K,B=et.c=V},M8RZ:function(vt,et,ne){"use strict";ne.d(et,"a",function(){return k});var ae=ne("fWQN"),J=ne("mtLc"),D=ne("yKVA"),Y=ne("879j"),F=ne("q1tI"),U=ne.n(F),W=ne("i8i4"),j=ne.n(W),k=function(I){Object(D.a)(c,I);var m=Object(Y.a)(c);function c(f){var u;Object(ae.a)(this,c),u=m.call(this,f);var r=window.document;return u.node=r.createElement("div"),r.body.appendChild(u.node),u}return Object(J.a)(c,[{key:"render",value:function(){var u=this.props.children;return Object(W.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),c}(U.a.Component)},Ot1p:function(vt,et,ne){"use strict";var ae=ne("2qtc"),J=ne("kLXV"),D=ne("rAM+"),Y=ne("miYZ"),F=ne("tsqr"),U=ne("9og8"),W=ne("tJVT"),j=ne("jrin"),k=ne("WmNS"),I=ne.n(k),m=ne("q1tI"),c=ne.n(m),f=ne("VrN/"),u=ne.n(f),r=ne("bdgK"),d=ne("p77/"),o=ne("Bd2K"),s=ne("ELLl"),l=ne("19Vz"),p=ne("lZu9"),R=ne("+NIl"),w=ne("kSUc"),x=ne("9Bee"),O=function(ge){var Ce=ge.value,De=Ce===void 0?"":Ce,Ke=ge.className,ht=ge.showTextOnly,it=ge.showLines,mt=ge.style,_t=mt===void 0?{}:mt,Qe=Object(m.useMemo)(function(){return""},[De]);return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},A=ne("0Owb"),T=ne("dejd"),E=ne("C+DQ"),y=ne("1vsH"),h=ne("m3rI"),_=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function g(ge){var Ce=ge.onActionCallback,De=ge.title,Ke=ge.icon,ht=ge.actionName,it=ge.className,mt=it===void 0?"":it,_t=ge.children;function Qe(){Ce(ht)}return c.a.createElement("a",{title:De,className:mt,onClick:Qe},c.a.createElement("i",{className:"md-iconfont ".concat(Ke)}),_t)}var b=function(ge){var Ce=ge.watch,De=ge.showNullButton,Ke=ge.onActionCallback,ht=ge.fullScreen,it=ge.insertTemp,mt=ge.hidetoolBar,_t=ge.uuid,Qe=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(y.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(y.F)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var Ft=[].concat(_,[{title:"".concat(Ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ce?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return c.a.createElement("ul",{className:"markdown-toolbar-container"},!mt&&Ft.map(function(Ct,Yt){return c.a.createElement("li",{key:Yt},Ct.actionName?c.a.createElement(g,Object(A.a)({},Ct,{onActionCallback:Ke})):c.a.createElement("span",{className:"v-line"}))}),De?c.a.createElement("li",null,c.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ke},c.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,it&&c.a.createElement("li",null,c.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(it),onActionCallback:Ke},c.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),c.a.createElement("li",{className:"btn-full-screen"},c.a.createElement(g,{icon:"".concat(ht?"icon-shrink":"icon-enlarge"),title:ht?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ke})))},M=ne("M8RZ"),P=ne("+L6B"),K=ne("2/Rp"),V=ne("y8nQ"),B=ne("Vl3Y"),C=ne("5NDa"),$=ne("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},re=function(ge){var Ce=ge.callback,De=ge.onCancel;function Ke(ht){Ce(ht)}return c.a.createElement(B.a,Object(A.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ke}),c.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},c.a.createElement($.a,null)),c.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},c.a.createElement($.a,null)),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(K.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},ue=ne("7ahc"),Te=ne("HmJG"),ye=ne("BjJ7"),be=B.a.useForm,we={width:280,marginRight:10},xe={labelCol:{span:5},wrapperCol:{span:19}},me=function(ge){var Ce=ge.callback,De=ge.onCancel,Ke=be(),ht=Object(W.a)(Ke,1),it=ht[0];function mt(Ft){Ce(Ft)}function _t(Ft,Ct){if(Ft.status===-1){F.b.error(Ft.message);return}it.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:Ct.type})}function Qe(Ft){var Ct=Ft.target.files[0];Re(Ct,_t)}return c.a.createElement(B.a,Object(A.a)({form:it},xe,{className:"upload-image-panel",onFinish:mt}),c.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},c.a.createElement("div",{className:"flex-container"},c.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},c.a.createElement($.a,{style:we})),c.a.createElement(se,{onFileChange:Qe}))),c.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},c.a.createElement($.a,{style:{width:264}})),c.a.createElement(B.a.Item,{style:{textAlign:"right"}},c.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(K.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function se(ge){var Ce=ge.onFileChange;return c.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",c.a.createElement("input",{type:"file",onChange:Ce}))}function Re(ge,Ce){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var De=new FormData;De.append("editormd-image-file",ge),De.append("file_param_name","editormd-image-file"),De.append("byxhr","true");var Ke=new window.XMLHttpRequest;Ke.withCredentials=!0,Ke.addEventListener("load",function(ht){Ce(JSON.parse(ht.target.responseText),ge)},!1),Ke.addEventListener("error",function(ht){console.error(ht)},!1),Ke.open("POST","".concat(ye.a,"/api/attachments.json")),Ke.send(De)}var ze=ne("giR+"),He=ne("fyUT"),rt=ne("7Kak"),ot=ne("9yH6"),Oe=ot.a.Group,Le={margin:"0 8px"},Ue=function(ge){var Ce=ge.callback,De=ge.onCancel;function Ke(ht){Ce(ht)}return c.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ke},c.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},c.a.createElement("span",{style:Le},"\u5355\u5143\u683C\u6570\uFF1A"),c.a.createElement("span",{style:Le},"\u884C\u6570"),c.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},c.a.createElement(He.a,null)),c.a.createElement("span",{style:Le},"\u5217\u6570"),c.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},c.a.createElement(He.a,null))),c.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},c.a.createElement("span",{style:Le},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),c.a.createElement(B.a.Item,{name:"align"},c.a.createElement(Oe,null,c.a.createElement(ot.a,{value:"default"},c.a.createElement("i",{className:"fa fa-align-justify"})),c.a.createElement(ot.a,{value:"left"},c.a.createElement("i",{className:"fa fa-align-left"})),c.a.createElement(ot.a,{value:"center"},c.a.createElement("i",{className:"fa fa-align-center"})),c.a.createElement(ot.a,{value:"right"},c.a.createElement("i",{className:"fa fa-align-right"}))))),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(K.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},Ge=ne("ErOA"),je=ne("7Cbv"),Me="link",Pe="upload-image",ut="code-block",tt="add-table",qe="------------",$e={default:qe,left:":".concat(qe),center:":".concat(qe,":"),right:"".concat(qe,":")},ft=ne("9VGf"),nt,Ye;function Ae(){}var ct=0,Je=1e4,Se="\u2581",Ne=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ve(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=de?"Cmd":"Ctrl",te=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(nt={},Object(j.a)(nt,pe+"-B","bold"),Object(j.a)(nt,pe+"-I","italic"),nt),oe=(Ye={},Object(j.a)(Ye,Me,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(Ye,ut,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(Ye,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(Ye,tt,"\u6DFB\u52A0\u8868\u683C"),Ye),he=et.a=function(ge){var Ce=ge.defaultValue,De=Ce===void 0?"":Ce,Ke=ge.onChange,ht=ge.width,it=ht===void 0?"100%":ht,mt=ge.height,_t=mt===void 0?400:mt,Qe=ge.miniToolbar,Ft=Qe===void 0?!1:Qe,Ct=ge.isFocus,Yt=Ct===void 0?!1:Ct,$t=ge.watch,Lt=ge.insertTemp,di=ge.mode,Ii=di===void 0?"markdown":di,Ve=ge.id,St=Ve===void 0?"markdown-editor-id":Ve,Rt=ge.showResizeBar,It=Rt===void 0?!1:Rt,qt=ge.noStorage,jt=qt===void 0?!1:qt,Kt=ge.showNullButton,Tt=Kt===void 0?!1:Kt,lt=ge.hidetoolBar,Ai=lt===void 0?!1:lt,Ei=ge.fullScreen,ii=Ei===void 0?!1:Ei,Mt=ge.onBlur,Gi=ge.onCMBeforeChange,$i=ge.onFullScreen,pn=ge.className,We=pn===void 0?"":pn,At=ge.disablePaste,mn=At===void 0?!1:At,gn=ge.placeholder,vn=gn===void 0?"":gn,yn=ge.values,z=yn===void 0?"":yn,v=Object(m.useState)(null),S=Object(W.a)(v,2),N=S[0],Z=S[1],G=Object(m.useState)(De),fe=Object(W.a)(G,2),ke=fe[0],Ze=fe[1],gt=Object(m.useState)($t),Fe=Object(W.a)(gt,2),Et=Fe[0],Ht=Fe[1],Zt=Object(m.useState)(ii),Bi=Object(W.a)(Zt,2),xi=Bi[0],Ti=Bi[1],Qi=Object(m.useState)(""),Dn=Object(W.a)(Qi,2),ci=Dn[0],zi=Dn[1],ln=Object(m.useState)(0),un=Object(W.a)(ln,2),ji=un[0],kn=un[1],_n=Object(m.useState)(_t),Kn=Object(W.a)(_n,2),Vn=Kn[0],Ji=Kn[1],Xi=Object(m.useState)(!1),bn=Object(W.a)(Xi,2),dr=bn[0],En=bn[1],ri=Object(m.useRef)(Object(je.a)()),Wt=Object(m.useRef)(!1),yi=Object(m.useRef)(),Pt=Object(m.useRef)(),si=Object(m.useRef)(),Vt=Object(m.useRef)(),nn=Object(m.useRef)(),fi=function(){var yt=Object(U.a)(I.a.mark(function Ot(){var xt,kt;return I.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(Ge.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ri.current}});case 2:kt=Qt.sent,kt!=null&&(xt=kt.attachments)!==null&&xt!==void 0&&xt.length&&(console.log("cm:",N,Pt),kt.attachments.map(function(Ut){Ut.content_type.indexOf("image")>-1?N.replaceSelection(".concat(Ut.content_type,")")):Ut.content_type.indexOf("video")>-1?N.replaceSelection(' ')):Ut.content_type.indexOf("pdf")>-1?N.replaceSelection('').concat(Ut.name," ")):N.replaceSelection("[".concat(Ut.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}));case 4:case"end":return Qt.stop()}},Ot)}));return function(){return yt.apply(this,arguments)}}();Object(m.useEffect)(function(){Ze(z),N==null||N.setValue(z)},[z]),Object(m.useEffect)(function(){$i==null||$i(xi)},[xi]),Object(m.useEffect)(function(){if(Pt.current){var yt=u.a.fromTextArea(Pt.current,{mode:Ii,lineNumbers:!Ft,lineWrapping:!0,value:De,autoCloseTags:!0,autoCloseBrackets:!0});Yt&&yt.focus();function Ot(xt,kt){if(mn){kt.preventDefault();return}var Bt=kt.clipboardData;if(Bt){var Qt=Bt.types.toString(),Ut=Bt.items;if(Qt==="Files"||Bt.types.indexOf("Files")>-1){if(kt.preventDefault(),Ii=="stex")return;try{var ui,Di=Ut[1];((ui=Ut[0])===null||ui===void 0?void 0:ui.kind)==="file"&&(Di=Ut[0]);var Nt=Di.getAsFile(),hn=Nt.name.split(".").pop();Re(Nt,function(Gt){if(Gt.id){var ki,wi,Yi;(Nt==null||((ki=Nt.type)===null||ki===void 0)?void 0:ki.indexOf("image"))>-1?yt.replaceSelection(".concat(Gt.content_type,")")):(Nt==null||((wi=Nt.type)===null||wi===void 0)?void 0:wi.indexOf("video"))>-1?yt.replaceSelection(' ')):(Nt==null||((Yi=Nt.type)===null||Yi===void 0)?void 0:Yi.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name," ")):te.includes(hn)?yt.replaceSelection('').concat(Nt.name," ")):yt.replaceSelection("[".concat(Nt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Ot),yt.on("dragleave",function(xt,kt){si.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(xt,kt){si.current.classList.add("mouse-hover-md")}),yt.on("drop",function(xt,kt){si.current.classList.add("mouse-hover-md");var Bt;if(Bt=kt.dataTransfer.files,Bt.length>0){kt.preventDefault(),kt.stopPropagation();for(var Qt=function(Di){var Nt=Bt[Di],hn=Nt.name.split(".").pop();Re(Nt,function(Gt){if(Gt.id){var ki,wi,Yi;(Nt==null||((ki=Nt.type)===null||ki===void 0)?void 0:ki.indexOf("image"))>-1?yt.replaceSelection(".concat(Gt.content_type,")")):(Nt==null||((wi=Nt.type)===null||wi===void 0)?void 0:wi.indexOf("video"))>-1?yt.replaceSelection(' ')):(Nt==null||((Yi=Nt.type)===null||Yi===void 0)?void 0:Yi.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name," ")):te.includes(hn)?yt.replaceSelection('').concat(Nt.name," ")):yt.replaceSelection("[".concat(Nt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Ut=0;Ut0||Ut.target.offsetWidth>0)&&(Oi(),N.setSize("100%","100%"),N.refresh())}}catch(ui){Bt.e(ui)}finally{Bt.f()}});return xt.observe(Pt.current.parentElement),xt}if(N){var Ot=yt();return function(){Ot.unobserve(Pt.current.parentElement)}}},[N,Oi]),Object(m.useEffect)(function(){if(N){for(var yt=[],Ot=function(){var Ut=kt[xt];Bt=Object(W.a)(Ut,2);var ui=Bt[0],Di=Bt[1],Nt=Object(j.a)({},ui,function(){Xn(Di)});yt.push(Nt),N.addKeyMap(Nt)},xt=0,kt=Object.entries(ie);xt0){var yt=new Date().getTime(),Ot=window.sessionStorage.getItem(St);yt>=ji+Je&&(!Ot||Ot!==ke)&&(window.sessionStorage.setItem(St,ke),En(!0))}},Je),Object(m.useEffect)(function(){Ht($t)},[N,$t]),Object(m.useEffect)(function(){N&&(Yt&&N.focus())},[N,Yt]),Object(m.useEffect)(function(){if(Et&&N){var yt=N.getScrollerElement();function Ot(xt){var kt=xt.target;if(nn.current){var Bt=kt.scrollTop/kt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Bt}}return yt.addEventListener("scroll",Ot),function(){yt.removeEventListener("scroll",Ot)}}},[N,Et]),Object(m.useEffect)(function(){if(N&&Gi){function yt(Ot,xt){Gi(Ot,xt)}return N.on("beforeChange",yt),function(){N.off("beforeChange",yt)}}},[N,Gi]),Object(m.useEffect)(function(){if(N&&Mt){function yt(){Mt(N.getValue())}return N.on("blur",yt),function(){N.off("blur",yt)}}},[N,Mt]),Object(m.useEffect)(function(){if(N){function yt(Ot){var xt=Ot.getValue();Ze(xt),kn(new Date().getTime()),Ot.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ke&&Ke(xt)}return N.on("change",yt),function(){N.off("change",yt)}}},[N,Ke]),Object(m.useEffect)(function(){N&&(De==null?(N.setValue(""),Ze("")):De!==N.getValue()&&(N.setValue(De),Ze(De),N.setCursor(N.lineCount(),0)))},[N,De]);var Xn=Object(m.useCallback)(function(yt){var Ot=N.getCursor(),xt=N.getSelection(),kt=xt.split(`
`);switch(yt){case"bold":return N.replaceSelection("**"+xt+"**"),xt===""&&N.setCursor(Ot.line,Ot.ch+2),N.focus();case"italic":return N.replaceSelection("*"+xt+"*"),xt===""&&N.setCursor(Ot.line,Ot.ch+1),N.focus();case"code":return N.replaceSelection("`"+xt+"`"),xt===""&&N.setCursor(Ot.line,Ot.ch+1),N.focus();case"inline-latex":return N.replaceSelection("`$$"+xt+"$$`"),xt===""&&N.setCursor(Ot.line,Ot.ch+3),N.focus();case"latex":return N.replaceSelection("```latex\n"+xt+"\n```"),N.setCursor(Ot.line+1,xt.length+1),N.focus();case"line-break":return N.replaceSelection(`
`),N.focus();case"list-ul":return xt===""?N.replaceSelection("- "+xt):N.replaceSelection(kt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
`)),N.focus();case"list-ol":return xt===""?N.replaceSelection("1. "+xt):N.replaceSelection(kt.map(function(Bt,Qt){return Bt===""?"":"".concat(Qt+1,". ").concat(Bt)}).join(`
`)),N.focus();case"add-null-ch":return xt===""&&N.setCursor(Ot.line,Ot.ch+1),N.replaceSelection(Se),N.focus();case"inster-template-1":return xt===""&&N.setCursor(Ot.line,Ot.ch),N.replaceSelection(Ne),N.focus();case"eraser":return N.setValue(""),N.focus();case"trigger-watch":return Ht(!Et),N.focus();case"trigger-full-screen":return Ti(!xi),N.focus();case Me:zi(Me);return;case ut:zi(ut);return;case Pe:zi(Pe);return;case tt:zi(tt);return;default:throw new Error}},[N,Et,xi]),xn=Object(m.useCallback)(function(yt){zi("");switch(ci){case Me:var Ot=yt.title,xt=yt.link;return N.replaceSelection("[".concat(Ot,"](").concat(xt,")")),N.focus();case ut:var kt=yt.language,Bt=yt.content;return N.replaceSelection(["```"+kt,Bt,"```"].join(`
`)),N.focus();case Pe:var Qt=yt.src,Ut=yt.alt;return Ut?N.replaceSelection(".concat(Qt,' "').concat(Ut,'" )')):N.replaceSelection("")),N.focus();case tt:for(var ui=yt.row,Di=yt.col,Nt=yt.align,hn=`
`,Gt=0;Gt300&&(ui=300);var Di=_t+ui+"px";Ji(Di)}}return yt.addEventListener("mousedown",kt),document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Bt),function(){yt.removeEventListener("mousedown",kt),document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Bt)}}},[N,Vt]),Object(m.useEffect)(function(){Ji(_t)},[_t]);var rn=ve(it),fr=ve(Vn),Zi={width:rn,height:fr},pr=Object(m.useMemo)(function(){if(ji){var yt=new Date(ji),Ot=yt.getHours(),xt=yt.getMinutes(),kt=yt.getSeconds();return Ot=Ot<10?"0"+Ot:Ot,xt=xt<10?"0"+xt:xt,kt=kt<10?"0"+kt:kt,"".concat(Ot,":").concat(xt,":").concat(kt)}return 0},[ji]);function jr(){window.sessionStorage.removeItem(St),En(!1),kn(0)}function Mn(){En(!1),kn(0),N.setValue(window.sessionStorage.getItem(St))}function ua(yt,Ot){var xt=N.getValue();xt=xt.replace(yt,Ot),Ze(xt),N==null||N.setValue(xt)}return c.a.createElement(m.Fragment,null,c.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},c.a.createElement("div",{className:"markdown-editor-container ".concat(We," ").concat(Et?"on-preview":""," ").concat(Ft?"mini":""," ").concat(xi?"full-screen":""),style:Zi},c.a.createElement(b,{insertTemp:Lt,watch:Et,fullScreen:xi,showNullButton:Tt,onActionCallback:Xn,hidetoolBar:Ai,uuid:ri.current,setOpenPhones:function(){Wt.current=!0}}),c.a.createElement("div",{className:"markdown-editor-body"},c.a.createElement("div",{className:"codemirror-container"},c.a.createElement("textarea",{ref:Pt,placeholder:vn})),Et?c.a.createElement("div",{ref:nn,className:"preview-container"},Ii==="stex"&&c.a.createElement(O,{value:ke}),Ii!=="stex"&&c.a.createElement(x.a,{edit:!0,value:ke,replaces:ua})):null))),It?c.a.createElement("a",{ref:Vt,className:"editor-resize"}):null,c.a.createElement(M.a,null,oe[ci]?c.a.createElement(J.a,{centered:!0,title:oe[ci],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},RotF:function(vt,et,ne){vt.exports=ne("LSTS")},SJMd:function(vt,et){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var ne,ae,J,D=!1,Y,F;window.PR_SHOULD_USE_CONTINUATION=!0;var U,W;(function(){var j=window,k=["break,continue,do,else,for,if,return,while"],I=[k,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],c=[m,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],f=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[m,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",s=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[k,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],p=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[c,u,f,d,o,s,l,p],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",O="kwd",A="com",T="typ",E="lit",y="pun",h="pln",_="tag",g="dec",b="src",M="atn",P="atv",K="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(Oe){for(var Le=0,Ue=!1,Ge=!1,je=0,Me=Oe.length;je122||(te<65||pe>90||ct.push([Math.max(65,pe)|32,Math.min(te,90)|32]),te<97||pe>122||ct.push([Math.max(97,pe)&~32,Math.min(te,122)&~32]))}}ct.sort(function(ge,Ce){return ge[0]-Ce[0]||Ce[1]-ge[1]});for(var ie=[],oe=[],Ne=0;Nehe[0]&&(he[1]+1>he[0]&&Se.push("-"),Se.push(qe(he[1])))}return Se.push("]"),Se.join("")}function ft(Ye){for(var Ae=Ye.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ct=Ae.length,Je=[],Se=0,Ne=0;Se=2&&pe==="["?Ae[Se]=$e(ve):pe!=="\\"&&(Ae[Se]=ve.replace(/[a-zA-Z]/g,function(oe){var he=oe.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Ae.join("")}for(var nt=[],je=0,Me=Oe.length;je=0;)Ue[nt.charAt(Ye)]=ft;var Ae=ft[1],ct=""+Ae;tt.hasOwnProperty(ct)||(ut.push(Ae),tt[ct]=null)}ut.push(/[\0-\uffff]/),Ge=B(ut)})();var je=Le.length,Me=function(Pe){for(var ut=Pe.sourceCode,tt=Pe.basePos,qe=Pe.sourceNode,$e=[tt,h],ft=0,nt=ut.match(Ge)||[],Ye={},Ae=0,ct=nt.length;Ae=5&&Se.substring(0,5)==="lang-",ve&&!(Ne&&typeof Ne[1]=="string")&&(ve=!1,Se=b),ve||(Ye[Je]=Se)}var te=ft;if(ft+=Je.length,!ve)$e.push(tt+te,Se);else{var ie=Ne[1],oe=Je.indexOf(ie),he=oe+ie.length;Ne[2]&&(he=Je.length-Ne[2].length,oe=he-ie.length);var ge=Se.substring(5);$(qe,tt+te,Je.substring(0,oe),Me,$e),$(qe,tt+te+oe,ie,se(ge,ie),$e),$(qe,tt+te+he,Je.substring(he),Me,$e)}}Pe.decorations=$e};return Me}function Te(Oe){var Le=[],Ue=[];Oe.tripleQuotedStrings?Le.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Oe.multiLineStrings?Le.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Oe.verbatimStrings&&Ue.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ge=Oe.hashComments;Ge&&(Oe.cStyleComments?(Ge>1?Le.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([A,/^#[^\r\n]*/,null,"#"])),Oe.cStyleComments&&(Ue.push([A,/^\/\/[^\r\n]*/,null]),Ue.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var je=Oe.regexLiterals;if(je){var Me=je>1?"":`
\r`,Pe=Me?".":"[\\S\\s]",ut="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+V+"("+ut+")")])}var tt=Oe.types;tt&&Ue.push([T,tt]);var qe=(""+Oe.keywords).replace(/^ | $/g,"");qe.length&&Ue.push([O,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([h,/^\s+/,null,` \r
\xA0`]);var $e="^.[^\\s\\w.$@'\"`/\\\\]*";return Oe.regexLiterals&&($e+="(?!s*/)"),Ue.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[T,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[y,new RegExp($e),null]),ue(Le,Ue)}var ye=Te({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function be(Oe,Le,Ue){for(var Ge=/(?:^|\s)nocode(?:\s|$)/,je=/\r\n?|\n/,Me=Oe.ownerDocument,Pe=Me.createElement("li");Oe.firstChild;)Pe.appendChild(Oe.firstChild);var ut=[Pe];function tt(Ae){var ct=Ae.nodeType;if(ct==1&&!Ge.test(Ae.className))if(Ae.nodeName==="br")qe(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var Je=Ae.firstChild;Je;Je=Je.nextSibling)tt(Je);else if((ct==3||ct==4)&&Ue){var Se=Ae.nodeValue,Ne=Se.match(je);if(Ne){var ve=Se.substring(0,Ne.index);Ae.nodeValue=ve;var de=Se.substring(Ne.index+Ne[0].length);if(de){var pe=Ae.parentNode;pe.insertBefore(Me.createTextNode(de),Ae.nextSibling)}qe(Ae),ve||Ae.parentNode.removeChild(Ae)}}}function qe(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function ct(Ne,ve){var de=ve?Ne.cloneNode(!1):Ne,pe=Ne.parentNode;if(pe){var te=ct(pe,1),ie=Ne.nextSibling;te.appendChild(de);for(var oe=ie;oe;oe=ie)ie=oe.nextSibling,te.appendChild(oe)}return de}for(var Je=ct(Ae.nextSibling,0),Se;(Se=Je.parentNode)&&Se.nodeType===1;)Je=Se;ut.push(Je)}for(var $e=0;$e=pe&&(tt+=2),Me>=te&&(ft+=2)}}finally{Se&&(Se.style.display=Ne)}}var xe={};function me(Oe,Le){for(var Ue=Le.length;--Ue>=0;){var Ge=Le[Ue];xe.hasOwnProperty(Ge)?j.console&&console.warn("cannot override language handler %s",Ge):xe[Ge]=Oe}}function se(Oe,Le){return Oe&&xe.hasOwnProperty(Oe)||(Oe=/^\s*]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[y,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^