(window.webpackJsonp=window.webpackJsonp||[]).push([[160,5,7],{"+NIl":function(_t,lt,ne){(function(ae){ae(ne("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function(Z,k){"use strict";function V(h,a){h.cmdState.push(a)}function F(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function D(h){var a=h.cmdState.pop();a&&a.closeBracket()}function G(h){for(var a=h.cmdState,c=a.length-1;c>=0;c--){var o=a[c];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function j(h,a,c){return function(){this.name=h,this.bracketNo=0,this.style=a,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var M={};M.importmodule=j("importmodule","tag",["string","builtin"]),M.documentclass=j("documentclass","tag",["","atom"]),M.usepackage=j("usepackage","tag",["atom"]),M.begin=j("begin","tag",["atom"]),M.end=j("end","tag",["atom"]),M.label=j("label","tag",["atom"]),M.ref=j("ref","tag",["atom"]),M.eqref=j("eqref","tag",["atom"]),M.cite=j("cite","tag",["atom"]),M.bibitem=j("bibitem","tag",["atom"]),M.Bibitem=j("Bibitem","tag",["atom"]),M.RBibitem=j("RBibitem","tag",["atom"]),M.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(h,a){h.f=a}function g(h,a){var c;if(h.match(/^\\[a-zA-Z@]+/)){var o=h.current().slice(1);return c=M.hasOwnProperty(o)?M[o]:M.DEFAULT,c=new c,V(a,c),I(a,f),c.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return I(a,function(l,d){return p(l,d,"\\]")}),"keyword";if(h.match("\\("))return I(a,function(l,d){return p(l,d,"\\)")}),"keyword";if(h.match("$$"))return I(a,function(l,d){return p(l,d,"$$")}),"keyword";if(h.match("$"))return I(a,function(l,d){return p(l,d,"$")}),"keyword";var s=h.next();if(s=="%")return h.skipToEnd(),"comment";if(s=="}"||s=="]"){if(c=F(a),c)c.closeBracket(s),I(a,f);else return"error";return"bracket"}else return s=="{"||s=="["?(c=M.DEFAULT,c=new c,V(a,c),"bracket"):/\d/.test(s)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),c=G(a),c.name=="begin"&&(c.argument=h.current()),c.styleIdentifier())}function p(h,a,c){if(h.eatSpace())return null;if(c&&h.match(c))return I(a,g),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=h.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(h.skipToEnd(),"comment"):"error"}function f(h,a){var c=h.peek(),o;return c=="{"||c=="["?(o=F(a),o.openBracket(c),h.eat(c),I(a,g),"bracket"):/[ \t\r]/.test(c)?(h.eat(c),null):(I(a,g),D(a),g(h,a))}return{startState:function(){var h=k.inMathMode?function(a,c){return p(a,c)}:g;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,a){return a.f(h,a)},blankLine:function(h){h.f=g,h.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"+ua5":function(_t,lt,ne){},"19Vz":function(_t,lt,ne){(function(ae){ae(ne("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(j,M,I){var g=I&&I!=ae.Init;if(M&&!g)j.on("blur",F),j.on("change",D),j.on("swapDoc",D),ae.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){V(j)}),D(j);else if(!M&&g){j.off("blur",F),j.off("change",D),j.off("swapDoc",D),ae.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),Z(j);var p=j.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}M&&!j.hasFocus()&&F(j)});function Z(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function k(j){Z(j);var M=j.state.placeholder=document.createElement("pre");M.style.cssText="height: 0; overflow: visible",M.style.direction=j.getOption("direction"),M.className="CodeMirror-placeholder CodeMirror-line-like";var I=j.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),M.appendChild(I),j.display.lineSpace.insertBefore(M,j.display.lineSpace.firstChild)}function V(j){setTimeout(function(){var M=!1,I=j.getInputField();I.nodeName=="TEXTAREA"?M=!I.value:j.lineCount()==1&&(M=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),M?k(j):Z(j)},20)}function F(j){G(j)&&k(j)}function D(j){var M=j.getWrapperElement(),I=G(j);M.className=M.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?k(j):Z(j)}function G(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(_t,lt,ne){(function(ae){ae(ne("VrN/"))})(function(ae){"use strict";var Z={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},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(V,F){var D=V.indentUnit,G={},j=F.htmlMode?Z:k;for(var M in j)G[M]=j[M];for(var M in F)G[M]=F[M];var I,g;function p(u,_){function m(N){return _.tokenize=N,N(u,_)}var b=u.next();if(b=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?m(a("atom","]]>")):null:u.match("--")?m(a("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),m(c(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),_.tokenize=a("meta","?>"),"meta"):(I=u.eat("/")?"closeTag":"openTag",_.tokenize=f,"tag bracket");if(b=="&"){var P;return u.eat("#")?u.eat("x")?P=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):P=u.eatWhile(/[\d]/)&&u.eat(";"):P=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),P?"atom":"error"}else return u.eatWhile(/[^&<]/),null}p.isInText=!0;function f(u,_){var m=u.next();if(m==">"||m=="/"&&u.eat(">"))return _.tokenize=p,I=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return I="equals",null;if(m=="<"){_.tokenize=p,_.state=d,_.tagName=_.tagStart=null;var b=_.tokenize(u,_);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(m)?(_.tokenize=h(m),_.stringStartCol=u.column(),_.tokenize(u,_)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(u){var _=function(m,b){for(;!m.eol();)if(m.next()==u){b.tokenize=f;break}return"string"};return _.isInAttribute=!0,_}function a(u,_){return function(m,b){for(;!m.eol();){if(m.match(_)){b.tokenize=p;break}m.next()}return u}}function c(u){return function(_,m){for(var b;(b=_.next())!=null;){if(b=="<")return m.tokenize=c(u+1),m.tokenize(_,m);if(b==">")if(u==1){m.tokenize=p;break}else return m.tokenize=c(u-1),m.tokenize(_,m)}return"meta"}}function o(u,_,m){this.prev=u.context,this.tagName=_,this.indent=u.indented,this.startOfLine=m,(G.doNotIndent.hasOwnProperty(_)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function s(u){u.context&&(u.context=u.context.prev)}function l(u,_){for(var m;;){if(!u.context)return;if(m=u.context.tagName,!G.contextGrabbers.hasOwnProperty(m)||!G.contextGrabbers[m].hasOwnProperty(_))return;s(u)}}function d(u,_,m){return u=="openTag"?(m.tagStart=_.column(),O):u=="closeTag"?w:d}function O(u,_,m){return u=="word"?(m.tagName=_.current(),g="tag",A):G.allowMissingTagName&&u=="endTag"?(g="tag bracket",A(u,_,m)):(g="error",O)}function w(u,_,m){if(u=="word"){var b=_.current();return m.context&&m.context.tagName!=b&&G.implicitlyClosed.hasOwnProperty(m.context.tagName)&&s(m),m.context&&m.context.tagName==b||G.matchClosing===!1?(g="tag",x):(g="tag error",R)}else return G.allowMissingTagName&&u=="endTag"?(g="tag bracket",x(u,_,m)):(g="error",R)}function x(u,_,m){return u!="endTag"?(g="error",x):(s(m),d)}function R(u,_,m){return g="error",x(u,_,m)}function A(u,_,m){if(u=="word")return g="attribute",T;if(u=="endTag"||u=="selfcloseTag"){var b=m.tagName,P=m.tagStart;return m.tagName=m.tagStart=null,u=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(b)?l(m,b):(l(m,b),m.context=new o(m,b,P==m.indented)),d}return g="error",A}function T(u,_,m){return u=="equals"?E:(G.allowMissing||(g="error"),A(u,_,m))}function E(u,_,m){return u=="string"?y:u=="word"&&G.allowUnquoted?(g="string",A):(g="error",A(u,_,m))}function y(u,_,m){return u=="string"?y:A(u,_,m)}return{startState:function(u){var _={tokenize:p,state:d,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(_.baseIndent=u),_},token:function(u,_){if(!_.tagName&&u.sol()&&(_.indented=u.indentation()),u.eatSpace())return null;I=null;var m=_.tokenize(u,_);return(m||I)&&m!="comment"&&(g=null,_.state=_.state(I||m,u,_),g&&(m=g=="error"?m+" error":g)),m},indent:function(u,_,m){var b=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+D;if(b&&b.noIndent)return ae.Pass;if(u.tokenize!=f&&u.tokenize!=p)return m?m.match(/^(\s*)/)[0].length:0;if(u.tagName)return G.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+D*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/$/,blockCommentStart:"",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(u){u.state==E&&(u.state=A)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var _=[],m=u.context;m;m=m.prev)m.tagName&&_.push(m.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})})},"55Ip":function(_t,lt,ne){"use strict";ne.d(lt,"a",function(){return l});var ae=ne("Ty5D"),Z=ne("dI71"),k=ne("q1tI"),V=ne.n(k),F=ne("YS25"),D=ne("17x9"),G=ne.n(D),j=ne("wx14"),M=ne("zLVn"),I=ne("9R94"),g=function(E){Object(Z.a)(y,E);function y(){for(var _,m=arguments.length,b=new Array(m),P=0;Pte&&(te=S.line_indent_level));var re={mode:Y,parent:S,last_token:S?S.last_token:new f(l.START_BLOCK,""),last_word:S?S.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:te,alignment:0,line_indent_level:S?S.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},X.prototype._reset=function(S){var Y=S.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var te=new c(S,this._options);return this._tokens=te.tokenize(),S},X.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S,Y=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
`,Y&&h.lineBreak.test(Y||"")&&(te=Y.match(h.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 S=this._output.get_code(te),S},X.prototype.handle_token=function(S,Y){S.type===l.START_EXPR?this.handle_start_expr(S):S.type===l.END_EXPR?this.handle_end_expr(S):S.type===l.START_BLOCK?this.handle_start_block(S):S.type===l.END_BLOCK?this.handle_end_block(S):S.type===l.WORD?this.handle_word(S):S.type===l.RESERVED?this.handle_word(S):S.type===l.SEMICOLON?this.handle_semicolon(S):S.type===l.STRING?this.handle_string(S):S.type===l.EQUALS?this.handle_equals(S):S.type===l.OPERATOR?this.handle_operator(S):S.type===l.COMMA?this.handle_comma(S):S.type===l.BLOCK_COMMENT?this.handle_block_comment(S,Y):S.type===l.COMMENT?this.handle_comment(S,Y):S.type===l.DOT?this.handle_dot(S):S.type===l.EOF?this.handle_eof(S):S.type===l.UNKNOWN?this.handle_unknown(S,Y):this.handle_unknown(S,Y)},X.prototype.handle_whitespace_and_comments=function(S,Y){var te=S.newlines,re=this._options.keep_array_indentation&&b(this._flags.mode);if(S.comments_before)for(var ce=S.comments_before.next();ce;)this.handle_whitespace_and_comments(ce,Y),this.handle_token(ce,Y),ce=S.comments_before.next();if(re)for(var Te=0;Te0,Y);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,Y);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))},X.prototype.set_mode=function(S){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,S),this._flags=this.create_flags(this._previous_flags,S),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},X.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===u.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},X.prototype.start_of_object_property=function(){return this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},X.prototype.start_of_statement=function(S){var Y=!1;return Y=Y||R(this._flags.last_token,["var","let","const"])&&S.type===l.WORD,Y=Y||x(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&R(this._flags.last_token,B)&&!S.newlines,Y=Y||x(this._flags.last_token,"else")&&!(x(S,"if")&&!S.comments_before),Y=Y||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),Y=Y||this._flags.last_token.type===l.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(S.text==="--"||S.text==="++")&&this._last_last_text!=="function"&&S.type!==l.WORD&&S.type!==l.RESERVED,Y=Y||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),Y?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(S,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S,R(S,["do","for","if","while"])),!0):!1},X.prototype.handle_start_expr=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S);var Y=u.Expression;if(S.text==="["){if(this._flags.last_token.type===l.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(S),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=u.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())),d(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,Y=u.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=u.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&S.whitespace_before===""?this._output.space_before_token=!1:(d(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(S);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var re=this._tokens.peek(-4);R(te,["async","function"])||te.text==="*"&&R(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(te.text==="{"||te.text===","||te.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(S);(this._flags.last_token.type===l.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&d(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(S,S.newlines),this.print_token(S),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},X.prototype.handle_end_expr=function(S){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(S),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(S,S.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(S),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},X.prototype.handle_start_block=function(S){this.handle_whitespace_and_comments(S);var Y=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):te&&(d(te.text,[":",","])&&d(Y.type,[l.STRING,l.WORD,l.RESERVED])||d(Y.text,["get","set","..."])&&d(te.type,[l.WORD,l.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(te.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===l.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):d(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!Y.comments_before&&Y.text==="}",ce=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===S))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&S.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(ce||this._flags.last_token.type===l.EQUALS||R(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(S),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(S),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},X.prototype.handle_end_block=function(S){for(this.handle_whitespace_and_comments(S);this._flags.mode===u.Statement;)this.restore_mode();var Y=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(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(S)},X.prototype.handle_word=function(S){if(S.type===l.RESERVED){if(d(S.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)S.type=l.WORD;else if(S.text==="import"&&d(this._tokens.peek().text,["(","."]))S.type=l.WORD;else if(d(S.text,["as","from"])&&!this._flags.import_block)S.type=l.WORD;else if(this._flags.mode===u.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(S.type=l.WORD)}}if(this.start_of_statement(S)?R(this._flags.last_token,["var","let","const"])&&S.type===l.WORD&&(this._flags.declaration_statement=!0):S.newlines&&!P(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||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(S),this.print_newline()):this.handle_whitespace_and_comments(S),this._flags.do_block&&!this._flags.do_while)if(x(S,"while")){this._output.space_before_token=!0,this.print_token(S),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(S,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(S,["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(S),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(S)),x(S,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===l.OPERATOR))&&(!this._output.just_added_blankline()&&!S.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?R(this._flags.last_token,["get","set","new","export"])||R(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&&(P(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(S),this._flags.last_word=S.text;return}var te="NONE";if(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":R(S,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&S.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===u.BlockStatement?te="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&P(this._flags.mode)?te="SPACE":this._flags.last_token.type===l.STRING?te="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&d(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===l.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),R(S,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),R(S,["else","catch","finally"]))if((!(this._flags.last_token.type===l.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&S.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 te==="NEWLINE"?R(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(S,["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||!R(S,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(S,"if")&&x(S.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(S,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():te==="SPACE"&&(this._output.space_before_token=!0);S.previous&&(S.previous.type===l.WORD||S.previous.type===l.RESERVED)&&(this._output.space_before_token=!0),this.print_token(S),this._flags.last_word=S.text,S.type===l.RESERVED&&(S.text==="do"?this._flags.do_block=!0:S.text==="if"?this._flags.if_block=!0:S.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(S,"from")&&(this._flags.import_block=!1))},X.prototype.handle_semicolon=function(S){this.start_of_statement(S)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(S);for(var Y=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&x(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(S)},X.prototype.handle_string=function(S){S.text.startsWith("`")&&S.newlines===0&&S.whitespace_before===""&&(S.previous.text===")"||this._flags.last_token.type===l.WORD)||(this.start_of_statement(S)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(S),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(S):S.text.startsWith("`")&&this._flags.last_token.type===l.END_EXPR&&(S.previous.text==="]"||S.previous.text===")")&&S.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(S)},X.prototype.handle_equals=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0},X.prototype.handle_comma=function(S){this.handle_whitespace_and_comments(S,!0),this.print_token(S),this._output.space_before_token=!0,this._flags.declaration_statement?(P(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(S)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(S)},X.prototype.handle_operator=function(S){var Y=S.text==="*"&&(R(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),te=d(S.text,["-","+"])&&(d(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||d(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(S)){var re=!Y;this.handle_whitespace_and_comments(S,re)}if(S.text==="*"&&this._flags.last_token.type===l.DOT){this.print_token(S);return}if(S.text==="::"){this.print_token(S);return}if(this._flags.last_token.type===l.OPERATOR&&d(this._options.operator_position,y)&&this.allow_wrap_or_preserved_newline(S),S.text===":"&&this._flags.in_case){this.print_token(S),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 ce=!0,Te=!0,ye=!1;if(S.text===":"?this._flags.ternary_depth===0?ce=!1:(this._flags.ternary_depth-=1,ye=!0):S.text==="?"&&(this._flags.ternary_depth+=1),!te&&!Y&&this._options.preserve_newlines&&d(S.text,s)){var be=S.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(S),(!be||we)&&this.allow_wrap_or_preserved_newline(S),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(S):this._output.space_before_token=!1,this.print_token(S),this._output.space_before_token=!0;return;case E.preserve_newline:xe||this.allow_wrap_or_preserved_newline(S),ce=!(this._output.just_added_newline()||xe),this._output.space_before_token=ce,this.print_token(S),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(S),ce=!1;var ve=this._tokens.peek();Te=ve&&d(ve.type,[l.WORD,l.RESERVED])}else if(S.text==="...")this.allow_wrap_or_preserved_newline(S),ce=this._flags.last_token.type===l.START_BLOCK,Te=!1;else if(d(S.text,["--","++","!","~"])||te){if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR)&&this.allow_wrap_or_preserved_newline(S),ce=!1,Te=!1,S.newlines&&(S.text==="--"||S.text==="++"||S.text==="~")){var oe=R(this._flags.last_token,A)&&S.newlines;oe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(oe,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(ce=!0),this._flags.last_token.type===l.RESERVED?ce=!0:this._flags.last_token.type===l.END_EXPR?ce=!(this._flags.last_token.text==="]"&&(S.text==="--"||S.text==="++")):this._flags.last_token.type===l.OPERATOR&&(ce=d(S.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(S.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(Te=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ce,this.print_token(S),this._output.space_before_token=Te},X.prototype.handle_block_comment=function(S,Y){if(this._output.raw){this._output.add_raw_token(S),S.directives&&S.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(S.directives){this.print_newline(!1,Y),this.print_token(S),S.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(S.text)&&!S.newlines){this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0;return}else this.print_block_commment(S,Y)},X.prototype.print_block_commment=function(S,Y){var te=m(S.text),re,ce=!1,Te=!1,ye=S.whitespace_before,be=ye.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(S),this._output.add_token(te[0]),this.print_newline(!1,Y),te.length>1){for(te=te.slice(1),ce=N(te,"*"),Te=K(te,ye),ce&&(this._flags.alignment=1),re=0;re=0;h--)if(this.__items[h].match(f))return!0;return!1},I.prototype.set_indent=function(f,h){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=h||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 h=f.lastIndexOf(`
`);h!==-1?this.__character_count=f.length-h: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 g(f,h){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)),h=h||"",f.indent_level>0&&(h=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}g.prototype.get_indent_size=function(f,h){var a=this.__base_string_length;return h=h||0,f<0&&(a=0),a+=f*this.__indent_size,a+=h,a},g.prototype.get_indent_string=function(f,h){var a=this.__base_string;return h=h||0,f<0&&(f=0,a=""),h+=f*this.__indent_size,this.__ensure_cache(h),a+=this.__cache[h],a},g.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var f=this.__cache.length,h=0,a="";this.__indent_size&&f>=this.__indent_size&&(h=Math.floor(f/this.__indent_size),f-=h*this.__indent_size,a=new Array(h+1).join(this.__indent_string)),f&&(a+=new Array(f+1).join(" ")),this.__cache.push(a)};function p(f,h){this.__indent_cache=new g(f,h),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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(f,h){return this.__indent_cache.get_indent_string(f,h)},p.prototype.get_indent_size=function(f,h){return this.__indent_cache.get_indent_size(f,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(f){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return f!==`
`&&(a=a.replace(/[\n]/g,f)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(f,h){return f=f||0,h=h||0,this.next_line.set_indent(f,h),this.__lines.length>1?(this.current_line.set_indent(f,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(f){for(var h=0;h1&&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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(f,h){for(var a=this.__lines.length-2;a>=0;){var c=this.__lines[a];if(c.is_empty())break;if(c.item(0).indexOf(f)!==0&&c.item(-1)!==h){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},M.exports.Output=p},function(M){function I(g,p,f,h){this.type=g,this.text=p,this.comments_before=null,this.newlines=f||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}M.exports.Token=I},function(M,I){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",h="\\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",a="(?:\\\\u[0-9a-fA-F]{4}|["+g+f+"])",c="(?:\\\\u[0-9a-fA-F]{4}|["+p+f+h+"])*";I.identifier=new RegExp(a+c,"g"),I.identifierStart=new RegExp(a),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+f+h+"])+");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(M,I,g){var p=g(6).Options,f=["before-newline","after-newline","preserve-newline"];function h(a){p.call(this,a,"js");var c=this.raw_options.brace_style||null;c==="expand-strict"?this.raw_options.brace_style="expand":c==="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(","),u=y.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+u.join("|")+")$"),m,b=function(N,K){f.call(this,N,K),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var X=new o(this._input),B=new s(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(c.identifier).matching(c.identifierMatch),number:X.matching(w),punct:X.matching(E),comment:X.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:X.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:X.matching(//),include:X.starting_with(/#include/).until_after(c.lineBreak),shebang:X.starting_with(/#!/).until_after(c.lineBreak),xml:X.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(N){return N.type===d.COMMENT||N.type===d.BLOCK_COMMENT||N.type===d.UNKNOWN},b.prototype._is_opening=function(N){return N.type===d.START_BLOCK||N.type===d.START_EXPR},b.prototype._is_closing=function(N,K){return(N.type===d.END_BLOCK||N.type===d.END_EXPR)&&K&&(N.text==="]"&&K.text==="["||N.text===")"&&K.text==="("||N.text==="}"&&K.text==="{")},b.prototype._reset=function(){m=!1},b.prototype._get_next_token=function(N,K){var X=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(d.EOF,""):(X=X||this._read_non_javascript(B),X=X||this._read_string(B),X=X||this._read_word(N),X=X||this._read_singles(B),X=X||this._read_comment(B),X=X||this._read_regexp(B,N),X=X||this._read_xml(B,N),X=X||this._read_punctuation(),X=X||this._create_token(d.UNKNOWN,this._input.next()),X)},b.prototype._read_word=function(N){var K;if(K=this.__patterns.identifier.read(),K!=="")return K=K.replace(c.allLineBreaks,`
`),!(N.type===d.DOT||N.type===d.RESERVED&&(N.text==="set"||N.text==="get"))&&_.test(K)?(K==="in"||K==="of")&&(N.type===d.WORD||N.type===d.STRING)?this._create_token(d.OPERATOR,K):this._create_token(d.RESERVED,K):this._create_token(d.WORD,K);if(K=this.__patterns.number.read(),K!=="")return this._create_token(d.WORD,K)},b.prototype._read_singles=function(N){var K=null;return N==="("||N==="["?K=this._create_token(d.START_EXPR,N):N===")"||N==="]"?K=this._create_token(d.END_EXPR,N):N==="{"?K=this._create_token(d.START_BLOCK,N):N==="}"?K=this._create_token(d.END_BLOCK,N):N===";"?K=this._create_token(d.SEMICOLON,N):N==="."&&R.test(this._input.peek(1))?K=this._create_token(d.DOT,N):N===","&&(K=this._create_token(d.COMMA,N)),K&&this._input.next(),K},b.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(d.EQUALS,N):N==="?."?this._create_token(d.DOT,N):this._create_token(d.OPERATOR,N)},b.prototype._read_non_javascript=function(N){var K="";if(N==="#"){if(this._is_first_token()&&(K=this.__patterns.shebang.read(),K))return this._create_token(d.UNKNOWN,K.trim()+`
`);if(K=this.__patterns.include.read(),K)return this._create_token(d.UNKNOWN,K.trim()+`
`);N=this._input.next();var X="#";if(this._input.hasNext()&&this._input.testChar(x)){do N=this._input.next(),X+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(X+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(X+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,X)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(K=this.__patterns.html_comment_start.read(),K){for(;this._input.hasNext()&&!this._input.testChar(c.newline);)K+=this._input.next();return m=!0,this._create_token(d.COMMENT,K)}}else if(m&&N==="-"&&(K=this.__patterns.html_comment_end.read(),K))return m=!1,this._create_token(d.COMMENT,K);return null},b.prototype._read_comment=function(N){var K=null;if(N==="/"){var X="";if(this._input.peek(1)==="*"){X=this.__patterns.block_comment.read();var B=O.get_directives(X);B&&B.ignore==="start"&&(X+=O.readIgnored(this._input)),X=X.replace(c.allLineBreaks,`
`),K=this._create_token(d.BLOCK_COMMENT,X),K.directives=B}else this._input.peek(1)==="/"&&(X=this.__patterns.comment.read(),K=this._create_token(d.COMMENT,X))}return K},b.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var K=this._input.next();return this.has_char_escapes=!1,N==="`"?K+=this._read_string_recursive("`",!0,"${"):K+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(K=P(K)),this._input.peek()===N&&(K+=this._input.next()),K=K.replace(c.allLineBreaks,`
`),this._create_token(d.STRING,K)}return null},b.prototype._allow_regexp_or_xml=function(N){return N.type===d.RESERVED&&l(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===d.END_EXPR&&N.text===")"&&N.opened.previous.type===d.RESERVED&&l(N.opened.previous.text,["if","while","for"])||l(N.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},b.prototype._read_regexp=function(N,K){if(N==="/"&&this._allow_regexp_or_xml(K)){for(var X=this._input.next(),B=!1,S=!1;this._input.hasNext()&&(B||S||this._input.peek()!==N)&&!this._input.testChar(c.newline);)X+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?S=!0:this._input.peek()==="]"&&(S=!1)),this._input.next();return this._input.peek()===N&&(X+=this._input.next(),X+=this._input.read(c.identifier)),this._create_token(d.STRING,X)}return null},b.prototype._read_xml=function(N,K){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(K)){var X="",B=this.__patterns.xml.read_match();if(B){for(var S=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=S.indexOf("{")===0,te=0;B;){var re=!!B[1],ce=B[2],Te=!!B[B.length-1]||ce.slice(0,8)==="![CDATA[";if(!Te&&(ce===S||Y&&ce.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--te:++te),X+=B[0],te<=0)break;B=this.__patterns.xml.read_match()}return B||(X+=this._input.match(/[\s\S]*/g)[0]),X=X.replace(c.allLineBreaks,`
`),this._create_token(d.STRING,X)}}return null};function P(N){for(var K="",X=0,B=new p(N),S=null;B.hasNext();)if(S=B.match(/([\s]|[^\\]|\\\\)+/g),S&&(K+=S[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")S=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")S=B.match(/u([0-9A-Fa-f]{4})/g);else{K+="\\",B.hasNext()&&(K+=B.next());continue}if(!S)return N;if(X=parseInt(S[1],16),X>126&&X<=255&&S[0].indexOf("x")===0)return N;if(X>=0&&X<32){K+="\\"+S[0];continue}else X===34||X===39||X===92?K+="\\"+String.fromCharCode(X):K+=String.fromCharCode(X)}return K}b.prototype._read_string_recursive=function(N,K,X){var B,S;N==="'"?S=this.__patterns.single_quote:N==='"'?S=this.__patterns.double_quote:N==="`"?S=this.__patterns.template_text:N==="}"&&(S=this.__patterns.template_expression);for(var Y=S.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===N||!K&&c.newline.test(te)){this._input.back();break}else te==="\\"&&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(),te+=this._input.next()):X&&(X==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),X===te&&(N==="`"?te+=this._read_string_recursive("}",K,"`"):te+=this._read_string_recursive("`",K,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=S.read(),Y+=te}return Y},M.exports.Tokenizer=b,M.exports.TOKEN=d,M.exports.positionable_operators=A.slice(),M.exports.line_starters=y.slice()},function(M){var I=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&p=0&&f=p.length&&this.__input.substring(f-p.length,f).toLowerCase()===p},M.exports.InputScanner=g},function(M,I,g){var p=g(8).InputScanner,f=g(3).Token,h=g(10).TokenStream,a=g(11).WhitespacePattern,c={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(s,l){this._input=new p(s),this._options=l||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var s,l=new f(c.START,""),d=null,O=[],w=new h;l.type!==c.EOF;){for(s=this._get_next_token(l,d);this._is_comment(s);)w.add(s),s=this._get_next_token(l,d);w.isEmpty()||(s.comments_before=w,w=new h),s.parent=d,this._is_opening(s)?(O.push(d),d=s):d&&this._is_closing(s,d)&&(s.opened=d,d.closed=s,d=O.pop(),s.parent=d),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 d=this._input.read(/.+/g);return d?this._create_token(c.RAW,d):this._create_token(c.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 d=new f(s,l,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},M.exports.Tokenizer=o,M.exports.TOKEN=c},function(M){function I(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position=0&&g/),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}/)}}h.prototype=new p,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(a){var c=this._create();return c._disabled[a]=!0,c._update(),c},h.prototype.read_options=function(a){var c=this._create();for(var o in f)c._disabled[o]=a.templating.indexOf(o)===-1;return c._update(),c},h.prototype.exclude=function(a){var c=this._create();return c._excluded[a]=!0,c._update(),c},h.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var c=this._read_template();c;)this._match_pattern?c+=this._input.read(this._match_pattern):c+=this._input.readUntil(this.__template_pattern),a+=c,c=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},h.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},h.prototype._read_template=function(){var a="",c=this._input.peek();if(c==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(a=a||this.__patterns.erb.read())}else c==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},M.exports.TemplatablePattern=h}],D={};function G(M){var I=D[M];if(I!==void 0)return I.exports;var g=D[M]={exports:{}};return F[M](g,g.exports,G),g.exports}var j=G(0);k=j})();var V=k;!(ae=[],Z=function(){return{js_beautify:V}}.apply(lt,ae),Z!==void 0&&(_t.exports=Z))})()},"7Cbv":function(_t,lt,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),Z=new Uint8Array(16);function k(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae(Z)}var V=/^(?:[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"&&V.test(f)}for(var D=F,G=[],j=0;j<256;++j)G.push((j+256).toString(16).substr(1));function M(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[f[h+0]]+G[f[h+1]]+G[f[h+2]]+G[f[h+3]]+"-"+G[f[h+4]]+G[f[h+5]]+"-"+G[f[h+6]]+G[f[h+7]]+"-"+G[f[h+8]]+G[f[h+9]]+"-"+G[f[h+10]]+G[f[h+11]]+G[f[h+12]]+G[f[h+13]]+G[f[h+14]]+G[f[h+15]]).toLowerCase();if(!D(a))throw TypeError("Stringified UUID is invalid");return a}var I=M;function g(f,h,a){f=f||{};var c=f.random||(f.rng||k)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,h){a=a||0;for(var o=0;o<16;++o)h[a+o]=c[o];return h}return I(c)}var p=lt.a=g},"7ahc":function(_t,lt,ne){"use strict";ne.d(lt,"a",function(){return O});var ae=ne("k1fw"),Z=ne("0Owb"),k=ne("+L6B"),V=ne("2/Rp"),F=ne("y8nQ"),D=ne("Vl3Y"),G=ne("tJVT"),j=ne("OaEy"),M=ne("2fM7"),I=ne("q1tI"),g=ne.n(I),p=ne("VrN/"),f=ne.n(p),h=ne("p77/"),a=ne.n(h),c=ne("c5Ni"),o=ne.n(c),s=M.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};lt.b=function(w){var x=w.callback,R=w.onCancel,A=Object(I.useState)("python"),T=Object(G.a)(A,2),E=T[0],y=T[1];function u(m){y(d[m][1])}function _(m){x(m)}return g.a.createElement(D.a,Object(Z.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),g.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(M.a,{onChange:u},Object.keys(d).map(function(m){return g.a.createElement(s,{key:m,value:m},d[m][0])}))),g.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(O,{mode:E})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(V.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function O(w){var x=w.value,R=w.onChange,A=w.mode,T=w.options,E=T===void 0?{}:T,y=Object(I.useRef)(),u=Object(I.useState)(),_=Object(G.a)(u,2),m=_[0],b=_[1];return Object(I.useEffect)(function(){if(m){function P(N){var K=N.getValue();R&&R(K)}return m.on("change",P),function(){m.off("change",P)}}},[m,R]),Object(I.useEffect)(function(){m&&m.setOption("mode",A)},[m,A]),Object(I.useEffect)(function(){m&&((x!==m.getValue()||x==="")&&setTimeout(function(){m.setValue(x||" ")},300))},[m,x]),Object(I.useEffect)(function(){if(y.current&&!m){var P=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(P)}},[y.current,m]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:y}))}},"8EBN":function(_t,lt,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 Z=0;Z-1&&V.substring(G+1,V.length);if(j)return ae.findModeByExtension(j)},ae.findModeByName=function(V){V=V.toLowerCase();for(var F=0;F=U.length?J.slice(U.length):J}).join(`
`)}var o=[],s=[""],l=new h.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){o.length=0,s=[""]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(z,v,C,U){if(v>=z.length||z[v].level<=C)return v;var J=z[v];U.push("- "+J.text+""),v++;var W=[];return v=x(z,v,J.level,W),W.length>0&&(U.push("
"),W.forEach(function(pe){U.push(pe)}),U.push("
")),U.push(" "),v=x(z,v,C,U),v}function R(){return x(o,0,0,s),s.push("
"),s.join("")}var A={heading:function(v){var C=d.exec(v);if(C)return{type:"heading",raw:C[0],depth:C[1].length,text:C[2]}},fences:function(v){var C=this.rules.block.fences.exec(v);if(C){var U=C[0],J=c(U,C[3]||""),W=C[2]?C[2].trim():C[2];if(["latex","katex","math"].indexOf(W)>=0){var pe=y(),De=J;J=pe,u[pe]={type:"block",expression:De}}return{type:"code",raw:U,lang:W,text:J}}}},T=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,y=function(){return"__special_katext_id_".concat(E++,"__")},u={};function _(){return u}function m(){E=0,u={}}function b(z){return z=z.replace(T,function(v,C){var U=y();return u[U]={type:"inline",expression:C},U}),z}var P=l.listitem;l.listitem=function(z){return P(b(z))};var N=l.paragraph;l.paragraph=function(z){return N(b(z))};var K=l.tablecell;l.tablecell=function(z,v){return K(b(z),v)},l.code=function(z,v,C){var U=(v||"").match(/\S*/)[0];return U?["latex","katex","math"].indexOf(U)>=0?"".concat(z,"
"):'
').concat(C?z:Object(a.escape)(z,!0),`
`):''+(C?z:Object(a.escape)(z,!0))+"
"},l.heading=function(z,v,C){var U=this.options.headerPrefix+C.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:U,level:v,text:z}),"'+z+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:A,renderer:l});var X=h.a,B=ne("SJMd"),S=ne("ulZh"),Y=ne.n(S),te=ne("m3rI"),re=ne("Oy/b"),ce=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(C,U){C.__proto__=U}||function(C,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(C[J]=U[J])})(z,v)};function be(z,v){function C(){this.constructor=z}ye(z,v),z.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}function we(z,v,C,U){return new(C||(C=Promise))(function(J,W){function pe(gt){try{it(U.next(gt))}catch(Ne){W(Ne)}}function De(gt){try{it(U.throw(gt))}catch(Ne){W(Ne)}}function it(gt){var Ne;gt.done?J(gt.value):(Ne=gt.value,Ne instanceof C?Ne:new C(function(Tt){Tt(Ne)})).then(pe,De)}it((U=U.apply(z,v||[])).next())})}function xe(z,v){var C,U,J,W,pe={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return W={next:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function De(it){return function(gt){return function(Ne){if(C)throw new TypeError("Generator is already executing.");for(;pe;)try{if(C=1,U&&(J=2&Ne[0]?U.return:Ne[0]?U.throw||((J=U.return)&&J.call(U),0):U.next)&&!(J=J.call(U,Ne[1])).done)return J;switch(U=0,J&&(Ne=[2&Ne[0],J.value]),Ne[0]){case 0:case 1:J=Ne;break;case 4:return pe.label++,{value:Ne[1],done:!1};case 5:pe.label++,U=Ne[1],Ne=[0];continue;case 7:Ne=pe.ops.pop(),pe.trys.pop();continue;default:if(!(J=pe.trys,(J=J.length>0&&J[J.length-1])||Ne[0]!==6&&Ne[0]!==2)){pe=0;continue}if(Ne[0]===3&&(!J||Ne[1]>J[0]&&Ne[1]',"select"),this.addActionButton(U,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(U,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(U,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(U,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(U,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(U,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(U,'',"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(W){var pe=document.createElement("div");pe.className=""+C.toolbarButtonStyleClass.name,pe.setAttribute("data-type-name",W.typeName),pe.innerHTML=W.icon,pe.addEventListener("click",function(){C.markerToolbarButtonClicked(pe,W)}),C.buttons.push(pe),C.markerButtons.push(pe)}),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 J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'',"render"),this.addActionButton(J,'',"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 C=0;C0&&this.buttonClickListeners.forEach(function(U){return U("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(v,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(U){return U("action",C)}),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 C=this.markerButtons.find(function(U){return U.getAttribute("data-type-name")===v});C&&this.setActiveButton(C)},z.prototype.setCurrentMarker=function(v){var C=this;this.currentMarker=v,this.buttons.filter(function(U){return/delete|notes/.test(U.getAttribute("data-action"))}).forEach(function(U){C.currentMarker===void 0?(U.style.fillOpacity="0.4",U.style.pointerEvents="none"):(U.style.fillOpacity="1",U.style.pointerEvents="all")})},z}(),We=function(){function z(v,C,U,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=C,this.uiStyleSettings=U,this.styles=J,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 C=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*C)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
padding: `+C+`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 C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(v){var C,U,J=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((U=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&U!==void 0?U:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(W){var pe;W.uiStyleSettings=J.uiStyleSettings;var De=document.createElement("div");De.className=J.toolboxButtonStyleClass.name+" "+((pe=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pe!==void 0?pe:J.toolboxButtonStyleColorsClass.name),De.innerHTML=W.icon,De.title=W.title,De.addEventListener("click",function(){J.panelButtonClick(W)}),J.panelButtons.push(De),J.buttonRow.appendChild(De)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(v){var C=this,U=-1;if(v!==this.activePanel){U=this.panels.indexOf(v),this.panelRow.innerHTML="";var J=v.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(W,pe){var De,it;W.className=C.toolboxButtonStyleClass.name+" "+(pe===U?""+((De=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&De!==void 0?De:C.toolboxActiveButtonStyleColorsClass.name):""+((it=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:C.toolboxButtonStyleColorsClass.name))})},z}(),qe=function(z,v){this.title=z,this.icon=v},Ve=function(z){function v(C,U,J,W){var pe=z.call(this,C,W||'')||this;return pe.colors=[],pe.addTransparent=!1,pe.colorBoxes=[],pe.colors=U,pe.currentColor=J,pe.setCurrentColor=pe.setCurrentColor.bind(pe),pe.getColorBox=pe.getColorBox.bind(pe),pe}return be(v,z),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.whiteSpace="nowrap",this.colors.forEach(function(J){var W=C.getColorBox(J);U.appendChild(W),C.colorBoxes.push(W)}),U},v.prototype.getColorBox=function(C){var U=this,J=this.uiStyleSettings.toolbarHeight/4,W=this.uiStyleSettings.toolbarHeight-J,pe=document.createElement("div");pe.style.display="inline-block",pe.style.boxSizing="content-box",pe.style.width=W-2+"px",pe.style.height=W-2+"px",pe.style.padding="1px",pe.style.marginRight="2px",pe.style.marginBottom="2px",pe.style.borderWidth="2px",pe.style.borderStyle="solid",pe.style.borderRadius=(W+2)/2+"px",pe.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",pe.addEventListener("click",function(){U.setCurrentColor(C,pe)});var De=document.createElement("div");return De.style.display="inline-block",De.style.width=W-2+"px",De.style.height=W-2+"px",De.style.backgroundColor=C,De.style.borderRadius=W/2+"px",C==="transparent"&&(De.style.fill=this.uiStyleSettings.toolboxAccentColor,De.innerHTML=``),pe.appendChild(De),pe},v.prototype.setCurrentColor=function(C,U){var J=this;this.currentColor=C,this.colorBoxes.forEach(function(W){W.style.borderColor=W===U?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},v}(qe),je=function(){function z(v,C,U){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=C,this.globalSettings=U,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,C){},z.prototype.dblClick=function(v,C){},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,C){},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}(),Fe=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}(),ht=function(){function z(){this.GRIP_SIZE=10,this.visual=oe.createGroup(),this.visual.appendChild(oe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(oe.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}(),He=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,C){return v.a=C.a,v.b=C.b,v.c=C.c,v.d=C.d,v.e=C.e,v.f=C.f,v},z}(),Pe=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.left=0,W.top=0,W.width=0,W.height=0,W.defaultSize={x:50,y:20},W.offsetX=0,W.offsetY=0,W.rotationAngle=0,W.CB_DISTANCE=10,W._suppressMarkerCreateEvent=!1,W.container.transform.baseVal.appendItem(oe.createTransform()),W.setupControlBox(),W}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(C){this._visual=C;var U=oe.createTransform();this._visual.transform.baseVal.appendItem(U)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(C){return!!z.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},v.prototype.pointerDown=function(C,U){z.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(C);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(U),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(U)){this.activeGrip=this.rotatorGrip;var W=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=W.x-this.width/2,this.top=W.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var pe=this.container.transform.baseVal.getItem(0);pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(C){var U=this.state;z.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",U==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},v.prototype.manipulate=function(C){var U=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(U.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(U.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(U):this.state==="rotate"&&this.rotate(C)},v.prototype.resize=function(C){var U=this.manipulationStartLeft,J=this.manipulationStartWidth,W=this.manipulationStartTop,pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:U=this.manipulationStartLeft+C.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-U;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:W=this.manipulationStartTop+C.y-this.manipulationStartY,pe=this.manipulationStartHeight+this.manipulationStartTop-W;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:pe=this.manipulationStartHeight+C.y-this.manipulationStartY}J>=0?(this.left=U,this.width=J):(this.left=U+J,this.width=-J),pe>=0?(this.top=W,this.height=pe):(this.top=W+pe,this.height=-pe),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var U=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*U,this.applyRotation()}},v.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},v.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var U=this.container.getCTM(),J=oe.createPoint(C.x,C.y);return{x:(J=J.matrixTransform(U)).x,y:J.y}},v.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var U=this.container.getCTM();U=U.inverse();var J=oe.createPoint(C.x,C.y);return{x:(J=J.matrixTransform(U)).x,y:J.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=oe.createGroup();var C=oe.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=oe.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=oe.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 Fe,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,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 C=new ht;return C.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(C.visual),C},v.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,U=-C/2,J=U,W=(this.width+this.CB_DISTANCE)/2-C/2,pe=(this.height+this.CB_DISTANCE)/2-C/2,De=this.height+this.CB_DISTANCE-C/2,it=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,U,J),this.positionGrip(this.controlGrips.topCenter.visual,W,J),this.positionGrip(this.controlGrips.topRight.visual,it,J),this.positionGrip(this.controlGrips.centerLeft.visual,U,pe),this.positionGrip(this.controlGrips.centerRight.visual,it,pe),this.positionGrip(this.controlGrips.bottomLeft.visual,U,De),this.positionGrip(this.controlGrips.bottomCenter.visual,W,De),this.positionGrip(this.controlGrips.bottomRight.visual,it,De),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,W,J-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(C,U,J){var W=C.transform.baseVal.getItem(0);W.setTranslate(U,J),C.transform.baseVal.replaceItem(W,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:He.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:He.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},v.prototype.restoreState=function(C){z.prototype.restoreState.call(this,C);var U=C;this.left=U.left,this.top=U.top,this.width=U.width,this.height=U.height,this.rotationAngle=U.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,U.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,U.containerTransformMatrix))},v.prototype.scale=function(C,U){z.prototype.scale.call(this,C,U);var J=this.rotatePoint({x:this.left,y:this.top}),W=this.unrotatePoint({x:J.x*C,y:J.y*U});this.left=W.x,this.top=W.y,this.width=this.width*C,this.height=this.height*U,this.adjustControlBox()},v}(je),Xe=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.fillColor="transparent",W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.opacity=1,W.setStrokeColor=W.setStrokeColor.bind(W),W.setFillColor=W.setFillColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.createVisual=W.createVisual.bind(W),W}return be(v,z),v.prototype.ownsTarget=function(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.visual)},v.prototype.createVisual=function(){this.visual=oe.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(C,U){z.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.manipulate=function(C){z.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){z.prototype.resize.call(this,C),this.setSize()},v.prototype.setSize=function(){z.prototype.setSize.call(this),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(C){z.prototype.pointerUp.call(this,C),this.setSize()},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},v.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&oe.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(C){var U=C;this.fillColor=U.fillColor,this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.opacity=U.opacity,this.createVisual(),z.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,U){z.prototype.scale.call(this,C,U),this.setSize()},v.title="Rectangle marker",v}(Pe),tt=function(z){function v(C,U,J,W){var pe=z.call(this,C,W||'')||this;return pe.widths=[],pe.widthBoxes=[],pe.widths=U,pe.currentWidth=J,pe.setCurrentWidth=pe.setCurrentWidth.bind(pe),pe}return be(v,z),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",this.widths.forEach(function(J){var W=document.createElement("div");W.style.display="flex",W.style.flexGrow="2",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderColor=J===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){C.setCurrentWidth(J,W)}),U.appendChild(W);var pe=document.createElement("div");pe.innerText=J.toString(),pe.style.marginRight="5px",W.appendChild(pe);var De=document.createElement("div");De.style.minHeight="20px",De.style.flexGrow="2",De.style.display="flex",De.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=J+"px solid "+C.uiStyleSettings.toolboxColor,it.style.flexGrow="2",De.appendChild(it),W.appendChild(De),C.widthBoxes.push(W)}),U},v.prototype.setCurrentWidth=function(C,U){var J=this;this.currentWidth=C,this.widthBoxes.forEach(function(W){W.style.borderColor=W===U?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(qe),Ke=function(z){function v(C,U,J,W){var pe=z.call(this,C,W||'')||this;return pe.styles=[],pe.styleBoxes=[],pe.styles=U,pe.currentStyle=J,pe.setCurrentStyle=pe.setCurrentStyle.bind(pe),pe}return be(v,z),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",this.styles.forEach(function(J){var W=document.createElement("div");W.style.display="flex",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.overflow="hidden",W.style.maxWidth=100/C.styles.length-5+"%",W.style.borderColor=J===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){C.setCurrentStyle(J,W)}),U.appendChild(W);var pe=document.createElement("div");pe.style.minHeight="20px",pe.style.flexGrow="2",pe.style.overflow="hidden";var De=``;pe.innerHTML=De,W.appendChild(pe),C.styleBoxes.push(W)}),U},v.prototype.setCurrentStyle=function(C,U){var J=this;this.currentStyle=C,this.styleBoxes.forEach(function(W){W.style.borderColor=W===U?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(qe),et=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.strokeColor=J.defaultColor,W.strokeWidth=J.defaultStrokeWidth,W.strokeDasharray=J.defaultStrokeDasharray,W.strokePanel=new Ve("Line color",J.defaultColorSet,J.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new tt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ke("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}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 C=z.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="FrameMarker",v.title="Frame marker",v.icon='',v}(Xe),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},nt=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.x1=0,W.y1=0,W.x2=0,W.y2=0,W.defaultLength=50,W.manipulationStartX=0,W.manipulationStartY=0,W.manipulationStartX1=0,W.manipulationStartY1=0,W.manipulationStartX2=0,W.manipulationStartY2=0,W.setupControlBox(),W}return be(v,z),v.prototype.ownsTarget=function(C){return!!z.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},v.prototype.pointerDown=function(C,U){z.prototype.pointerDown.call(this,C,U),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.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(U)?this.activeGrip=this.grip1:this.grip2.ownsTarget(U)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(C){var U=this.state;z.prototype.pointerUp.call(this,C),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(C),this._state="select",U==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},v.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.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=oe.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 C=new ht;return C.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(C.visual),C},v.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},v.prototype.positionGrip=function(C,U,J){var W=C.transform.baseVal.getItem(0);W.setTranslate(U,J),C.transform.baseVal.replaceItem(W,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(C){z.prototype.restoreState.call(this,C);var U=C;this.x1=U.x1,this.y1=U.y1,this.x2=U.x2,this.y2=U.y2},v.prototype.scale=function(C,U){z.prototype.scale.call(this,C,U),this.x1=this.x1*C,this.y1=this.y1*U,this.x2=this.x2*C,this.y2=this.y2*U,this.adjustVisual(),this.adjustControlBox()},v}(je),Je=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.setStrokeColor=W.setStrokeColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.strokeColor=J.defaultColor,W.strokeWidth=J.defaultStrokeWidth,W.strokeDasharray=J.defaultStrokeDasharray,W.strokePanel=new Ve("Line color",J.defaultColorSet,J.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new tt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ke("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return be(v,z),v.prototype.ownsTarget=function(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=oe.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(C,U){z.prototype.pointerDown.call(this,C,U),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()),oe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,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 C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){z.prototype.restoreState.call(this,C);var U=C;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='',v}(nt),Se=function(z){function v(C,U,J,W){var pe=z.call(this,C,W||'')||this;return pe.fonts=[],pe.fontBoxes=[],pe.fonts=U,pe.currentFont=J,pe.setCurrentFont=pe.setCurrentFont.bind(pe),pe}return be(v,z),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.flexGrow="2",this.fonts.forEach(function(J){var W=document.createElement("div");W.style.display="inline-block",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.overflow="hidden",W.style.maxWidth=100/C.fonts.length-5+"%",W.style.borderColor=J===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){C.setCurrentFont(J,W)}),U.appendChild(W);var pe=document.createElement("div");pe.style.display="flex",pe.style.minHeight="20px",pe.style.flexGrow="2",pe.style.fontFamily=J,pe.style.overflow="hidden";var De=document.createElement("div");De.style.whiteSpace="nowrap",De.style.overflow="hidden",De.style.textOverflow="ellipsis",De.innerHTML="The quick brown fox jumps over the lazy dog",pe.appendChild(De),W.appendChild(pe),C.fontBoxes.push(W)}),U},v.prototype.setCurrentFont=function(C,U){var J=this;this.currentFont=C,this.fontBoxes.forEach(function(W){W.style.borderColor=W===U?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(qe),ke=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.color="transparent",W.padding=5,W.DEFAULT_TEXT="your text here",W.text=W.DEFAULT_TEXT,W.isMoved=!1,W.color=J.defaultColor,W.fontFamily=J.defaultFontFamily,W.defaultSize={x:100,y:30},W.setColor=W.setColor.bind(W),W.setFont=W.setFont.bind(W),W.renderText=W.renderText.bind(W),W.sizeText=W.sizeText.bind(W),W.textEditDivClicked=W.textEditDivClicked.bind(W),W.showTextEditor=W.showTextEditor.bind(W),W.setSize=W.setSize.bind(W),W.positionTextEditor=W.positionTextEditor.bind(W),W.colorPanel=new Ve("Color",J.defaultColorSet,J.defaultColor),W.colorPanel.onColorChanged=W.setColor,W.fontFamilyPanel=new Se("Font",J.defaultFontFamilies,J.defaultFontFamily),W.fontFamilyPanel.onFontChanged=W.setFont,W}return be(v,z),v.prototype.ownsTarget=function(C){if(z.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var U=!1;return this.textElement.childNodes.forEach(function(J){J===C&&(U=!0)}),U},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.bgRectangle=oe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=oe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(C,U){z.prototype.pointerDown.call(this,C,U),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.renderText=function(){var C=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(U){C.textElement.appendChild(oe.createTSpan(U.trim()===""?" ":U.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var C=this.textElement.getBBox(),U=1;if(C.width>0&&C.height>0){var J=(1*this.width-this.width*this.padding*2/100)/C.width,W=(1*this.height-this.height*this.padding*2/100)/C.height;U=Math.min(J,W)}return U},v.prototype.getTextPosition=function(C){var U=this.textElement.getBBox(),J=0,W=0;return U.width>0&&U.height>0&&(J=(this.width-U.width*C)/2,W=this.height/2-U.height*C/2),{x:J,y:W}},v.prototype.sizeText=function(){var C=this.textElement.getBBox(),U=this.getTextScale(),J=this.getTextPosition(U);J.y-=C.y*U,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+U+", "+U+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(U,U))},v.prototype.manipulate=function(C){z.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(C){z.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(C){var U=this.state;U==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,C),this.setSize(),(U==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var C=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(U){U.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var U=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&U>.9;)U-=.1,C.textEditor.style.fontSize=Math.max(U,.9)+"em"}),this.textEditor.addEventListener("keyup",function(U){U.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(U){if(U.clipboardData){var J=U.clipboardData.getData("text"),W=window.getSelection();if(!W.rangeCount)return!1;W.deleteFromDocument(),W.getRangeAt(0).insertNode(document.createTextNode(J)),U.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.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 C=this.getTextScale(),U=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),W={x:J.width*C,y:J.height*C};U.x-=W.x/2,U.y-=W.y/2,this.textEditor.style.top=U.y+"px",this.textEditor.style.left=U.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-U.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(C){this.text=C.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(C,U){z.prototype.dblClick.call(this,C,U),this.showTextEditor()},v.prototype.setColor=function(C){this.textElement&&oe.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},v.prototype.setFont=function(C){this.textElement&&oe.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,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 C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var U=C;this.color=U.color,this.fontFamily=U.fontFamily,this.padding=U.padding,this.text=U.text,this.createVisual(),z.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,U){z.prototype.scale.call(this,C,U),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.icon='',v}(Pe),me=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.color="transparent",W.lineWidth=3,W.drawing=!1,W.pixelRatio=1,W.color=J.defaultColor,W.lineWidth=J.defaultStrokeWidth,W.pixelRatio=J.freehandPixelRatio,W.setColor=W.setColor.bind(W),W.addCanvas=W.addCanvas.bind(W),W.finishCreation=W.finishCreation.bind(W),W.setLineWidth=W.setLineWidth.bind(W),W.colorPanel=new Ve("Color",J.defaultColorSet,J.defaultColor),W.colorPanel.onColorChanged=W.setColor,W.lineWidthPanel=new tt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),W.lineWidthPanel.onWidthChanged=W.setLineWidth,W}return be(v,z),v.prototype.ownsTarget=function(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.drawingImage=oe.createImage(),this.visual.appendChild(this.drawingImage);var C=oe.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,U){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(C.x,C.y),this.drawing=!0):z.prototype.pointerDown.call(this,C,U)},v.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){z.prototype.resize.call(this,C),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,C)},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 C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),U=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=U[0],W=U[1],pe=U[2],De=U[3],it=!1,gt=0;gt0&&(it=!0,gtDe&&(De=gt),Ne>pe&&(pe=Ne));if(it){this.left=J/this.pixelRatio,this.top=W/this.pixelRatio,this.width=(pe-J)/this.pixelRatio,this.height=(De-W)/this.pixelRatio;var Tt=document.createElement("canvas");Tt.width=pe-J,Tt.height=De-W,Tt.getContext("2d").putImageData(this.canvasContext.getImageData(J,W,pe-J,De-W),0,0),this.drawingImgUrl=Tt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},v.prototype.setLineWidth=function(C){this.lineWidth=C},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 C=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){this.createVisual(),z.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(C,U){z.prototype.scale.call(this,C,U),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.icon='',v}(Pe),he=function(z){function v(C,U,J){var W=z.call(this,C,J||'')||this;return W.typeBoxes=[],W.currentType=U,W.setCurrentType=W.setCurrentType.bind(W),W}return be(v,z),v.prototype.getUi=function(){var C=this,U=document.createElement("div");U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2";for(var J=function(De){var it="both";switch(De){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="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=it===W.currentType?W.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){C.setCurrentType(it,gt)}),U.appendChild(gt),it==="both"||it==="start"){var Ne=document.createElement("div");Ne.style.display="flex",Ne.style.alignItems="center",Ne.style.minHeight="20px",Ne.innerHTML=``,Ne.style.marginLeft="5px",gt.appendChild(Ne)}var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.style.flexGrow="2";var zt=document.createElement("hr");if(zt.style.minWidth="20px",zt.style.border="0px",zt.style.borderTop="3px solid "+(W.uiStyleSettings!==void 0?W.uiStyleSettings.toolboxColor:"#eeeeee"),zt.style.flexGrow="2",Tt.appendChild(zt),gt.appendChild(Tt),it==="both"||it==="end"){var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.innerHTML=``,qt.style.marginRight="5px",gt.appendChild(qt)}W.typeBoxes.push(gt)},W=this,pe=0;pe<4;pe++)J(pe);return U},v.prototype.setCurrentType=function(C,U){var J=this;this.currentType=C,this.typeBoxes.forEach(function(W){W.style.borderColor=W===U?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(qe),de=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.arrowType="end",W.arrowBaseHeight=10,W.arrowBaseWidth=10,W.getArrowPoints=W.getArrowPoints.bind(W),W.setArrowType=W.setArrowType.bind(W),W.arrowTypePanel=new he("Arrow type","end"),W.arrowTypePanel.onArrowTypeChanged=W.setArrowType,W}return be(v,z),v.prototype.ownsTarget=function(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},v.prototype.getArrowPoints=function(C,U){var J=this.arrowBaseWidth+2*this.strokeWidth,W=this.arrowBaseHeight+2*this.strokeWidth;return C-J/2+","+(U+W/2)+" "+C+","+(U-W/2)+" "+(C+J/2)+","+(U+W/2)},v.prototype.createTips=function(){this.arrow1=oe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=oe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(C,U){z.prototype.pointerDown.call(this,C,U),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",oe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),oe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),U=this.arrow1.transform.baseVal.getItem(0);U.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(U,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},v.prototype.setArrowType=function(C){this.arrowType=C,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 C=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){z.prototype.restoreState.call(this,C);var U=C;this.arrowType=U.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='',v}(Je),ie=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.fillColor=J.defaultFillColor,W.strokeWidth=0,W.fillPanel=new Ve("Color",J.defaultColorSet,J.defaultFillColor),W.fillPanel.onColorChanged=W.setFillColor,W}return be(v,z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=z.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="CoverMarker",v.title="Cover marker",v.icon='',v}(Xe),q=function(z){function v(C,U,J,W){var pe=z.call(this,C,W||'')||this;return pe.opacities=[],pe.opacityBoxes=[],pe.opacities=U,pe.currentOpacity=J,pe.setCurrentOpacity=pe.setCurrentOpacity.bind(pe),pe}return be(v,z),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",U.style.justifyContent="space-between",this.opacities.forEach(function(J){var W=document.createElement("div");W.style.display="flex",W.style.alignItems="center",W.style.justifyContent="center",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderColor=J===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){C.setCurrentOpacity(J,W)}),U.appendChild(W);var pe=document.createElement("div");pe.innerText=100*J+"%",W.appendChild(pe),C.opacityBoxes.push(W)}),U},v.prototype.setCurrentOpacity=function(C,U){var J=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(W){W.style.borderColor=W===U?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(qe),se=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.setOpacity=W.setOpacity.bind(W),W.fillColor=J.defaultHighlightColor,W.strokeWidth=0,W.opacity=J.defaultHighlightOpacity,W.fillPanel=new Ve("Color",J.defaultColorSet,W.fillColor),W.fillPanel.onColorChanged=W.setFillColor,W.opacityPanel=new q("Opacity",J.defaultOpacitySteps,W.opacity),W.opacityPanel.onOpacityChanged=W.setOpacity,W}return be(v,z),v.prototype.setOpacity=function(C){this.opacity=C,this.visual&&oe.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 C=z.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="HighlightMarker",v.title="Highlight marker",v.icon='',v}(ie),ue='',ge=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.bgColor="transparent",W.tipPosition={x:0,y:0},W.tipBase1Position={x:0,y:0},W.tipBase2Position={x:0,y:0},W.tipMoving=!1,W.color=J.defaultStrokeColor,W.bgColor=J.defaultFillColor,W.fontFamily=J.defaultFontFamily,W.defaultSize={x:100,y:30},W.setBgColor=W.setBgColor.bind(W),W.getTipPoints=W.getTipPoints.bind(W),W.positionTip=W.positionTip.bind(W),W.setTipPoints=W.setTipPoints.bind(W),W.colorPanel=new Ve("Text color",J.defaultColorSet,W.color,''),W.colorPanel.onColorChanged=W.setColor,W.bgColorPanel=new Ve("Fill color",J.defaultColorSet,W.bgColor,ue),W.bgColorPanel.onColorChanged=W.setBgColor,W.fontFamilyPanel=new Se("Font",J.defaultFontFamilies,J.defaultFontFamily),W.fontFamilyPanel.onFontChanged=W.setFont,W.tipGrip=new ht,W.tipGrip.visual.transform.baseVal.appendItem(oe.createTransform()),W.controlBox.appendChild(W.tipGrip.visual),W}return be(v,z),v.prototype.ownsTarget=function(C){return z.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},v.prototype.createTip=function(){oe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=oe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(C,U){this.state==="new"&&z.prototype.pointerDown.call(this,C,U),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(U)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,C,U)},v.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,C);else{var U=this.state==="creating";z.prototype.pointerUp.call(this,C),this.setTipPoints(U),this.positionTip()}},v.prototype.manipulate=function(C){if(this.tipMoving){var U=this.unrotatePoint(C);this.tipPosition={x:U.x-this.manipulationStartLeft,y:U.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,C)},v.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(oe.setAttributes(this.bgRectangle,[["fill",C]]),oe.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},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(C){C===void 0&&(C=!1);var U=Math.min(this.height/2,15),J=this.height/5;C&&(this.tipPosition={x:U+J/2,y:this.height+20});var W=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?W',v}(ke),Ce=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.fillColor="transparent",W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.opacity=1,W.strokeColor=J.defaultColor,W.strokeWidth=J.defaultStrokeWidth,W.strokeDasharray=J.defaultStrokeDasharray,W.fillColor=J.defaultFillColor,W.setStrokeColor=W.setStrokeColor.bind(W),W.setFillColor=W.setFillColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.setOpacity=W.setOpacity.bind(W),W.createVisual=W.createVisual.bind(W),W.strokePanel=new Ve("Line color",ve(J.defaultColorSet,["transparent"]),J.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.fillPanel=new Ve("Fill color",ve(J.defaultColorSet,["transparent"]),W.fillColor,ue),W.fillPanel.onColorChanged=W.setFillColor,W.strokeWidthPanel=new tt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ke("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W.opacityPanel=new q("Opacity",J.defaultOpacitySteps,W.opacity),W.opacityPanel.onOpacityChanged=W.setOpacity,W}return be(v,z),v.prototype.ownsTarget=function(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.visual)},v.prototype.createVisual=function(){this.visual=oe.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(C,U){z.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.manipulate=function(C){z.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){z.prototype.resize.call(this,C),this.setSize()},v.prototype.setSize=function(){z.prototype.setSize.call(this),oe.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(C){z.prototype.pointerUp.call(this,C),this.setSize()},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},v.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(C){this.opacity=C,this.visual&&oe.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 C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var U=C;this.fillColor=U.fillColor,this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.opacity=U.opacity,this.createVisual(),z.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,U){z.prototype.scale.call(this,C,U),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.icon='',v}(Pe),Le=function(z){function v(C,U,J){return z.call(this,C,U,J)||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(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},v.prototype.createTips=function(){this.tip1=oe.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(oe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=oe.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(oe.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(C,U){z.prototype.pointerDown.call(this,C,U),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(oe.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()]]),oe.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 C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),U=this.tip1.transform.baseVal.getItem(0);U.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(U,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=z.prototype.getState.call(this);return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){z.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.icon='',v}(Je),ze=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.strokePanel.colors=J.defaultColorSet,W.fillColor="transparent",W}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 C=z.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.icon='',v}(Ce),pt=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}(),ct=function(z){function v(C,U,J){var W=z.call(this,C,U,J)||this;return W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.curveX=0,W.curveY=0,W.manipulationStartCurveX=0,W.manipulationStartCurveY=0,W.setStrokeColor=W.setStrokeColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.positionGrips=W.positionGrips.bind(W),W.addControlGrips=W.addControlGrips.bind(W),W.adjustVisual=W.adjustVisual.bind(W),W.setupControlBox=W.setupControlBox.bind(W),W.resize=W.resize.bind(W),W.strokeColor=J.defaultColor,W.strokeWidth=J.defaultStrokeWidth,W.strokeDasharray=J.defaultStrokeDasharray,W.strokePanel=new Ve("Line color",J.defaultColorSet,J.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new tt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ke("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return be(v,z),v.prototype.ownsTarget=function(C){return!(!z.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},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=oe.createGroup(),this.selectorCurve=oe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=oe.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(C,U){z.prototype.pointerDown.call(this,C,U),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(U)&&(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()),oe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){z.prototype.setupControlBox.call(this),this.curveControlLine1=oe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=oe.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 C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/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(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),z.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),z.prototype.resize.call(this,C),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(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},v.prototype.scale=function(C,U){this.curveX=this.curveX*C,this.curveY=this.curveY*U,z.prototype.scale.call(this,C,U)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){z.prototype.restoreState.call(this,C);var U=C;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.curveX=U.curveX,this.curveY=U.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.icon='',v}(nt),Ct=function(){function z(v,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=C}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),xt=function(z){function v(C,U,J){var W=z.call(this,C,!1)||this;return W.dataUrl=U,W.state=J,W}return be(v,z),v}(Ct),$e=function(z){function v(C,U,J){J===void 0&&(J=!1);var W=z.call(this,C,J)||this;return W.marker=U,W}return be(v,z),v}(Ct),Rt=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,C){this[v].push(C)},z.prototype.removeEventListener=function(v,C){var U=this[v].indexOf(C);U>-1&&this[v].splice(U,1)},z}(),vt=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 pt,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 Rt,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[et,me,de,ke,ze,Ce,se,ge,Le,ie,Je,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,me,de,ke,Ce,se,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,me,de,ke,se]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var C=this;this._availableMarkerTypes.splice(0),v.forEach(function(U){if(typeof U=="string"){var J=C.ALL_MARKER_TYPES.find(function(W){return W.typeName===U});J!==void 0&&C._availableMarkerTypes.push(J)}else C._availableMarkerTypes.push(U)})},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&&Ue.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ue.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(C){return C(new Ct(v))})},z.prototype.render=function(){return we(this,void 0,void 0,function(){var v;return xe(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(v=new Ye).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 C.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},z.prototype.close=function(v){var C=this;if(v===void 0&&(v=!1),this.isOpen){var U=!1;v||this.eventListeners.beforeclose.forEach(function(J){var W=new Ct(C,!0);J(W),W.defaultPrevented&&(U=!0)}),U||(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(J){return J(new Ct(C))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var v,C=[],U=0;Uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,U=C',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 Me(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,C){if(v==="marker"&&C!==void 0)this.createNewMarker(C);else if(v==="action")switch(C){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 C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var W=new $e(v,v._currentMarker,!0);J(W),W.defaultPrevented&&(C=!0)}),!C){var U=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(J){return J(new $e(v,U))})}}},z.prototype.clear=function(){var v=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(pe){var De=new $e(v,void 0,!0);pe(De),De.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var U=function(pe){var De=J.markers[pe];J.setCurrentMarker(J.markers[pe]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(it){return it(new $e(v,De))})},J=this,W=this.markers.length-1;W>=0;W--)U(W);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 C=this.getState(),U=this.undoRedoManager.getLastUndoStep();if(!U||U.width===C.width&&U.height===C.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),J1&&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,C){var U=this.markerImage.getBoundingClientRect();return{x:(v-U.left)/this.zoomLevel,y:(C-U.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,C){this.eventListeners.addEventListener(v,C)},z.prototype.removeEventListener=function(v,C){this.eventListeners.removeEventListener(v,C)},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(C){return C(new Ct(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(C){return C(new Ct(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 Nt=function(z,v){return(Nt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,U){C.__proto__=U}||function(C,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(C[J]=U[J])})(z,v)};function It(z,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function C(){this.constructor=z}Nt(z,v),z.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}function At(z,v,C,U){return new(C||(C=Promise))(function(J,W){function pe(gt){try{it(U.next(gt))}catch(Ne){W(Ne)}}function De(gt){try{it(U.throw(gt))}catch(Ne){W(Ne)}}function it(gt){var Ne;gt.done?J(gt.value):(Ne=gt.value,Ne instanceof C?Ne:new C(function(Tt){Tt(Ne)})).then(pe,De)}it((U=U.apply(z,v||[])).next())})}function di(z,v){var C,U,J,W,pe={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return W={next:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function De(it){return function(gt){return function(Ne){if(C)throw new TypeError("Generator is already executing.");for(;pe;)try{if(C=1,U&&(J=2&Ne[0]?U.return:Ne[0]?U.throw||((J=U.return)&&J.call(U),0):U.next)&&!(J=J.call(U,Ne[1])).done)return J;switch(U=0,J&&(Ne=[2&Ne[0],J.value]),Ne[0]){case 0:case 1:J=Ne;break;case 4:return pe.label++,{value:Ne[1],done:!1};case 5:pe.label++,U=Ne[1],Ne=[0];continue;case 7:Ne=pe.ops.pop(),pe.trys.pop();continue;default:if(!(J=pe.trys,(J=J.length>0&&J[J.length-1])||Ne[0]!==6&&Ne[0]!==2)){pe=0;continue}if(Ne[0]===3&&(!J||Ne[1]>J[0]&&Ne[1]0&&C>0){var U=new ti(v,C),J=U.ratio>=1?20:U.getHorizontalLength(20),W=U.ratio<1?20:U.getVerticalLength(20),pe=document.createElementNS("http://www.w3.org/2000/svg","svg");pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(pe);var De=Qe.createDefs();pe.appendChild(De);var it=Qe.createElement("clipPath",[["id","text-bg-clip"]]);De.appendChild(it);var gt=Qe.createPath(Qe.getHollowRectanglePath((24-J)/2,(24-W)/2,J,W,(24-J)/2+2,(24-W)/2+2,J-4,W-4));pe.appendChild(gt);var Ne=Qe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ne.appendChild(Qe.createTSpan(v+":"+C)),pe.appendChild(Ne);var Tt=Ne.getBBox();Qe.setAttributes(Ne,[["x",((24-Tt.width)/2).toString()],["y",((24-Tt.height)/2-Tt.y).toString()]]);var zt=Qe.createPath(Qe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Tt.width))/2,(24-Math.ceil(Tt.height))/2,Math.ceil(Tt.width),Math.ceil(Tt.height)));return it.appendChild(zt),Qe.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(pe),pe.outerHTML}return''},z}(),Ut=function(z){function v(C,U,J){var W=z.call(this,C,U)||this;return W.isDropdownOpen=!1,W.onClick=W.dropdownButtonClicked,W.dropdownButtons=J,W}return It(v,z),v.prototype.setupDropdown=function(){var C=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(U){U.className=C.className,U.colorsClassName=C.colorsClassName,C.dropdownBlock.appendChild(U.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}(ft),Dt=function(){function z(v,C){this.GRIP_SIZE=10,this.color=v,this.fillColor=C,this.visual=Qe.createGroup(),this.visual.appendChild(Qe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Qe.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,C){this.visual.childNodes.forEach(function(U){return Qe.setAttributes(U,[["cx",v.toString()],["cy",C.toString()]])})},z}(),Vt=function(){function z(v,C,U,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=C,this.margin=U,this.container=J,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&&Qe.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=Qe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Qe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var C=0;Cthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-C.height/2),Qe.setAttributes(this.cropRectElement,[["x",C.x.toString()],["y",C.y.toString()],["width",C.width.toString()],["height",C.height.toString()]]);var U=C.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(W,pe){var De=C.y+U*(pe+1);Qe.setAttributes(W,[["x1",""+C.x],["y1",""+De],["x2",""+(C.x+C.width)],["y2",""+De]])});var J=C.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(W,pe){var De=C.x+J*(pe+1);Qe.setAttributes(W,[["x1",""+De],["y1",""+C.y],["x2",""+De],["y2",""+(C.y+C.height)]])}),Qe.setAttributes(this.cropShadeElement,[["d",Qe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,C.x,C.y,C.width,C.height)]]),this.topLeftGrip.setCenter(C.x,C.y),this.topRightGrip.setCenter(C.x+C.width,C.y),this.bottomLeftGrip.setCenter(C.x,C.y+C.height),this.bottomRightGrip.setCenter(C.x+C.width,C.y+C.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,C){var U=this.container.getBoundingClientRect();return{x:v-U.left+this.margin,y:C-U.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 C=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(C)}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 C=v.x-this.previousPoint.x,U=v.y-this.previousPoint.y;this.zoomFactor!==1&&(C=-C/this.zoomFactor,U=-U/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+C),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+U),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 C=Object.assign({},this.cropRect),U=v.x-this.previousPoint.x,J=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:C.x+Uthis.canvasWidth*this.zoomFactor&&(U=this.canvasWidth*this.zoomFactor-C.width),C.width+=U}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(C.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(U),C.height=this.aspectRatio.getVerticalLength(C.width)):(C.y+=J,C.height=this.cropRect.y+this.cropRect.height-C.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?C.height=this.aspectRatio.getVerticalLength(C.width):C.height+=J}C.width<10&&(C.x=this.cropRect.x,C.width=10),C.height<10&&(C.y=this.cropRect.y,C.height=10),this.previousPoint=v,C.x>=this.margin&&C.y>=this.margin&&C.x-this.margin+C.width<=this.canvasWidth&&C.y-this.margin+C.height<=this.canvasHeight&&(this.cropRect=C,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,C=this.cropRect.y+this.cropRect.height/2,U=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);U/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=C-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,C,U,J,W,pe){var De=U/v,it=J/C;return{x:(W.x-pe)*De+pe,y:(W.y-pe)*it+pe,width:W.width*De,height:W.height*it}},z.prototype.scaleCanvas=function(v,C){var U=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,C,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=C,this.onCropChange&&this.onCropChange(U),this.setCropRectangle(U)},z}(),Ti=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();Qe.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 C="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,U=1;U<=this.width/5+10;U++){var J=U%5==0?this.height/3:this.height/6;C+="h4v"+-J+"h1v"+J}C+="v1H0Z",this.scaleShape=Qe.createPath(C);var W=Qe.createTransform();this.scaleShape.transform.baseVal.appendItem(W),v.appendChild(this.scaleShape),this.angleLabelElement=Qe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Qe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var pe=Qe.createTSpan("");return pe.innerHTML="°",this.angleLabelElement.appendChild(pe),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,C,U,J,W,pe,De){var it=this;return new Promise(function(gt){var Ne=document.createElement("canvas");Ne.width=v.width.baseVal.value-2*J,Ne.height=v.height.baseVal.value-2*J;var Tt=1,zt=1;it.naturalSize===!0?(Tt=C.naturalWidth/(v.width.baseVal.value-2*J)/pe,zt=C.naturalHeight/(v.height.baseVal.value-2*J)/De,Ne.width=C.naturalWidth/pe,Ne.height=C.naturalHeight/De):it.width!==void 0&&it.height!==void 0&&(Tt=it.width/U.width,zt=it.height/U.height,Ne.width*=Tt,Ne.height*=zt);var qt=Ne.getContext("2d");qt.translate(Ne.width/2,Ne.height/2),qt.rotate(W*Math.PI/180),qt.scale(pe,De),qt.translate(-Ne.width/2,-Ne.height/2),qt.drawImage(C,0,0,Ne.width,Ne.height);var Bi=document.createElement("canvas");Bi.width=U.width*Tt,Bi.height=U.height*zt,Bi.getContext("2d").putImageData(qt.getImageData((U.x-J)*Tt,(U.y-J)*zt,U.width*Tt,U.height*zt),0,0),gt(Bi.toDataURL(it.imageType,it.imageQuality))})},z}(),Ge=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 bt(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(C){return C()}),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,C=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,U=C+2*this.CANVAS_MARGINv+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=C+"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 ei,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 C=new Xi;C.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(C);var U=[];this.aspectRatios.forEach(function(zt){var qt=new ft(Wt.getIcon(zt.horizontal,zt.vertical),zt.horizontal===0&&zt.vertical===0?"FREE":zt.horizontal+":"+zt.vertical);qt.onClick=function(){return v.ratioButtonClicked(zt)},U.push(qt)}),this.aspectRatioButton=new Ut(Wt.getIcon(0,0),"Aspect ratio",U),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,C.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new ft('',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){v.isGridVisible=!v.isGridVisible,J.isActive=v.isGridVisible},C.addButton(J);var W=new ft('',"Zoom to selection");if(W.isActive=this.zoomToCropEnabled,W.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,W.isActive=v.zoomToCropEnabled},C.addButton(W),!ri.isLicensed){var pe=new ut;this.topToolbar.addElementBlock(pe);var De=document.createElement("div");De.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='',De.appendChild(it),pe.addElement(De)}var gt=new Xi;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Ne=new ft('',"OK");Ne.onClick=this.startRenderAndClose,gt.addButton(Ne),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ne.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Tt=new ft('',"Close");Tt.onClick=this.close,gt.addButton(Tt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Tt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},z.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new ei,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 C=new Xi;C.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(C);var U=new ft('',"Rotate left");U.onClick=this.rotateLeftButtonClicked,C.addButton(U);var J=new ft('',"Rotate right");J.onClick=this.rotateRightButtonClicked,C.addButton(J);var W=new ut;W.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(W),this.straightener=new Ti("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},W.addElement(this.straightener.getUI());var pe=new Xi;pe.minWidth=2*this.toolbarHeight+"px",pe.contentAlign="end",this.bottomToolbar.addButtonBlock(pe);var De=new ft('',"Flip horizontal");De.onClick=this.flipHorizontallyButtonClicked,pe.addButton(De);var it=new ft('',"Flip vertical");it.onClick=this.flipVerticallyButtonClicked,pe.addButton(it)},z.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Wt.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 ti(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 C=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(C),this.cropRectChanged(C),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},z.prototype.clientToLocalCoordinates=function(v,C){var U=this.cropImage.getBoundingClientRect();return{x:v-U.left,y:C-U.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 C=this.editingTargetRotationContainer.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(C,0);var U=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/U.width,this.imageHeight/U.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 At(this,void 0,void 0,function(){var v,C;return di(this,function(U){switch(U.label){case 0:return[4,this.render()];case 1:return v=U.sent(),C=this.getState(),this.renderEventListeners.forEach(function(J){return J(v,C)}),this.close(!0),[2]}})})},z.prototype.render=function(){return At(this,void 0,void 0,function(){var v;return di(this,function(C){switch(C.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(),Qe.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 C.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,C.sent()]}})})},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Mt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new kt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new kt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Mt("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 Mt("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 Mt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},z.instanceCounter=0,z}(),Ot=ne("8hTe"),mn=ne.n(Ot),gn=/]*>/g;function vn(z){var v=document.createElement("div");return v.innerHTML=z,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var yn=lt.a=function(z){var v=z.value,C=v===void 0?"":v,U=z.edit,J=U===void 0?!1:U,W=z.className,pe=z.showTextOnly,De=z.showLines,it=z.replaces,gt=z.zoomImg,Ne=z.hasMask,Tt=z.style,zt=Tt===void 0?{}:Tt,qt=z.stylesPrev,Bi=qt===void 0?{}:qt,wi=String(C),Si=Object(I.useRef)(),Qi=Object(I.useRef)(),Dn=Object(I.useState)(""),pi=Object(G.a)(Dn,2),zi=pi[0],ln=pi[1],un=Object(I.useState)("office"),ji=Object(G.a)(un,2),kn=ji[0],_n=ji[1],Kn=function(){var Kt=new Ge(Qi.current);Kt.displayMode="popup",Kt.addRenderEventListener(function(){var bi=Object(D.a)(M.a.mark(function Bt(li){var $t;return M.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return Si.current.style.display="none",mi.next=3,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:li}});case 3:$t=mi.sent,$t!=null&&$t.id&&it(Qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return mi.stop()}},Bt)}));return function(Bt){return bi.apply(this,arguments)}}()),Kt.show()},Vn=function(){var Kt=new vt(Qi.current);Kt.settings.displayMode="popup",Kt.addEventListener("render",function(){var bi=Object(D.a)(M.a.mark(function Bt(li){var $t;return M.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:if(Si.current.style.display="none",!Qi.current){mi.next=6;break}return mi.next=4,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:li.dataUrl}});case 4:$t=mi.sent,$t!=null&&$t.id&&it(Qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return mi.stop()}},Bt)}));return function(Bt){return bi.apply(this,arguments)}}()),Kt.show(),window.markerArea=Kt},Zi=Object(I.useMemo)(function(){Si.current&&(Si.current.style.zIndex=-1);try{var si=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Kt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,bi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;wi=wi.replace(si,"("+te.a.API_SERVER+"/api/attachments/").replace(Kt,'"'+te.a.API_SERVER+"/api/attachments/").replace(bi,'"'+te.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 Bt=X(wi),li=_();if(wi.match(/\[TOC\]/)&&(Bt=Bt.replace("[TOC]
",R()),O()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(nn,mi){var Oi=li[mi],Xn=Oi.type,xn=Oi.expression;return Object(re.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),m(),pe){var $t=document.createElement("div");return $t.innerHTML=Bt,$t.innerText}return setTimeout(function(){return dr()},500),Bt},[wi]),Yi=Object(I.useRef)();w.WebkitLineClamp=De,De&&(zt=Object(F.a)(Object(F.a)({},zt),w));function bn(si){var Kt=si.target;if(Kt.tagName.toUpperCase()==="IMG"){if(gt){var bi=Kt.getAttribute("src");ln(bi),_n("image")}}else if(Kt.tagName.toUpperCase()==="A"){var Bt=Kt.getAttribute("href");if(Bt.indexOf("office")>-1)si.preventDefault(),ln(Bt),_n("office");else if(Bt.indexOf("application/pdf")>-1)si.preventDefault(),ln(Bt),_n("pdf");else if(Bt.indexOf("text/html")>-1)si.preventDefault(),ln(Bt),_n("html");else if(Bt.startsWith("#")){si.preventDefault();var li=document.getElementById(Bt.replace("#",""));li&&li.scrollIntoView(!0)}}}var dr=function(){var Kt,bi=(Kt=Yi.current)===null||Kt===void 0?void 0:Kt.querySelectorAll("video");bi==null||bi.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var li=new Y.a;li.loadSource(Bt.src),li.attachMedia(Bt)}}})};Object(I.useEffect)(function(){if(Yi.current&&Zi&&(Zi.match(gn)&&window.PR.prettyPrint()),Yi.current)return Yi.current.addEventListener("click",bn),function(){Yi.current.removeEventListener("click",bn),m(),O()}},[Zi,Yi.current,bn]);var En=function(Kt){if(!J)return;Kt.target.nodeName==="IMG"?(Si.current.style.zIndex=1,Si.current.style.display="flex",Si.current.style.width=Kt.target.clientWidth+"px",Si.current.style.height=Kt.target.clientHeight+"px",Si.current.style.top=Kt.target.offsetTop+"px",Si.current.style.left=Kt.target.offsetLeft+"px",Qi.current.src=Kt.target.getAttribute("src")):Si.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:Yi,style:Object(F.a)({},zt),className:"".concat(W||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Zi}}),g.a.createElement("div",{ref:Si,className:mn.a.button},g.a.createElement(Z.a,null,g.a.createElement(V.a,{onClick:function(){return Kn()}},"\u88C1\u526A"),g.a.createElement(V.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ce.a,{close:!0,data:zi,type:zi!=null&&zi.length?kn:"",style:Object(F.a)({},Bi),onClose:function(){return ln("")}}))}},"9VGf":function(_t,lt,ne){"use strict";ne.d(lt,"a",function(){return k});var ae=ne("q1tI"),Z=ne.n(ae);function k(V,F){var D=Object(ae.useRef)();Object(ae.useEffect)(function(){D.current=V}),Object(ae.useEffect)(function(){function G(){D.current()}if(F!==null){var j=setInterval(G,F);return function(){return clearInterval(j)}}},[F])}},BU3w:function(_t,lt,ne){"use strict";ne.d(lt,"a",function(){return D});var ae=ne("MNnm"),Z="rc-util-key";function k(G){if(G.attachTo)return G.attachTo;var j=document.querySelector("head");return j||document.body}function V(G){var j,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ae.a)())return null;var I=document.createElement("style");if((j=M.csp)===null||j===void 0?void 0:j.nonce){var g;I.nonce=(g=M.csp)===null||g===void 0?void 0:g.nonce}I.innerHTML=G;var p=k(M),f=p.firstChild;return M.prepend&&p.prepend?p.prepend(I):M.prepend&&f?p.insertBefore(I,f):p.appendChild(I),I}var F=new Map;function D(G,j){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=k(M);if(!F.has(I)){var g=V("",M),p=g.parentNode;F.set(I,p),p.removeChild(g)}var f=Array.from(F.get(I).children).find(function(s){return s.tagName==="STYLE"&&s[Z]===j});if(f){var h,a;if(((h=M.csp)===null||h===void 0?void 0:h.nonce)&&f.nonce!==((a=M.csp)===null||a===void 0?void 0:a.nonce)){var c;f.nonce=(c=M.csp)===null||c===void 0?void 0:c.nonce}return f.innerHTML!==G&&(f.innerHTML=G),f}var o=V(G,M);return o[Z]=j,o}},Bd2K:function(_t,lt,ne){(function(ae){ae(ne("VrN/"),ne("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(M,I,g){if(g!=ae.Init&&g&&M.removeKeyMap("autoCloseTags"),!I)return;var p={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(p["'/'"]=function(f){return D(f)}),(typeof I!="object"||I.whenOpening!==!1)&&(p["'>'"]=function(f){return V(f)}),M.addKeyMap(p)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 V(M){if(M.getOption("disableInput"))return ae.Pass;for(var I=M.listSelections(),g=[],p=M.getOption("autoCloseTags"),f=0;fh.ch&&(l=l.slice(0,l.length-a.end+h.ch));var x=l.toLowerCase();if(!l||a.type=="string"&&(a.end!=h.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&s.close||a.string.indexOf("/")==h.ch-a.start-1||O&&G(O,x)>-1||j(M,c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(o)||[],l,h,!0))return ae.Pass;var R=typeof p=="object"&&p.emptyTags;if(R&&G(R,l)>-1){g[f]={text:"/>",newPos:ae.Pos(h.line,h.ch+2)};continue}var A=w&&G(w,x)>-1;g[f]={indent:A,text:">"+(A?`
`:"")+""+l+">",newPos:A?ae.Pos(h.line+1,0):ae.Pos(h.line,h.ch+1)}}for(var T=typeof p=="object"&&p.dontIndentOnAutoClose,f=I.length-1;f>=0;f--){var E=g[f];M.replaceRange(E.text,I[f].head,I[f].anchor,"+insert");var y=M.listSelections().slice(0);y[f]={head:E.newPos,anchor:E.newPos},M.setSelections(y),!T&&E.indent&&(M.indentLine(E.newPos.line,null,!0),M.indentLine(E.newPos.line+1,null,!0))}}function F(M,I){for(var g=M.listSelections(),p=[],f=I?"/":"",h=M.getOption("autoCloseTags"),a=typeof h=="object"&&h.dontIndentOnSlash,c=0;c"&&(O+=">"),p[c]=O}if(M.replaceSelections(p),g=M.listSelections(),!a)for(var c=0;c=0&&I[o]==g;o--)++c;p=a.to;for(var o=1;o0){for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:"",I=[],g=0;gme.length)&&(he=me.length);for(var de=0,ie=new Array(he);de=me.length?{done:!0}:{done:!1,value:me[ie++]}}}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 de=me[Symbol.iterator](),de.next.bind(de)}function D(me,he){return he={exports:{}},me(he,he.exports),he.exports}var G=D(function(me){function he(){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 de(ie){me.exports.defaults=ie}me.exports={defaults:he(),getDefaults:he,changeDefaults:de}}),j=G.defaults,M=G.getDefaults,I=G.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(he){return a[he]};function o(me,he){if(he){if(g.test(me))return me.replace(p,c)}else if(f.test(me))return me.replace(h,c);return me}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(me){return me.replace(s,function(he,de){return de=de.toLowerCase(),de==="colon"?":":de.charAt(0)==="#"?de.charAt(1)==="x"?String.fromCharCode(parseInt(de.substring(2),16)):String.fromCharCode(+de.substring(1)):""})}var d=/(^|[^\[])\^/g;function O(me,he){me=me.source||me,he=he||"";var de={replace:function(q,se){return se=se.source||se,se=se.replace(d,"$1"),me=me.replace(q,se),de},getRegex:function(){return new RegExp(me,he)}};return de}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(me,he,de){if(me){var ie;try{ie=decodeURIComponent(l(de)).replace(w,"").toLowerCase()}catch(q){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}he&&!x.test(de)&&(de=u(he,de));try{de=encodeURI(de).replace(/%25/g,"%")}catch(q){return null}return de}var A={},T=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(me,he){A[" "+me]||(T.test(me)?A[" "+me]=me+"/":A[" "+me]=P(me,"/",!0)),me=A[" "+me];var de=me.indexOf(":")===-1;return he.substring(0,2)==="//"?de?he:me.replace(E,"$1")+he:he.charAt(0)==="/"?de?he:me.replace(y,"$1")+he:me+he}var _={exec:function(){}};function m(me){for(var he=1,de,ie;he=0&&ge[Le]==="\\";)Ce=!Ce;return Ce?"|":" |"}),ie=de.split(/ \|/),q=0;if(ie.length>he)ie.splice(he);else for(;ie.length=ie.length?q.slice(ie.length):q}).join(`
`)}var ye=function(){function me(de){this.options=de||B}var he=me.prototype;return he.space=function(ie){var q=this.rules.block.newline.exec(ie);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
`}},he.code=function(ie,q){var se=this.rules.block.code.exec(ie);if(se){var ue=q[q.length-1];if(ue&&ue.type==="paragraph")return{raw:se[0],text:se[0].trimRight()};var ge=se[0].replace(/^ {4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:S(ge,`
`)}}},he.fences=function(ie){var q=this.rules.block.fences.exec(ie);if(q){var se=q[0],ue=Te(se,q[3]||"");return{type:"code",raw:se,lang:q[2]?q[2].trim():q[2],text:ue}}},he.heading=function(ie){var q=this.rules.block.heading.exec(ie);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},he.nptable=function(ie){var q=this.rules.block.nptable.exec(ie);if(q){var se={type:"table",header:Y(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
`):[],raw:q[0]};if(se.header.length===se.align.length){var ue=se.align.length,ge;for(ge=0;ge ?/gm,"");return{type:"blockquote",raw:q[0],text:se}}},he.list=function(ie){var q=this.rules.block.list.exec(ie);if(q){for(var se=q[0],ue=q[2],ge=ue.length>1,Ce=ue[ue.length-1]===")",Le={type:"list",raw:se,ordered:ge,start:ge?+ue.slice(0,-1):"",loose:!1,items:[]},ze=q[0].match(this.rules.block.item),pt=!1,ct,Ct,xt,$e,Rt,vt,Nt,It=ze.length,At=0;At1||this.options.smartLists&&xt!==ue)&&($e=ze.slice(At+1).join(`
`),Le.raw=Le.raw.substring(0,Le.raw.length-$e.length),At=It-1)),Rt=pt||/\n\n(?!\s*$)/.test(ct),At!==It-1&&(pt=ct.charAt(ct.length-1)===`
`,Rt||(Rt=pt)),Rt&&(Le.loose=!0),vt=/^\[[ xX]\] /.test(ct),Nt=void 0,vt&&(Nt=ct[1]!==" ",ct=ct.replace(/^\[[ xX]\] +/,"")),Le.items.push({type:"list_item",raw:se,task:vt,checked:Nt,loose:Rt,text:ct});return Le}},he.html=function(ie){var q=this.rules.block.html.exec(ie);if(q)return{type:this.options.sanitize?"paragraph":"html",raw:q[0],pre:!this.options.sanitizer&&(q[1]==="pre"||q[1]==="script"||q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):te(q[0]):q[0]}},he.def=function(ie){var q=this.rules.block.def.exec(ie);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var se=q[1].toLowerCase().replace(/\s+/g," ");return{tag:se,raw:q[0],href:q[2],title:q[3]}}},he.table=function(ie){var q=this.rules.block.table.exec(ie);if(q){var se={type:"table",header:Y(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
`):[]};if(se.header.length===se.align.length){se.raw=q[0];var ue=se.align.length,ge;for(ge=0;ge/i.test(ue[0])&&(q=!1),!se&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?se=!0:se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(se=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:q,inRawBlock:se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):te(ue[0]):ue[0]}},he.link=function(ie){var q=this.rules.inline.link.exec(ie);if(q){var se=re(q[2],"()");if(se>-1){var ue=q[0].indexOf("!")===0?5:4,ge=ue+q[1].length+se;q[2]=q[2].substring(0,se),q[0]=q[0].substring(0,ge).trim(),q[3]=""}var Ce=q[2],Le="";if(this.options.pedantic){var ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);ze?(Ce=ze[1],Le=ze[3]):Le=""}else Le=q[3]?q[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var pt=ce(q,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Le&&Le.replace(this.rules.inline._escapes,"$1")},q[0]);return pt}},he.reflink=function(ie,q){var se;if((se=this.rules.inline.reflink.exec(ie))||(se=this.rules.inline.nolink.exec(ie))){var ue=(se[2]||se[1]).replace(/\s+/g," ");if(ue=q[ue.toLowerCase()],!ue||!ue.href){var ge=se[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Ce=ce(se,ue,se[0]);return Ce}},he.strong=function(ie,q,se){se===void 0&&(se="");var ue=this.rules.inline.strong.start.exec(ie);if(ue&&(!ue[1]||ue[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){q=q.slice(-1*ie.length);var ge=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Ce;(ue=ge.exec(q))!=null;)if(Ce=this.rules.inline.strong.middle.exec(q.slice(0,ue.index+3)),Ce)return{type:"strong",raw:ie.slice(0,Ce[0].length),text:ie.slice(2,Ce[0].length-2)}}},he.em=function(ie,q,se){se===void 0&&(se="");var ue=this.rules.inline.em.start.exec(ie);if(ue&&(!ue[1]||ue[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){q=q.slice(-1*ie.length);var ge=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Ce;(ue=ge.exec(q))!=null;)if(Ce=this.rules.inline.em.middle.exec(q.slice(0,ue.index+2)),Ce)return{type:"em",raw:ie.slice(0,Ce[0].length),text:ie.slice(1,Ce[0].length-1)}}},he.codespan=function(ie){var q=this.rules.inline.code.exec(ie);if(q){var se=q[2].replace(/\n/g," "),ue=/[^ ]/.test(se),ge=se.startsWith(" ")&&se.endsWith(" ");return ue&&ge&&(se=se.substring(1,se.length-1)),se=te(se,!0),{type:"codespan",raw:q[0],text:se}}},he.br=function(ie){var q=this.rules.inline.br.exec(ie);if(q)return{type:"br",raw:q[0]}},he.del=function(ie){var q=this.rules.inline.del.exec(ie);if(q)return{type:"del",raw:q[0],text:q[1]}},he.autolink=function(ie,q){var se=this.rules.inline.autolink.exec(ie);if(se){var ue,ge;return se[2]==="@"?(ue=te(this.options.mangle?q(se[1]):se[1]),ge="mailto:"+ue):(ue=te(se[1]),ge=ue),{type:"link",raw:se[0],text:ue,href:ge,tokens:[{type:"text",raw:ue,text:ue}]}}},he.url=function(ie,q){var se;if(se=this.rules.inline.url.exec(ie)){var ue,ge;if(se[2]==="@")ue=te(this.options.mangle?q(se[0]):se[0]),ge="mailto:"+ue;else{var Ce;do Ce=se[0],se[0]=this.rules.inline._backpedal.exec(se[0])[0];while(Ce!==se[0]);ue=te(se[0]),se[1]==="www."?ge="http://"+ue:ge=ue}return{type:"link",raw:se[0],text:ue,href:ge,tokens:[{type:"text",raw:ue,text:ue}]}}},he.inlineText=function(ie,q,se){var ue=this.rules.inline.text.exec(ie);if(ue){var ge;return q?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):te(ue[0]):ue[0]:ge=te(this.options.smartypants?se(ue[0]):ue[0]),{type:"text",raw:ue[0],text:ge}}},me}(),be=X.noopTest,we=X.edit,xe=X.merge,ve={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]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=we(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=we(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=we(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=//,ve.html=we(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=we(ve._paragraph).replace("hr",ve.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",ve._tag).getRegex(),ve.blockquote=we(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=xe({},ve),ve.gfm=xe({},ve.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*|$)"}),ve.gfm.nptable=we(ve.gfm.nptable).replace("hr",ve.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",ve._tag).getRegex(),ve.gfm.table=we(ve.gfm.table).replace("hr",ve.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",ve._tag).getRegex(),ve.pedantic=xe({},ve.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._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(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var oe={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]*?(?:(?=[\\?@\\[\\]`^{|}~",oe.punctuation=we(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",oe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",oe.em.start=we(oe.em.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.middle=we(oe.em.middle).replace(/punctuation/g,oe._punctuation).replace(/overlapSkip/g,oe._overlapSkip).getRegex(),oe.em.endAst=we(oe.em.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.endUnd=we(oe.em.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.start=we(oe.strong.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.middle=we(oe.strong.middle).replace(/punctuation/g,oe._punctuation).replace(/blockSkip/g,oe._blockSkip).getRegex(),oe.strong.endAst=we(oe.strong.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.endUnd=we(oe.strong.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=we(oe._blockSkip,"g").getRegex(),oe.overlapSkip=we(oe._overlapSkip,"g").getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=we(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=we(oe.tag).replace("comment",ve._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=we(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=we(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=we(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=xe({},oe),oe.pedantic=xe({},oe.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",oe._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=xe({},oe.normal,{escape:we(oe.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&&(ie="x"+ie.toString(16)),he+=""+ie+";";return he}var Me=function(){function me(de){this.tokens=[],this.tokens.links=Object.create(null),this.options=de||Ye,this.options.tokenizer=this.options.tokenizer||new ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:Ue.normal,inline:rt.normal};this.options.pedantic?(ie.block=Ue.pedantic,ie.inline=rt.pedantic):this.options.gfm&&(ie.block=Ue.gfm,this.options.breaks?ie.inline=rt.breaks:ie.inline=rt.gfm),this.tokenizer.rules=ie}me.lex=function(ie,q){var se=new me(q);return se.lex(ie)};var he=me.prototype;return he.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},he.blockTokens=function(ie,q,se){q===void 0&&(q=[]),se===void 0&&(se=!0),ie=ie.replace(/^ +$/gm,"");for(var ue,ge,Ce,Le;ie;){if(ue=this.tokenizer.space(ie)){ie=ie.substring(ue.raw.length),ue.type&&q.push(ue);continue}if(ue=this.tokenizer.code(ie,q)){ie=ie.substring(ue.raw.length),ue.type?q.push(ue):(Le=q[q.length-1],Le.raw+=`
`+ue.raw,Le.text+=`
`+ue.text);continue}if(ue=this.tokenizer.fences(ie)){ie=ie.substring(ue.raw.length),q.push(ue);continue}if(ue=this.tokenizer.heading(ie)){ie=ie.substring(ue.raw.length),q.push(ue);continue}if(ue=this.tokenizer.nptable(ie)){ie=ie.substring(ue.raw.length),q.push(ue);continue}if(ue=this.tokenizer.hr(ie)){ie=ie.substring(ue.raw.length),q.push(ue);continue}if(ue=this.tokenizer.blockquote(ie)){ie=ie.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],se),q.push(ue);continue}if(ue=this.tokenizer.list(ie)){for(ie=ie.substring(ue.raw.length),Ce=ue.items.length,ge=0;ge0)for(;(ze=this.tokenizer.rules.inline.reflinkSearch.exec(Le))!=null;)pt.includes(ze[0].slice(ze[0].lastIndexOf("[")+1,-1))&&(Le=Le.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ze=this.tokenizer.rules.inline.blockSkip.exec(Le))!=null;)Le=Le.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Ce=this.tokenizer.escape(ie)){ie=ie.substring(Ce.raw.length),q.push(Ce);continue}if(Ce=this.tokenizer.tag(ie,se,ue)){ie=ie.substring(Ce.raw.length),se=Ce.inLink,ue=Ce.inRawBlock,q.push(Ce);continue}if(Ce=this.tokenizer.link(ie)){ie=ie.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,ue)),q.push(Ce);continue}if(Ce=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,ue)),q.push(Ce);continue}if(Ce=this.tokenizer.strong(ie,Le,ge)){ie=ie.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],se,ue),q.push(Ce);continue}if(Ce=this.tokenizer.em(ie,Le,ge)){ie=ie.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],se,ue),q.push(Ce);continue}if(Ce=this.tokenizer.codespan(ie)){ie=ie.substring(Ce.raw.length),q.push(Ce);continue}if(Ce=this.tokenizer.br(ie)){ie=ie.substring(Ce.raw.length),q.push(Ce);continue}if(Ce=this.tokenizer.del(ie)){ie=ie.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],se,ue),q.push(Ce);continue}if(Ce=this.tokenizer.autolink(ie,Oe)){ie=ie.substring(Ce.raw.length),q.push(Ce);continue}if(!se&&(Ce=this.tokenizer.url(ie,Oe))){ie=ie.substring(Ce.raw.length),q.push(Ce);continue}if(Ce=this.tokenizer.inlineText(ie,ue,ot)){ie=ie.substring(Ce.raw.length),ge=Ce.raw.slice(-1),q.push(Ce);continue}if(ie){var ct="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(ct);break}else throw new Error(ct)}}return q},Z(me,null,[{key:"rules",get:function(){return{block:Ue,inline:rt}}}]),me}(),We=G.defaults,qe=X.cleanUrl,Ve=X.escape,je=function(){function me(de){this.options=de||We}var he=me.prototype;return he.code=function(ie,q,se){var ue=(q||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(ie,ue);ge!=null&&ge!==ie&&(se=!0,ie=ge)}return ue?''+(se?ie:Ve(ie,!0))+`
`:""+(se?ie:Ve(ie,!0))+`
`},he.blockquote=function(ie){return`
`+ie+`
`},he.html=function(ie){return ie},he.heading=function(ie,q,se,ue){return this.options.headerIds?"
`:""+ie+"
`},he.hr=function(){return this.options.xhtml?`
`:`
`},he.list=function(ie,q,se){var ue=q?"ol":"ul",ge=q&&se!==1?' start="'+se+'"':"";return"<"+ue+ge+`>
`+ie+""+ue+`>
`},he.listitem=function(ie){return""+ie+`
`},he.checkbox=function(ie){return" "},he.paragraph=function(ie){return""+ie+`
`},he.table=function(ie,q){return q&&(q=""+q+""),`
`},he.tablerow=function(ie){return`
`+ie+`
`},he.tablecell=function(ie,q){var se=q.header?"th":"td",ue=q.align?"<"+se+' align="'+q.align+'">':"<"+se+">";return ue+ie+""+se+`>
`},he.strong=function(ie){return""+ie+""},he.em=function(ie){return""+ie+""},he.codespan=function(ie){return""+ie+""},he.br=function(){return this.options.xhtml?"
":"
"},he.del=function(ie){return""+ie+""},he.link=function(ie,q,se){if(ie=qe(this.options.sanitize,this.options.baseUrl,ie),ie===null)return se;var ue='"+se+"",ue},he.image=function(ie,q,se){if(ie=qe(this.options.sanitize,this.options.baseUrl,ie),ie===null)return se;var ue='
":">",ue},he.text=function(ie){return ie},me}(),Fe=function(){function me(){}var he=me.prototype;return he.strong=function(ie){return ie},he.em=function(ie){return ie},he.codespan=function(ie){return ie},he.del=function(ie){return ie},he.html=function(ie){return ie},he.text=function(ie){return ie},he.link=function(ie,q,se){return""+se},he.image=function(ie,q,se){return""+se},he.br=function(){return""},me}(),ht=function(){function me(){this.seen={}}var he=me.prototype;return he.slug=function(ie){var q=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(q)){var se=q;do this.seen[se]++,q=se+"-"+this.seen[se];while(this.seen.hasOwnProperty(q))}return this.seen[q]=0,q},me}(),He=G.defaults,Pe=X.unescape,Xe=function(){function me(de){this.options=de||He,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fe,this.slugger=new ht}me.parse=function(ie,q){var se=new me(q);return se.parse(ie)};var he=me.prototype;return he.parse=function(ie,q){q===void 0&&(q=!0);var se="",ue,ge,Ce,Le,ze,pt,ct,Ct,xt,$e,Rt,vt,Nt,It,At,di,ri,Qe,bt=ie.length;for(ue=0;ue0&&At.tokens[0].type==="text"?(At.tokens[0].text=Qe+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=Qe+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:Qe}):It+=Qe),It+=this.parse(At.tokens,Nt),xt+=this.renderer.listitem(It,ri,di);se+=this.renderer.list(xt,Rt,vt);continue}case"html":{se+=this.renderer.html($e.text);continue}case"paragraph":{se+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(xt=$e.tokens?this.parseInline($e.tokens):$e.text;ue+1An error occurred:
"+et(Ce.message+"",!0)+"
";throw Ce}}Se.options=Se.setOptions=function(me){return tt(Se.defaults,me),nt(Se.defaults),Se},Se.getDefaults=Ae,Se.defaults=Je,Se.use=function(me){var he=tt({},me);if(me.renderer&&function(){var ie=Se.defaults.renderer||new je,q=function(ge){var Ce=ie[ge];ie[ge]=function(){for(var Le=arguments.length,ze=new Array(Le),pt=0;pt`,triples:"",explode:"[]{}"},k=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(a,c,o){o&&o!=ae.Init&&(a.removeKeyMap(F),a.state.closeBrackets=null),c&&(D(V(c,"pairs")),a.state.closeBrackets=c,a.addKeyMap(F))});function V(a,c){return c=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[c]!=null?a[c]:Z[c]}var F={Backspace:M,Enter:I};function D(a){for(var c=0;c=0;l--){var O=s[l].head;a.replaceRange("",k(O.line,O.ch-1),k(O.line,O.ch+1),"+delete")}}function I(a){var c=j(a),o=c&&V(c,"explode");if(!o||a.getOption("disableInput"))return ae.Pass;for(var s=a.listSelections(),l=0;l0;return{anchor:new k(a.anchor.line,a.anchor.ch+(c?-1:1)),head:new k(a.head.line,a.head.ch+(c?1:-1))}}function p(a,c){var o=j(a);if(!o||a.getOption("disableInput"))return ae.Pass;var s=V(o,"pairs"),l=s.indexOf(c);if(l==-1)return ae.Pass;for(var d=V(o,"closeBefore"),O=V(o,"triples"),w=s.charAt(l+1)==c,x=a.listSelections(),R=l%2==0,A,T=0;T=0&&a.getRange(y,k(y.line,y.ch+3))==c+c+c?u="skipThree":u="skip";else if(w&&y.ch>1&&O.indexOf(c)>=0&&a.getRange(k(y.line,y.ch-2),y)==c+c){if(y.ch>2&&/\bstring/.test(a.getTokenTypeAt(k(y.line,y.ch-2))))return ae.Pass;u="addFour"}else if(w){var m=y.ch==0?" ":a.getRange(k(y.line,y.ch-1),y);if(!ae.isWordChar(_)&&m!=c&&!ae.isWordChar(m))u="both";else return ae.Pass}else if(R&&(_.length===0||/\s/.test(_)||d.indexOf(_)>-1))u="both";else return ae.Pass;if(!A)A=u;else if(A!=u)return ae.Pass}var b=l%2?s.charAt(l-1):c,P=l%2?c:s.charAt(l+1);a.operation(function(){if(A=="skip")a.execCommand("goCharRight");else if(A=="skipThree")for(var N=0;N<3;N++)a.execCommand("goCharRight");else if(A=="surround"){for(var K=a.getSelections(),N=0;N10)},[me==null?void 0:me.replies_count]);var ei=function(){var ft=Object(ae.a)(V.a.mark(function ut(){var ti,Wt,Ut;return V.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return ti=di+1,ri(ti),Vt.next=4,Object(l.h)({id:de.memoId,page:ti});case 4:Wt=Vt.sent,Wt!=null&&Wt.memo_replies&&(nt({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Ke.forumsDetailData),{},{memo_replies:[].concat(Object(te.a)(he),Object(te.a)(Wt.memo_replies))})}),Nt(((Ut=Wt.memo_replies)===null||Ut===void 0?void 0:Ut.length)===10));case 6:case"end":return Vt.stop()}},ut)}));return function(){return ft.apply(this,arguments)}}(),Gi=function(ut){var ti,Wt,Ut,Dt;return Object(a.a)(Object(a.a)({},ut),{},{image_url:(ti=tt.userInfo)===null||ti===void 0?void 0:ti.image_url,children:[],user_id:(Wt=tt.userInfo)===null||Wt===void 0?void 0:Wt.user_id,user_login:(Ut=tt.userInfo)===null||Ut===void 0?void 0:Ut.login,username:(Dt=tt.userInfo)===null||Dt===void 0?void 0:Dt.username,time:"".concat(Object(ve.bb)((new Date().getTime()-new Date(ut.created_at).getTime())/1e3),"\u524D")})},Xi=function(){Mt(!0)};return D.a.createElement("section",{className:be.a.wrap},!!(he!=null&&he.length)&&D.a.createElement("aside",{className:be.a.content},D.a.createElement("div",{style:{padding:"10px 15px 5px 15px",justifyContent:"space-between",display:"flex"}},D.a.createElement("span",null,"\u5168\u90E8\u56DE\u590D\uFF08",me.replies_count,"\uFF09")),D.a.createElement("aside",{className:be.a.replyList},he==null?void 0:he.map(function(ft,ut){var ti;return D.a.createElement(I.a,{gutter:[12,12],key:ut},D.a.createElement(p.a,{flex:"40px"},D.a.createElement("a",{href:"/users/".concat(ft.user_login),target:"_blank"},D.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",width:"50",height:"50",src:"".concat(c.a.IMG_SERVER,"/images/").concat(ft==null?void 0:ft.image_url)}))),D.a.createElement(p.a,{flex:"1"},D.a.createElement(I.a,{align:"middle"},D.a.createElement(p.a,{span:24},D.a.createElement("a",{href:"/users/".concat(ft.user_login),target:"_blank"},D.a.createElement("span",{className:"c-light-black"},ft==null?void 0:ft.username)),D.a.createElement("span",{className:"c-light-black ml10"},ft.time)),D.a.createElement(p.a,{span:24},D.a.createElement("div",{onClick:Je},D.a.createElement(Y.a,{value:ft.content}))),!!(ft!=null&&(ti=ft.children)!==null&&ti!==void 0&&ti.length)&&D.a.createElement(xe,{user:tt,id:ft==null?void 0:ft.id,vlist:ft==null?void 0:ft.children,dispatch:nt,params:de,memo_replies:he,forumsDetail:Ke}),D.a.createElement(p.a,{span:24,className:"mt5 c-light-black"},Ct===ut?D.a.createElement("aside",null,D.a.createElement(ce.a,{onChange:function(Ut){ze(Ut)},height:150,isFocus:!0,placeholder:"\u6211\u8981\u56DE\u590D..."}),D.a.createElement(I.a,null,D.a.createElement(p.a,{span:24,className:"tr"},D.a.createElement(h.a,{type:"primary",size:"large",onClick:Object(ae.a)(V.a.mark(function Wt(){var Ut;return V.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(!(Le==="")){Vt.next=4;break}K.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Vt.next=9;break;case 4:return Vt.next=6,Object(l.k)({parent_id:ft.id,content:Le});case 6:Ut=Vt.sent,ze(null),Ut&&(xt(-1),he.find(function(Ti){return Ti.id===Ut.parent_id}).children.push(Gi(Ut)),nt({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Ke.forumsDetailData),{},{memo:Object(a.a)(Object(a.a)({},me),{},{replies_count:me.replies_count+1}),memo_replies:Object(te.a)(he)})}));case 9:case"end":return Vt.stop()}},Wt)}))},"\u53D1\u9001")))):D.a.createElement("div",{className:"tr"},D.a.createElement("span",{className:"iconfont icon-huifu1 mr15 ml30 current",onClick:function(){return xt(ut)}}),D.a.createElement(A.a,{title:ft.user_praise?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},D.a.createElement("span",{className:ft.user_praise?"c-orange":"c-gery-888"},D.a.createElement("i",{className:"iconfont icon-dianzan mr3 current",onClick:Object(ae.a)(V.a.mark(function Wt(){var Ut;return V.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Vt.next=2,Object(l.i)({id:ft.id,container_type:"Memo",type:ft.user_praise?0:1});case 2:Ut=Vt.sent,(Ut==null?void 0:Ut.praise_count)>=0&&(he.find(function(Ti){return Ti.id===ft.id}).user_praise=!ft.user_praise,he.find(function(Ti){return Ti.id===ft.id}).praise_count=Ut==null?void 0:Ut.praise_count,nt({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Ke.forumsDetailData),{},{memo_replies:Object(te.a)(he)})}));case 4:case"end":return Vt.stop()}},Wt)}))}),ft.praise_count>0?ft.praise_count:"")))))))}))),vt&&D.a.createElement("aside",{className:"bg-white pb20",style:{display:"flex",justifyContent:"center"}},D.a.createElement(I.a,{justify:"space-between"},D.a.createElement(p.a,null),D.a.createElement(p.a,null,vt&&D.a.createElement("a",{className:"c-black",onClick:ei},"\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))),D.a.createElement("aside",{className:be.a.reply},D.a.createElement(ce.a,{onBlur:function(){return Mt(!1)},isFocus:kt,defaultValue:se,id:"writeForumsReviewId",onChange:function(ut){ue(ut)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),D.a.createElement(I.a,null,D.a.createElement(p.a,{flex:"1"}),D.a.createElement(p.a,null,D.a.createElement(h.a,{type:"primary",size:"large",onClick:Object(ae.a)(V.a.mark(function ft(){var ut;return V.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(se==="")){Wt.next=4;break}K.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Wt.next=9;break;case 4:return Wt.next=6,Object(l.k)({parent_id:me.id,content:se});case 6:ut=Wt.sent,ue(null),ut&&nt({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Ke.forumsDetailData),{},{memo:Object(a.a)(Object(a.a)({},me),{},{replies_count:me.replies_count+1}),memo_replies:[Gi(ut)].concat(Object(te.a)(he))})});case 9:case"end":return Wt.stop()}},ft)}))},"\u53D1\u9001")))))},Re=Object(j.a)(function(He){var Pe=He.user,Xe=He.forumsDetail,tt=He.loading,Ke=He.globalSetting;return{user:Pe,forumsDetail:Xe,globalSetting:Ke,loading:tt.models.forumsDetail}},null,null,{forwardRef:!0})(Object(F.forwardRef)(oe)),Ye=ne("smFo"),Ue=ne.n(Ye),rt=ne("RCxd"),ot=ne("kaH+"),Oe=ne("dhSg"),Me={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},We=function(Pe){var Xe,tt,Ke,et,Ae,nt=Pe.user,Je=Pe.forumsDetail,Se=Pe.globalSetting,ke=Pe.loading,me=Pe.dispatch,he=Object(Z.a)(Pe,["user","forumsDetail","globalSetting","loading","dispatch"]),de=Je.forumsDetailData||{},ie=de.author_info,q=de.memo,se=de.attachments_list,ue=Object(F.useRef)(),ge=Object(F.useRef)(),Ce=function(){var $e=Object(ae.a)(V.a.mark(function Rt(){var vt,Nt;return V.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return vt={id:q.id,sticky:q.sticky?0:1},At.next=3,Object(l.m)(vt);case 3:Nt=At.sent,(Nt==null?void 0:Nt.status)===0&&me({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Je.forumsDetailData),{},{memo:Object(a.a)(Object(a.a)({},q),{},{sticky:!(q!=null&&q.sticky)})})});case 5:case"end":return At.stop()}},Rt)}));return function(){return $e.apply(this,arguments)}}(),Le=function(){var $e=Object(ae.a)(V.a.mark(function Rt(){var vt;return V.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(l.b)({id:q==null?void 0:q.id});case 2:vt=It.sent,(vt==null?void 0:vt.status)===0&&(K.b.success("\u5220\u9664\u6210\u529F"),j.d.push("/forums")),(vt==null?void 0:vt.status)===-1&&j.d.push("/forums");case 5:case"end":return It.stop()}},Rt)}));return function(){return $e.apply(this,arguments)}}(),ze=function(){var $e=Object(ae.a)(V.a.mark(function Rt(){return V.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:P.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5956\u52B1\u8BBE\u7F6E",content:D.a.createElement("div",{className:"font14 tc"},D.a.createElement(m.a,{defaultValue:ue.current,onChange:function(At){return ue.current=At.target.value}})),onOk:function(){var It=Object(ae.a)(V.a.mark(function di(){var ri;return V.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(l.l)({id:q==null?void 0:q.id,container_type:"Memo",score:ue.current?Number(ue.current):0,user_id:ie==null?void 0:ie.user_id});case 2:if(ri=bt.sent,ue.current=null,!((ri==null?void 0:ri.code)>0)){bt.next=8;break}return me({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Je.forumsDetailData),{},{memo:Object(a.a)(Object(a.a)({},q),{},{reward:ri==null?void 0:ri.code})})}),K.b.success("\u5956\u52B1\u6210\u529F"),bt.abrupt("return");case 8:K.b.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01");case 9:case"end":return bt.stop()}},di)}));function At(){return It.apply(this,arguments)}return At}()});case 1:case"end":return Nt.stop()}},Rt)}));return function(){return $e.apply(this,arguments)}}(),pt=function(){ge.current.onMdFouch&&ge.current.onMdFouch()},ct=function(){var $e=Object(ae.a)(V.a.mark(function Rt(){var vt;return V.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(l.i)({id:q.id,container_type:"Memo",type:1});case 2:vt=It.sent,(vt==null?void 0:vt.praise_count)>=0&&me({type:"forumsDetail/setForumsDetailData",payload:Object(a.a)(Object(a.a)({},Je.forumsDetailData),{},{memo:Object(a.a)(Object(a.a)({},q),{},{user_praise:!(q!=null&&q.user_praise),memo_praise_count:vt==null?void 0:vt.praise_count})})});case 4:case"end":return It.stop()}},Rt)}));return function(){return $e.apply(this,arguments)}}(),Ct=D.a.createElement(u.a,{className:Ue.a.menu},((Xe=nt.userInfo)===null||Xe===void 0?void 0:Xe.admin)&&(q==null?void 0:q.sticky)&&D.a.createElement(u.a.Item,null,D.a.createElement("a",{onClick:function(){return Ce()}},"\u53D6\u6D88\u7F6E\u9876")),((tt=nt.userInfo)===null||tt===void 0?void 0:tt.admin)&&!(q!=null&&q.sticky)&&D.a.createElement(u.a.Item,null,D.a.createElement("a",{onClick:function(){return Ce()}},"\u7F6E\xA0\xA0\u9876")),D.a.createElement(u.a.Item,null,D.a.createElement(X.a,{to:"/forums/".concat(q==null?void 0:q.id,"/edit")},"\u7F16\xA0\xA0\u8F91")),D.a.createElement(u.a.Item,null,D.a.createElement("a",{onClick:function(){P.a.confirm({title:"\u63D0\u793A",icon:D.a.createElement(rt.a,null),content:"\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",okText:"\u786E\u8BA4",onOk:function(){Le()},cancelText:"\u53D6\u6D88"})}},"\u5220\xA0\xA0\u9664"))),xt=function(Rt){var vt=Rt.target,Nt=vt.nodeName,It=vt.src;Nt==="IMG"&&(Oe.a.publish("preview-image",It),console.log("src:",It))};return Object(F.useEffect)(function(){},[]),D.a.createElement("section",{className:Ue.a.wrap},D.a.createElement(E.a,{separator:"/",className:"mb5"},D.a.createElement(E.a.Item,null,D.a.createElement(X.a,{to:"/forums/categories/".concat(q==null?void 0:q.forum_id)},Me[q==null?void 0:q.forum_id])),D.a.createElement(E.a.Item,null,"\u8BE6\u60C5")),D.a.createElement("header",{className:"bg-white pt40 pb40 pl30 pr30 ".concat(Ue.a.header)},D.a.createElement(I.a,{align:"middle"},D.a.createElement(p.a,{flex:1,className:"font24 mb5"},D.a.createElement("span",{className:Ue.a.title},q==null?void 0:q.subject),(q==null?void 0:q.sticky)&&D.a.createElement("span",{className:Ue.a.top},"\u7F6E\u9876"),!!(q!=null&&q.reward)&&D.a.createElement(A.a,{placement:"bottom",title:"\u83B7\u5F97\u5E73\u53F0\u5956\u52B1\u91D1\u5E01\uFF1A".concat(q==null?void 0:q.reward)},D.a.createElement("span",{className:"ml10 c-orange-ff7"},D.a.createElement("i",{className:"iconfont icon-gift font16 mr5"}),D.a.createElement("span",{className:"font14"},q==null?void 0:q.reward)))),D.a.createElement(p.a,null,(((Ke=nt.userInfo)===null||Ke===void 0?void 0:Ke.admin)||((et=nt.userInfo)===null||et===void 0?void 0:et.user_id)===(ie==null?void 0:ie.user_id))&&D.a.createElement(x.a,{overlay:Ct},D.a.createElement("i",{className:"fa fa-bars font-16 current c-grey-bcb"})))),D.a.createElement(I.a,{align:"middle",className:"font14"},D.a.createElement(p.a,{flex:1,className:"c-grey-999"},D.a.createElement("span",null,S()(q==null?void 0:q.time).fromNow()," \u53D1\u5E03")),D.a.createElement(p.a,{className:"c-grey-999"},((Ae=nt.userInfo)===null||Ae===void 0?void 0:Ae.admin)&&D.a.createElement(A.a,{placement:"bottom",title:"\u5E16\u5B50\u5956\u52B1"},D.a.createElement("span",{className:"current pr10 ".concat(Ue.a.line),onClick:ze},D.a.createElement("i",{className:"iconfont icon-jiangli font18 mr5"}))),D.a.createElement("span",{className:"pr10 pl10 ".concat(q!=null&&q.replies_count?Ue.a.line:"")},D.a.createElement("i",{className:"iconfont icon-liulanyan font18 mr5"}),q==null?void 0:q.viewed_count),!!(q!=null&&q.replies_count)&&D.a.createElement(A.a,{placement:"bottom",title:"\u5199\u8BC4\u8BBA"},D.a.createElement("span",{className:"current pl10",onClick:pt},D.a.createElement("i",{className:"iconfont icon-huifu1 font18 mr5"}),q==null?void 0:q.replies_count))))),D.a.createElement("main",{className:"bg-white pt40 pb40 pl40 pr40"},D.a.createElement("div",{onClick:xt},D.a.createElement(Y.a,{value:q==null?void 0:q.content})),D.a.createElement("div",{className:"bg-white pl40 pr40 mt40"},D.a.createElement("div",{className:"mt10 mb20 ".concat(Ue.a.flexCenter)},D.a.createElement("div",{className:"".concat(Ue.a.like," ").concat(q!=null&&q.user_praise?"":Ue.a.canLike),onClick:ct},D.a.createElement("i",{className:"iconfont icon-dianzan font18"}),D.a.createElement("br",null),D.a.createElement("span",null,q==null?void 0:q.memo_praise_count)))),!!(se!=null&&se.length)&&D.a.createElement("div",{className:"mt40"},se==null?void 0:se.map(function($e){return D.a.createElement("div",{className:"c-grey-888 ".concat(Ue.a.flexCenter)},D.a.createElement("i",{className:"iconfont icon-fujian mr10 font14 c-green-29b"}),D.a.createElement("a",{href:$e==null?void 0:$e.url,title:$e==null?void 0:$e.title,className:"".concat(Ue.a.attachmentName," mr10")},$e==null?void 0:$e.title),D.a.createElement("span",{className:"font12 c-grey-666 mt3"},$e==null?void 0:$e.filesize))}))),D.a.createElement(Re,{ref:ge,handleClick:xt}),D.a.createElement(ot.a,null))},qe=Object(j.a)(function(He){var Pe=He.user,Xe=He.forumsDetail,tt=He.loading,Ke=He.globalSetting;return{user:Pe,forumsDetail:Xe,globalSetting:Ke,loading:tt.effects}})(We),Ve=ne("G8my"),je=ne.n(Ve),Fe=function(Pe){var Xe=Pe.forumsDetail,tt=Pe.globalSetting,Ke=Pe.loading,et=Pe.dispatch,Ae=Object(Z.a)(Pe,["forumsDetail","globalSetting","loading","dispatch"]),nt=Object(G.i)();Object(F.useEffect)(function(){Je()},[nt.memoId]);var Je=function(){var Se=Object(ae.a)(V.a.mark(function ke(){return V.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:et({type:"forumsDetail/getForumsDetailData",payload:{id:nt.memoId}});case 1:case"end":return he.stop()}},ke)}));return function(){return Se.apply(this,arguments)}}();return D.a.createElement("section",{className:"edu-container mb20 mt30 ".concat(je.a.flex)},D.a.createElement(qe,null),D.a.createElement(O,null))},ht=lt.default=Object(j.a)(function(He){var Pe=He.forumsDetail,Xe=He.loading,tt=He.globalSetting;return{forumsDetail:Pe,globalSetting:tt,loading:Xe.models.forumsDetail}})(Fe)},LO5M:function(_t,lt,ne){_t.exports={wrap:"wrap___1d4rP",head:"head___1_Uzf",recommendItem:"recommendItem___IStR9",buttonWrap:"buttonWrap___3dpFm",privateMessage:"privateMessage___24GfS",flex1:"flex1___3wIqQ",mWidth147:"mWidth147___3ODny"}},LdHM:function(_t,lt,ne){"use strict";ne.d(lt,"b",function(){return d}),ne.d(lt,"a",function(){return w});var ae=ne("1OyB"),Z=ne("vuIU"),k=ne("Ji7U"),V=ne("LK+K"),F=ne("q1tI"),D=ne("rePB"),G=ne("Ff2n"),j=ne("ODXe"),M=ne("4IlW"),I=ne("bX4T"),g=ne("YrtM"),p=ne("TSYQ"),f=ne.n(p),h=ne("+nKL"),a=ne("8OUc"),c=function(Y,te){var re=Y.prefixCls,ce=Y.id,Te=Y.flattenOptions,ye=Y.childrenAsData,be=Y.values,we=Y.searchValue,xe=Y.multiple,ve=Y.defaultActiveFirstOption,oe=Y.height,Re=Y.itemHeight,Ye=Y.notFoundContent,Ue=Y.open,rt=Y.menuItemSelectedIcon,ot=Y.virtual,Oe=Y.onSelect,Me=Y.onToggleOpen,We=Y.onActiveValue,qe=Y.onScroll,Ve=Y.onMouseEnter,je="".concat(re,"-item"),Fe=Object(g.a)(function(){return Te},[Ue,Te],function(ke,me){return me[0]&&ke[1]!==me[1]}),ht=F.useRef(null),He=function(me){me.preventDefault()},Pe=function(me){ht.current&&ht.current.scrollTo({index:me})},Xe=function(me){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,de=Fe.length,ie=0;ie1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(S).map(function(te,re){if(!F.isValidElement(te)||!te.type)return null;var ce=te.type.isSelectOptGroup,Te=te.key,ye=te.props,be=ye.children,we=Object(G.a)(ye,["children"]);return Y||!ce?A(te):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Te===null?re:Te,"__"),label:Te},we),{},{options:T(be)})}).filter(function(te){return te})}var E=ne("2Qr1"),y=ne("qNPg"),u=ne("U8pU"),_=ne("Kwbf"),m=ne("WKfj");function b(S){var Y=S.mode,te=S.options,re=S.children,ce=S.backfill,Te=S.allowClear,ye=S.placeholder,be=S.getInputElement,we=S.showSearch,xe=S.onSearch,ve=S.defaultOpen,oe=S.autoFocus,Re=S.labelInValue,Ye=S.value,Ue=S.inputValue,rt=S.optionLabelProp,ot=Y==="multiple"||Y==="tags",Oe=we!==void 0?we:ot||Y==="combobox",Me=te||T(re);if(Object(_.a)(Y!=="tags"||Me.every(function(je){return!je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var We=Me.some(function(je){return je.options?je.options.some(function(Fe){return typeof("value"in Fe?Fe.value:Fe.key)=="number"}):typeof("value"in je?je.value:je.key)=="number"});Object(_.a)(!We,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(Y!=="combobox"||!rt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(Y==="combobox"||!ce,"`backfill` only works with `combobox` mode."),Object(_.a)(Y==="combobox"||!be,"`getInputElement` only work with `combobox` mode."),Object(_.b)(Y!=="combobox"||!be||!Te||!ye,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xe&&!Oe&&Y!=="combobox"&&Y!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ve||oe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var qe=Object(m.d)(Ye);Object(_.a)(!Re||qe.every(function(je){return Object(u.a)(je)==="object"&&("key"in je||"value"in je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!ot||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var Ve=null;Object(R.a)(re).some(function(je){if(!F.isValidElement(je)||!je.type)return!1;var Fe=je.type;if(Fe.isSelectOption)return!1;if(Fe.isSelectOptGroup){var ht=Object(R.a)(je.props.children).every(function(He){return!F.isValidElement(He)||!je.type||He.type.isSelectOption?!0:(Ve=He.type,!1)});return!ht}return Ve=Fe,!0}),Ve&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ve.displayName||Ve.name||Ve,"`.")),Object(_.a)(Ue===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=b,N=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:P,fillOptionsWithMissingValue:E.a}),K=function(S){Object(k.a)(te,S);var Y=Object(V.a)(te);function te(){var re;return Object(ae.a)(this,te),re=Y.apply(this,arguments),re.selectRef=F.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(Z.a)(te,[{key:"render",value:function(){return F.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),te}(F.Component);K.Option=d,K.OptGroup=w;var X=K,B=lt.c=X},M8RZ:function(_t,lt,ne){"use strict";ne.d(lt,"a",function(){return M});var ae=ne("fWQN"),Z=ne("mtLc"),k=ne("yKVA"),V=ne("879j"),F=ne("q1tI"),D=ne.n(F),G=ne("i8i4"),j=ne.n(G),M=function(I){Object(k.a)(p,I);var g=Object(V.a)(p);function p(f){var h;Object(ae.a)(this,p),h=g.call(this,f);var a=window.document;return h.node=a.createElement("div"),a.body.appendChild(h.node),h}return Object(Z.a)(p,[{key:"render",value:function(){var h=this.props.children;return Object(G.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(D.a.Component)},Ot1p:function(_t,lt,ne){"use strict";var ae=ne("2qtc"),Z=ne("kLXV"),k=ne("rAM+"),V=ne("miYZ"),F=ne("tsqr"),D=ne("9og8"),G=ne("tJVT"),j=ne("jrin"),M=ne("WmNS"),I=ne.n(M),g=ne("q1tI"),p=ne.n(g),f=ne("VrN/"),h=ne.n(f),a=ne("bdgK"),c=ne("p77/"),o=ne("Bd2K"),s=ne("ELLl"),l=ne("19Vz"),d=ne("lZu9"),O=ne("+NIl"),w=ne("kSUc"),x=ne("9Bee"),R=function(ge){var Ce=ge.value,Le=Ce===void 0?"":Ce,ze=ge.className,pt=ge.showTextOnly,ct=ge.showLines,Ct=ge.style,xt=Ct===void 0?{}:Ct,$e=Object(g.useMemo)(function(){return""},[Le]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:$e}}))},A=ne("0Owb"),T=ne("dejd"),E=ne("C+DQ"),y=ne("1vsH"),u=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 m(ge){var Ce=ge.onActionCallback,Le=ge.title,ze=ge.icon,pt=ge.actionName,ct=ge.className,Ct=ct===void 0?"":ct,xt=ge.children;function $e(){Ce(pt)}return p.a.createElement("a",{title:Le,className:Ct,onClick:$e},p.a.createElement("i",{className:"md-iconfont ".concat(ze)}),xt)}var b=function(ge){var Ce=ge.watch,Le=ge.showNullButton,ze=ge.onActionCallback,pt=ge.fullScreen,ct=ge.insertTemp,Ct=ge.hidetoolBar,xt=ge.uuid,$e=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(xt,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var Rt=[].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 p.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&Rt.map(function(vt,Nt){return p.a.createElement("li",{key:Nt},vt.actionName?p.a.createElement(m,Object(A.a)({},vt,{onActionCallback:ze})):p.a.createElement("span",{className:"v-line"}))}),Le?p.a.createElement("li",null,p.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ze},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ct&&p.a.createElement("li",null,p.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ct),onActionCallback:ze},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(m,{icon:"".concat(pt?"icon-shrink":"icon-enlarge"),title:pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ze})))},P=ne("M8RZ"),N=ne("+L6B"),K=ne("2/Rp"),X=ne("y8nQ"),B=ne("Vl3Y"),S=ne("5NDa"),Y=ne("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},re=function(ge){var Ce=ge.callback,Le=ge.onCancel;function ze(pt){Ce(pt)}return p.a.createElement(B.a,Object(A.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ze}),p.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(K.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},ce=ne("7ahc"),Te=ne("HmJG"),ye=ne("BjJ7"),be=B.a.useForm,we={width:280,marginRight:10},xe={labelCol:{span:5},wrapperCol:{span:19}},ve=function(ge){var Ce=ge.callback,Le=ge.onCancel,ze=be(),pt=Object(G.a)(ze,1),ct=pt[0];function Ct(Rt){Ce(Rt)}function xt(Rt,vt){if(Rt.status===-1){F.b.error(Rt.message);return}ct.setFieldsValue({src:"/api/attachments/".concat(Rt.id),type:vt.type})}function $e(Rt){var vt=Rt.target.files[0];Re(vt,xt)}return p.a.createElement(B.a,Object(A.a)({form:ct},xe,{className:"upload-image-panel",onFinish:Ct}),p.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:we})),p.a.createElement(oe,{onFileChange:$e}))),p.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(B.a.Item,{style:{textAlign:"right"}},p.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(K.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))};function oe(ge){var Ce=ge.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Ce}))}function Re(ge,Ce){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var Le=new FormData;Le.append("editormd-image-file",ge),Le.append("file_param_name","editormd-image-file"),Le.append("byxhr","true");var ze=new window.XMLHttpRequest;ze.withCredentials=!0,ze.addEventListener("load",function(pt){Ce(JSON.parse(pt.target.responseText),ge)},!1),ze.addEventListener("error",function(pt){console.error(pt)},!1),ze.open("POST","".concat(ye.a,"/api/attachments.json")),ze.send(Le)}var Ye=ne("giR+"),Ue=ne("fyUT"),rt=ne("7Kak"),ot=ne("9yH6"),Oe=ot.a.Group,Me={margin:"0 8px"},We=function(ge){var Ce=ge.callback,Le=ge.onCancel;function ze(pt){Ce(pt)}return p.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ze},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Me},"\u884C\u6570"),p.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Ue.a,null)),p.a.createElement("span",{style:Me},"\u5217\u6570"),p.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Ue.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(B.a.Item,{name:"align"},p.a.createElement(Oe,null,p.a.createElement(ot.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(ot.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(ot.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(ot.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(K.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},qe=ne("ErOA"),Ve=ne("7Cbv"),je="link",Fe="upload-image",ht="code-block",He="add-table",Pe="------------",Xe={default:Pe,left:":".concat(Pe),center:":".concat(Pe,":"),right:"".concat(Pe,":")},tt=ne("9VGf"),Ke,et;function Ae(){}var nt=0,Je=1e4,Se="\u2581",ke=`
**\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 me(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var he=navigator.platform.toUpperCase().indexOf("MAC")>=0,de=he?"Cmd":"Ctrl",ie=["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"],q=(Ke={},Object(j.a)(Ke,de+"-B","bold"),Object(j.a)(Ke,de+"-I","italic"),Ke),se=(et={},Object(j.a)(et,je,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(et,ht,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(et,Fe,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(et,He,"\u6DFB\u52A0\u8868\u683C"),et),ue=lt.a=function(ge){var Ce=ge.defaultValue,Le=Ce===void 0?"":Ce,ze=ge.onChange,pt=ge.width,ct=pt===void 0?"100%":pt,Ct=ge.height,xt=Ct===void 0?400:Ct,$e=ge.miniToolbar,Rt=$e===void 0?!1:$e,vt=ge.isFocus,Nt=vt===void 0?!1:vt,It=ge.watch,At=ge.insertTemp,di=ge.mode,ri=di===void 0?"markdown":di,Qe=ge.id,bt=Qe===void 0?"markdown-editor-id":Qe,kt=ge.showResizeBar,Mt=kt===void 0?!1:kt,ei=ge.noStorage,Gi=ei===void 0?!1:ei,Xi=ge.showNullButton,ft=Xi===void 0?!1:Xi,ut=ge.hidetoolBar,ti=ut===void 0?!1:ut,Wt=ge.fullScreen,Ut=Wt===void 0?!1:Wt,Dt=ge.onBlur,Vt=ge.onCMBeforeChange,Ti=ge.onFullScreen,pn=ge.className,Ge=pn===void 0?"":pn,Ot=ge.disablePaste,mn=Ot===void 0?!1:Ot,gn=ge.placeholder,vn=gn===void 0?"":gn,yn=ge.values,z=yn===void 0?"":yn,v=Object(g.useState)(null),C=Object(G.a)(v,2),U=C[0],J=C[1],W=Object(g.useState)(Le),pe=Object(G.a)(W,2),De=pe[0],it=pe[1],gt=Object(g.useState)(It),Ne=Object(G.a)(gt,2),Tt=Ne[0],zt=Ne[1],qt=Object(g.useState)(Ut),Bi=Object(G.a)(qt,2),wi=Bi[0],Si=Bi[1],Qi=Object(g.useState)(""),Dn=Object(G.a)(Qi,2),pi=Dn[0],zi=Dn[1],ln=Object(g.useState)(0),un=Object(G.a)(ln,2),ji=un[0],kn=un[1],_n=Object(g.useState)(xt),Kn=Object(G.a)(_n,2),Vn=Kn[0],Zi=Kn[1],Yi=Object(g.useState)(!1),bn=Object(G.a)(Yi,2),dr=bn[0],En=bn[1],si=Object(g.useRef)(Object(Ve.a)()),Kt=Object(g.useRef)(!1),bi=Object(g.useRef)(),Bt=Object(g.useRef)(),li=Object(g.useRef)(),$t=Object(g.useRef)(),nn=Object(g.useRef)(),mi=function(){var yt=Object(D.a)(I.a.mark(function Lt(){var wt,Ft;return I.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(qe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:si.current}});case 2:Ft=Zt.sent,Ft!=null&&(wt=Ft.attachments)!==null&&wt!==void 0&&wt.length&&(console.log("cm:",U,Bt),Ft.attachments.map(function(Ht){Ht.content_type.indexOf("image")>-1?U.replaceSelection(".concat(Ht.content_type,")")):Ht.content_type.indexOf("video")>-1?U.replaceSelection('')):Ht.content_type.indexOf("pdf")>-1?U.replaceSelection('').concat(Ht.name,"")):U.replaceSelection("[".concat(Ht.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Ht.id,"?type=").concat(Ht.content_type,")"))}));case 4:case"end":return Zt.stop()}},Lt)}));return function(){return yt.apply(this,arguments)}}();Object(g.useEffect)(function(){it(z),U==null||U.setValue(z)},[z]),Object(g.useEffect)(function(){Ti==null||Ti(wi)},[wi]),Object(g.useEffect)(function(){if(Bt.current){var yt=h.a.fromTextArea(Bt.current,{mode:ri,lineNumbers:!Rt,lineWrapping:!0,value:Le,autoCloseTags:!0,autoCloseBrackets:!0});Nt&&yt.focus();function Lt(wt,Ft){if(mn){Ft.preventDefault();return}var Gt=Ft.clipboardData;if(Gt){var Zt=Gt.types.toString(),Ht=Gt.items;if(Zt==="Files"||Gt.types.indexOf("Files")>-1){if(Ft.preventDefault(),ri=="stex")return;try{var ci,Di=Ht[1];((ci=Ht[0])===null||ci===void 0?void 0:ci.kind)==="file"&&(Di=Ht[0]);var jt=Di.getAsFile(),hn=jt.name.split(".").pop();Re(jt,function(Xt){if(Xt.id){var ki,Ci,$i;(jt==null||((ki=jt.type)===null||ki===void 0)?void 0:ki.indexOf("image"))>-1?yt.replaceSelection(".concat(Xt.content_type,")")):(jt==null||((Ci=jt.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?yt.replaceSelection('')):(jt==null||(($i=jt.type)===null||$i===void 0)?void 0:$i.indexOf("pdf"))>-1?yt.replaceSelection('').concat(jt.name,"")):ie.includes(hn)?yt.replaceSelection('').concat(jt.name,"")):yt.replaceSelection("[".concat(jt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})}catch(Xt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Lt),yt.on("dragleave",function(wt,Ft){li.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(wt,Ft){li.current.classList.add("mouse-hover-md")}),yt.on("drop",function(wt,Ft){li.current.classList.add("mouse-hover-md");var Gt;if(Gt=Ft.dataTransfer.files,Gt.length>0){Ft.preventDefault(),Ft.stopPropagation();for(var Zt=function(Di){var jt=Gt[Di],hn=jt.name.split(".").pop();Re(jt,function(Xt){if(Xt.id){var ki,Ci,$i;(jt==null||((ki=jt.type)===null||ki===void 0)?void 0:ki.indexOf("image"))>-1?yt.replaceSelection(".concat(Xt.content_type,")")):(jt==null||((Ci=jt.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?yt.replaceSelection('')):(jt==null||(($i=jt.type)===null||$i===void 0)?void 0:$i.indexOf("pdf"))>-1?yt.replaceSelection('').concat(jt.name,"")):ie.includes(hn)?yt.replaceSelection('').concat(jt.name,"")):yt.replaceSelection("[".concat(jt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})},Ht=0;Ht0||Ht.target.offsetWidth>0)&&(Oi(),U.setSize("100%","100%"),U.refresh())}}catch(ci){Gt.e(ci)}finally{Gt.f()}});return wt.observe(Bt.current.parentElement),wt}if(U){var Lt=yt();return function(){Lt.unobserve(Bt.current.parentElement)}}},[U,Oi]),Object(g.useEffect)(function(){if(U){for(var yt=[],Lt=function(){var Ht=Ft[wt];Gt=Object(G.a)(Ht,2);var ci=Gt[0],Di=Gt[1],jt=Object(j.a)({},ci,function(){Xn(Di)});yt.push(jt),U.addKeyMap(jt)},wt=0,Ft=Object.entries(q);wt0){var yt=new Date().getTime(),Lt=window.sessionStorage.getItem(bt);yt>=ji+Je&&(!Lt||Lt!==De)&&(window.sessionStorage.setItem(bt,De),En(!0))}},Je),Object(g.useEffect)(function(){zt(It)},[U,It]),Object(g.useEffect)(function(){U&&(Nt&&U.focus())},[U,Nt]),Object(g.useEffect)(function(){if(Tt&&U){var yt=U.getScrollerElement();function Lt(wt){var Ft=wt.target;if(nn.current){var Gt=Ft.scrollTop/Ft.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Gt}}return yt.addEventListener("scroll",Lt),function(){yt.removeEventListener("scroll",Lt)}}},[U,Tt]),Object(g.useEffect)(function(){if(U&&Vt){function yt(Lt,wt){Vt(Lt,wt)}return U.on("beforeChange",yt),function(){U.off("beforeChange",yt)}}},[U,Vt]),Object(g.useEffect)(function(){if(U&&Dt){function yt(){Dt(U.getValue())}return U.on("blur",yt),function(){U.off("blur",yt)}}},[U,Dt]),Object(g.useEffect)(function(){if(U){function yt(Lt){var wt=Lt.getValue();it(wt),kn(new Date().getTime()),Lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ze&&ze(wt)}return U.on("change",yt),function(){U.off("change",yt)}}},[U,ze]),Object(g.useEffect)(function(){U&&(Le==null?(U.setValue(""),it("")):Le!==U.getValue()&&(U.setValue(Le),it(Le),U.setCursor(U.lineCount(),0)))},[U,Le]);var Xn=Object(g.useCallback)(function(yt){var Lt=U.getCursor(),wt=U.getSelection(),Ft=wt.split(`
`);switch(yt){case"bold":return U.replaceSelection("**"+wt+"**"),wt===""&&U.setCursor(Lt.line,Lt.ch+2),U.focus();case"italic":return U.replaceSelection("*"+wt+"*"),wt===""&&U.setCursor(Lt.line,Lt.ch+1),U.focus();case"code":return U.replaceSelection("`"+wt+"`"),wt===""&&U.setCursor(Lt.line,Lt.ch+1),U.focus();case"inline-latex":return U.replaceSelection("`$$"+wt+"$$`"),wt===""&&U.setCursor(Lt.line,Lt.ch+3),U.focus();case"latex":return U.replaceSelection("```latex\n"+wt+"\n```"),U.setCursor(Lt.line+1,wt.length+1),U.focus();case"line-break":return U.replaceSelection(`
`),U.focus();case"list-ul":return wt===""?U.replaceSelection("- "+wt):U.replaceSelection(Ft.map(function(Gt){return Gt===""?"":"- ".concat(Gt)}).join(`
`)),U.focus();case"list-ol":return wt===""?U.replaceSelection("1. "+wt):U.replaceSelection(Ft.map(function(Gt,Zt){return Gt===""?"":"".concat(Zt+1,". ").concat(Gt)}).join(`
`)),U.focus();case"add-null-ch":return wt===""&&U.setCursor(Lt.line,Lt.ch+1),U.replaceSelection(Se),U.focus();case"inster-template-1":return wt===""&&U.setCursor(Lt.line,Lt.ch),U.replaceSelection(ke),U.focus();case"eraser":return U.setValue(""),U.focus();case"trigger-watch":return zt(!Tt),U.focus();case"trigger-full-screen":return Si(!wi),U.focus();case je:zi(je);return;case ht:zi(ht);return;case Fe:zi(Fe);return;case He:zi(He);return;default:throw new Error}},[U,Tt,wi]),xn=Object(g.useCallback)(function(yt){zi("");switch(pi){case je:var Lt=yt.title,wt=yt.link;return U.replaceSelection("[".concat(Lt,"](").concat(wt,")")),U.focus();case ht:var Ft=yt.language,Gt=yt.content;return U.replaceSelection(["```"+Ft,Gt,"```"].join(`
`)),U.focus();case Fe:var Zt=yt.src,Ht=yt.alt;return Ht?U.replaceSelection(".concat(Zt,' "').concat(Ht,'" )')):U.replaceSelection("")),U.focus();case He:for(var ci=yt.row,Di=yt.col,jt=yt.align,hn=`
`,Xt=0;Xt300&&(ci=300);var Di=xt+ci+"px";Zi(Di)}}return yt.addEventListener("mousedown",Ft),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Gt),function(){yt.removeEventListener("mousedown",Ft),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Gt)}}},[U,$t]),Object(g.useEffect)(function(){Zi(xt)},[xt]);var rn=me(ct),fr=me(Vn),Ji={width:rn,height:fr},pr=Object(g.useMemo)(function(){if(ji){var yt=new Date(ji),Lt=yt.getHours(),wt=yt.getMinutes(),Ft=yt.getSeconds();return Lt=Lt<10?"0"+Lt:Lt,wt=wt<10?"0"+wt:wt,Ft=Ft<10?"0"+Ft:Ft,"".concat(Lt,":").concat(wt,":").concat(Ft)}return 0},[ji]);function jr(){window.sessionStorage.removeItem(bt),En(!1),kn(0)}function Mn(){En(!1),kn(0),U.setValue(window.sessionStorage.getItem(bt))}function ua(yt,Lt){var wt=U.getValue();wt=wt.replace(yt,Lt),it(wt),U==null||U.setValue(wt)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:li},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Tt?"on-preview":""," ").concat(Rt?"mini":""," ").concat(wi?"full-screen":""),style:Ji},p.a.createElement(b,{insertTemp:At,watch:Tt,fullScreen:wi,showNullButton:ft,onActionCallback:Xn,hidetoolBar:ti,uuid:si.current,setOpenPhones:function(){Kt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Bt,placeholder:vn})),Tt?p.a.createElement("div",{ref:nn,className:"preview-container"},ri==="stex"&&p.a.createElement(R,{value:De}),ri!=="stex"&&p.a.createElement(x.a,{edit:!0,value:De,replaces:ua})):null))),Mt?p.a.createElement("a",{ref:$t,className:"editor-resize"}):null,p.a.createElement(P.a,null,se[pi]?p.a.createElement(Z.a,{centered:!0,title:se[pi],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},SJMd:function(_t,lt){/**
* @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,Z,k=!1,V,F;window.PR_SHOULD_USE_CONTINUATION=!0;var D,G;(function(){var j=window,M=["break,continue,do,else,for,if,return,while"],I=[M,"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"],g=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"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=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[g,"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"],a="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",c=[g,"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=[M,"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=[M,"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"],d=[M,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[p,h,f,c,o,s,l,d],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",R="kwd",A="com",T="typ",E="lit",y="pun",u="pln",_="tag",m="dec",b="src",P="atn",N="atv",K="nocode",X="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(Oe){for(var Me=0,We=!1,qe=!1,Ve=0,je=Oe.length;Ve122||(ie<65||de>90||nt.push([Math.max(65,de)|32,Math.min(ie,90)|32]),ie<97||de>122||nt.push([Math.max(97,de)&~32,Math.min(ie,122)&~32]))}}nt.sort(function(ge,Ce){return ge[0]-Ce[0]||Ce[1]-ge[1]});for(var q=[],se=[],ke=0;keue[0]&&(ue[1]+1>ue[0]&&Se.push("-"),Se.push(Pe(ue[1])))}return Se.push("]"),Se.join("")}function tt(et){for(var Ae=et.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")),nt=Ae.length,Je=[],Se=0,ke=0;Se=2&&de==="["?Ae[Se]=Xe(me):de!=="\\"&&(Ae[Se]=me.replace(/[a-zA-Z]/g,function(se){var ue=se.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Ae.join("")}for(var Ke=[],Ve=0,je=Oe.length;Ve=0;)We[Ke.charAt(et)]=tt;var Ae=tt[1],nt=""+Ae;He.hasOwnProperty(nt)||(ht.push(Ae),He[nt]=null)}ht.push(/[\0-\uffff]/),qe=B(ht)})();var Ve=Me.length,je=function(Fe){for(var ht=Fe.sourceCode,He=Fe.basePos,Pe=Fe.sourceNode,Xe=[He,u],tt=0,Ke=ht.match(qe)||[],et={},Ae=0,nt=Ke.length;Ae=5&&Se.substring(0,5)==="lang-",me&&!(ke&&typeof ke[1]=="string")&&(me=!1,Se=b),me||(et[Je]=Se)}var ie=tt;if(tt+=Je.length,!me)Xe.push(He+ie,Se);else{var q=ke[1],se=Je.indexOf(q),ue=se+q.length;ke[2]&&(ue=Je.length-ke[2].length,se=ue-q.length);var ge=Se.substring(5);Y(Pe,He+ie,Je.substring(0,se),je,Xe),Y(Pe,He+ie+se,q,oe(ge,q),Xe),Y(Pe,He+ie+ue,Je.substring(ue),je,Xe)}}Fe.decorations=Xe};return je}function Te(Oe){var Me=[],We=[];Oe.tripleQuotedStrings?Me.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Oe.multiLineStrings?Me.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Oe.verbatimStrings&&We.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=Oe.hashComments;qe&&(Oe.cStyleComments?(qe>1?Me.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),We.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([A,/^#[^\r\n]*/,null,"#"])),Oe.cStyleComments&&(We.push([A,/^\/\/[^\r\n]*/,null]),We.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ve=Oe.regexLiterals;if(Ve){var je=Ve>1?"":`
\r`,Fe=je?".":"[\\S\\s]",ht="/(?=[^/*"+je+"])(?:[^/\\x5B\\x5C"+je+"]|\\x5C"+Fe+"|\\x5B(?:[^\\x5C\\x5D"+je+"]|\\x5C"+Fe+")*(?:\\x5D|$))+/";We.push(["lang-regex",RegExp("^"+X+"("+ht+")")])}var He=Oe.types;He&&We.push([T,He]);var Pe=(""+Oe.keywords).replace(/^ | $/g,"");Pe.length&&We.push([R,new RegExp("^(?:"+Pe.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([u,/^\s+/,null,` \r
\xA0`]);var Xe="^.[^\\s\\w.$@'\"`/\\\\]*";return Oe.regexLiterals&&(Xe+="(?!s*/)"),We.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[T,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[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"],[u,/^\\[\s\S]?/,null],[y,new RegExp(Xe),null]),ce(Me,We)}var ye=Te({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function be(Oe,Me,We){for(var qe=/(?:^|\s)nocode(?:\s|$)/,Ve=/\r\n?|\n/,je=Oe.ownerDocument,Fe=je.createElement("li");Oe.firstChild;)Fe.appendChild(Oe.firstChild);var ht=[Fe];function He(Ae){var nt=Ae.nodeType;if(nt==1&&!qe.test(Ae.className))if(Ae.nodeName==="br")Pe(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var Je=Ae.firstChild;Je;Je=Je.nextSibling)He(Je);else if((nt==3||nt==4)&&We){var Se=Ae.nodeValue,ke=Se.match(Ve);if(ke){var me=Se.substring(0,ke.index);Ae.nodeValue=me;var he=Se.substring(ke.index+ke[0].length);if(he){var de=Ae.parentNode;de.insertBefore(je.createTextNode(he),Ae.nextSibling)}Pe(Ae),me||Ae.parentNode.removeChild(Ae)}}}function Pe(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function nt(ke,me){var he=me?ke.cloneNode(!1):ke,de=ke.parentNode;if(de){var ie=nt(de,1),q=ke.nextSibling;ie.appendChild(he);for(var se=q;se;se=q)q=se.nextSibling,ie.appendChild(se)}return he}for(var Je=nt(Ae.nextSibling,0),Se;(Se=Je.parentNode)&&Se.nodeType===1;)Je=Se;ht.push(Je)}for(var Xe=0;Xe=de&&(He+=2),je>=ie&&(tt+=2)}}finally{Se&&(Se.style.display=ke)}}var xe={};function ve(Oe,Me){for(var We=Me.length;--We>=0;){var qe=Me[We];xe.hasOwnProperty(qe)?j.console&&console.warn("cannot override language handler %s",qe):xe[qe]=Oe}}function oe(Oe,Me){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",/^