(window.webpackJsonp=window.webpackJsonp||[]).push([[168,6,7],{"+NIl":function(bt,Qe,C){(function(G){G(C("VrN/"))})(function(G){"use strict";G.defineMode("stex",function(_e,de){"use strict";function Re(ae,K){ae.cmdState.push(K)}function ke(ae){return ae.cmdState.length>0?ae.cmdState[ae.cmdState.length-1]:null}function le(ae){var K=ae.cmdState.pop();K&&K.closeBracket()}function N(ae){for(var K=ae.cmdState,ee=K.length-1;ee>=0;ee--){var H=K[ee];if(H.name=="DEFAULT")continue;return H}return{styleIdentifier:function(){return null}}}function Q(ae,K,ee){return function(){this.name=ae,this.bracketNo=0,this.style=K,this.styles=ee,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var U={};U.importmodule=Q("importmodule","tag",["string","builtin"]),U.documentclass=Q("documentclass","tag",["","atom"]),U.usepackage=Q("usepackage","tag",["atom"]),U.begin=Q("begin","tag",["atom"]),U.end=Q("end","tag",["atom"]),U.label=Q("label","tag",["atom"]),U.ref=Q("ref","tag",["atom"]),U.eqref=Q("eqref","tag",["atom"]),U.cite=Q("cite","tag",["atom"]),U.bibitem=Q("bibitem","tag",["atom"]),U.Bibitem=Q("Bibitem","tag",["atom"]),U.RBibitem=Q("RBibitem","tag",["atom"]),U.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function q(ae,K){ae.f=K}function M(ae,K){var ee;if(ae.match(/^\\[a-zA-Z@]+/)){var H=ae.current().slice(1);return ee=U.hasOwnProperty(H)?U[H]:U.DEFAULT,ee=new ee,Re(K,ee),q(K,fe),ee.style}if(ae.match(/^\\[$&%#{}_]/))return"tag";if(ae.match(/^\\[,;!\/\\]/))return"tag";if(ae.match("\\["))return q(K,function(he,ze){return F(he,ze,"\\]")}),"keyword";if(ae.match("\\("))return q(K,function(he,ze){return F(he,ze,"\\)")}),"keyword";if(ae.match("$$"))return q(K,function(he,ze){return F(he,ze,"$$")}),"keyword";if(ae.match("$"))return q(K,function(he,ze){return F(he,ze,"$")}),"keyword";var me=ae.next();if(me=="%")return ae.skipToEnd(),"comment";if(me=="}"||me=="]"){if(ee=ke(K),ee)ee.closeBracket(me),q(K,fe);else return"error";return"bracket"}else return me=="{"||me=="["?(ee=U.DEFAULT,ee=new ee,Re(K,ee),"bracket"):/\d/.test(me)?(ae.eatWhile(/[\w.%]/),"atom"):(ae.eatWhile(/[\w\-_]/),ee=N(K),ee.name=="begin"&&(ee.argument=ae.current()),ee.styleIdentifier())}function F(ae,K,ee){if(ae.eatSpace())return null;if(ee&&ae.match(ee))return q(K,M),"keyword";if(ae.match(/^\\[a-zA-Z@]+/))return"tag";if(ae.match(/^[a-zA-Z]+/))return"variable-2";if(ae.match(/^\\[$&%#{}_]/))return"tag";if(ae.match(/^\\[,;!\/]/))return"tag";if(ae.match(/^[\^_&]/))return"tag";if(ae.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ae.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var H=ae.next();return H=="{"||H=="}"||H=="["||H=="]"||H=="("||H==")"?"bracket":H=="%"?(ae.skipToEnd(),"comment"):"error"}function fe(ae,K){var ee=ae.peek(),H;return ee=="{"||ee=="["?(H=ke(K),H.openBracket(ee),ae.eat(ee),q(K,M),"bracket"):/[ \t\r]/.test(ee)?(ae.eat(ee),null):(q(K,M),le(K),M(ae,K))}return{startState:function(){var ae=de.inMathMode?function(K,ee){return F(K,ee)}:M;return{cmdState:[],f:ae}},copyState:function(ae){return{cmdState:ae.cmdState.slice(),f:ae.f}},token:function(ae,K){return K.f(ae,K)},blankLine:function(ae){ae.f=M,ae.cmdState.length=0},lineComment:"%"}}),G.defineMIME("text/x-stex","stex"),G.defineMIME("text/x-latex","stex")})},"19Vz":function(bt,Qe,C){(function(G){G(C("VrN/"))})(function(G){G.defineOption("placeholder","",function(Q,U,q){var M=q&&q!=G.Init;if(U&&!M)Q.on("blur",ke),Q.on("change",le),Q.on("swapDoc",le),G.on(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose=function(){Re(Q)}),le(Q);else if(!U&&M){Q.off("blur",ke),Q.off("change",le),Q.off("swapDoc",le),G.off(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose),_e(Q);var F=Q.getWrapperElement();F.className=F.className.replace(" CodeMirror-empty","")}U&&!Q.hasFocus()&&ke(Q)});function _e(Q){Q.state.placeholder&&(Q.state.placeholder.parentNode.removeChild(Q.state.placeholder),Q.state.placeholder=null)}function de(Q){_e(Q);var U=Q.state.placeholder=document.createElement("pre");U.style.cssText="height: 0; overflow: visible",U.style.direction=Q.getOption("direction"),U.className="CodeMirror-placeholder CodeMirror-line-like";var q=Q.getOption("placeholder");typeof q=="string"&&(q=document.createTextNode(q)),U.appendChild(q),Q.display.lineSpace.insertBefore(U,Q.display.lineSpace.firstChild)}function Re(Q){setTimeout(function(){var U=!1,q=Q.getInputField();q.nodeName=="TEXTAREA"?U=!q.value:Q.lineCount()==1&&(U=!/[^\u200b]/.test(q.querySelector(".CodeMirror-line").textContent)),U?de(Q):_e(Q)},20)}function ke(Q){N(Q)&&de(Q)}function le(Q){var U=Q.getWrapperElement(),q=N(Q);U.className=U.className.replace(" CodeMirror-empty","")+(q?" CodeMirror-empty":""),q?de(Q):_e(Q)}function N(Q){return Q.lineCount()===1&&Q.getLine(0)===""}})},"1eCo":function(bt,Qe,C){(function(G){G(C("VrN/"))})(function(G){"use strict";var _e={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},de={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};G.defineMode("xml",function(Re,ke){var le=Re.indentUnit,N={},Q=ke.htmlMode?_e:de;for(var U in Q)N[U]=Q[U];for(var U in ke)N[U]=ke[U];var q,M;function F(S,ne){function J(z){return ne.tokenize=z,z(S,ne)}var _=S.next();if(_=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?J(K("atom","]]>")):null:S.match("--")?J(K("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),J(ee(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),ne.tokenize=K("meta","?>"),"meta"):(q=S.eat("/")?"closeTag":"openTag",ne.tokenize=fe,"tag bracket");if(_=="&"){var re;return S.eat("#")?S.eat("x")?re=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):re=S.eatWhile(/[\d]/)&&S.eat(";"):re=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),re?"atom":"error"}else return S.eatWhile(/[^&<]/),null}F.isInText=!0;function fe(S,ne){var J=S.next();if(J==">"||J=="/"&&S.eat(">"))return ne.tokenize=F,q=J==">"?"endTag":"selfcloseTag","tag bracket";if(J=="=")return q="equals",null;if(J=="<"){ne.tokenize=F,ne.state=ze,ne.tagName=ne.tagStart=null;var _=ne.tokenize(S,ne);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(J)?(ne.tokenize=ae(J),ne.stringStartCol=S.column(),ne.tokenize(S,ne)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ae(S){var ne=function(J,_){for(;!J.eol();)if(J.next()==S){_.tokenize=fe;break}return"string"};return ne.isInAttribute=!0,ne}function K(S,ne){return function(J,_){for(;!J.eol();){if(J.match(ne)){_.tokenize=F;break}J.next()}return S}}function ee(S){return function(ne,J){for(var _;(_=ne.next())!=null;){if(_=="<")return J.tokenize=ee(S+1),J.tokenize(ne,J);if(_==">")if(S==1){J.tokenize=F;break}else return J.tokenize=ee(S-1),J.tokenize(ne,J)}return"meta"}}function H(S,ne,J){this.prev=S.context,this.tagName=ne,this.indent=S.indented,this.startOfLine=J,(N.doNotIndent.hasOwnProperty(ne)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function me(S){S.context&&(S.context=S.context.prev)}function he(S,ne){for(var J;;){if(!S.context)return;if(J=S.context.tagName,!N.contextGrabbers.hasOwnProperty(J)||!N.contextGrabbers[J].hasOwnProperty(ne))return;me(S)}}function ze(S,ne,J){return S=="openTag"?(J.tagStart=ne.column(),Ke):S=="closeTag"?Ee:ze}function Ke(S,ne,J){return S=="word"?(J.tagName=ne.current(),M="tag",pe):N.allowMissingTagName&&S=="endTag"?(M="tag bracket",pe(S,ne,J)):(M="error",Ke)}function Ee(S,ne,J){if(S=="word"){var _=ne.current();return J.context&&J.context.tagName!=_&&N.implicitlyClosed.hasOwnProperty(J.context.tagName)&&me(J),J.context&&J.context.tagName==_||N.matchClosing===!1?(M="tag",Ce):(M="tag error",We)}else return N.allowMissingTagName&&S=="endTag"?(M="tag bracket",Ce(S,ne,J)):(M="error",We)}function Ce(S,ne,J){return S!="endTag"?(M="error",Ce):(me(J),ze)}function We(S,ne,J){return M="error",Ce(S,ne,J)}function pe(S,ne,J){if(S=="word")return M="attribute",Ae;if(S=="endTag"||S=="selfcloseTag"){var _=J.tagName,re=J.tagStart;return J.tagName=J.tagStart=null,S=="selfcloseTag"||N.autoSelfClosers.hasOwnProperty(_)?he(J,_):(he(J,_),J.context=new H(J,_,re==J.indented)),ze}return M="error",pe}function Ae(S,ne,J){return S=="equals"?ve:(N.allowMissing||(M="error"),pe(S,ne,J))}function ve(S,ne,J){return S=="string"?ie:S=="word"&&N.allowUnquoted?(M="string",pe):(M="error",pe(S,ne,J))}function ie(S,ne,J){return S=="string"?ie:pe(S,ne,J)}return{startState:function(S){var ne={tokenize:F,state:ze,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(ne.baseIndent=S),ne},token:function(S,ne){if(!ne.tagName&&S.sol()&&(ne.indented=S.indentation()),S.eatSpace())return null;q=null;var J=ne.tokenize(S,ne);return(J||q)&&J!="comment"&&(M=null,ne.state=ne.state(q||J,S,ne),M&&(J=M=="error"?J+" error":M)),J},indent:function(S,ne,J){var _=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+le;if(_&&_.noIndent)return G.Pass;if(S.tokenize!=fe&&S.tokenize!=F)return J?J.match(/^(\s*)/)[0].length:0;if(S.tagName)return N.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+le*(N.multilineTagIndentFactor||1);if(N.alignCDATA&&/$/,blockCommentStart:"",configuration:N.htmlMode?"html":"xml",helperType:N.htmlMode?"html":"xml",skipAttribute:function(S){S.state==ve&&(S.state=pe)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var ne=[],J=S.context;J;J=J.prev)J.tagName&&ne.push(J.tagName);return ne.reverse()}}}),G.defineMIME("text/xml","xml"),G.defineMIME("application/xml","xml"),G.mimeModes.hasOwnProperty("text/html")||G.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return he}),C.d(Qe,"b",function(){return pe});var G=C("Ty5D"),_e=C("dI71"),de=C("q1tI"),Re=C.n(de),ke=C("YS25"),le=C("17x9"),N=C.n(le),Q=C("wx14"),U=C("zLVn"),q=C("9R94"),M=function(ve){Object(_e.a)(ie,ve);function ie(){for(var ne,J=arguments.length,_=new Array(J),re=0;re1&&arguments[1]!==void 0?arguments[1]:0,K=(N[fe[ae+0]]+N[fe[ae+1]]+N[fe[ae+2]]+N[fe[ae+3]]+"-"+N[fe[ae+4]]+N[fe[ae+5]]+"-"+N[fe[ae+6]]+N[fe[ae+7]]+"-"+N[fe[ae+8]]+N[fe[ae+9]]+"-"+N[fe[ae+10]]+N[fe[ae+11]]+N[fe[ae+12]]+N[fe[ae+13]]+N[fe[ae+14]]+N[fe[ae+15]]).toLowerCase();if(!le(K))throw TypeError("Stringified UUID is invalid");return K}var q=U;function M(fe,ae,K){fe=fe||{};var ee=fe.random||(fe.rng||de)();if(ee[6]=ee[6]&15|64,ee[8]=ee[8]&63|128,ae){K=K||0;for(var H=0;H<16;++H)ae[K+H]=ee[H];return ae}return q(ee)}var F=Qe.a=M},"7ahc":function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return Ke});var G=C("k1fw"),_e=C("0Owb"),de=C("+L6B"),Re=C("2/Rp"),ke=C("y8nQ"),le=C("Vl3Y"),N=C("tJVT"),Q=C("OaEy"),U=C("2fM7"),q=C("q1tI"),M=C.n(q),F=C("VrN/"),fe=C.n(F),ae=C("p77/"),K=C.n(ae),ee=C("c5Ni"),H=C.n(ee),me=U.a.Option,he={labelCol:{span:4},wrapperCol:{span:20}},ze={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"]};Qe.b=function(Ee){var Ce=Ee.callback,We=Ee.onCancel,pe=Object(q.useState)("python"),Ae=Object(N.a)(pe,2),ve=Ae[0],ie=Ae[1];function S(J){ie(ze[J][1])}function ne(J){Ce(J)}return M.a.createElement(le.a,Object(_e.a)({},he,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ne}),M.a.createElement(le.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},M.a.createElement(U.a,{onChange:S},Object.keys(ze).map(function(J){return M.a.createElement(me,{key:J,value:J},ze[J][0])}))),M.a.createElement(le.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},M.a.createElement(Ke,{mode:ve})),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(Re.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(Re.a,{type:"ghost",onClick:We},"\u53D6\u6D88")))};function Ke(Ee){var Ce=Ee.value,We=Ee.onChange,pe=Ee.mode,Ae=Ee.options,ve=Ae===void 0?{}:Ae,ie=Object(q.useRef)(),S=Object(q.useState)(),ne=Object(N.a)(S,2),J=ne[0],_=ne[1];return Object(q.useEffect)(function(){if(J){function re(z){var D=z.getValue();We&&We(D)}return J.on("change",re),function(){J.off("change",re)}}},[J,We]),Object(q.useEffect)(function(){J&&J.setOption("mode",pe)},[J,pe]),Object(q.useEffect)(function(){J&&((Ce!==J.getValue()||Ce==="")&&setTimeout(function(){J.setValue(Ce||" ")},300))},[J,Ce]),Object(q.useEffect)(function(){if(ie.current&&!J){var re=fe.a.fromTextArea(ie.current,Object(G.a)({mode:pe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ve));_(re)}},[ie.current,J]),M.a.createElement("div",{className:"my-codemirror-container"},M.a.createElement("textarea",{ref:ie}))}},"7ixt":function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return de});var G={adjustX:1,adjustY:1},_e=[0,0],de={left:{points:["cr","cl"],overflow:G,offset:[-4,0],targetOffset:_e},right:{points:["cl","cr"],overflow:G,offset:[4,0],targetOffset:_e},top:{points:["bc","tc"],overflow:G,offset:[0,-4],targetOffset:_e},bottom:{points:["tc","bc"],overflow:G,offset:[0,4],targetOffset:_e},topLeft:{points:["bl","tl"],overflow:G,offset:[0,-4],targetOffset:_e},leftTop:{points:["tr","tl"],overflow:G,offset:[-4,0],targetOffset:_e},topRight:{points:["br","tr"],overflow:G,offset:[0,-4],targetOffset:_e},rightTop:{points:["tl","tr"],overflow:G,offset:[4,0],targetOffset:_e},bottomRight:{points:["tr","br"],overflow:G,offset:[0,4],targetOffset:_e},rightBottom:{points:["bl","br"],overflow:G,offset:[4,0],targetOffset:_e},bottomLeft:{points:["tl","bl"],overflow:G,offset:[0,4],targetOffset:_e},leftBottom:{points:["br","bl"],overflow:G,offset:[-4,0],targetOffset:_e}},Re=de},"8EBN":function(bt,Qe,C){(function(G){G(C("VrN/"))})(function(G){"use strict";G.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 _e=0;_e-1&&Re.substring(N+1,Re.length);if(Q)return G.findModeByExtension(Q)},G.findModeByName=function(Re){Re=Re.toLowerCase();for(var ke=0;ke=u.length?d.slice(u.length):d}).join(` `)}var H=[],me=["
    "],he=new ae.a.Renderer,ze=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ke(){H.length=0,me=["
      "]}var Ee={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ce(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var d=c[o];u.push("
    • "+d.text+""),o++;var h=[];return o=Ce(c,o,d.level,h),h.length>0&&(u.push("
        "),h.forEach(function(I){u.push(I)}),u.push("
      ")),u.push("
    • "),o=Ce(c,o,a,u),o}function We(){return Ce(H,0,0,me),me.push("
    "),me.join("")}var pe={heading:function(o){var a=ze.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],d=ee(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var I=ie(),Be=d;d=I,S[I]={type:"block",expression:Be}}return{type:"code",raw:u,lang:h,text:d}}}},Ae=/(?:\${2})([^\n`]+?)(?:\${2})/gi,ve=0,ie=function(){return"__special_katext_id_".concat(ve++,"__")},S={};function ne(){return S}function J(){ve=0,S={}}function _(c){return c=c.replace(Ae,function(o,a){var u=ie();return S[u]={type:"inline",expression:a},u}),c}var re=he.listitem;he.listitem=function(c){return re(_(c))};var z=he.paragraph;he.paragraph=function(c){return z(_(c))};var D=he.tablecell;he.tablecell=function(c,o){return D(_(c),o)},he.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"

    ".concat(c,"

    "):'
    ').concat(a?c:Object(K.escape)(c,!0),`
    `):'
    '+(a?c:Object(K.escape)(c,!0))+"
    "},he.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return H.push({anchor:u,level:o,text:c}),"'+c+""},ae.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),ae.a.use({tokenizer:pe,renderer:he});var L=ae.a,g=C("SJMd"),p=C("ulZh"),w=C.n(p),P=C("m3rI"),Y=C("Oy/b"),ge=C("p5ED"),De=C("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 be=function(c,o){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(c,o)};function Se(c,o){function a(){this.constructor=c}be(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ce(c,o,a,u){return new(a||(a=Promise))(function(d,h){function I(ot){try{$e(u.next(ot))}catch(Fe){h(Fe)}}function Be(ot){try{$e(u.throw(ot))}catch(Fe){h(Fe)}}function $e(ot){var Fe;ot.done?d(ot.value):(Fe=ot.value,Fe instanceof a?Fe:new a(function(wt){wt(Fe)})).then(I,Be)}$e((u=u.apply(c,o||[])).next())})}function xe(c,o){var a,u,d,h,I={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:Be(0),throw:Be(1),return:Be(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Be($e){return function(ot){return function(Fe){if(a)throw new TypeError("Generator is already executing.");for(;I;)try{if(a=1,u&&(d=2&Fe[0]?u.return:Fe[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Fe[1])).done)return d;switch(u=0,d&&(Fe=[2&Fe[0],d.value]),Fe[0]){case 0:case 1:d=Fe;break;case 4:return I.label++,{value:Fe[1],done:!1};case 5:I.label++,u=Fe[1],Fe=[0];continue;case 7:Fe=I.ops.pop(),I.trys.pop();continue;default:if(!(d=I.trys,(d=d.length>0&&d[d.length-1])||Fe[0]!==6&&Fe[0]!==2)){I=0;continue}if(Fe[0]===3&&(!d||Fe[1]>d[0]&&Fe[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(h){var I=document.createElement("div");I.className=""+a.toolbarButtonStyleClass.name,I.setAttribute("data-type-name",h.typeName),I.innerHTML=h.icon,I.addEventListener("click",function(){a.markerToolbarButtonClicked(I,h)}),a.buttons.push(I),a.markerButtons.push(I)}),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 d=document.createElement("div");d.className=this.toolbarBlockStyleClass.name,d.style.whiteSpace="nowrap",d.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(d),this.addActionButton(d,'',"render"),this.addActionButton(d,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),Me=function(){function c(o,a,u,d){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=d,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new V("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 V("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new V("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new V("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new V("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 V("toolbox-panel-row_colors",` background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new V("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px; padding: `+a+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new V("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new V("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new ye("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new ye("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},c.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var a,u,d=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a: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(h){var I;h.uiStyleSettings=d.uiStyleSettings;var Be=document.createElement("div");Be.className=d.toolboxButtonStyleClass.name+" "+((I=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&I!==void 0?I:d.toolboxButtonStyleColorsClass.name),Be.innerHTML=h.icon,Be.title=h.title,Be.addEventListener("click",function(){d.panelButtonClick(h)}),d.panelButtons.push(Be),d.buttonRow.appendChild(Be)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var d=o.getUi();d.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(d),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=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(h,I){var Be,$e;h.className=a.toolboxButtonStyleClass.name+" "+(I===u?""+((Be=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Be!==void 0?Be:a.toolboxActiveButtonStyleColorsClass.name):""+(($e=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:a.toolboxButtonStyleColorsClass.name))})},c}(),Ue=function(c,o){this.title=c,this.icon=o},Ie=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'')||this;return I.colors=[],I.addTransparent=!1,I.colorBoxes=[],I.colors=u,I.currentColor=d,I.setCurrentColor=I.setCurrentColor.bind(I),I.getColorBox=I.getColorBox.bind(I),I}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(d){var h=a.getColorBox(d);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,d=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-d,I=document.createElement("div");I.style.display="inline-block",I.style.boxSizing="content-box",I.style.width=h-2+"px",I.style.height=h-2+"px",I.style.padding="1px",I.style.marginRight="2px",I.style.marginBottom="2px",I.style.borderWidth="2px",I.style.borderStyle="solid",I.style.borderRadius=(h+2)/2+"px",I.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",I.addEventListener("click",function(){u.setCurrentColor(a,I)});var Be=document.createElement("div");return Be.style.display="inline-block",Be.style.width=h-2+"px",Be.style.height=h-2+"px",Be.style.backgroundColor=a,Be.style.borderRadius=h/2+"px",a==="transparent"&&(Be.style.fill=this.uiStyleSettings.toolboxAccentColor,Be.innerHTML=` `),I.appendChild(Be),I},o.prototype.setCurrentColor=function(a,u){var d=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ue),Le=function(){function c(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},c.typeName="MarkerBase",c}(),Ne=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},c}(),Ye=function(){function c(){this.GRIP_SIZE=10,this.visual=j.createGroup(),this.visual.appendChild(j.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(j.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),tt=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},c}(),Ze=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(j.createTransform()),h.setupControlBox(),h}return Se(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=j.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var d=this.unrotatePoint(a);if(this.manipulationStartX=d.x,this.manipulationStartY=d.y,this.offsetX=d.x-this.left,this.offsetY=d.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 h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):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(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,d=this.manipulationStartWidth,h=this.manipulationStartTop,I=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,d=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:d=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,I=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:I=this.manipulationStartHeight+a.y-this.manipulationStartY}d>=0?(this.left=u,this.width=d):(this.left=u+d,this.width=-d),I>=0?(this.top=h,this.height=I):(this.top=h+I,this.height=-I),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),d=j.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var d=j.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=j.createGroup();var a=j.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=j.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=j.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 Ne,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,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()},o.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()},o.prototype.createGrip=function(){var a=new Ye;return a.visual.transform.baseVal.appendItem(j.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,d=u,h=(this.width+this.CB_DISTANCE)/2-a/2,I=(this.height+this.CB_DISTANCE)/2-a/2,Be=this.height+this.CB_DISTANCE-a/2,$e=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,d),this.positionGrip(this.controlGrips.topCenter.visual,h,d),this.positionGrip(this.controlGrips.topRight.visual,$e,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,I),this.positionGrip(this.controlGrips.centerRight.visual,$e,I),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Be),this.positionGrip(this.controlGrips.bottomCenter.visual,h,Be),this.positionGrip(this.controlGrips.bottomRight.visual,$e,Be),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,d-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,d){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,d),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:tt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:tt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;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(tt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var d=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:d.x*a,y:d.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Le),nt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=j.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)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),j.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&j.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&j.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&j.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&j.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(Ze),mt=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'')||this;return I.widths=[],I.widthBoxes=[],I.widths=u,I.currentWidth=d,I.setCurrentWidth=I.setCurrentWidth.bind(I),I}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(d){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=d===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(d,h)}),u.appendChild(h);var I=document.createElement("div");I.innerText=d.toString(),I.style.marginRight="5px",h.appendChild(I);var Be=document.createElement("div");Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.display="flex",Be.style.alignItems="center";var $e=document.createElement("hr");$e.style.minWidth="20px",$e.style.border="0px",$e.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,$e.style.flexGrow="2",Be.appendChild($e),h.appendChild(Be),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var d=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ue),ft=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'')||this;return I.styles=[],I.styleBoxes=[],I.styles=u,I.currentStyle=d,I.setCurrentStyle=I.setCurrentStyle.bind(I),I}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(d){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=d===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(d,h)}),u.appendChild(h);var I=document.createElement("div");I.style.minHeight="20px",I.style.flexGrow="2",I.style.overflow="hidden";var Be=` `;I.innerHTML=Be,h.appendChild(I),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var d=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ue),rt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new mt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ft("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Se(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='',o}(nt),Te=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},yt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return Se(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.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")},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),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(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=j.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new Ye;return a.visual.transform.baseVal.appendItem(j.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,d){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,d),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Le),st=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new mt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ft("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.selectorLine=j.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=j.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)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.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()),j.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),j.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),j.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='',o}(yt),Pe=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'')||this;return I.fonts=[],I.fontBoxes=[],I.fonts=u,I.currentFont=d,I.setCurrentFont=I.setCurrentFont.bind(I),I}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(d){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=d===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(d,h)}),u.appendChild(h);var I=document.createElement("div");I.style.display="flex",I.style.minHeight="20px",I.style.flexGrow="2",I.style.fontFamily=d,I.style.overflow="hidden";var Be=document.createElement("div");Be.style.whiteSpace="nowrap",Be.style.overflow="hidden",Be.style.textOverflow="ellipsis",Be.innerHTML="The quick brown fox jumps over the lazy dog",I.appendChild(Be),h.appendChild(I),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var d=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ue),Ve=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=d.defaultColor,h.fontFamily=d.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new Ie("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Pe("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return Se(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(d){d===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.bgRectangle=j.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=j.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(j.createTransform()),this.textElement.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=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){a.textElement.appendChild(j.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var d=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(d,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),d=0,h=0;return u.width>0&&u.height>0&&(d=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:d,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),d=this.getTextPosition(u);d.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+d.x+"px, "+d.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(d.x,d.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(j.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),j.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=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(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.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 d=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(d)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),d=this.textElement.getBBox(),h={x:d.width*a,y:d.height*a};u.x-=h.x/2,u.y-=h.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*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&j.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&j.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='',o}(Ze),X=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=d.defaultColor,h.lineWidth=d.defaultStrokeWidth,h.pixelRatio=d.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new Ie("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new mt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.drawingImage=j.createImage(),this.visual.appendChild(this.drawingImage);var a=j.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,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(a.x,a.y),this.drawing=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),j.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),j.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,a)},o.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)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],d=u[0],h=u[1],I=u[2],Be=u[3],$e=!1,ot=0;ot0&&($e=!0,otBe&&(Be=ot),Fe>I&&(I=Fe));if($e){this.left=d/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(I-d)/this.pixelRatio,this.height=(Be-h)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=I-d,wt.height=Be-h,wt.getContext("2d").putImageData(this.canvasContext.getImageData(d,h,I-d,Be-h),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){j.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),j.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='',o}(Ze),B=function(c){function o(a,u,d){var h=c.call(this,a,d||'')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var d=function(Be){var $e="both";switch(Be){case 0:$e="both";break;case 1:$e="start";break;case 2:$e="end";break;case 3:$e="none"}var ot=document.createElement("div");if(ot.style.display="flex",ot.style.flexGrow="2",ot.style.alignItems="center",ot.style.justifyContent="space-between",ot.style.padding="5px",ot.style.borderWidth="2px",ot.style.borderStyle="solid",ot.style.borderColor=$e===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ot.addEventListener("click",function(){a.setCurrentType($e,ot)}),u.appendChild(ot),$e==="both"||$e==="start"){var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.innerHTML=` `,Fe.style.marginLeft="5px",ot.appendChild(Fe)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var Rt=document.createElement("hr");if(Rt.style.minWidth="20px",Rt.style.border="0px",Rt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Rt.style.flexGrow="2",wt.appendChild(Rt),ot.appendChild(wt),$e==="both"||$e==="end"){var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.innerHTML=` `,Vt.style.marginRight="5px",ot.appendChild(Vt)}h.typeBoxes.push(ot)},h=this,I=0;I<4;I++)d(I);return u},o.prototype.setCurrentType=function(a,u){var d=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ue),W=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new B("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var d=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-d/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+d/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=j.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=j.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.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",j.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),j.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=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(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var d=this.arrow2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(d,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='',o}(st),y=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor=d.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Ie("Color",d.defaultColorSet,d.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return Se(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='',o}(nt),x=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'')||this;return I.opacities=[],I.opacityBoxes=[],I.opacities=u,I.currentOpacity=d,I.setCurrentOpacity=I.setCurrentOpacity.bind(I),I}return Se(o,c),o.prototype.getUi=function(){var a=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(d){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=d===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(d,h)}),u.appendChild(h);var I=document.createElement("div");I.innerText=100*d+"%",h.appendChild(I),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var d=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ue),k=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=d.defaultHighlightColor,h.strokeWidth=0,h.opacity=d.defaultHighlightOpacity,h.fillPanel=new Ie("Color",d.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new x("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Se(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&j.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='',o}(y),T='',se=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=d.defaultStrokeColor,h.bgColor=d.defaultFillColor,h.fontFamily=d.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new Ie("Text color",d.defaultColorSet,h.color,''),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new Ie("Fill color",d.defaultColorSet,h.bgColor,T),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Pe("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new Ye,h.tipGrip.visual.transform.baseVal.appendItem(j.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return Se(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){j.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=j.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(j.setAttributes(this.bgRectangle,[["fill",a]]),j.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.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},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),d=this.height/5;a&&(this.tipPosition={x:u+d/2,y:this.height+20});var h=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?h.1)){var a=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(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var d=this.tip2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(d,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='',o}(st),et=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokePanel.colors=d.defaultColorSet,h.fillColor="transparent",h}return Se(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='',o}($),ct=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),lt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new mt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ft("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.selectorCurve=j.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=j.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)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),j.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),j.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),j.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=j.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=j.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)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/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()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,c.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='',o}(yt),kt=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),Et=function(c){function o(a,u,d){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=d,h}return Se(o,c),o}(kt),ut=function(c){function o(a,u,d){d===void 0&&(d=!1);var h=c.call(this,a,d)||this;return h.marker=u,h}return Se(o,c),o}(kt),Kt=function(){function c(){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 c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),Nt=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Te,this._isOpen=!1,this.undoRedoManager=new ct,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 Kt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.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(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[rt,X,W,Ve,et,$,k,se,je,y,st,lt]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[rt,X,W,Ve,$,k,se]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[rt,X,W,Ve,k]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var d=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});d!==void 0&&a._availableMarkerTypes.push(d)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,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(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&E.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=E.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new kt(o))})},c.prototype.render=function(){return ce(this,void 0,void 0,function(){var o;return xe(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new R).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(d){var h=new kt(a,!0);d(h),h.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(d){return d(new kt(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.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")},c.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"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.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 o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"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 we(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(o),1),o.dispose()},c.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())},c.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){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()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(d){var h=new ut(o,o._currentMarker,!0);d(h),h.defaultPrevented&&(a=!0)}),!a){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(d){return d(new ut(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(I){var Be=new ut(o,void 0,!0);I(Be),Be.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(I){var Be=d.markers[I];d.setCurrentMarker(d.markers[I]),d._currentMarker.dispose(),d.markerImage.removeChild(d._currentMarker.container),d.markers.splice(d.markers.indexOf(d._currentMarker),1),d.eventListeners.markerdelete.forEach(function($e){return $e(new ut(o,Be))})},d=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;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=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.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)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var d=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),d1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"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()},c.prototype.addLicenseKey=function(o){b.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new kt(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new kt(o))}))},c.instanceCounter=0,c}();/* ********************************** 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 Gt=function(c,o){return(Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(c,o)};function Ht(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=c}Gt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function _t(c,o,a,u){return new(a||(a=Promise))(function(d,h){function I(ot){try{$e(u.next(ot))}catch(Fe){h(Fe)}}function Be(ot){try{$e(u.throw(ot))}catch(Fe){h(Fe)}}function $e(ot){var Fe;ot.done?d(ot.value):(Fe=ot.value,Fe instanceof a?Fe:new a(function(wt){wt(Fe)})).then(I,Be)}$e((u=u.apply(c,o||[])).next())})}function zn(c,o){var a,u,d,h,I={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:Be(0),throw:Be(1),return:Be(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Be($e){return function(ot){return function(Fe){if(a)throw new TypeError("Generator is already executing.");for(;I;)try{if(a=1,u&&(d=2&Fe[0]?u.return:Fe[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Fe[1])).done)return d;switch(u=0,d&&(Fe=[2&Fe[0],d.value]),Fe[0]){case 0:case 1:d=Fe;break;case 4:return I.label++,{value:Fe[1],done:!1};case 5:I.label++,u=Fe[1],Fe=[0];continue;case 7:Fe=I.ops.pop(),I.trys.pop();continue;default:if(!(d=I.trys,(d=d.length>0&&d[d.length-1])||Fe[0]!==6&&Fe[0]!==2)){I=0;continue}if(Fe[0]===3&&(!d||Fe[1]>d[0]&&Fe[1]0&&a>0){var u=new Pn(o,a),d=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),I=document.createElementNS("http://www.w3.org/2000/svg","svg");I.setAttribute("xmlns","http://www.w3.org/2000/svg"),I.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(I);var Be=gt.createDefs();I.appendChild(Be);var $e=gt.createElement("clipPath",[["id","text-bg-clip"]]);Be.appendChild($e);var ot=gt.createPath(gt.getHollowRectanglePath((24-d)/2,(24-h)/2,d,h,(24-d)/2+2,(24-h)/2+2,d-4,h-4));I.appendChild(ot);var Fe=gt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Fe.appendChild(gt.createTSpan(o+":"+a)),I.appendChild(Fe);var wt=Fe.getBBox();gt.setAttributes(Fe,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var Rt=gt.createPath(gt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return $e.appendChild(Rt),gt.setAttributes(ot,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(I),I.outerHTML}return''},c}(),wn=function(c){function o(a,u,d){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=d,h}return Ht(o,c),o.prototype.setupDropdown=function(){var a=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=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Dt),At=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=gt.createGroup(),this.visual.appendChild(gt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(gt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return gt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Nn=function(){function c(o,a,u,d){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=d,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(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&>.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=gt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=gt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;athis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),gt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,I){var Be=a.y+u*(I+1);gt.setAttributes(h,[["x1",""+a.x],["y1",""+Be],["x2",""+(a.x+a.width)],["y2",""+Be]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,I){var Be=a.x+d*(I+1);gt.setAttributes(h,[["x1",""+Be],["y1",""+a.y],["x2",""+Be],["y2",""+(a.y+a.height)]])}),gt.setAttributes(this.cropShadeElement,[["d",gt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.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)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),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=o},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,d=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+uthis.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=d,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=d}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),d=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=o-this.cropRect.width/2,this.cropRect.y=a-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)}},c.prototype.getRescaledRect=function(o,a,u,d,h,I){var Be=u/o,$e=d/a;return{x:(h.x-I)*Be+I,y:(h.y-I)*$e+I,width:h.width*Be,height:h.height*$e}},c.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),Yn=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,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(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.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},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();gt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var d=u%5==0?this.height/3:this.height/6;a+="h4v"+-d+"h1v"+d}a+="v1H0Z",this.scaleShape=gt.createPath(a);var h=gt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=gt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=gt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var I=gt.createTSpan("");return I.innerHTML="°",this.angleLabelElement.appendChild(I),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),hi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,d,h,I,Be){var $e=this;return new Promise(function(ot){var Fe=document.createElement("canvas");Fe.width=o.width.baseVal.value-2*d,Fe.height=o.height.baseVal.value-2*d;var wt=1,Rt=1;$e.naturalSize===!0?(wt=a.naturalWidth/(o.width.baseVal.value-2*d)/I,Rt=a.naturalHeight/(o.height.baseVal.value-2*d)/Be,Fe.width=a.naturalWidth/I,Fe.height=a.naturalHeight/Be):$e.width!==void 0&&$e.height!==void 0&&(wt=$e.width/u.width,Rt=$e.height/u.height,Fe.width*=wt,Fe.height*=Rt);var Vt=Fe.getContext("2d");Vt.translate(Fe.width/2,Fe.height/2),Vt.rotate(h*Math.PI/180),Vt.scale(I,Be),Vt.translate(-Fe.width/2,-Fe.height/2),Vt.drawImage(a,0,0,Fe.width,Fe.height);var In=document.createElement("canvas");In.width=u.width*wt,In.height=u.height*Rt,In.getContext("2d").putImageData(Vt.getImageData((u.x-d)*wt,(u.y-d)*Rt,u.width*wt,u.height*Rt),0,0),ot(In.toDataURL($e.imageType,$e.imageQuality))})},c}(),Ge=function(){function c(o){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=c.instanceCounter++,this.styles=new Kn(this.instanceNo),this.target=o,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(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.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},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.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))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGINo+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"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},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Wn,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 a=new li;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Rt){var Vt=new Dt(ui.getIcon(Rt.horizontal,Rt.vertical),Rt.horizontal===0&&Rt.vertical===0?"FREE":Rt.horizontal+":"+Rt.vertical);Vt.onClick=function(){return o.ratioButtonClicked(Rt)},u.push(Vt)}),this.aspectRatioButton=new wn(ui.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,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var d=new Dt('',"Toggle grid");d.isActive=this.isGridVisible,d.onClick=function(){o.isGridVisible=!o.isGridVisible,d.isActive=o.isGridVisible},a.addButton(d);var h=new Dt('',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!ai.isLicensed){var I=new ht;this.topToolbar.addElementBlock(I);var Be=document.createElement("div");Be.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var $e=document.createElement("a");$e.style.color="currentColor",$e.href="https://markerjs.com/products/cropro",$e.target="_blank",$e.innerHTML='',Be.appendChild($e),I.addElement(Be)}var ot=new li;ot.minWidth=3*this.toolbarHeight+"px",ot.contentAlign="end",this.topToolbar.addButtonBlock(ot);var Fe=new Dt('',"OK");Fe.onClick=this.startRenderAndClose,ot.addButton(Fe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Fe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new Dt('',"Close");wt.onClick=this.close,ot.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Wn,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 a=new li;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Dt('',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var d=new Dt('',"Rotate right");d.onClick=this.rotateRightButtonClicked,a.addButton(d);var h=new ht;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new Yn("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(ot){o.rotateBy(ot),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var I=new li;I.minWidth=2*this.toolbarHeight+"px",I.contentAlign="end",this.bottomToolbar.addButtonBlock(I);var Be=new Dt('',"Flip horizontal");Be.onClick=this.flipHorizontallyButtonClicked,I.addButton(Be);var $e=new Dt('',"Flip vertical");$e.onClick=this.flipVerticallyButtonClicked,I.addButton($e)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ui.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Pn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"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()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,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=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return _t(this,void 0,void 0,function(){var o,a;return zn(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(d){return d(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return _t(this,void 0,void 0,function(){var o;return zn(this,function(a){switch(a.label){case 0:return(o=new hi).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),gt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.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 a.sent(),[4,o.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,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new fn("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 fn("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new fn("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new fn("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*o)+`px; height: `+(this.toolbarHeight-2*o)+`px; padding: `+o+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new fn("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new fn("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new on("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new on("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new fn("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 fn("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new fn("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 fn("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*o)+`px; padding: `+o+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new fn("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},c.instanceCounter=0,c}(),Ct=C("8hTe"),ci=C.n(Ct),Ai=/]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Li=Qe.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,d=u===void 0?!1:u,h=c.className,I=c.showTextOnly,Be=c.showLines,$e=c.replaces,ot=c.zoomImg,Fe=c.hasMask,wt=c.style,Rt=wt===void 0?{}:wt,Vt=c.stylesPrev,In=Vt===void 0?{}:Vt,jn=String(a),an=Object(q.useRef)(),Gn=Object(q.useRef)(),Wi=Object(q.useState)(""),Cn=Object(N.a)(Wi,2),Bn=Cn[0],Rn=Cn[1],vi=Object(q.useState)("office"),$n=Object(N.a)(vi,2),fi=$n[0],ti=$n[1],cr=function(){var It=new Ge(Gn.current);It.displayMode="popup",It.addRenderEventListener(function(){var pn=Object(le.a)(U.a.mark(function Pt(en){var Ft;return U.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return an.current.style.display="none",qt.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:en}});case 3:Ft=qt.sent,Ft!=null&&Ft.id&&$e(Gn.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(Ft==null?void 0:Ft.id,"?type=").concat(Ft.content_type));case 5:case"end":return qt.stop()}},Pt)}));return function(Pt){return pn.apply(this,arguments)}}()),It.show()},Gi=function(){var It=new Nt(Gn.current);It.settings.displayMode="popup",It.addEventListener("render",function(){var pn=Object(le.a)(U.a.mark(function Pt(en){var Ft;return U.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:if(an.current.style.display="none",!Gn.current){qt.next=6;break}return qt.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:en.dataUrl}});case 4:Ft=qt.sent,Ft!=null&&Ft.id&&$e(Gn.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(Ft==null?void 0:Ft.id,"?type=").concat(Ft.content_type));case 6:case"end":return qt.stop()}},Pt)}));return function(Pt){return pn.apply(this,arguments)}}()),It.show(),window.markerArea=It},Zn=Object(q.useMemo)(function(){try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,It=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;jn=jn.replace(Zt,"("+P.a.API_SERVER+"/api/attachments/").replace(It,'"'+P.a.API_SERVER+"/api/attachments/").replace(pn,'"'+P.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,` `),jn=jn.replace(new RegExp("(?[TOC]

    ",We()),Ke()),Pt=Pt.replace(/(__special_katext_id_\d+__)/g,function(ni,qt){var Sn=en[qt],Vi=Sn.type,Xi=Sn.expression;return Object(Y.renderToString)(di(Xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Pt=Pt.replace(/▁/g,"\u2581\u2581\u2581"),J(),I){var Ft=document.createElement("div");return Ft.innerHTML=Pt,Ft.innerText}return setTimeout(function(){return Mi()},500),Pt},[jn]),Fn=Object(q.useRef)();Ee.WebkitLineClamp=Be,Be&&(Rt=Object(ke.a)(Object(ke.a)({},Rt),Ee));function Ri(Zt){var It=Zt.target;if(It.tagName.toUpperCase()==="IMG"){if(ot){var pn=It.getAttribute("src");Rn(pn),ti("image")}}else if(It.tagName.toUpperCase()==="A"){var Pt=It.getAttribute("href");if(Pt.indexOf("office")>-1)Zt.preventDefault(),Rn(Pt),ti("office");else if(Pt.indexOf("application/pdf")>-1)Zt.preventDefault(),Rn(Pt),ti("pdf");else if(Pt.indexOf("type=text")>-1)Zt.preventDefault(),Rn(Pt),ti("html");else if(Pt.startsWith("#")){Zt.preventDefault();var en=document.getElementById(Pt.replace("#",""));en&&en.scrollIntoView(!0)}}}var Mi=function(){var It,pn=(It=Fn.current)===null||It===void 0?void 0:It.querySelectorAll("video");pn==null||pn.forEach(function(Pt){if(Pt.oncontextmenu=function(){return!1},Pt.src.indexOf(".m3u8")>-1&&!Pt.canPlayType("application/vnd.apple.mpegurl")){if(w.a.isSupported()){var en=new w.a;en.loadSource(Pt.src),en.attachMedia(Pt)}}})};Object(q.useEffect)(function(){if(Fn.current&&Zn&&(Zn.match(Ai)&&window.PR.prettyPrint()),Fn.current)return Fn.current.addEventListener("click",Ri),function(){Fn.current.removeEventListener("click",Ri),J(),Ke()}},[Zn,Fn.current,Ri]);var dr=function(It){if(!d)return;It.target.nodeName==="IMG"?(an.current.style.display="flex",an.current.style.width=It.target.clientWidth+"px",an.current.style.height=It.target.clientHeight+"px",an.current.style.top=It.target.offsetTop+"px",an.current.style.left=It.target.offsetLeft+"px",Gn.current.src=It.target.getAttribute("src")):an.current.style.display="none"};return M.a.createElement("div",{style:{position:"relative"}},M.a.createElement("div",{ref:Fn,style:Object(ke.a)({},Rt),className:"".concat(h||""," markdown-body ").concat(ci.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:Zn}}),M.a.createElement("div",{ref:an,className:ci.a.button},M.a.createElement(_e.a,null,M.a.createElement(Re.a,{onClick:function(){return cr()}},"\u88C1\u526A"),M.a.createElement(Re.a,{onClick:function(){return Gi()}},"\u7F16\u8F91"))),M.a.createElement("img",{ref:Gn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),M.a.createElement(ge.a,{close:!0,data:Bn,hasMask:Fe,type:Bn!=null&&Bn.length?fi:"",style:Object(ke.a)({},In),onClose:function(){return Rn("")}}))}},"9VGf":function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return de});var G=C("q1tI"),_e=C.n(G);function de(Re,ke){var le=Object(G.useRef)();Object(G.useEffect)(function(){le.current=Re}),Object(G.useEffect)(function(){function N(){le.current()}if(ke!==null){var Q=setInterval(N,ke);return function(){return clearInterval(Q)}}},[ke])}},Bd2K:function(bt,Qe,C){(function(G){G(C("VrN/"),C("osHv"))})(function(G){G.defineOption("autoCloseTags",!1,function(U,q,M){if(M!=G.Init&&M&&U.removeKeyMap("autoCloseTags"),!q)return;var F={name:"autoCloseTags"};(typeof q!="object"||q.whenClosing!==!1)&&(F["'/'"]=function(fe){return le(fe)}),(typeof q!="object"||q.whenOpening!==!1)&&(F["'>'"]=function(fe){return Re(fe)}),U.addKeyMap(F)});var _e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],de=["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 Re(U){if(U.getOption("disableInput"))return G.Pass;for(var q=U.listSelections(),M=[],F=U.getOption("autoCloseTags"),fe=0;feae.ch&&(he=he.slice(0,he.length-K.end+ae.ch));var Ce=he.toLowerCase();if(!he||K.type=="string"&&(K.end!=ae.ch||!/[\"\']/.test(K.string.charAt(K.string.length-1))||K.string.length==1)||K.type=="tag"&&me.close||K.string.indexOf("/")==ae.ch-K.start-1||Ke&&N(Ke,Ce)>-1||Q(U,ee.mode.xmlCurrentContext&&ee.mode.xmlCurrentContext(H)||[],he,ae,!0))return G.Pass;var We=typeof F=="object"&&F.emptyTags;if(We&&N(We,he)>-1){M[fe]={text:"/>",newPos:G.Pos(ae.line,ae.ch+2)};continue}var pe=Ee&&N(Ee,Ce)>-1;M[fe]={indent:pe,text:">"+(pe?` `:"")+"",newPos:pe?G.Pos(ae.line+1,0):G.Pos(ae.line,ae.ch+1)}}for(var Ae=typeof F=="object"&&F.dontIndentOnAutoClose,fe=q.length-1;fe>=0;fe--){var ve=M[fe];U.replaceRange(ve.text,q[fe].head,q[fe].anchor,"+insert");var ie=U.listSelections().slice(0);ie[fe]={head:ve.newPos,anchor:ve.newPos},U.setSelections(ie),!Ae&&ve.indent&&(U.indentLine(ve.newPos.line,null,!0),U.indentLine(ve.newPos.line+1,null,!0))}}function ke(U,q){for(var M=U.listSelections(),F=[],fe=q?"/":""&&(Ke+=">"),F[ee]=Ke}if(U.replaceSelections(F),M=U.listSelections(),!K)for(var ee=0;ee=0&&q[H]==M;H--)++ee;F=K.to;for(var H=1;H0){for(var q=0;q1&&arguments[1]!==void 0?arguments[1]:"",q=[],M=0;MX.length)&&(B=X.length);for(var W=0,y=new Array(B);W=X.length?{done:!0}:{done:!1,value:X[y++]}}}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 W=X[Symbol.iterator](),W.next.bind(W)}function le(X,B){return B={exports:{}},X(B,B.exports),B.exports}var N=le(function(X){function B(){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 W(y){X.exports.defaults=y}X.exports={defaults:B(),getDefaults:B,changeDefaults:W}}),Q=N.defaults,U=N.getDefaults,q=N.changeDefaults,M=/[&<>"']/,F=/[&<>"']/g,fe=/[<>"']|&(?!#?\w+;)/,ae=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},ee=function(B){return K[B]};function H(X,B){if(B){if(M.test(X))return X.replace(F,ee)}else if(fe.test(X))return X.replace(ae,ee);return X}var me=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function he(X){return X.replace(me,function(B,W){return W=W.toLowerCase(),W==="colon"?":":W.charAt(0)==="#"?W.charAt(1)==="x"?String.fromCharCode(parseInt(W.substring(2),16)):String.fromCharCode(+W.substring(1)):""})}var ze=/(^|[^\[])\^/g;function Ke(X,B){X=X.source||X,B=B||"";var W={replace:function(x,k){return k=k.source||k,k=k.replace(ze,"$1"),X=X.replace(x,k),W},getRegex:function(){return new RegExp(X,B)}};return W}var Ee=/[^\w:]/g,Ce=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function We(X,B,W){if(X){var y;try{y=decodeURIComponent(he(W)).replace(Ee,"").toLowerCase()}catch(x){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}B&&!Ce.test(W)&&(W=S(B,W));try{W=encodeURI(W).replace(/%25/g,"%")}catch(x){return null}return W}var pe={},Ae=/^[^:]+:\/*[^/]*$/,ve=/^([^:]+:)[\s\S]*$/,ie=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(X,B){pe[" "+X]||(Ae.test(X)?pe[" "+X]=X+"/":pe[" "+X]=re(X,"/",!0)),X=pe[" "+X];var W=X.indexOf(":")===-1;return B.substring(0,2)==="//"?W?B:X.replace(ve,"$1")+B:B.charAt(0)==="/"?W?B:X.replace(ie,"$1")+B:X+B}var ne={exec:function(){}};function J(X){for(var B=1,W,y;B=0&&se[je]==="\\";)$=!$;return $?"|":" |"}),y=W.split(/ \|/),x=0;if(y.length>B)y.splice(B);else for(;y.length=y.length?x.slice(y.length):x}).join(` `)}var be=function(){function X(W){this.options=W||g}var B=X.prototype;return B.space=function(y){var x=this.rules.block.newline.exec(y);if(x)return x[0].length>1?{type:"space",raw:x[0]}:{raw:` `}},B.code=function(y,x){var k=this.rules.block.code.exec(y);if(k){var T=x[x.length-1];if(T&&T.type==="paragraph")return{raw:k[0],text:k[0].trimRight()};var se=k[0].replace(/^ {4}/gm,"");return{type:"code",raw:k[0],codeBlockStyle:"indented",text:this.options.pedantic?se:p(se,` `)}}},B.fences=function(y){var x=this.rules.block.fences.exec(y);if(x){var k=x[0],T=De(k,x[3]||"");return{type:"code",raw:k,lang:x[2]?x[2].trim():x[2],text:T}}},B.heading=function(y){var x=this.rules.block.heading.exec(y);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},B.nptable=function(y){var x=this.rules.block.nptable.exec(y);if(x){var k={type:"table",header:w(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(` `):[],raw:x[0]};if(k.header.length===k.align.length){var T=k.align.length,se;for(se=0;se ?/gm,"");return{type:"blockquote",raw:x[0],text:k}}},B.list=function(y){var x=this.rules.block.list.exec(y);if(x){for(var k=x[0],T=x[2],se=T.length>1,$=T[T.length-1]===")",je={type:"list",raw:k,ordered:se,start:se?+T.slice(0,-1):"",loose:!1,items:[]},et=x[0].match(this.rules.block.item),ct=!1,lt,kt,Et,ut,Kt,Nt,Gt,Ht=et.length,_t=0;_t1||this.options.smartLists&&Et!==T)&&(ut=et.slice(_t+1).join(` `),je.raw=je.raw.substring(0,je.raw.length-ut.length),_t=Ht-1)),Kt=ct||/\n\n(?!\s*$)/.test(lt),_t!==Ht-1&&(ct=lt.charAt(lt.length-1)===` `,Kt||(Kt=ct)),Kt&&(je.loose=!0),Nt=/^\[[ xX]\] /.test(lt),Gt=void 0,Nt&&(Gt=lt[1]!==" ",lt=lt.replace(/^\[[ xX]\] +/,"")),je.items.push({type:"list_item",raw:k,task:Nt,checked:Gt,loose:Kt,text:lt});return je}},B.html=function(y){var x=this.rules.block.html.exec(y);if(x)return{type:this.options.sanitize?"paragraph":"html",raw:x[0],pre:!this.options.sanitizer&&(x[1]==="pre"||x[1]==="script"||x[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):P(x[0]):x[0]}},B.def=function(y){var x=this.rules.block.def.exec(y);if(x){x[3]&&(x[3]=x[3].substring(1,x[3].length-1));var k=x[1].toLowerCase().replace(/\s+/g," ");return{tag:k,raw:x[0],href:x[2],title:x[3]}}},B.table=function(y){var x=this.rules.block.table.exec(y);if(x){var k={type:"table",header:w(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(` `):[]};if(k.header.length===k.align.length){k.raw=x[0];var T=k.align.length,se;for(se=0;se/i.test(T[0])&&(x=!1),!k&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?k=!0:k&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(k=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:x,inRawBlock:k,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):P(T[0]):T[0]}},B.link=function(y){var x=this.rules.inline.link.exec(y);if(x){var k=Y(x[2],"()");if(k>-1){var T=x[0].indexOf("!")===0?5:4,se=T+x[1].length+k;x[2]=x[2].substring(0,k),x[0]=x[0].substring(0,se).trim(),x[3]=""}var $=x[2],je="";if(this.options.pedantic){var et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec($);et?($=et[1],je=et[3]):je=""}else je=x[3]?x[3].slice(1,-1):"";$=$.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=ge(x,{href:$&&$.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},x[0]);return ct}},B.reflink=function(y,x){var k;if((k=this.rules.inline.reflink.exec(y))||(k=this.rules.inline.nolink.exec(y))){var T=(k[2]||k[1]).replace(/\s+/g," ");if(T=x[T.toLowerCase()],!T||!T.href){var se=k[0].charAt(0);return{type:"text",raw:se,text:se}}var $=ge(k,T,k[0]);return $}},B.strong=function(y,x,k){k===void 0&&(k="");var T=this.rules.inline.strong.start.exec(y);if(T&&(!T[1]||T[1]&&(k===""||this.rules.inline.punctuation.exec(k)))){x=x.slice(-1*y.length);var se=T[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;se.lastIndex=0;for(var $;(T=se.exec(x))!=null;)if($=this.rules.inline.strong.middle.exec(x.slice(0,T.index+3)),$)return{type:"strong",raw:y.slice(0,$[0].length),text:y.slice(2,$[0].length-2)}}},B.em=function(y,x,k){k===void 0&&(k="");var T=this.rules.inline.em.start.exec(y);if(T&&(!T[1]||T[1]&&(k===""||this.rules.inline.punctuation.exec(k)))){x=x.slice(-1*y.length);var se=T[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;se.lastIndex=0;for(var $;(T=se.exec(x))!=null;)if($=this.rules.inline.em.middle.exec(x.slice(0,T.index+2)),$)return{type:"em",raw:y.slice(0,$[0].length),text:y.slice(1,$[0].length-1)}}},B.codespan=function(y){var x=this.rules.inline.code.exec(y);if(x){var k=x[2].replace(/\n/g," "),T=/[^ ]/.test(k),se=k.startsWith(" ")&&k.endsWith(" ");return T&&se&&(k=k.substring(1,k.length-1)),k=P(k,!0),{type:"codespan",raw:x[0],text:k}}},B.br=function(y){var x=this.rules.inline.br.exec(y);if(x)return{type:"br",raw:x[0]}},B.del=function(y){var x=this.rules.inline.del.exec(y);if(x)return{type:"del",raw:x[0],text:x[1]}},B.autolink=function(y,x){var k=this.rules.inline.autolink.exec(y);if(k){var T,se;return k[2]==="@"?(T=P(this.options.mangle?x(k[1]):k[1]),se="mailto:"+T):(T=P(k[1]),se=T),{type:"link",raw:k[0],text:T,href:se,tokens:[{type:"text",raw:T,text:T}]}}},B.url=function(y,x){var k;if(k=this.rules.inline.url.exec(y)){var T,se;if(k[2]==="@")T=P(this.options.mangle?x(k[0]):k[0]),se="mailto:"+T;else{var $;do $=k[0],k[0]=this.rules.inline._backpedal.exec(k[0])[0];while($!==k[0]);T=P(k[0]),k[1]==="www."?se="http://"+T:se=T}return{type:"link",raw:k[0],text:T,href:se,tokens:[{type:"text",raw:T,text:T}]}}},B.inlineText=function(y,x,k){var T=this.rules.inline.text.exec(y);if(T){var se;return x?se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):P(T[0]):T[0]:se=P(this.options.smartypants?k(T[0]):T[0]),{type:"text",raw:T[0],text:se}}},X}(),Se=L.noopTest,ce=L.edit,xe=L.merge,Z={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Z._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Z._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Z.def=ce(Z.def).replace("label",Z._label).replace("title",Z._title).getRegex(),Z.bullet=/(?:[*+-]|\d{1,9}[.)])/,Z.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Z.item=ce(Z.item,"gm").replace(/bull/g,Z.bullet).getRegex(),Z.list=ce(Z.list).replace(/bull/g,Z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Z.def.source+")").getRegex(),Z._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",Z._comment=//,Z.html=ce(Z.html,"i").replace("comment",Z._comment).replace("tag",Z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z.paragraph=ce(Z._paragraph).replace("hr",Z.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",")|<(?:script|pre|style|!--)").replace("tag",Z._tag).getRegex(),Z.blockquote=ce(Z.blockquote).replace("paragraph",Z.paragraph).getRegex(),Z.normal=xe({},Z),Z.gfm=xe({},Z.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*|$)"}),Z.gfm.nptable=ce(Z.gfm.nptable).replace("hr",Z.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",")|<(?:script|pre|style|!--)").replace("tag",Z._tag).getRegex(),Z.gfm.table=ce(Z.gfm.table).replace("hr",Z.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",")|<(?:script|pre|style|!--)").replace("tag",Z._tag).getRegex(),Z.pedantic=xe({},Z.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Z._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:ce(Z.normal._paragraph).replace("hr",Z.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var j={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^|^<[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:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",j.punctuation=ce(j.punctuation).replace(/punctuation/g,j._punctuation).getRegex(),j._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",j._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",j.em.start=ce(j.em.start).replace(/punctuation/g,j._punctuation).getRegex(),j.em.middle=ce(j.em.middle).replace(/punctuation/g,j._punctuation).replace(/overlapSkip/g,j._overlapSkip).getRegex(),j.em.endAst=ce(j.em.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.em.endUnd=ce(j.em.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.start=ce(j.strong.start).replace(/punctuation/g,j._punctuation).getRegex(),j.strong.middle=ce(j.strong.middle).replace(/punctuation/g,j._punctuation).replace(/blockSkip/g,j._blockSkip).getRegex(),j.strong.endAst=ce(j.strong.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.endUnd=ce(j.strong.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.blockSkip=ce(j._blockSkip,"g").getRegex(),j.overlapSkip=ce(j._overlapSkip,"g").getRegex(),j._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,j._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,j._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])?)+(?![-_])/,j.autolink=ce(j.autolink).replace("scheme",j._scheme).replace("email",j._email).getRegex(),j._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,j.tag=ce(j.tag).replace("comment",Z._comment).replace("attribute",j._attribute).getRegex(),j._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,j._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,j._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,j.link=ce(j.link).replace("label",j._label).replace("href",j._href).replace("title",j._title).getRegex(),j.reflink=ce(j.reflink).replace("label",j._label).getRegex(),j.reflinkSearch=ce(j.reflinkSearch,"g").replace("reflink",j.reflink).replace("nolink",j.nolink).getRegex(),j.normal=xe({},j),j.pedantic=xe({},j.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:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",j._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j._label).getRegex()}),j.gfm=xe({},j.normal,{escape:ce(j.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&&(y="x"+y.toString(16)),B+="&#"+y+";";return B}var we=function(){function X(W){this.tokens=[],this.tokens.links=Object.create(null),this.options=W||R,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var y={block:E.normal,inline:ue.normal};this.options.pedantic?(y.block=E.pedantic,y.inline=ue.pedantic):this.options.gfm&&(y.block=E.gfm,this.options.breaks?y.inline=ue.breaks:y.inline=ue.gfm),this.tokenizer.rules=y}X.lex=function(y,x){var k=new X(x);return k.lex(y)};var B=X.prototype;return B.lex=function(y){return y=y.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(y,this.tokens,!0),this.inline(this.tokens),this.tokens},B.blockTokens=function(y,x,k){x===void 0&&(x=[]),k===void 0&&(k=!0),y=y.replace(/^ +$/gm,"");for(var T,se,$,je;y;){if(T=this.tokenizer.space(y)){y=y.substring(T.raw.length),T.type&&x.push(T);continue}if(T=this.tokenizer.code(y,x)){y=y.substring(T.raw.length),T.type?x.push(T):(je=x[x.length-1],je.raw+=` `+T.raw,je.text+=` `+T.text);continue}if(T=this.tokenizer.fences(y)){y=y.substring(T.raw.length),x.push(T);continue}if(T=this.tokenizer.heading(y)){y=y.substring(T.raw.length),x.push(T);continue}if(T=this.tokenizer.nptable(y)){y=y.substring(T.raw.length),x.push(T);continue}if(T=this.tokenizer.hr(y)){y=y.substring(T.raw.length),x.push(T);continue}if(T=this.tokenizer.blockquote(y)){y=y.substring(T.raw.length),T.tokens=this.blockTokens(T.text,[],k),x.push(T);continue}if(T=this.tokenizer.list(y)){for(y=y.substring(T.raw.length),$=T.items.length,se=0;se<$;se++)T.items[se].tokens=this.blockTokens(T.items[se].text,[],!1);x.push(T);continue}if(T=this.tokenizer.html(y)){y=y.substring(T.raw.length),x.push(T);continue}if(k&&(T=this.tokenizer.def(y))){y=y.substring(T.raw.length),this.tokens.links[T.tag]||(this.tokens.links[T.tag]={href:T.href,title:T.title});continue}if(T=this.tokenizer.table(y)){y=y.substring(T.raw.length),x.push(T);continue}if(T=this.tokenizer.lheading(y)){y=y.substring(T.raw.length),x.push(T);continue}if(k&&(T=this.tokenizer.paragraph(y))){y=y.substring(T.raw.length),x.push(T);continue}if(T=this.tokenizer.text(y,x)){y=y.substring(T.raw.length),T.type?x.push(T):(je=x[x.length-1],je.raw+=` `+T.raw,je.text+=` `+T.text);continue}if(y){var et="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(et);break}else throw new Error(et)}}return x},B.inline=function(y){var x,k,T,se,$,je,et=y.length;for(x=0;x0)for(;(et=this.tokenizer.rules.inline.reflinkSearch.exec(je))!=null;)ct.includes(et[0].slice(et[0].lastIndexOf("[")+1,-1))&&(je=je.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(et=this.tokenizer.rules.inline.blockSkip.exec(je))!=null;)je=je.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;y;){if($=this.tokenizer.escape(y)){y=y.substring($.raw.length),x.push($);continue}if($=this.tokenizer.tag(y,k,T)){y=y.substring($.raw.length),k=$.inLink,T=$.inRawBlock,x.push($);continue}if($=this.tokenizer.link(y)){y=y.substring($.raw.length),$.type==="link"&&($.tokens=this.inlineTokens($.text,[],!0,T)),x.push($);continue}if($=this.tokenizer.reflink(y,this.tokens.links)){y=y.substring($.raw.length),$.type==="link"&&($.tokens=this.inlineTokens($.text,[],!0,T)),x.push($);continue}if($=this.tokenizer.strong(y,je,se)){y=y.substring($.raw.length),$.tokens=this.inlineTokens($.text,[],k,T),x.push($);continue}if($=this.tokenizer.em(y,je,se)){y=y.substring($.raw.length),$.tokens=this.inlineTokens($.text,[],k,T),x.push($);continue}if($=this.tokenizer.codespan(y)){y=y.substring($.raw.length),x.push($);continue}if($=this.tokenizer.br(y)){y=y.substring($.raw.length),x.push($);continue}if($=this.tokenizer.del(y)){y=y.substring($.raw.length),$.tokens=this.inlineTokens($.text,[],k,T),x.push($);continue}if($=this.tokenizer.autolink(y,V)){y=y.substring($.raw.length),x.push($);continue}if(!k&&($=this.tokenizer.url(y,V))){y=y.substring($.raw.length),x.push($);continue}if($=this.tokenizer.inlineText(y,T,ye)){y=y.substring($.raw.length),se=$.raw.slice(-1),x.push($);continue}if(y){var lt="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return x},_e(X,null,[{key:"rules",get:function(){return{block:E,inline:ue}}}]),X}(),Me=N.defaults,Ue=L.cleanUrl,Ie=L.escape,Le=function(){function X(W){this.options=W||Me}var B=X.prototype;return B.code=function(y,x,k){var T=(x||"").match(/\S*/)[0];if(this.options.highlight){var se=this.options.highlight(y,T);se!=null&&se!==y&&(k=!0,y=se)}return T?'
    '+(k?y:Ie(y,!0))+`
    `:"
    "+(k?y:Ie(y,!0))+`
    `},B.blockquote=function(y){return`
    `+y+`
    `},B.html=function(y){return y},B.heading=function(y,x,k,T){return this.options.headerIds?"'+y+" `:""+y+" `},B.hr=function(){return this.options.xhtml?`
    `:`
    `},B.list=function(y,x,k){var T=x?"ol":"ul",se=x&&k!==1?' start="'+k+'"':"";return"<"+T+se+`> `+y+" `},B.listitem=function(y){return"
  • "+y+`
  • `},B.checkbox=function(y){return" "},B.paragraph=function(y){return"

    "+y+`

    `},B.table=function(y,x){return x&&(x=""+x+""),` `+y+` `+x+`
    `},B.tablerow=function(y){return` `+y+` `},B.tablecell=function(y,x){var k=x.header?"th":"td",T=x.align?"<"+k+' align="'+x.align+'">':"<"+k+">";return T+y+" `},B.strong=function(y){return""+y+""},B.em=function(y){return""+y+""},B.codespan=function(y){return""+y+""},B.br=function(){return this.options.xhtml?"
    ":"
    "},B.del=function(y){return""+y+""},B.link=function(y,x,k){if(y=Ue(this.options.sanitize,this.options.baseUrl,y),y===null)return k;var T='",T},B.image=function(y,x,k){if(y=Ue(this.options.sanitize,this.options.baseUrl,y),y===null)return k;var T=''+k+'":">",T},B.text=function(y){return y},X}(),Ne=function(){function X(){}var B=X.prototype;return B.strong=function(y){return y},B.em=function(y){return y},B.codespan=function(y){return y},B.del=function(y){return y},B.html=function(y){return y},B.text=function(y){return y},B.link=function(y,x,k){return""+k},B.image=function(y,x,k){return""+k},B.br=function(){return""},X}(),Ye=function(){function X(){this.seen={}}var B=X.prototype;return B.slug=function(y){var x=y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(x)){var k=x;do this.seen[k]++,x=k+"-"+this.seen[k];while(this.seen.hasOwnProperty(x))}return this.seen[x]=0,x},X}(),tt=N.defaults,Ze=L.unescape,nt=function(){function X(W){this.options=W||tt,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ne,this.slugger=new Ye}X.parse=function(y,x){var k=new X(x);return k.parse(y)};var B=X.prototype;return B.parse=function(y,x){x===void 0&&(x=!0);var k="",T,se,$,je,et,ct,lt,kt,Et,ut,Kt,Nt,Gt,Ht,_t,zn,ai,gt,Kn=y.length;for(T=0;T0&&_t.tokens[0].type==="text"?(_t.tokens[0].text=gt+" "+_t.tokens[0].text,_t.tokens[0].tokens&&_t.tokens[0].tokens.length>0&&_t.tokens[0].tokens[0].type==="text"&&(_t.tokens[0].tokens[0].text=gt+" "+_t.tokens[0].tokens[0].text)):_t.tokens.unshift({type:"text",text:gt}):Ht+=gt),Ht+=this.parse(_t.tokens,Gt),Et+=this.renderer.listitem(Ht,ai,zn);k+=this.renderer.list(Et,Kt,Nt);continue}case"html":{k+=this.renderer.html(ut.text);continue}case"paragraph":{k+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(Et=ut.tokens?this.parseInline(ut.tokens):ut.text;T+1An error occurred:

    "+rt($.message+"",!0)+"
    ";throw $}}Pe.options=Pe.setOptions=function(X){return mt(Pe.defaults,X),yt(Pe.defaults),Pe},Pe.getDefaults=Te,Pe.defaults=st,Pe.use=function(X){var B=mt({},X);if(X.renderer&&function(){var y=Pe.defaults.renderer||new Le,x=function(se){var $=y[se];y[se]=function(){for(var je=arguments.length,et=new Array(je),ct=0;ct`,triples:"",explode:"[]{}"},de=G.Pos;G.defineOption("autoCloseBrackets",!1,function(K,ee,H){H&&H!=G.Init&&(K.removeKeyMap(ke),K.state.closeBrackets=null),ee&&(le(Re(ee,"pairs")),K.state.closeBrackets=ee,K.addKeyMap(ke))});function Re(K,ee){return ee=="pairs"&&typeof K=="string"?K:typeof K=="object"&&K[ee]!=null?K[ee]:_e[ee]}var ke={Backspace:U,Enter:q};function le(K){for(var ee=0;ee=0;he--){var Ke=me[he].head;K.replaceRange("",de(Ke.line,Ke.ch-1),de(Ke.line,Ke.ch+1),"+delete")}}function q(K){var ee=Q(K),H=ee&&Re(ee,"explode");if(!H||K.getOption("disableInput"))return G.Pass;for(var me=K.listSelections(),he=0;he0;return{anchor:new de(K.anchor.line,K.anchor.ch+(ee?-1:1)),head:new de(K.head.line,K.head.ch+(ee?1:-1))}}function F(K,ee){var H=Q(K);if(!H||K.getOption("disableInput"))return G.Pass;var me=Re(H,"pairs"),he=me.indexOf(ee);if(he==-1)return G.Pass;for(var ze=Re(H,"closeBefore"),Ke=Re(H,"triples"),Ee=me.charAt(he+1)==ee,Ce=K.listSelections(),We=he%2==0,pe,Ae=0;Ae=0&&K.getRange(ie,de(ie.line,ie.ch+3))==ee+ee+ee?S="skipThree":S="skip";else if(Ee&&ie.ch>1&&Ke.indexOf(ee)>=0&&K.getRange(de(ie.line,ie.ch-2),ie)==ee+ee){if(ie.ch>2&&/\bstring/.test(K.getTokenTypeAt(de(ie.line,ie.ch-2))))return G.Pass;S="addFour"}else if(Ee){var J=ie.ch==0?" ":K.getRange(de(ie.line,ie.ch-1),ie);if(!G.isWordChar(ne)&&J!=ee&&!G.isWordChar(J))S="both";else return G.Pass}else if(We&&(ne.length===0||/\s/.test(ne)||ze.indexOf(ne)>-1))S="both";else return G.Pass;if(!pe)pe=S;else if(pe!=S)return G.Pass}var _=he%2?me.charAt(he-1):ee,re=he%2?ee:me.charAt(he+1);K.operation(function(){if(pe=="skip")K.execCommand("goCharRight");else if(pe=="skipThree")for(var z=0;z<3;z++)K.execCommand("goCharRight");else if(pe=="surround"){for(var D=K.getSelections(),z=0;z0&&(Y.percent=Y.loaded/Y.total*100),L.onProgress(Y)});var p=new FormData;L.data&&Object.keys(L.data).forEach(function(P){var Y=L.data[P];if(Array.isArray(Y)){Y.forEach(function(ge){p.append(P+"[]",ge)});return}p.append(P,L.data[P])}),L.file instanceof Blob?p.append(L.filename,L.file,L.file.name):p.append(L.filename,L.file),g.onerror=function(Y){L.onError(Y)},g.onload=function(){return g.status<200||g.status>=300?L.onError(ke(L,g),le(g)):L.onSuccess(le(g),g)},g.open(L.method,L.action,!0),L.withCredentials&&"withCredentials"in g&&(g.withCredentials=!0);var w=L.headers||{};return w["X-Requested-With"]!==null&&g.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(w).forEach(function(P){w[P]!==null&&g.setRequestHeader(P,w[P])}),g.send(p),{abort:function(){g.abort()}}}var Q=+new Date,U=0;function q(){return"rc-upload-"+Q+"-"+ ++U}function M(L,g){return L.indexOf(g,L.length-g.length)!==-1}var F=function(L,g){if(L&&g){var p=Array.isArray(g)?g:g.split(","),w=L.name||"",P=L.type||"",Y=P.replace(/\/.*$/,"");return p.some(function(ge){var De=ge.trim();return De.charAt(0)==="."?M(w.toLowerCase(),De.toLowerCase()):/\/\*$/.test(De)?Y===De.replace(/\/.*$/,""):P===De})}return!0};function fe(L,g){var p=L.createReader(),w=[];function P(){p.readEntries(function(Y){var ge=Array.prototype.slice.apply(Y);w=w.concat(ge);var De=!ge.length;De?g(w):P()})}P()}var ae=function(g,p,w){var P=function Y(ge,De){De=De||"",ge.isFile?ge.file(function(be){w(be)&&(ge.fullPath&&!be.webkitRelativePath&&(Object.defineProperties(be,{webkitRelativePath:{writable:!0}}),be.webkitRelativePath=ge.fullPath.replace(/^\//,""),Object.defineProperties(be,{webkitRelativePath:{writable:!1}})),p([be]))}):ge.isDirectory&&fe(ge,function(be){be.forEach(function(Se){Y(Se,""+De+ge.name+"/")})})};g.forEach(function(Y){P(Y.webkitGetAsEntry())})},K=ae,ee=Object.assign||function(L){for(var g=1;g=0)continue;if(!Object.prototype.hasOwnProperty.call(L,w))continue;p[w]=L[w]}return p}function Ke(L,g){if(!(L instanceof g))throw new TypeError("Cannot call a class as a function")}function Ee(L,g){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:L}function Ce(L,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);L.prototype=Object.create(g&&g.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(L,g):L.__proto__=g)}var We=function(g){return Object.keys(g).reduce(function(p,w){return(w.substr(0,5)==="data-"||w.substr(0,5)==="aria-"||w==="role")&&(p[w]=g[w]),p},{})},pe=function(L){Ce(g,L);function g(){var p,w,P,Y;Ke(this,g);for(var ge=arguments.length,De=Array(ge),be=0;be1&&arguments[1]!==void 0?arguments[1]:1,W=Ne.length,y=0;y1&&arguments[1]!==void 0?arguments[1]:!1;return Object(We.a)(p).map(function(P,Y){if(!ke.isValidElement(P)||!P.type)return null;var ge=P.type.isSelectOptGroup,De=P.key,be=P.props,Se=be.children,ce=Object(N.a)(be,["children"]);return w||!ge?pe(P):Object(Ce.a)(Object(Ce.a)({key:"__RC_SELECT_GRP__".concat(De===null?Y:De,"__"),label:De},ce),{},{options:Ae(Se)})}).filter(function(P){return P})}var ve=C("2Qr1"),ie=C("qNPg"),S=C("U8pU"),ne=C("Kwbf"),J=C("WKfj");function _(p){var w=p.mode,P=p.options,Y=p.children,ge=p.backfill,De=p.allowClear,be=p.placeholder,Se=p.getInputElement,ce=p.showSearch,xe=p.onSearch,Z=p.defaultOpen,j=p.autoFocus,b=p.labelInValue,R=p.value,E=p.inputValue,ue=p.optionLabelProp,ye=w==="multiple"||w==="tags",V=ce!==void 0?ce:ye||w==="combobox",we=P||Ae(Y);if(Object(ne.a)(w!=="tags"||we.every(function(Le){return!Le.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),w==="tags"||w==="combobox"){var Me=we.some(function(Le){return Le.options?Le.options.some(function(Ne){return typeof("value"in Ne?Ne.value:Ne.key)=="number"}):typeof("value"in Le?Le.value:Le.key)=="number"});Object(ne.a)(!Me,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ne.a)(w!=="combobox"||!ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ne.a)(w==="combobox"||!ge,"`backfill` only works with `combobox` mode."),Object(ne.a)(w==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(ne.b)(w!=="combobox"||!Se||!De||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xe&&!V&&w!=="combobox"&&w!=="tags"&&Object(ne.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ne.b)(!Z||j,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),R!=null){var Ue=Object(J.d)(R);Object(ne.a)(!b||Ue.every(function(Le){return Object(S.a)(Le)==="object"&&("key"in Le||"value"in Le)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ne.a)(!ye||Array.isArray(R),"`value` should be array when `mode` is `multiple` or `tags`")}if(Y){var Ie=null;Object(We.a)(Y).some(function(Le){if(!ke.isValidElement(Le)||!Le.type)return!1;var Ne=Le.type;if(Ne.isSelectOption)return!1;if(Ne.isSelectOptGroup){var Ye=Object(We.a)(Le.props.children).every(function(tt){return!ke.isValidElement(tt)||!Le.type||tt.type.isSelectOption?!0:(Ie=tt.type,!1)});return!Ye}return Ie=Ne,!0}),Ie&&Object(ne.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(ne.a)(E===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var re=_,z=Object(ie.a)({prefixCls:"rc-select",components:{optionList:me},convertChildrenToData:Ae,flattenOptions:ve.d,getLabeledValue:ve.e,filterOptions:ve.b,isValueDisabled:ve.g,findValueOption:ve.c,warningProps:re,fillOptionsWithMissingValue:ve.a}),D=function(p){Object(de.a)(P,p);var w=Object(Re.a)(P);function P(){var Y;return Object(G.a)(this,P),Y=w.apply(this,arguments),Y.selectRef=ke.createRef(),Y.focus=function(){Y.selectRef.current.focus()},Y.blur=function(){Y.selectRef.current.blur()},Y}return Object(_e.a)(P,[{key:"render",value:function(){return ke.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),P}(ke.Component);D.Option=ze,D.OptGroup=Ee;var L=D,g=Qe.c=L},M8RZ:function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return U});var G=C("fWQN"),_e=C("mtLc"),de=C("yKVA"),Re=C("879j"),ke=C("q1tI"),le=C.n(ke),N=C("i8i4"),Q=C.n(N),U=function(q){Object(de.a)(F,q);var M=Object(Re.a)(F);function F(fe){var ae;Object(G.a)(this,F),ae=M.call(this,fe);var K=window.document;return ae.node=K.createElement("div"),K.body.appendChild(ae.node),ae}return Object(_e.a)(F,[{key:"render",value:function(){var ae=this.props.children;return Object(N.createPortal)(ae,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),F}(le.a.Component)},OLES:function(bt,Qe,C){"use strict";var G=C("U8pU"),_e=C("VTBJ"),de=C("Ff2n"),Re=C("q1tI"),ke=C("uciX"),le=C("7ixt"),N=function(fe){var ae=fe.overlay,K=fe.prefixCls,ee=fe.id,H=fe.overlayInnerStyle;return Re.createElement("div",{className:"".concat(K,"-inner"),id:ee,role:"tooltip",style:H},typeof ae=="function"?ae():ae)},Q=N,U=function(fe,ae){var K=fe.overlayClassName,ee=fe.trigger,H=ee===void 0?["hover"]:ee,me=fe.mouseEnterDelay,he=me===void 0?0:me,ze=fe.mouseLeaveDelay,Ke=ze===void 0?.1:ze,Ee=fe.overlayStyle,Ce=fe.prefixCls,We=Ce===void 0?"rc-tooltip":Ce,pe=fe.children,Ae=fe.onVisibleChange,ve=fe.afterVisibleChange,ie=fe.transitionName,S=fe.animation,ne=fe.placement,J=ne===void 0?"right":ne,_=fe.align,re=_===void 0?{}:_,z=fe.destroyTooltipOnHide,D=z===void 0?!1:z,L=fe.defaultVisible,g=fe.getTooltipContainer,p=fe.overlayInnerStyle,w=Object(de.a)(fe,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),P=Object(Re.useRef)(null);Object(Re.useImperativeHandle)(ae,function(){return P.current});var Y=Object(_e.a)({},w);"visible"in fe&&(Y.popupVisible=fe.visible);var ge=function(){var xe=fe.arrowContent,Z=xe===void 0?null:xe,j=fe.overlay,b=fe.id;return[Re.createElement("div",{className:"".concat(We,"-arrow"),key:"arrow"},Z),Re.createElement(Q,{key:"content",prefixCls:We,id:b,overlay:j,overlayInnerStyle:p})]},De=!1,be=!1;if(typeof D=="boolean")De=D;else if(D&&Object(G.a)(D)==="object"){var Se=D.keepParent;De=Se===!0,be=Se===!1}return Re.createElement(ke.a,Object.assign({popupClassName:K,prefixCls:We,popup:ge,action:H,builtinPlacements:le.a,popupPlacement:J,ref:P,popupAlign:re,getPopupContainer:g,onPopupVisibleChange:Ae,afterPopupVisibleChange:ve,popupTransitionName:ie,popupAnimation:S,defaultPopupVisible:L,destroyPopupOnHide:De,autoDestroy:be,mouseLeaveDelay:Ke,popupStyle:Ee,mouseEnterDelay:he},Y),pe)},q=Object(Re.forwardRef)(U),M=Qe.a=q},Ot1p:function(bt,Qe,C){"use strict";var G=C("2qtc"),_e=C("kLXV"),de=C("rAM+"),Re=C("miYZ"),ke=C("tsqr"),le=C("9og8"),N=C("tJVT"),Q=C("jrin"),U=C("WmNS"),q=C.n(U),M=C("q1tI"),F=C.n(M),fe=C("VrN/"),ae=C.n(fe),K=C("bdgK"),ee=C("p77/"),H=C("Bd2K"),me=C("ELLl"),he=C("19Vz"),ze=C("lZu9"),Ke=C("+NIl"),Ee=C("kSUc"),Ce=C("9Bee"),We=function($){var je=$.value,et=je===void 0?"":je,ct=$.className,lt=$.showTextOnly,kt=$.showLines,Et=$.style,ut=Et===void 0?{}:Et,Kt=Object(M.useMemo)(function(){return""},[et]);return F.a.createElement(F.a.Fragment,null,F.a.createElement("div",{dangerouslySetInnerHTML:{__html:Kt}}))},pe=C("0Owb"),Ae=C("dejd"),ve=C("C+DQ"),ie=C("1vsH"),S=C("m3rI"),ne=[{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 J($){var je=$.onActionCallback,et=$.title,ct=$.icon,lt=$.actionName,kt=$.className,Et=kt===void 0?"":kt,ut=$.children;function Kt(){je(lt)}return F.a.createElement("a",{title:et,className:Et,onClick:Kt},F.a.createElement("i",{className:"md-iconfont ".concat(ct)}),ut)}var _=function($){var je=$.watch,et=$.showNullButton,ct=$.onActionCallback,lt=$.fullScreen,kt=$.insertTemp,Et=$.hidetoolBar,ut=$.uuid,Kt=$.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(ie.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(ie.E)("_educoder_session"),"&key=").concat(ut,"&api=").concat(encodeURIComponent(S.a.PROXY_SERVER)));var Nt=[].concat(ne,[{title:"".concat(je?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(je?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return F.a.createElement("ul",{className:"markdown-toolbar-container"},!Et&&Nt.map(function(Gt,Ht){return F.a.createElement("li",{key:Ht},Gt.actionName?F.a.createElement(J,Object(pe.a)({},Gt,{onActionCallback:ct})):F.a.createElement("span",{className:"v-line"}))}),et?F.a.createElement("li",null,F.a.createElement(J,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ct},F.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&F.a.createElement("li",null,F.a.createElement(J,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:ct},F.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),F.a.createElement("li",{className:"btn-full-screen"},F.a.createElement(J,{icon:"".concat(lt?"icon-shrink":"icon-enlarge"),title:lt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ct})))},re=C("M8RZ"),z=C("+L6B"),D=C("2/Rp"),L=C("y8nQ"),g=C("Vl3Y"),p=C("5NDa"),w=C("5rEg"),P={labelCol:{span:4},wrapperCol:{span:20}},Y=function($){var je=$.callback,et=$.onCancel;function ct(lt){je(lt)}return F.a.createElement(g.a,Object(pe.a)({},P,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ct}),F.a.createElement(g.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},F.a.createElement(w.a,null)),F.a.createElement(g.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},F.a.createElement(w.a,null)),F.a.createElement("div",{className:"flex-container flex-end"},F.a.createElement(D.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(D.a,{type:"ghost",onClick:et},"\u53D6\u6D88")))},ge=C("7ahc"),De=C("k1fw"),be=C("HmJG"),Se=C("BjJ7"),ce=g.a.useForm,xe={width:280,marginRight:10},Z={labelCol:{span:5},wrapperCol:{span:19}},j=function($){var je=$.callback,et=$.onCancel,ct=ce(),lt=Object(N.a)(ct,1),kt=lt[0],Et=Object(M.useRef)();function ut(Gt){je(Object(De.a)(Object(De.a)({},Gt),{},{name:Et.current}))}function Kt(Gt,Ht){kt.setFieldsValue({src:"/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type),type:Ht.type})}function Nt(Gt){var Ht=Gt.target.files[0];Et.current=Ht.name,R(Ht,Kt)}return F.a.createElement(g.a,Object(pe.a)({form:kt},Z,{className:"upload-image-panel",onFinish:ut}),F.a.createElement(g.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},F.a.createElement("div",{className:"flex-container"},F.a.createElement(g.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},F.a.createElement(w.a,{style:xe})),F.a.createElement(b,{onFileChange:Nt}))),F.a.createElement(g.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},F.a.createElement(w.a,{style:{width:264}})),F.a.createElement(g.a.Item,{style:{textAlign:"right"}},F.a.createElement(D.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(D.a,{type:"ghost",onClick:et},"\u53D6\u6D88")))};function b($){var je=$.onFileChange;return F.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",F.a.createElement("input",{type:"file",onChange:je}))}function R($,je){if(!$)throw new String("\u6CA1\u6709\u6587\u4EF6");var et=new FormData;et.append("editormd-image-file",$),et.append("file_param_name","editormd-image-file"),et.append("byxhr","true");var ct=new window.XMLHttpRequest;ct.withCredentials=!0,ct.addEventListener("load",function(lt){je(JSON.parse(lt.target.responseText),$)},!1),ct.addEventListener("error",function(lt){console.error(lt)},!1),ct.open("POST","".concat(Se.a,"/api/attachments.json")),ct.send(et)}var E=C("giR+"),ue=C("fyUT"),ye=C("7Kak"),V=C("9yH6"),we=V.a.Group,Me={margin:"0 8px"},Ue=function($){var je=$.callback,et=$.onCancel;function ct(lt){je(lt)}return F.a.createElement(g.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ct},F.a.createElement("div",{className:"flex-container"},F.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),F.a.createElement("span",{style:Me},"\u884C\u6570"),F.a.createElement(g.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},F.a.createElement(ue.a,null)),F.a.createElement("span",{style:Me},"\u5217\u6570"),F.a.createElement(g.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},F.a.createElement(ue.a,null))),F.a.createElement("div",{className:"flex-container",style:{marginTop:12}},F.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),F.a.createElement(g.a.Item,{name:"align"},F.a.createElement(we,null,F.a.createElement(V.a,{value:"default"},F.a.createElement("i",{className:"fa fa-align-justify"})),F.a.createElement(V.a,{value:"left"},F.a.createElement("i",{className:"fa fa-align-left"})),F.a.createElement(V.a,{value:"center"},F.a.createElement("i",{className:"fa fa-align-center"})),F.a.createElement(V.a,{value:"right"},F.a.createElement("i",{className:"fa fa-align-right"}))))),F.a.createElement("div",{className:"flex-container flex-end"},F.a.createElement(D.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(D.a,{type:"ghost",onClick:et},"\u53D6\u6D88")))},Ie=C("ErOA"),Le=C("7Cbv"),Ne="link",Ye="upload-image",tt="code-block",Ze="add-table",nt="------------",mt={default:nt,left:":".concat(nt),center:":".concat(nt,":"),right:"".concat(nt,":")},ft=C("9VGf"),rt,Te;function yt(){}var st=0,Pe=1e4,Ve="\u2581",X=` **\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 B($){return/^\d+$/.test($)?"".concat($,"px"):$}var W=navigator.platform.toUpperCase().indexOf("MAC")>=0,y=W?"Cmd":"Ctrl",x=["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"],k=(rt={},Object(Q.a)(rt,y+"-B","bold"),Object(Q.a)(rt,y+"-I","italic"),rt),T=(Te={},Object(Q.a)(Te,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(Q.a)(Te,tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(Q.a)(Te,Ye,"\u6DFB\u52A0\u6587\u4EF6"),Object(Q.a)(Te,Ze,"\u6DFB\u52A0\u8868\u683C"),Te),se=Qe.a=function($){var je=$.defaultValue,et=je===void 0?"":je,ct=$.onChange,lt=$.width,kt=lt===void 0?"100%":lt,Et=$.height,ut=Et===void 0?400:Et,Kt=$.miniToolbar,Nt=Kt===void 0?!1:Kt,Gt=$.isFocus,Ht=Gt===void 0?!1:Gt,_t=$.watch,zn=$.insertTemp,ai=$.mode,gt=ai===void 0?"markdown":ai,Kn=$.id,on=Kn===void 0?"markdown-editor-id":Kn,fn=$.showResizeBar,Wn=fn===void 0?!1:fn,si=$.noStorage,li=si===void 0?!1:si,Dt=$.showNullButton,ht=Dt===void 0?!1:Dt,Pn=$.hidetoolBar,ui=Pn===void 0?!1:Pn,wn=$.fullScreen,At=wn===void 0?!1:wn,Nn=$.onBlur,Yn=$.onCMBeforeChange,hi=$.onFullScreen,Ge=$.className,Ct=Ge===void 0?"":Ge,ci=$.disablePaste,Ai=ci===void 0?!1:ci,di=$.placeholder,Li=di===void 0?"":di,c=$.values,o=c===void 0?"":c,a=Object(M.useState)(null),u=Object(N.a)(a,2),d=u[0],h=u[1],I=Object(M.useState)(et),Be=Object(N.a)(I,2),$e=Be[0],ot=Be[1],Fe=Object(M.useState)(_t),wt=Object(N.a)(Fe,2),Rt=wt[0],Vt=wt[1],In=Object(M.useState)(At),jn=Object(N.a)(In,2),an=jn[0],Gn=jn[1],Wi=Object(M.useState)(""),Cn=Object(N.a)(Wi,2),Bn=Cn[0],Rn=Cn[1],vi=Object(M.useState)(0),$n=Object(N.a)(vi,2),fi=$n[0],ti=$n[1],cr=Object(M.useState)(ut),Gi=Object(N.a)(cr,2),Zn=Gi[0],Fn=Gi[1],Ri=Object(M.useState)(!1),Mi=Object(N.a)(Ri,2),dr=Mi[0],Zt=Mi[1],It=Object(M.useRef)(Object(Le.a)()),pn=Object(M.useRef)(!1),Pt=Object(M.useRef)(),en=Object(M.useRef)(),Ft=Object(M.useRef)(),ni=Object(M.useRef)(),qt=Object(M.useRef)(),Sn=function(){var dt=Object(le.a)(q.a.mark(function St(){var vt,Lt;return q.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(Ie.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:It.current}});case 2:Lt=zt.sent,Lt!=null&&(vt=Lt.attachments)!==null&&vt!==void 0&&vt.length&&(console.log("cm:",d,en),Lt.attachments.map(function(Ot){Ot.content_type.indexOf("image")>-1?d.replaceSelection("![,](/api/attachments/".concat(Ot.id,"?type=").concat(Ot.content_type,")")):Ot.content_type.indexOf("video")>-1?d.replaceSelection('')):Ot.content_type.indexOf("pdf")>-1?d.replaceSelection('
    ').concat(Ot.name,"")):d.replaceSelection("[".concat(Ot.name,"](").concat(S.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,")"))}));case 4:case"end":return zt.stop()}},St)}));return function(){return dt.apply(this,arguments)}}();Object(M.useEffect)(function(){ot(o),d==null||d.setValue(o)},[o]),Object(M.useEffect)(function(){hi==null||hi(an)},[an]),Object(M.useEffect)(function(){if(en.current){var dt=ae.a.fromTextArea(en.current,{mode:gt,lineNumbers:!Nt,lineWrapping:!0,value:et,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&dt.focus();function St(vt,Lt){if(Ai){Lt.preventDefault();return}var jt=Lt.clipboardData;if(jt){var zt=jt.types.toString(),Ot=jt.items;if(zt==="Files"||jt.types.indexOf("Files")>-1){if(Lt.preventDefault(),gt=="stex")return;try{var tn,En=Ot[1];((tn=Ot[0])===null||tn===void 0?void 0:tn.kind)==="file"&&(En=Ot[0]);var Mt=En.getAsFile(),bi=Mt.name.split(".").pop();R(Mt,function(Bt){if(Bt.id){var ln,Vn,Xn;(Mt==null||((ln=Mt.type)===null||ln===void 0)?void 0:ln.indexOf("image"))>-1?dt.replaceSelection("![,](/api/attachments/".concat(Bt.id,"?type=").concat(Bt.content_type,")")):(Mt==null||((Vn=Mt.type)===null||Vn===void 0)?void 0:Vn.indexOf("video"))>-1?dt.replaceSelection('')):(Mt==null||((Xn=Mt.type)===null||Xn===void 0)?void 0:Xn.indexOf("pdf"))>-1?dt.replaceSelection('').concat(Mt.name,"")):x.includes(bi)?dt.replaceSelection('').concat(Mt.name,"")):dt.replaceSelection("[".concat(Mt.name,"](").concat(S.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}else(Bt==null?void 0:Bt.status)===401&&(document.location.href="/user/login")})}catch(Bt){ke.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dt.on("paste",St),dt.on("dragleave",function(vt,Lt){Ft.current.classList.remove("mouse-hover-md")}),dt.on("dragover",function(vt,Lt){Ft.current.classList.add("mouse-hover-md")}),dt.on("drop",function(vt,Lt){Ft.current.classList.add("mouse-hover-md");var jt;if(jt=Lt.dataTransfer.files,jt.length>0){Lt.preventDefault(),Lt.stopPropagation();for(var zt=function(En){var Mt=jt[En],bi=Mt.name.split(".").pop();R(Mt,function(Bt){if(Bt.id){var ln,Vn,Xn;(Mt==null||((ln=Mt.type)===null||ln===void 0)?void 0:ln.indexOf("image"))>-1?dt.replaceSelection("![,](/api/attachments/".concat(Bt.id,"?type=").concat(Bt.content_type,")")):(Mt==null||((Vn=Mt.type)===null||Vn===void 0)?void 0:Vn.indexOf("video"))>-1?dt.replaceSelection('')):(Mt==null||((Xn=Mt.type)===null||Xn===void 0)?void 0:Xn.indexOf("pdf"))>-1?dt.replaceSelection('').concat(Mt.name,"")):x.includes(bi)?dt.replaceSelection('').concat(Mt.name,"")):dt.replaceSelection("[".concat(Mt.name,"](").concat(S.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}else(Bt==null?void 0:Bt.status)===401&&(document.location.href="/user/login")})},Ot=0;Ot0||Ot.target.offsetWidth>0)&&(Vi(),d.setSize("100%","100%"),d.refresh())}}catch(tn){jt.e(tn)}finally{jt.f()}});return vt.observe(en.current.parentElement),vt}if(d){var St=dt();return function(){St.unobserve(en.current.parentElement)}}},[d,Vi]),Object(M.useEffect)(function(){if(d){for(var dt=[],St=function(){var Ot=Lt[vt];jt=Object(N.a)(Ot,2);var tn=jt[0],En=jt[1],Mt=Object(Q.a)({},tn,function(){Xi(En)});dt.push(Mt),d.addKeyMap(Mt)},vt=0,Lt=Object.entries(k);vt0){var dt=new Date().getTime(),St=window.sessionStorage.getItem(on);dt>=fi+Pe&&(!St||St!==$e)&&(window.sessionStorage.setItem(on,$e),Zt(!0))}},Pe),Object(M.useEffect)(function(){Vt(_t)},[d,_t]),Object(M.useEffect)(function(){d&&(Ht&&d.focus())},[d,Ht]),Object(M.useEffect)(function(){if(Rt&&d){var dt=d.getScrollerElement();function St(vt){var Lt=vt.target;if(qt.current){var jt=Lt.scrollTop/Lt.scrollHeight;qt.current.scrollTop=qt.current.scrollHeight*jt}}return dt.addEventListener("scroll",St),function(){dt.removeEventListener("scroll",St)}}},[d,Rt]),Object(M.useEffect)(function(){if(d&&Yn){function dt(St,vt){Yn(St,vt)}return d.on("beforeChange",dt),function(){d.off("beforeChange",dt)}}},[d,Yn]),Object(M.useEffect)(function(){if(d&&Nn){function dt(){Nn(d.getValue())}return d.on("blur",dt),function(){d.off("blur",dt)}}},[d,Nn]),Object(M.useEffect)(function(){if(d){function dt(St){var vt=St.getValue();ot(vt),ti(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ct&&ct(vt)}return d.on("change",dt),function(){d.off("change",dt)}}},[d,ct]),Object(M.useEffect)(function(){d&&(et==null?(d.setValue(""),ot("")):et!==d.getValue()&&(d.setValue(et),ot(et),d.setCursor(d.lineCount(),0)))},[d,et]);var Xi=Object(M.useCallback)(function(dt){var St=d.getCursor(),vt=d.getSelection(),Lt=vt.split(` `);switch(dt){case"bold":return d.replaceSelection("**"+vt+"**"),vt===""&&d.setCursor(St.line,St.ch+2),d.focus();case"italic":return d.replaceSelection("*"+vt+"*"),vt===""&&d.setCursor(St.line,St.ch+1),d.focus();case"code":return d.replaceSelection("`"+vt+"`"),vt===""&&d.setCursor(St.line,St.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+vt+"$$`"),vt===""&&d.setCursor(St.line,St.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+vt+"\n```"),d.setCursor(St.line+1,vt.length+1),d.focus();case"line-break":return d.replaceSelection(`
    `),d.focus();case"list-ul":return vt===""?d.replaceSelection("- "+vt):d.replaceSelection(Lt.map(function(jt){return jt===""?"":"- ".concat(jt)}).join(` `)),d.focus();case"list-ol":return vt===""?d.replaceSelection("1. "+vt):d.replaceSelection(Lt.map(function(jt,zt){return jt===""?"":"".concat(zt+1,". ").concat(jt)}).join(` `)),d.focus();case"add-null-ch":return vt===""&&d.setCursor(St.line,St.ch+1),d.replaceSelection(Ve),d.focus();case"inster-template-1":return vt===""&&d.setCursor(St.line,St.ch),d.replaceSelection(X),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return Vt(!Rt),d.focus();case"trigger-full-screen":return Gn(!an),d.focus();case Ne:Rn(Ne);return;case tt:Rn(tt);return;case Ye:Rn(Ye);return;case Ze:Rn(Ze);return;default:throw new Error}},[d,Rt,an]),yi=Object(M.useCallback)(function(dt){Rn("");switch(Bn){case Ne:var St=dt.title,vt=dt.link;return d.replaceSelection("[".concat(St,"](").concat(vt,")")),d.focus();case tt:var Lt=dt.language,jt=dt.content;return d.replaceSelection(["```"+Lt,jt,"```"].join(` `)),d.focus();case Ye:var zt=dt.src,Ot=dt.alt,tn=dt.name;return zt.indexOf("type=image")>-1?d.replaceSelection("![ ".concat(Ot||""," ]( ").concat(zt,' "').concat(Ot||"",'" )')):zt.indexOf("type=application/pdf")>-1?d.replaceSelection('').concat(tn,"")):d.replaceSelection('').concat(tn,"")),d.focus();case Ze:for(var En=dt.row,Mt=dt.col,bi=dt.align,Bt=` `,ln=0;ln300&&(tn=300);var En=ut+tn+"px";Fn(En)}}return dt.addEventListener("mousedown",Lt),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",jt),function(){dt.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",jt)}}},[d,ni]),Object(M.useEffect)(function(){Fn(ut)},[ut]);var fr=B(kt),Jn=B(Zn),Ki={width:fr,height:Jn},Ur=Object(M.useMemo)(function(){if(fi){var dt=new Date(fi),St=dt.getHours(),vt=dt.getMinutes(),Lt=dt.getSeconds();return St=St<10?"0"+St:St,vt=vt<10?"0"+vt:vt,Lt=Lt<10?"0"+Lt:Lt,"".concat(St,":").concat(vt,":").concat(Lt)}return 0},[fi]);function Oi(){window.sessionStorage.removeItem(on),Zt(!1),ti(0)}function Zo(){Zt(!1),ti(0),d.setValue(window.sessionStorage.getItem(on))}function ho(dt,St){var vt=d.getValue();vt=vt.replace(dt,St),ot(vt),d==null||d.setValue(vt)}return F.a.createElement(M.Fragment,null,F.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ft},F.a.createElement("div",{className:"markdown-editor-container ".concat(Ct," ").concat(Rt?"on-preview":""," ").concat(Nt?"mini":""," ").concat(an?"full-screen":""),style:Ki},F.a.createElement(_,{insertTemp:zn,watch:Rt,fullScreen:an,showNullButton:ht,onActionCallback:Xi,hidetoolBar:ui,uuid:It.current,setOpenPhones:function(){pn.current=!0}}),F.a.createElement("div",{className:"markdown-editor-body"},F.a.createElement("div",{className:"codemirror-container"},F.a.createElement("textarea",{ref:en,placeholder:Li})),Rt?F.a.createElement("div",{ref:qt,className:"preview-container"},gt==="stex"&&F.a.createElement(We,{value:$e}),gt!=="stex"&&F.a.createElement(Ce.a,{edit:!0,value:$e,replaces:ho})):null))),Wn?F.a.createElement("a",{ref:ni,className:"editor-resize"}):null,F.a.createElement(re.a,null,T[Bn]?F.a.createElement(_e.a,{centered:!0,title:T[Bn],visible:!0,onCancel:Mn,footer:null},Fr):null))}},SJMd:function(bt,Qe){/** * @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 C,G,_e,de=!1,Re,ke;window.PR_SHOULD_USE_CONTINUATION=!0;var le,N;(function(){var Q=window,U=["break,continue,do,else,for,if,return,while"],q=[U,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],M=[q,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[M,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],fe=[M,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],ae=[M,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],K="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",ee=[M,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],H="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",me=[U,"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"],he=[U,"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"],ze=[U,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ke=[F,ae,fe,ee,H,me,he,ze],Ee=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,Ce="str",We="kwd",pe="com",Ae="typ",ve="lit",ie="pun",S="pln",ne="tag",J="dec",_="src",re="atn",z="atv",D="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function g(V){for(var we=0,Me=!1,Ue=!1,Ie=0,Le=V.length;Ie122||(y<65||W>90||yt.push([Math.max(65,W)|32,Math.min(y,90)|32]),y<97||W>122||yt.push([Math.max(97,W)&~32,Math.min(y,122)&~32]))}}yt.sort(function(se,$){return se[0]-$[0]||$[1]-se[1]});for(var x=[],k=[],Ve=0;VeT[0]&&(T[1]+1>T[0]&&Pe.push("-"),Pe.push(Ze(T[1])))}return Pe.push("]"),Pe.join("")}function mt(rt){for(var Te=rt.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")),yt=Te.length,st=[],Pe=0,Ve=0;Pe=2&&W==="["?Te[Pe]=nt(X):W!=="\\"&&(Te[Pe]=X.replace(/[a-zA-Z]/g,function(k){var T=k.charCodeAt(0);return"["+String.fromCharCode(T&~32,T|32)+"]"}))}return Te.join("")}for(var ft=[],Ie=0,Le=V.length;Ie=0;)Me[ft.charAt(rt)]=mt;var Te=mt[1],yt=""+Te;tt.hasOwnProperty(yt)||(Ye.push(Te),tt[yt]=null)}Ye.push(/[\0-\uffff]/),Ue=g(Ye)})();var Ie=we.length,Le=function(Ne){for(var Ye=Ne.sourceCode,tt=Ne.basePos,Ze=Ne.sourceNode,nt=[tt,S],mt=0,ft=Ye.match(Ue)||[],rt={},Te=0,yt=ft.length;Te=5&&Pe.substring(0,5)==="lang-",X&&!(Ve&&typeof Ve[1]=="string")&&(X=!1,Pe=_),X||(rt[st]=Pe)}var y=mt;if(mt+=st.length,!X)nt.push(tt+y,Pe);else{var x=Ve[1],k=st.indexOf(x),T=k+x.length;Ve[2]&&(T=st.length-Ve[2].length,k=T-x.length);var se=Pe.substring(5);w(Ze,tt+y,st.substring(0,k),Le,nt),w(Ze,tt+y+k,x,j(se,x),nt),w(Ze,tt+y+T,st.substring(T),Le,nt)}}Ne.decorations=nt};return Le}function De(V){var we=[],Me=[];V.tripleQuotedStrings?we.push([Ce,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):V.multiLineStrings?we.push([Ce,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):we.push([Ce,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),V.verbatimStrings&&Me.push([Ce,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ue=V.hashComments;Ue&&(V.cStyleComments?(Ue>1?we.push([pe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):we.push([pe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Me.push([Ce,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):we.push([pe,/^#[^\r\n]*/,null,"#"])),V.cStyleComments&&(Me.push([pe,/^\/\/[^\r\n]*/,null]),Me.push([pe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=V.regexLiterals;if(Ie){var Le=Ie>1?"":` \r`,Ne=Le?".":"[\\S\\s]",Ye="/(?=[^/*"+Le+"])(?:[^/\\x5B\\x5C"+Le+"]|\\x5C"+Ne+"|\\x5B(?:[^\\x5C\\x5D"+Le+"]|\\x5C"+Ne+")*(?:\\x5D|$))+/";Me.push(["lang-regex",RegExp("^"+L+"("+Ye+")")])}var tt=V.types;tt&&Me.push([Ae,tt]);var Ze=(""+V.keywords).replace(/^ | $/g,"");Ze.length&&Me.push([We,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),we.push([S,/^\s+/,null,` \r \xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return V.regexLiterals&&(nt+="(?!s*/)"),Me.push([ve,/^@[a-z_$][a-z_$@0-9]*/i,null],[Ae,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[S,/^[a-z_$][a-z_$@0-9]*/i,null],[ve,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[S,/^\\[\s\S]?/,null],[ie,new RegExp(nt),null]),ge(we,Me)}var be=De({keywords:Ke,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(V,we,Me){for(var Ue=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,Le=V.ownerDocument,Ne=Le.createElement("li");V.firstChild;)Ne.appendChild(V.firstChild);var Ye=[Ne];function tt(Te){var yt=Te.nodeType;if(yt==1&&!Ue.test(Te.className))if(Te.nodeName==="br")Ze(Te),Te.parentNode&&Te.parentNode.removeChild(Te);else for(var st=Te.firstChild;st;st=st.nextSibling)tt(st);else if((yt==3||yt==4)&&Me){var Pe=Te.nodeValue,Ve=Pe.match(Ie);if(Ve){var X=Pe.substring(0,Ve.index);Te.nodeValue=X;var B=Pe.substring(Ve.index+Ve[0].length);if(B){var W=Te.parentNode;W.insertBefore(Le.createTextNode(B),Te.nextSibling)}Ze(Te),X||Te.parentNode.removeChild(Te)}}}function Ze(Te){for(;!Te.nextSibling;)if(Te=Te.parentNode,!Te)return;function yt(Ve,X){var B=X?Ve.cloneNode(!1):Ve,W=Ve.parentNode;if(W){var y=yt(W,1),x=Ve.nextSibling;y.appendChild(B);for(var k=x;k;k=x)x=k.nextSibling,y.appendChild(k)}return B}for(var st=yt(Te.nextSibling,0),Pe;(Pe=st.parentNode)&&Pe.nodeType===1;)st=Pe;Ye.push(st)}for(var nt=0;nt=W&&(tt+=2),Le>=y&&(mt+=2)}}finally{Pe&&(Pe.style.display=Ve)}}var xe={};function Z(V,we){for(var Me=we.length;--Me>=0;){var Ue=we[Me];xe.hasOwnProperty(Ue)?Q.console&&console.warn("cannot override language handler %s",Ue):xe[Ue]=V}}function j(V,we){return V&&xe.hasOwnProperty(V)||(V=/^\s*]*(?:>|$)/],[pe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ie,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Z(ge([[S,/^[\s]+/,null,` \r `],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ne,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[re,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ie,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Z(ge([],[[z,/^[\s\S]+/]]),["uq.val"]),Z(De({keywords:F,hashComments:!0,cStyleComments:!0,types:Ee}),["c","cc","cpp","cxx","cyc","m"]),Z(De({keywords:"null,true,false"}),["json"]),Z(De({keywords:ae,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Ee}),["cs"]),Z(De({keywords:fe,cStyleComments:!0}),["java"]),Z(De({keywords:ze,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Z(De({keywords:me,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Z(De({keywords:H,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Z(De({keywords:he,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Z(De({keywords:ee,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Z(De({keywords:K,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Z(ge([],[[Ce,/^[\s\S]+/]]),["regex"]);function b(V){var we=V.langExtension;try{var Me=p(V.sourceNode,V.pre),Ue=Me.sourceCode;V.sourceCode=Ue,V.spans=Me.spans,V.basePos=0,j(we,Ue)(V),ce(V)}catch(Ie){Q.console&&console.log(Ie&&Ie.stack||Ie)}}function R(V,we,Me){var Ue=Me||!1,Ie=we||null,Le=document.createElement("div");Le.innerHTML="
    "+V+"
    ",Le=Le.firstChild,Ue&&Se(Le,Ue,!0);var Ne={langExtension:Ie,numberLines:Ue,sourceNode:Le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Ne),Le.innerHTML}function E(V,we){var Me=we||document.body,Ue=Me.ownerDocument||document;function Ie(B){return Me.getElementsByTagName(B)}for(var Le=[Ie("pre"),Ie("code"),Ie("xmp")],Ne=[],Ye=0;Ye=15&&(F=!1,U=!0);var Ce=he&&(q||F&&(Ee==null||Ee<12.11)),We=de||N&&Q>=9;function pe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ae=function(e,t){var i=e.className,n=pe(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function ve(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ie(e,t){return ve(e).appendChild(t)}function S(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var P=function(){this.id=null,this.f=null,this.time=0,this.handler=g(this.onTimeout,this)};P.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},P.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var Z=[""];function j(e){for(;Z.length<=e;)Z.push(b(Z)+" ");return Z[e]}function b(e){return e[e.length-1]}function R(e,t){for(var i=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||V.test(e))}function Me(e,t){return t?t.source.indexOf("\\w")>-1&&we(e)?!0:t.test(e):we(e)}function Ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Le(e){return e.charCodeAt(0)>=768&&Ie.test(e)}function Ne(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function tt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;st||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var Ze=null;function nt(e,t,i){var n;Ze=null;for(var r=0;rt)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:Ze=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:Ze=r)}return n!=null?n:Ze}var mt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(v,A,O){this.level=v,this.from=A,this.to=O}return function(v,A){var O=A=="ltr"?"L":"R";if(v.length==0||A=="ltr"&&!n.test(v))return!1;for(var oe=v.length,te=[],Oe=0;Oe-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Pe(e,t){var i=yt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r0}function W(e){e.prototype.on=function(t,i){Te(this,t,i)},e.prototype.off=function(t,i){st(this,t,i)}}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function x(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function k(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function T(e){y(e),x(e)}function se(e){return e.target||e.srcElement}function $(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),he&&e.ctrlKey&&t==1&&(t=3),t}var je=function(){if(N&&Q<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}(),et;function ct(e){if(et==null){var t=S("span","\u200B");ie(e,S("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(et=t.offsetWidth<=1&&t.offsetHeight>2&&!(N&&Q<8))}var i=et?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var lt;function kt(e){if(lt!=null)return lt;var t=ie(e,document.createTextNode("A\u062EA")),i=J(t,0,1).getBoundingClientRect(),n=J(t,1,2).getBoundingClientRect();return ve(e),!i||i.left==i.right?!1:lt=n.right-i.right<3}var Et=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(` `,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ut=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Kt=function(){var e=S("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Nt=null;function Gt(e){if(Nt!=null)return Nt;var t=ie(e,S("span","x")),i=t.getBoundingClientRect(),n=J(t,0,1).getBoundingClientRect();return Nt=Math.abs(i.left-n.left)>1}var Ht={},_t={};function zn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ht[e]=t}function ai(e,t){_t[e]=t}function gt(e){if(typeof e=="string"&&_t.hasOwnProperty(e))e=_t[e];else if(e&&typeof e.name=="string"&&_t.hasOwnProperty(e.name)){var t=_t[e.name];typeof t=="string"&&(t={name:t}),e=ye(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return gt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return gt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Kn(e,t){t=gt(t);var i=Ht[t.name];if(!i)return Kn(e,"text/plain");var n=i(e,t);if(on.hasOwnProperty(t.name)){var r=on[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var on={};function fn(e,t){var i=on.hasOwnProperty(e)?on[e]:on[e]={};p(t,i)}function Wn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function si(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function li(e,t,i){return e.startState?e.startState(t,i):!0}var Dt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.post},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ht(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t=e.first&&ti?Ge(i,ht(e,i).text.length):a(t,ht(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Ge(e.line,t):i<0?Ge(e.line,0):e}function u(e,t){for(var i=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},h.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof d?new h(e,Wn(e.mode,t.state),i,t.lookAhead):new h(e,Wn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?Wn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new d(t,this.maxLookAhead):t};function I(e,t,i,n){var r=[e.state.modeGen],s={};jn(e,t.text,e.doc.mode,i,function(v,A){return r.push(v,A)},s,n);for(var l=i.state,f=function(v){i.baseTokens=r;var A=e.state.overlays[v],O=1,oe=0;i.state=!0,jn(e,t.text,A.mode,i,function(te,Oe){for(var He=O;oete&&r.splice(O,1,te,r[O+1],Xe),O+=2,oe=Math.min(te,Xe)}if(!Oe)return;if(A.opaque)r.splice(He,O-He,te,"overlay "+Oe),O=He+2;else for(;Hee.options.maxHighlightLength&&Wn(e.doc.mode,n.state),s=I(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function $e(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=an(e,t,i),l=s>n.first&&ht(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,li(n.mode),s);return n.iter(s,t,function(m){ot(e,m.text,f);var v=f.line;m.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&vt.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Rt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Vt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ht(r,t.line),m=$e(e,t.line,i),v=new Dt(f.text,e.options.tabSize,m),A;for(n&&(A=[]);(n||v.pose.options.maxHighlightLength?(f=!1,l&&ot(e,t,n,A.pos),A.pos=t.length,O=null):O=In(wt(i,A,n.state,oe),s),oe){var te=oe[0].name;te&&(O="m-"+(O?te+" "+O:te))}if(!f||v!=O){for(;ml;--f){if(f<=s.first)return s.first;var m=ht(s,f-1),v=m.stateAfter;if(v&&(!i||f+(v instanceof d?v.lookAhead:0)<=s.modeFrontier))return f;var A=w(m.text,null,e.options.tabSize);(r==null||n>A)&&(r=f-1,n=A)}return r}function Gn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;n--){var r=ht(e,n).stateAfter;if(r&&(!(r instanceof d)||n+r.lookAhead=t:s.to>t);(n||(n=[])).push(new vi(l,s.from,m?null:s.to))}}return n}function Gi(e,t,i){var n;if(e)for(var r=0;r=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from0&&f)for(var at=0;at0)continue;var A=[m,1],O=Ct(v.from,f.from),oe=Ct(v.to,f.to);(O<0||!l.inclusiveLeft&&!O)&&A.push({from:v.from,to:f.from}),(oe>0||!l.inclusiveRight&&!oe)&&A.push({from:f.to,to:v.to}),r.splice.apply(r,A),m+=A.length-3}return r}function Mi(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!n||pn(n,s.marker)<0)&&(n=s.marker)}return n}function qt(e,t,i,n,r){var s=ht(e,t),l=Cn&&s.markedSpans;if(l)for(var f=0;f=0&&O<=0||A<=0&&O>=0)continue;if(A<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(v.to,i)>=0:Ct(v.to,i)>0)||A>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(v.from,n)<=0:Ct(v.from,n)<0))return!0}}function Sn(e){for(var t;t=en(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Ft(e);)e=t.find(1,!0).line;return e}function Xi(e){for(var t,i;t=Ft(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function yi(e,t){var i=ht(e,t),n=Sn(i);return i==n?t:At(n)}function Fr(e,t){if(t>e.lastLine())return t;var i=ht(e,t),n;if(!Mn(e,i))return t;for(;n=Ft(i);)i=n.find(1,!0).line;return At(i)+1}function Mn(e,t){var i=Cn&&t.markedSpans;if(i)for(var n=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Oi=function(e,t,i){this.text=e,dr(this,t),this.height=i?i(this):1};Oi.prototype.lineNo=function(){return At(this)},W(Oi);function Zo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Mi(e),dr(e,i);var r=n?n(e):1;r!=e.height&&wn(e,r)}function ho(e){e.parent=null,Mi(e)}var dt={},St={};function vt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?St:dt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Lt(e,t){var i=ne("span",null,null,U?"padding-right: .1px":null),n={pre:ne("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=zt,kt(e.display.measure)&&(l=ft(s,e.doc.direction))&&(n.addToken=tn(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&At(s);Mt(s,n,Be(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=D(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=D(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(ct(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(U){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=D(n.pre.className,n.textClass||"")),n}function jt(e){var t=S("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zt(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?Ot(t,e.trailingSpace):t,m=e.cm.state.specialChars,v=!1,A;if(!m.test(t))e.col+=t.length,A=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,A),N&&Q<9&&(v=!0),e.pos+=t.length;else{A=document.createDocumentFragment();for(var O=0;;){m.lastIndex=O;var oe=m.exec(t),te=oe?oe.index-O:t.length-O;if(te){var Oe=document.createTextNode(f.slice(O,O+te));N&&Q<9?A.appendChild(S("span",[Oe])):A.appendChild(Oe),e.map.push(e.pos,e.pos+te,Oe),e.col+=te,e.pos+=te}if(!oe)break;O+=te+1;var He=void 0;if(oe[0]==" "){var Xe=e.cm.options.tabSize,Je=Xe-e.col%Xe;He=A.appendChild(S("span",j(Je),"cm-tab")),He.setAttribute("role","presentation"),He.setAttribute("cm-text"," "),e.col+=Je}else oe[0]=="\r"||oe[0]==` `?(He=A.appendChild(S("span",oe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),He.setAttribute("cm-text",oe[0]),e.col+=1):(He=e.cm.options.specialCharPlaceholder(oe[0]),He.setAttribute("cm-text",oe[0]),N&&Q<9?A.appendChild(S("span",[He])):A.appendChild(He),e.col+=1);e.map.push(e.pos,e.pos+1,He),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var it=i||"";n&&(it+=n),r&&(it+=r);var qe=S("span",[A],it,s);if(l)for(var at in l)l.hasOwnProperty(at)&&at!="style"&&at!="class"&&qe.setAttribute(at,l[at]);return e.content.appendChild(qe)}e.content.appendChild(A)}function Ot(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;rv&&O.from<=v);oe++);if(O.to>=A)return e(i,n,r,s,l,f,m);e(i,n.slice(0,O.to-v),r,s,null,f,m),s=null,n=n.slice(O.to-v),v=O.to}}}function En(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Mt(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;lm||Tt.collapsed&&pt.to==m&&pt.from==m)){if(pt.to!=null&&pt.to!=m&&te>pt.to&&(te=pt.to,He=""),Tt.className&&(Oe+=" "+Tt.className),Tt.css&&(oe=(oe?oe+";":"")+Tt.css),Tt.startStyle&&pt.from==m&&(Xe+=" "+Tt.startStyle),Tt.endStyle&&pt.to==te&&(at||(at=[])).push(Tt.endStyle,pt.to),Tt.title&&((it||(it={})).title=Tt.title),Tt.attributes)for(var Xt in Tt.attributes)(it||(it={}))[Xt]=Tt.attributes[Xt];Tt.collapsed&&(!Je||pn(Je.marker,Tt)<0)&&(Je=pt)}else pt.from>m&&te>pt.from&&(te=pt.from)}if(at)for(var cn=0;cn=f)break;for(var Dn=Math.min(f,te);;){if(A){var _n=m+A.length;if(!Je){var nn=_n>Dn?A.slice(0,Dn-m):A;t.addToken(t,nn,O?O+Oe:Oe,Xe,m+nn.length==te?He:"",oe,it)}if(_n>=Dn){A=A.slice(Dn-m),m=Dn;break}m=_n,Xe=""}A=r.slice(s,s=i[v++]),O=vt(i[v++],t.cm.options)}}}function bi(e,t,i){this.line=t,this.rest=Xi(t),this.size=this.rest?At(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Mn(e,t)}function Bt(e,t,i){for(var n=[],r,s=t;s2&&s.push((m.bottom+v.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ia(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;ni)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fs(e,t){t=Sn(t);var i=At(t),n=e.display.externalMeasured=new bi(e.doc,t,i);n.lineN=i;var r=n.built=Lt(e,n);return n.text=r.pre,ie(e.display.lineMeasure,r.pre),n}function ra(e,t,i,n){return ri(e,Yi(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[v+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)n=e[(v-=3)+2],l="left";if(i=="right"&&r==m-f)for(;v=0&&!((i=e[r]).left!=i.right);r--);return i}function Hs(e,t,i,n){var r=aa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,v;if(s.nodeType==3){for(var A=0;A<4;A++){for(;l&&Le(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f0&&(m=n="right");var O;e.options.lineWrapping&&(O=s.getClientRects()).length>1?v=O[n=="right"?O.length-1:0]:v=s.getBoundingClientRect()}if(N&&Q<9&&!l&&(!v||!v.left&&!v.right)){var oe=s.parentNode.getClientRects()[0];oe?v={left:oe.left,right:oe.left+Zi(e.display),top:oe.top,bottom:oe.bottom}:v=oa}for(var te=v.top-t.rect.top,Oe=v.bottom-t.rect.top,He=(te+Oe)/2,Xe=t.view.measure.heights,Je=0;Je=n.text.length?(m=n.text.length,v="before"):m<=0&&(m=0,v="after"),!f)return l(v=="before"?m-1:m,v=="before");function A(Oe,He,Xe){var Je=f[He],it=Je.level==1;return l(Xe?Oe-1:Oe,it!=Xe)}var O=nt(f,m,v),oe=Ze,te=A(m,O,v=="before");return oe!=null&&(te.other=A(m,oe,v!="before")),te}function da(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Zi(e.display)*t.ch);var n=ht(e.doc,t.line),r=Jn(n)+zr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function yo(e,t,i,n,r){var s=Ge(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function bo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return yo(n.first,0,null,-1,-1);var r=Nn(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,ht(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ht(n,r);;){var f=Ws(e,l,r,t,i),m=ni(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var v=m.find(1);if(v.line==r)return v;l=ht(n,r=v.line)}}function fa(e,t,i,n){n-=go(t);var r=t.text.length,s=Ye(function(l){return ri(e,i,l-1).bottom<=n},r,0);return r=Ye(function(l){return ri(e,i,l).top>n},s,r),{begin:s,end:r}}function pa(e,t,i,n){i||(i=Yi(e,t));var r=Wr(e,t,ri(e,i,n),"line").top;return fa(e,t,i,r)}function xo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Ws(e,t,i,n,r){r-=Jn(t);var s=Yi(e,t),l=go(t),f=0,m=t.text.length,v=!0,A=ft(t,e.doc.direction);if(A){var O=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,A,n,r);v=O.level!=1,f=v?O.from:O.to-1,m=v?O.to:O.from-1}var oe=null,te=null,Oe=Ye(function(xt){var pt=ri(e,s,xt);return pt.top+=l,pt.bottom+=l,xo(pt,n,r,!1)?(pt.top<=r&&pt.left<=n&&(oe=xt,te=pt),!0):!1},f,m),He,Xe,Je=!1;if(te){var it=n-te.left=at.bottom?1:0}return Oe=Ne(t.text,Oe,1),yo(i,Oe,Xe,Je,n-He)}function Gs(e,t,i,n,r,s,l){var f=Ye(function(O){var oe=r[O],te=oe.level!=1;return xo(qn(e,Ge(i,te?oe.to:oe.from,te?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var v=m.level!=1,A=qn(e,Ge(i,v?m.from:m.to,v?"after":"before"),"line",t,n);xo(A,s,l,!0)&&A.top>l&&(m=r[f-1])}return m}function Vs(e,t,i,n,r,s,l){var f=fa(e,t,n,l),m=f.begin,v=f.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var A=null,O=null,oe=0;oe=v||te.to<=m)continue;var Oe=te.level!=1,He=ri(e,n,Oe?Math.min(v,te.to)-1:Math.max(m,te.from)).right,Xe=HeXe)&&(A=te,O=Xe)}return A||(A=r[r.length-1]),A.fromv&&(A={from:A.from,to:v,level:A.level}),A}var Pi;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=S("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(S("br"));Pi.appendChild(document.createTextNode("x"))}ie(e.measure,Pi);var i=Pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ve(e.measure),i||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=S("span","xxxxxxxxxx"),i=S("pre",[t],"CodeMirror-line-like");ie(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function wo(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=s.clientWidth}return{fixedPos:Co(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Co(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=$i(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Zi(e.display)-3);return function(r){if(Mn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l0&&(v=ht(e.doc,m.line).text).length==m.ch){var A=w(v,v.length,e.options.tabSize)-v.length;m=Ge(m.line,Math.max(0,Math.round((s-na(e.display).left)/Zi(e.display))-A))}return m}function Ii(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;nt)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Cn&&yi(e.doc,t)r.viewFrom?wi(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)wi(e);else if(t<=r.viewFrom){var s=Gr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):wi(e)}else if(i>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):wi(e)}else{var f=Gr(e,t,t,-1),m=Gr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(Bt(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):wi(e)}var v=r.externalMeasured;v&&(i=r.lineN&&t=n.viewTo)return;var s=n.view[Ii(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Y(l,i)==-1&&l.push(i)}function wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,i,n){var r=Ii(e,t),s,l=e.display.view;if(!Cn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,i+=s}for(;yi(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Bt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Bt(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Ii(e,i)))),n.viewTo=i}function ga(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||f.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ji(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ji(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Pe(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),U&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Eo(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Pe(e,"blur",e,t),e.state.focused=!1,Ae(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Xr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n.005||A<-.005)&&(wn(r.line,l),wa(r.line),r.rest))for(var O=0;Oe.display.sizerWidth){var oe=Math.ceil(f/Zi(e.display));oe>e.display.maxLineLength&&(e.display.maxLineLength=oe,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(e){if(e.widgets)for(var t=0;t=l&&(s=Nn(t,Jn(ht(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(Ve(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!K){var s=S("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-zr(e.display))+`px; height: `+(t.bottom-t.top+ii(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=qn(e,t),m=!i||i==t?f:qn(e,i);r={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var v=To(e,r),A=e.doc.scrollTop,O=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),v.scrollLeft!=null&&(ji(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-O)>1&&(l=!0)),!l)break}return r}function Zs(e,t){var i=To(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&ji(e,i.scrollLeft)}function To(e,t){var i=e.display,n=$i(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+fo(i),m=t.topf-n;if(t.topr+s){var A=Math.min(t.top,(v?f:t.bottom)-s);A!=r&&(l.scrollTop=A)}var O=e.options.fixedGutter?0:i.gutters.offsetWidth,oe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-O,te=Di(e)-i.gutters.offsetWidth,Oe=t.right-t.left>te;return Oe&&(t.right=t.left+te),t.left<10?l.scrollLeft=0:t.leftte+oe-3&&(l.scrollLeft=t.right+(Oe?0:10)-te),l}function _o(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function qi(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Js(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=da(e,t.from),n=da(e,t.to);Ca(e,i,n,t.margin)}}function Ca(e,t,i,n){var r=To(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;de||Lo(e,{top:t}),Sa(e,t,!0),de&&Lo(e),Sr(e,100)}function Sa(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ji(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Aa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function wr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+fo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+ii(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Bi=function(e,t,i){this.cm=i;var n=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Te(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Te(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,N&&Q<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bi.prototype.zeroWidthHack=function(){var e=he&&!ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new P,this.disableVert=new P},Bi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Bi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Cr=function(){};Cr.prototype.update=function(){return{bottom:0,right:0}},Cr.prototype.setScrollLeft=function(){},Cr.prototype.setScrollTop=function(){},Cr.prototype.clear=function(){};function Qi(e,t){t||(t=wr(e));var i=e.display.barWidth,n=e.display.barHeight;Ea(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Xr(e),Ea(e,wr(e)),i=e.display.barWidth,n=e.display.barHeight}function Ea(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ka={native:Bi,null:Cr};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ae(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Te(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ji(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Fi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},Vn(e.curOp)}function Ui(e){var t=e.curOp;t&&Hr(t,function(i){for(var n=0;n=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ao(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Xr(t),e.barMeasure=wr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+ii(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Di(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=$e(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?Wn(t.mode,n.state):null,m=I(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var v=s.styleClasses,A=m.classes;A?s.styleClasses=A:v&&(s.styleClasses=null);for(var O=!l||l.length!=s.styles.length||v!=A&&(!v||!A||v.bgClass!=A.bgClass||v.textClass!=A.textClass),oe=0;!O&&oei)return Sr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&On(e,function(){for(var s=0;s=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&ga(e)==0)return!1;La(e)&&(wi(e),t.dims=wo(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFroml&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),Cn&&(s=yi(e.doc,s),l=Fr(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=Jn(ht(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=ga(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),ve(i.cursorDiv),ve(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Sr(e,400)),i.updateLineNumbers=null,!0}function _a(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Di(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+fo(e.display)-po(e),i.top)}),t.visible=Kr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Kr(e.display,e.doc,i));if(!Ao(e,t))break;Xr(e);var r=wr(e);yr(e),Qi(e,r),Mo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Lo(e,t){var i=new $r(e,t);if(Ao(e,i)){Xr(e),_a(e,i);var n=wr(e);yr(e),Qi(e,n),Mo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Oe){var He=Oe.nextSibling;return U&&he&&e.display.currentWheelTarget==Oe?Oe.style.display="none":Oe.parentNode.removeChild(Oe),He}for(var m=n.view,v=n.viewFrom,A=0;A-1&&(te=!1),Jo(e,O,v,i)),te&&(ve(O.lineNumber),O.lineNumber.appendChild(document.createTextNode(hi(e.options,v)))),l=O.node.nextSibling}v+=O.size}for(;l;)l=f(l)}function Ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Mo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+ii(e)+"px"}function Aa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Co(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;ll.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&he&&U){e:for(var v=t.target,A=s.view;v!=l;v=v.parentNode)for(var O=0;O=0&&Ct(e,n.to())<=0)return i}return-1};var Ut=function(e,t){this.anchor=e,this.head=t};Ut.prototype.from=function(){return Li(this.anchor,this.head)},Ut.prototype.to=function(){return di(this.anchor,this.head)},Ut.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Qn(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(oe,te){return Ct(oe.from(),te.from())}),i=Y(t,r);for(var s=1;s0:m>=0){var v=Li(f.from(),l.from()),A=di(f.to(),l.to()),O=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ut(O?A:v,O?v:A))}}return new Hn(t,i)}function Ci(e,t){return new Hn([new Ut(e,t||e)],0)}function Si(e){return e.text?Ge(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return Si(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Si(t).ch-t.to.ch),Ge(i,n)}function Do(e,t){for(var i=[],n=0;n1&&e.remove(f.line+1,Oe-1),e.insert(f.line+1,Je)}mn(e,"change",e,t)}function Ei(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,f;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))f=b(l.changes),Ct(t.from,t.to)==0&&Ct(t.from,f.to)==0?f.to=Si(t):l.changes.push(Io(e,t));else{var m=b(r.done);for((!m||!m.ranges)&&qr(e.sel,r.done),l={changes:[Io(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,f||Pe(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,b(r.done),t))?r.done[r.done.length-1]=t:qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ba(r.undone)}function qr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ua(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i-1&&(b(f)[O]=v[O],delete v[O]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ct(t,r)<0;s!=Ct(i,r)<0?(r=t,t=i):s!=Ct(t,i)<0&&(t=i)}return new Ut(r,t)}else return new Ut(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),vn(e,new Hn([jo(e.sel.primary(),t,i,r)],0),n)}function za(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s=t.ch:f.to>t.ch))){if(r&&(Pe(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var O=m.find(n<0?1:-1),oe=void 0;if((n<0?A:v)&&(O=Ya(e,O,-n,O&&O.line==t.line?s:null)),O&&O.line==t.line&&(oe=Ct(O,i))&&(n<0?oe<0:oe>0))return tr(e,O,t,n,r)}var te=m.find(n<0?-1:1);return(n<0?v:A)&&(te=Ya(e,te,n,te.line==t.line?s:null)),te?tr(e,te,t,n,r):null}}return t}function to(e,t,i,n,r){var s=n||1,l=tr(e,t,i,s,r)||!r&&tr(e,t,i,s,!0)||tr(e,t,i,-s,r)||!r&&tr(e,t,i,-s,!0);return l||(e.cantEdit=!0,Ge(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Ge(t.line-1)):null:i>0&&t.ch==(n||ht(e,t.line)).text.length?t.line=0;--r)Ja(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Ja(e,t)}function Ja(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Do(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,Zn(e,t));var n=[];Ei(e,function(r,s){!s&&Y(n,r.history)==-1&&(ts(r.history,t),n.push(r.history)),Tr(r,t,null,Zn(r,t))})}function no(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,m=t=="undo"?r.undone:r.done,v=0;v=0;--te){var Oe=oe(te);if(Oe)return Oe.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Hn(R(e.sel.ranges,function(r){return new Ut(Ge(r.anchor.line+t,r.anchor.ch),Ge(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){kn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())return;if(t.from.lines&&(t={from:t.from,to:Ge(s,ht(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Pn(e,t.from,t.to),i||(i=Do(e,t)),e.cm?xl(e.cm,t,n):No(e,t,n),eo(e,i,be),e.cantEdit&&to(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,m=s.line;e.options.lineWrapping||(m=At(Sn(ht(n,s.line))),n.iter(m,l.line+1,function(te){if(te==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&X(e),No(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(te){var Oe=Ki(te);Oe>r.maxLineLength&&(r.maxLine=te,r.maxLineLength=Oe,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Gn(n,s.line),Sr(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?kn(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?xi(e,s.line,"text"):kn(e,s.line,l.line+1,v);var A=B(e,"changes"),O=B(e,"change");if(O||A){var oe={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};O&&mn(e,"change",e,oe),A&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(oe)}e.display.selForContextMenu=null}function ir(e,t,i,n,r){var s;n||(n=i),Ct(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:r})}function Qa(e,t,i,n){i1||!(this.children[0]instanceof Ar))){var f=[];this.collapse(f),this.children=[new Ar(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=r.lines.length%25+25,f=l;f10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=A,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&kn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&mn(e,"markerCleared",e,this,n,r),t&&Ui(e),this.parent&&this.parent.clear()},ki.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ne("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(qt(e,t.line,t,i,s)||t.line!=i.line&&qt(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Rn()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,v;if(e.iter(f,i.line+1,function(O){m&&s.collapsed&&!m.options.lineWrapping&&Sn(O)==m.display.maxLine&&(v=!0),s.collapsed&&f!=t.line&&wn(O,0),ti(O,new vi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(O){Mn(e,O)&&wn(O,0)}),s.clearOnEnter&&Te(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Bn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++is,s.atomic=!0),m){if(v&&(m.curOp.updateMaxLine=!0),s.collapsed)kn(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var A=t.line;A<=i.line;A++)xi(m,A,"text");s.atomic&&Xa(m.doc),mn(m,"markerAdded",m,s)}return s}var Mr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;m--)nr(this,n[m]);f?Ga(this,f):this.cm&&qi(this.cm)}),undo:hn(function(){no(this,"undo")}),redo:hn(function(){no(this,"redo")}),undoSelection:hn(function(){no(this,"undo",!0)}),redoSelection:hn(function(){no(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f=m.to||m.from==null&&r!=e.line||m.from!=null&&r==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=s,++i}),o(this,Ge(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var O;if(t.state.draggingText&&!t.state.draggingText.copy&&(O=t.listSelections()),eo(t.doc,Ci(i,i)),O)for(var oe=0;oe=0;f--)ir(e.doc,"",n[f].from,n[f].to,"+delete");qi(e)})}function Fo(e,t,i){var n=Ne(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Uo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new Ge(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=ft(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var A=Yi(t,i);v=r<0?i.text.length-1:0;var O=ri(t,A,v).top;v=Ye(function(oe){return ri(t,A,oe).top==O},r<0==(l.level==1)?l.from:l.to-1,v),m=="before"&&(v=Fo(i,v,1))}else v=r<0?l.to:l.from;return new Ge(n,v,m)}}return new Ge(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=ft(t,e.doc.direction);if(!r)return Uo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=nt(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from=l.from&&oe>=A.begin)){var te=O?"before":"after";return new Ge(i.line,oe,te)}}var Oe=function(Je,it,qe){for(var at=function(Xt,cn){return cn?new Ge(i.line,f(Xt,1),"before"):new Ge(i.line,Xt,"after")};Je>=0&&Je0==(xt.level!=1),Tt=pt?qe.begin:f(qe.end,-1);if(xt.from<=Tt&&Tt0?A.end:f(A.begin,-1);return Xe!=null&&!(n>0&&Xe==t.text.length)&&(He=Oe(n>0?0:r.length-1,n,v(Xe)),He)?He:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return ar(e,function(t){if(t.empty()){var i=ht(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)r=new Ge(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Ge(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ht(e.doc,r.line-1).text;l&&(r=new Ge(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ge(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ut(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return On(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;ne&&Ct(t,this.pos)==0&&i==this.button};var Ir,jr;function Hl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new Wo(i,e,t),Ir=null,"double"):(Ir=new Wo(i,e,t),jr=null,"single")}function bs(e){var t=this,i=t.display;if(Ve(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){U||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Go(t,e))return;var n=Ni(t,e),r=$(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):se(e)==i.scroller&&y(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(We?t.display.input.onContextMenu(e):xa(t))}function zl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=De}finally{e.state.suppressEdits=!1}return f})}function Wl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=ze?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=he?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(he?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){N?setTimeout(g(ba,e),0):e.curOp.focus=re();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&je&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ct((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ct(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=un(e,function(v){U&&(r.scroller.draggable=!1),e.state.draggingText=!1,st(r.wrapper.ownerDocument,"mouseup",l),st(r.wrapper.ownerDocument,"mousemove",f),st(r.scroller,"dragstart",m),st(r.scroller,"drop",l),s||(y(v),n.addNew||Qr(e.doc,i,null,null,n.extend),U&&!fe||N&&Q==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},m=function(){return s=!0};U&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Te(r.wrapper.ownerDocument,"mouseup",l),Te(r.wrapper.ownerDocument,"mousemove",f),Te(r.scroller,"dragstart",m),Te(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Ut(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ut(Ge(t.line,0),o(e.doc,Ge(t.line+1,0)));var n=i(e,t);return new Ut(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;y(t);var l,f,m=s.sel,v=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=v[f]:l=new Ut(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ut(i,i)),i=Ni(e,t,!0,!0),f=-1;else{var A=xs(e,i,n.unit);n.extend?l=jo(l,A.anchor,A.head,n.extend):l=A}n.addNew?f==-1?(f=v.length,vn(s,Qn(e,v.concat([l]),f),{scroll:!1,origin:"*mouse"})):v.length>1&&v[f].empty()&&n.unit=="char"&&!n.extend?(vn(s,Qn(e,v.slice(0,f).concat(v.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Bo(s,f,l,Se):(f=0,vn(s,new Hn([l],0),Se),m=s.sel);var O=i;function oe(qe){if(Ct(O,qe)==0)return;if(O=qe,n.unit=="rectangle"){for(var at=[],xt=e.options.tabSize,pt=w(ht(s,i.line).text,i.ch,xt),Tt=w(ht(s,qe.line).text,qe.ch,xt),Xt=Math.min(pt,Tt),cn=Math.max(pt,Tt),$t=Math.min(i.line,qe.line),Dn=Math.min(e.lastLine(),Math.max(i.line,qe.line));$t<=Dn;$t++){var _n=ht(s,$t).text,nn=xe(_n,Xt,xt);Xt==cn?at.push(new Ut(Ge($t,nn),Ge($t,nn))):_n.length>nn&&at.push(new Ut(Ge($t,nn),Ge($t,xe(_n,cn,xt))))}at.length||at.push(new Ut(i,i)),vn(s,Qn(e,m.ranges.slice(0,f).concat(at),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(qe)}else{var An=l,gn=xs(e,qe,n.unit),sn=An.anchor,rn;Ct(gn.anchor,sn)>0?(rn=gn.head,sn=Li(An.from(),gn.anchor)):(rn=gn.anchor,sn=di(An.to(),gn.head));var Jt=m.ranges.slice(0);Jt[f]=Kl(e,new Ut(o(s,sn),rn)),vn(s,Qn(e,Jt,f),Se)}}var te=r.wrapper.getBoundingClientRect(),Oe=0;function He(qe){var at=++Oe,xt=Ni(e,qe,!0,n.unit=="rectangle");if(!xt)return;if(Ct(xt,O)!=0){e.curOp.focus=re(),oe(xt);var pt=Kr(r,s);(xt.line>=pt.to||xt.linete.bottom?20:0;Tt&&setTimeout(un(e,function(){if(Oe!=at)return;r.scroller.scrollTop+=Tt,He(qe)}),50)}}function Xe(qe){e.state.selectingText=!1,Oe=Infinity,qe&&(y(qe),r.input.focus()),st(r.wrapper.ownerDocument,"mousemove",Je),st(r.wrapper.ownerDocument,"mouseup",it),s.history.lastSelOrigin=null}var Je=un(e,function(qe){qe.buttons===0||!$(qe)?Xe(qe):He(qe)}),it=un(e,Xe);e.state.selectingText=it,Te(r.wrapper.ownerDocument,"mousemove",Je),Te(r.wrapper.ownerDocument,"mouseup",it)}function Kl(e,t){var i=t.anchor,n=t.head,r=ht(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var s=ft(r);if(!s)return t;var l=nt(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var v;if(n.line!=i.line)v=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var A=nt(s,n.ch,n.sticky),O=A-l||(n.ch-i.ch)*(f.level==1?-1:1);A==m-1||A==m?v=O<0:v=O>0}var oe=s[m+(v?-1:0)],te=v==(oe.level==1),Oe=te?oe.from:oe.to,He=te?"after":"before";return i.ch==Oe&&i.sticky==He?t:new Ut(new Ge(i.line,Oe,He),n)}function ws(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(oe){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&y(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!B(e,i))return k(t);s-=f.top-l.viewOffset;for(var m=0;m=r){var A=Nn(e.doc,s),O=e.display.gutterSpecs[m];return Pe(e,i,e,A,O.className,t),k(t)}}}function Go(e,t){return ws(e,t,"gutterClick",!0)}function Cs(e,t){if(pi(e.display,t)||Yl(e,t))return;if(Ve(e,t,"contextmenu"))return;We||e.display.input.onContextMenu(t)}function Yl(e,t){return B(e,"gutterContextMenu")?ws(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var sr={toString:function(){return"CodeMirror.Init"}},Es={},ao={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,m,v){v!=sr&&s(f,m,v)}:s)}e.defineOption=i,e.Init=sr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Po(n)},!0),i("indentUnit",2,Po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){kr(n),vr(n),kn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(m){for(var v=0;;){var A=m.text.indexOf(r,v);if(A==-1)break;v=A+r.length,s.push(Ge(l,A))}l++});for(var f=s.length-1;f>=0;f--)ir(n.doc,r,s[f],Ge(s[f].line,s[f].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=sr&&n.refresh()}),i("specialCharPlaceholder",jt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",me?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!Ke),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Ss(n),Er(n)},!0),i("keyMap","default",function(n,r,s){var l=ro(r),f=s!=sr&&ro(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Jl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Oo(r,n.options.lineNumbers),Er(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Co(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Qi(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),Qi(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Oo(n.options.gutters,r),Er(n)},!0),i("firstLineNumber",1,Er,!0),i("lineNumberFormatter",function(n){return n},Er,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(Ji(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Zl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,kr,!0),i("addModeClass",!1,kr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,kr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Zl(e,t,i){var n=i&&i!=sr;if(!t!=!n){var r=e.display.dragFunctions,s=t?Te:st;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Jl(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ae(e.display.wrapper,"CodeMirror-wrap"),Ur(e)),So(e),kn(e),vr(e),setTimeout(function(){return Qi(e)},100)}function Yt(e,t){var i=this;if(!(this instanceof Yt))return new Yt(e,t);this.options=t=t?p(t):{},p(Es,t,!1);var n=t.value;typeof n=="string"?n=new Tn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Yt.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new P,keySeq:null,specialChars:null},t.autofocus&&!me&&s.input.focus(),N&&Q<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Ll(),Fi(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!me||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):Ji(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);La(this),t.finishInit&&t.finishInit(this);for(var f=0;f20*20}Te(t.scroller,"touchstart",function(m){if(!Ve(e,m)&&!s(m)&&!Go(e,m)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Te(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Te(t.scroller,"touchend",function(m){var v=t.activeTouch;if(v&&!pi(t,m)&&v.left!=null&&!v.moved&&new Date-v.start<300){var A=e.coordsChar(t.activeTouch,"page"),O;!v.prev||l(v,v.prev)?O=new Ut(A,A):!v.prev.prev||l(v,v.prev.prev)?O=e.findWordAt(A):O=new Ut(Ge(A.line,0),o(e.doc,Ge(A.line+1,0))),e.setSelection(O.anchor,O.head),e.focus(),y(m)}r()}),Te(t.scroller,"touchcancel",r),Te(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),ji(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),Te(t.scroller,"mousewheel",function(m){return Oa(e,m)}),Te(t.scroller,"DOMMouseScroll",function(m){return Oa(e,m)}),Te(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){Ve(e,m)||T(m)},over:function(m){Ve(e,m)||(Al(e,m),T(m))},start:function(m){return _l(e,m)},drop:un(e,Tl),leave:function(m){Ve(e,m)||as(e)}};var f=t.input.getField();Te(f,"keyup",function(m){return vs.call(e,m)}),Te(f,"keydown",un(e,gs)),Te(f,"keypress",un(e,ys)),Te(f,"focus",function(m){return ko(e,m)}),Te(f,"blur",function(m){return Ji(e,m)})}var Vo=[];Yt.defineInitHook=function(e){return Vo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=$e(e,t).state:i="prev");var l=e.options.tabSize,f=ht(r,t),m=w(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var v=f.text.match(/^\s*/)[0],A;if(!n&&!/\S/.test(f.text))A=0,i="not";else if(i=="smart"&&(A=r.mode.indent(s,f.text.slice(v.length),f.text),A==De||A>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?A=w(ht(r,t-1).text,null,l):A=0:i=="add"?A=m+e.options.indentUnit:i=="subtract"?A=m-e.options.indentUnit:typeof i=="number"&&(A=m+i),A=Math.max(0,A);var O="",oe=0;if(e.options.indentWithTabs)for(var te=Math.floor(A/l);te;--te)oe+=l,O+=" ";if(oel,m=Et(t),v=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(` `)==t){if(n.ranges.length%ei.text.length==0){v=[];for(var A=0;A=0;oe--){var te=n.ranges[oe],Oe=te.from(),He=te.to();te.empty()&&(i&&i>0?Oe=Ge(Oe.line,Oe.ch-i):e.state.overwrite&&!f?He=Ge(He.line,Math.min(ht(s,He.line).text.length,He.ch+b(m).length)):f&&ei&&ei.lineWise&&ei.text.join(` `)==m.join(` `)&&(Oe=He=Ge(Oe.line,0)));var Xe={from:Oe,to:He,text:v?v[oe%v.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};nr(e.doc,Xe),mn(e,"inputRead",e,Xe)}t&&!f&&Ts(e,t),qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=O),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&On(t,function(){return Xo(t,i,0,null,"paste")}),!0}function Ts(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var f=0;f-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ht(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&mn(e,"electricInput",e,r.head.line)}}function _s(e){for(var t=[],i=[],n=0;ns&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&qi(this));else{var m=f.from(),v=f.to(),A=Math.max(s,m.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var O=A;O0&&Bo(this.doc,l,new Ut(m,oe[l].to()),be)}}}),getTokenAt:function(n,r){return Vt(this,n,r)},getLineTokens:function(n,r){return Vt(this,Ge(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Be(this,ht(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=f)l=v;else if(r[v*2+1]m&&(n=m,l=!0),f=ht(this.doc,n)}else f=n;return Wr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Jn(f):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return Zi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var m=this.display;n=qn(this,o(this.doc,n));var v=n.bottom,A=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var O=Math.max(m.wrapper.clientHeight,this.doc.height),oe=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>O)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=O&&(v=n.bottom),A+r.offsetWidth>oe&&(A=oe-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",f=="right"?(A=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?A=0:f=="middle"&&(A=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=A+"px"),s&&Zs(this,{left:A,top:v,right:A+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:bn(gs),triggerOnKeyPress:bn(ys),triggerOnKeyUp:vs,triggerOnMouseDown:bn(bs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:bn(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),v=0;v0&&A(s.charAt(l-1));)--l;for(;f.5||this.options.lineWrapping)&&So(this),Pe(this,"refresh",this)}),swapDoc:bn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,mn(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},W(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function Ko(e,t,i,n,r){var s=t,l=i,f=ht(e,t.line),m=r&&e.direction=="rtl"?-i:i;function v(){var it=t.line+m;return it=e.first+e.size?!1:(t=new Ge(it,t.ch,t.sticky),f=ht(e,it))}function A(it){var qe;if(n=="codepoint"){var at=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(at)?qe=null:qe=new Ge(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(at>=55296&&at<56320?2:1))),-i)}else r?qe=Pl(e.cm,f,t,i):qe=Uo(f,t,i);if(qe==null)if(!it&&v())t=Ho(r,e.cm,f,t.line,m);else return!1;else t=qe;return!0}if(n=="char"||n=="codepoint")A();else if(n=="column")A(!0);else if(n=="word"||n=="group")for(var O=null,oe=n=="group",te=e.cm&&e.cm.getHelper(t,"wordChars"),Oe=!0;!(i<0&&!A(!Oe));Oe=!1){var He=f.text.charAt(t.ch)||` `,Xe=Me(He,te)?"w":oe&&He==` `?"n":!oe||/\s/.test(He)?null:"p";if(oe&&!Oe&&!Xe&&(Xe="s"),O&&O!=Xe){i<0&&(i=1,A(),t.sticky="after");break}if(Xe&&(O=Xe),i>0&&!A(!Oe))break}var Je=to(e,t,s,l,!0);return ci(s,Je)&&(Je.hitSide=!0),Je}function Rs(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(f-.5*$i(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=bo(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var Wt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new P,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Wt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;As(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Te(r,"paste",function(f){if(!s(f)||Ve(n,f)||ks(f,n))return;Q<=11&&setTimeout(un(n,function(){return t.updateFromDOM()}),20)}),Te(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Te(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Te(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Te(r,"touchstart",function(){return i.forceCompositionEnd()}),Te(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Ve(n,f))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=_s(n);so({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,be),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var v=ei.text.join(` `);if(f.clipboardData.setData("Text",v),f.clipboardData.getData("Text")==v){f.preventDefault();return}}var A=Ls(),O=A.firstChild;n.display.lineSpace.insertBefore(A,n.display.lineSpace.firstChild),O.value=ei.text.join(` `);var oe=document.activeElement;L(O),setTimeout(function(){n.display.lineSpace.removeChild(A),oe.focus(),oe==r&&i.showPrimarySelection()},50)}Te(r,"copy",l),Te(r,"cut",l)},Wt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Wt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},Wt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Wt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line=t.display.viewFrom&&Ms(t,n)||{node:f[0].measure.map[2],offset:0},v=r.linee.firstLine()&&(n=Ge(n.line-1,ht(e.doc,n.line-1).length)),r.ch==ht(e.doc,r.line).text.length&&r.linet.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ii(e,n.line))==0?(l=At(t.view[0].line),f=t.view[0].node):(l=At(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Ii(e,r.line),v,A;if(m==t.view.length-1?(v=t.viewTo-1,A=t.lineDiv.lastChild):(v=At(t.view[m+1].line)-1,A=t.view[m+1].node.previousSibling),!f)return!1;for(var O=e.doc.splitLines(tu(e,f,A,l,v)),oe=Pn(e.doc,Ge(l,0),Ge(v,ht(e.doc,v).text.length));O.length>1&&oe.length>1;)if(b(O)==b(oe))O.pop(),oe.pop(),v--;else if(O[0]==oe[0])O.shift(),oe.shift(),l++;else break;for(var te=0,Oe=0,He=O[0],Xe=oe[0],Je=Math.min(He.length,Xe.length);ten.ch&&it.charCodeAt(it.length-Oe-1)==qe.charCodeAt(qe.length-Oe-1);)te--,Oe++;O[O.length-1]=it.slice(0,it.length-Oe).replace(/^\u200b+/,""),O[0]=O[0].slice(te).replace(/\u200b+$/,"");var xt=Ge(l,te),pt=Ge(v,oe.length?b(oe).length-Oe:0);if(O.length>1||O[0]||Ct(xt,pt))return ir(e.doc,O,xt,pt,"+input"),!0},Wt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wt.prototype.reset=function(){this.forceCompositionEnd()},Wt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Wt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Wt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&On(this.cm,function(){return kn(e.cm)})},Wt.prototype.setUneditable=function(e){e.contentEditable="false"},Wt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||un(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Wt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Wt.prototype.onContextMenu=function(){},Wt.prototype.resetPosition=function(){},Wt.prototype.needsContentAttribute=!0;function Ms(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=ht(e.doc,t.line),r=ia(i,n,t.line),s=ft(n,e.doc.direction),l="left";if(s){var f=nt(s,t.ch);l=f%2?"right":"left"}var m=aa(r.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function v(te){return function(Oe){return Oe.id==te}}function A(){l&&(s+=f,m&&(s+=f),l=m=!1)}function O(te){te&&(A(),s+=te)}function oe(te){if(te.nodeType==1){var Oe=te.getAttribute("cm-text");if(Oe){O(Oe);return}var He=te.getAttribute("cm-marker"),Xe;if(He){var Je=e.findMarks(Ge(n,0),Ge(r+1,0),v(+He));Je.length&&(Xe=Je[0].find(0))&&O(Pn(e.doc,Xe.from,Xe.to).join(f));return}if(te.getAttribute("contenteditable")=="false")return;var it=/^(pre|div|p|li|table|br)$/i.test(te.nodeName);if(!/^br$/i.test(te.nodeName)&&te.textContent.length==0)return;it&&A();for(var qe=0;qe=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Te(r,"paste",function(l){if(Ve(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Ve(n,l))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=_s(n);so({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,be):(i.prevInput="",r.value=f.text.join(` `),L(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Te(r,"cut",s),Te(r,"copy",s),Te(e.scroller,"paste",function(l){if(pi(e,l)||Ve(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),Te(e.lineSpace,"selectstart",function(l){pi(e,l)||y(l)}),Te(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Te(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Qt.prototype.createField=function(e){this.wrapper=Ls(),this.textarea=this.wrapper.firstChild},Qt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Qt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=va(e);if(e.options.moveInputWithCursor){var r=qn(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},Qt.prototype.showSelection=function(e){var t=this.cm,i=t.display;ie(i.cursorDiv,e.cursors),ie(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Qt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&L(this.textarea),N&&Q>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",N&&Q>=9&&(this.hasSelection=null))},Qt.prototype.getField=function(){return this.textarea},Qt.prototype.supportsTouch=function(){return!1},Qt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!me||re()!=this.textarea))try{this.textarea.focus()}catch(e){}},Qt.prototype.blur=function(){this.textarea.blur()},Qt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Qt.prototype.receivedFocus=function(){this.slowPoll()},Qt.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Qt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Qt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ut(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(N&&Q>=9&&this.hasSelection===r||he&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,f=Math.min(n.length,r.length);l1e3||r.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Qt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Qt.prototype.onKeyPress=function(){N&&Q>=9&&(this.hasSelection=null),this.fastPoll()},Qt.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Ni(i,e),l=n.scroller.scrollTop;if(!s||F)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&un(i,vn)(i.doc,Ci(s),be);var m=r.style.cssText,v=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px; z-index: 1000; background: `+(N?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var O;U&&(O=window.scrollY),n.input.focus(),U&&window.scrollTo(null,O),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=te,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function oe(){if(r.selectionStart!=null){var He=i.somethingSelected(),Xe="\u200B"+(He?r.value:"");r.value="\u21DA",r.value=Xe,t.prevInput=He?"":"\u200B",r.selectionStart=1,r.selectionEnd=Xe.length,n.selForContextMenu=i.doc.sel}}function te(){if(t.contextMenuPending!=te)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=m,N&&Q<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!N||N&&Q<9)&&oe();var He=0,Xe=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?un(i,$a)(i):He++<10?n.detectingSelectAll=setTimeout(Xe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Xe,200)}}if(N&&Q>=9&&oe(),We){T(e);var Oe=function(){st(window,"mouseup",Oe),setTimeout(te,20)};Te(window,"mouseup",Oe)}else setTimeout(te,50)},Qt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Qt.prototype.setUneditable=function(){},Qt.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?p(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=re();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(Te(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=Yt(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=st,e.on=Te,e.wheelEventPixels=cl,e.Doc=Tn,e.splitLines=Et,e.countColumn=w,e.findColumn=xe,e.isWordChar=we,e.Pass=De,e.signal=Pe,e.Line=Oi,e.changeEnd=Si,e.scrollbarModel=ka,e.Pos=Ge,e.cmpPos=Ct,e.modes=Ht,e.mimeModes=_t,e.resolveMode=gt,e.getMode=Kn,e.modeExtensions=on,e.extendMode=fn,e.copyState=Wn,e.startState=li,e.innerMode=si,e.commands=Pr,e.keyMap=mi,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=Dl,e.StringStream=Dt,e.SharedTextMarker=Mr,e.TextMarker=ki,e.LineWidget=Rr,e.e_preventDefault=y,e.e_stopPropagation=x,e.e_stop=T,e.addClass=z,e.contains=_,e.rmClass=Ae,e.keyNames=Ti}$l(Yt),Ql(Yt);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in Tn.prototype)Tn.prototype.hasOwnProperty(uo)&&Y(ou,uo)<0&&(Yt.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tn.prototype[uo]));return W(Tn),Yt.inputStyles={textarea:Qt,contenteditable:Wt},Yt.defineMode=function(e){!Yt.defaults.mode&&e!="null"&&(Yt.defaults.mode=e),zn.apply(this,arguments)},Yt.defineMIME=ai,Yt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yt.defineMIME("text/plain","null"),Yt.defineExtension=function(e,t){Yt.prototype[e]=t},Yt.defineDocExtension=function(e,t){Tn.prototype[e]=t},Yt.fromTextArea=iu,ru(Yt),Yt.version="5.58.2",Yt})},X0ci:function(bt,Qe,C){},Y1PL:function(bt,Qe,C){"use strict";C.r(Qe),C.d(Qe,"ResizableTextArea",function(){return Y});var G=C("wx14"),_e=C("1OyB"),de=C("vuIU"),Re=C("Ji7U"),ke=C("LK+K"),le=C("q1tI"),N=C("VTBJ"),Q=C("rePB"),U=C("Zm9Q"),q=C("Kwbf"),M=C("c+Xe"),F=C("m+aA"),fe=C("bdgK"),ae=new Map;function K(be){be.forEach(function(Se){var ce,xe=Se.target;(ce=ae.get(xe))===null||ce===void 0||ce.forEach(function(Z){return Z(xe)})})}var ee=new fe.default(K),H=null,me=null;function he(be,Se){ae.has(be)||(ae.set(be,new Set),ee.observe(be)),ae.get(be).add(Se)}function ze(be,Se){ae.has(be)&&(ae.get(be).delete(Se),ae.get(be).size||(ee.unobserve(be),ae.delete(be)))}var Ke=function(be){Object(Re.a)(ce,be);var Se=Object(ke.a)(ce);function ce(){return Object(_e.a)(this,ce),Se.apply(this,arguments)}return Object(de.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(le.Component),Ee=le.createContext(null);function Ce(be){var Se=be.children,ce=be.onBatchResize,xe=le.useRef(0),Z=le.useRef([]),j=le.useContext(Ee),b=le.useCallback(function(R,E,ue){xe.current+=1;var ye=xe.current;Z.current.push({size:R,element:E,data:ue}),Promise.resolve().then(function(){ye===xe.current&&(ce==null||ce(Z.current),Z.current=[])}),j==null||j(R,E,ue)},[ce,j]);return le.createElement(Ee.Provider,{value:b},Se)}function We(be){var Se=be.children,ce=be.disabled,xe=le.useRef(null),Z=le.useRef(null),j=le.useContext(Ee),b=le.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),R=le.isValidElement(Se)&&Object(M.c)(Se),E=R?Se.ref:null,ue=le.useMemo(function(){return Object(M.a)(E,xe)},[E,xe]),ye=le.useRef(be);ye.current=be;var V=le.useCallback(function(we){var Me=ye.current,Ue=Me.onResize,Ie=Me.data,Le=we.getBoundingClientRect(),Ne=Le.width,Ye=Le.height,tt=we.offsetWidth,Ze=we.offsetHeight,nt=Math.floor(Ne),mt=Math.floor(Ye);if(b.current.width!==nt||b.current.height!==mt||b.current.offsetWidth!==tt||b.current.offsetHeight!==Ze){var ft={width:nt,height:mt,offsetWidth:tt,offsetHeight:Ze};b.current=ft;var rt=tt===Math.round(Ne)?Ne:tt,Te=Ze===Math.round(Ye)?Ye:Ze,yt=Object(N.a)(Object(N.a)({},ft),{},{offsetWidth:rt,offsetHeight:Te});j==null||j(yt,we,Ie),Ue&&Promise.resolve().then(function(){Ue(yt,we)})}},[]);return le.useEffect(function(){var we=Object(F.a)(xe.current)||Object(F.a)(Z.current);return we&&!ce&&he(we,V),function(){return ze(we,V)}},[xe.current,ce]),le.createElement(Ke,{ref:Z},R?le.cloneElement(Se,{ref:ue}):Se)}var pe="rc-observer-key";function Ae(be){var Se=be.children,ce=Object(U.a)(Se);return ce.map(function(xe,Z){var j=(xe==null?void 0:xe.key)||"".concat(pe,"-").concat(Z);return le.createElement(We,Object(G.a)({},be,{key:j}),xe)})}Ae.Collection=Ce;var ve=Ae,ie=C("bT9E"),S=C("TSYQ"),ne=C.n(S),J=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],re={},z;function D(be){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Se&&re[ce])return re[ce];var xe=window.getComputedStyle(be),Z=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),j=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),b=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),R=_.map(function(ue){return"".concat(ue,":").concat(xe.getPropertyValue(ue))}).join(";"),E={sizingStyle:R,paddingSize:j,borderSize:b,boxSizing:Z};return Se&&ce&&(re[ce]=E),E}function L(be){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),be.getAttribute("wrap")?z.setAttribute("wrap",be.getAttribute("wrap")):z.removeAttribute("wrap");var Z=D(be,Se),j=Z.paddingSize,b=Z.borderSize,R=Z.boxSizing,E=Z.sizingStyle;z.setAttribute("style","".concat(E,";").concat(J)),z.value=be.value||be.placeholder||"";var ue=Number.MIN_SAFE_INTEGER,ye=Number.MAX_SAFE_INTEGER,V=z.scrollHeight,we;if(R==="border-box"?V+=b:R==="content-box"&&(V-=j),ce!==null||xe!==null){z.value=" ";var Me=z.scrollHeight-j;ce!==null&&(ue=Me*ce,R==="border-box"&&(ue=ue+j+b),V=Math.max(ue,V)),xe!==null&&(ye=Me*xe,R==="border-box"&&(ye=ye+j+b),we=V>ye?"":"hidden",V=Math.min(ye,V))}return{height:V,minHeight:ue,maxHeight:ye,overflowY:we,resize:"none"}}var g=C("Gytx"),p=C.n(g),w;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(w||(w={}));var P=function(be){Object(Re.a)(ce,be);var Se=Object(ke.a)(ce);function ce(xe){var Z;return Object(_e.a)(this,ce),Z=Se.call(this,xe),Z.nextFrameActionId=void 0,Z.resizeFrameId=void 0,Z.textArea=void 0,Z.saveTextArea=function(j){Z.textArea=j},Z.handleResize=function(j){var b=Z.state.resizeStatus,R=Z.props,E=R.autoSize,ue=R.onResize;if(b!==w.NONE)return;typeof ue=="function"&&ue(j),E&&Z.resizeOnNextFrame()},Z.resizeOnNextFrame=function(){cancelAnimationFrame(Z.nextFrameActionId),Z.nextFrameActionId=requestAnimationFrame(Z.resizeTextarea)},Z.resizeTextarea=function(){var j=Z.props.autoSize;if(!j||!Z.textArea)return;var b=j.minRows,R=j.maxRows,E=L(Z.textArea,!1,b,R);Z.setState({textareaStyles:E,resizeStatus:w.RESIZING},function(){cancelAnimationFrame(Z.resizeFrameId),Z.resizeFrameId=requestAnimationFrame(function(){Z.setState({resizeStatus:w.RESIZED},function(){Z.resizeFrameId=requestAnimationFrame(function(){Z.setState({resizeStatus:w.NONE}),Z.fixFirefoxAutoScroll()})})})})},Z.renderTextArea=function(){var j=Z.props,b=j.prefixCls,R=b===void 0?"rc-textarea":b,E=j.autoSize,ue=j.onResize,ye=j.className,V=j.disabled,we=Z.state,Me=we.textareaStyles,Ue=we.resizeStatus,Ie=Object(ie.a)(Z.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Le=ne()(R,ye,Object(Q.a)({},"".concat(R,"-disabled"),V));"value"in Ie&&(Ie.value=Ie.value||"");var Ne=Object(N.a)(Object(N.a)(Object(N.a)({},Z.props.style),Me),Ue===w.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return le.createElement(ve,{onResize:Z.handleResize,disabled:!(E||ue)},le.createElement("textarea",Object(G.a)({},Ie,{className:Le,style:Ne,ref:Z.saveTextArea})))},Z.state={textareaStyles:{},resizeStatus:w.NONE},Z}return Object(de.a)(ce,[{key:"componentDidUpdate",value:function(Z){(Z.value!==this.props.value||!p()(Z.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var Z=this.textArea.selectionStart,j=this.textArea.selectionEnd;this.textArea.setSelectionRange(Z,j)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(le.Component),Y=P,ge=function(be){Object(Re.a)(ce,be);var Se=Object(ke.a)(ce);function ce(xe){var Z;Object(_e.a)(this,ce),Z=Se.call(this,xe),Z.resizableTextArea=void 0,Z.focus=function(){Z.resizableTextArea.textArea.focus()},Z.saveTextArea=function(b){Z.resizableTextArea=b},Z.handleChange=function(b){var R=Z.props.onChange;Z.setValue(b.target.value,function(){Z.resizableTextArea.resizeTextarea()}),R&&R(b)},Z.handleKeyDown=function(b){var R=Z.props,E=R.onPressEnter,ue=R.onKeyDown;b.keyCode===13&&E&&E(b),ue&&ue(b)};var j=typeof xe.value=="undefined"||xe.value===null?xe.defaultValue:xe.value;return Z.state={value:j},Z}return Object(de.a)(ce,[{key:"setValue",value:function(Z,j){"value"in this.props||this.setState({value:Z},j)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return le.createElement(Y,Object(G.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Z){return"value"in Z?{value:Z.value}:null}}]),ce}(le.Component),De=Qe.default=ge},ZW9T:function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return Ke});var G=C("k1fw"),_e=C("miYZ"),de=C("tsqr"),Re=C("rAM+"),ke=C("tJVT"),le=C("PpiC"),N=C("q1tI"),Q=C.n(N),U=C("bdgK");function q(Ee,Ce,We,pe,Ae){var ve=Ce.getWordUntilPosition(We),ie={startLineNumber:We.lineNumber,endLineNumber:We.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},S=pe.map(function(ne){return{label:ne,kind:Ee.languages.CompletionItemKind.Keyword,insertText:ne,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}});return Ae.map(function(ne){S.push(Object(G.a)(Object(G.a)({},ne),{},{range:ie}))}),S}var M=function(Ee){var Ce={label:"ifelse",kind:Ee.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet},We=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];Ee.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ie,S){var ne=q(Ee,ie,S,We,[Ce]);return{suggestions:ne}}});var pe=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];Ee.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ie,S){var ne=[{label:"print",kind:Ee.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet}],J=q(Ee,ie,S,pe,ne);return{suggestions:J}}});var Ae=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];Ee.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ie,S){var ne=[Ce,{label:"main",kind:Ee.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:Ee.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet}],J=q(Ee,ie,S,Ae,ne);return{suggestions:J}}})},F="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",fe=C("LvDl");function ae(Ee){return/^\d+$/.test(Ee)?"".concat(Ee,"px"):Ee}function K(){}var ee=!1,H={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function me(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ce=Ee;if(Array.isArray(Ee)){for(var We=0;We0||je.target.offsetWidth>0)&&ye.current.instance.layout()}}catch(et){se.e(et)}finally{se.f()}}),k.observe(ue.current)),k}function tt(){de.b.warn(decodeURIComponent(F))}var Ze=function(){var T=ye.current.instance;if(ve!=null&&T&&Le){var se=T.getModel();se&&ve!==se.getValue()&&(ee=!0,se.setValue(ve),T.layout(),ee=!1)}};Object(N.useEffect)(function(){V.current&&clearTimeout(V.current),V.current=setTimeout(function(){Ze()},500)},[ve,Le,ye.current]);function nt(){var k=ye.current.instance;if(k){var T=k.getSelection(),se=ye.current.pastePos||{},$=new he.Range(se.startLineNumber||T.endLineNumber,se.startColumn||T.endColumn,se.endLineNumber||T.endLineNumber,se.endColumn||T.endColumn);setTimeout(function(){k.executeEdits("",[{range:$,text:""}])},300)}}function mt(k){(window.navigator.platform.match("Mac")?k.metaKey:k.ctrlKey)&&k.keyCode==83&&(k.preventDefault(),w())}var ft=function(){if(Y&&ye.current.instance){var T=ye.current.instance.getContentHeight();y(T0||ce.target.offsetWidth>0)&&Y.layout()}}catch(xe){be.e(xe)}finally{be.f()}}),ge.observe(_.current)),ge}Object(N.useEffect)(function(){_.current&&C.e(27).then(C.t.bind(null,"M/lh",7)).then(function(Y){he=Y;var ge=he.editor.createDiffEditor(_.current,Object(G.a)(Object(G.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},J),{},{wordWrap:!0}));L(ge);var De=g(ge);return function(){ge.dispose();var be=ge.getModel();be&&be.dispose(),De.unobserve(_.current)}})},[]),Object(N.useEffect)(function(){D&&D.setModel({original:he.editor.createModel(ve,S),modified:he.editor.createModel(ie,S)})},[ve,ie,S,D]);var p=ae(We),w=ae(Ae),P={width:p,height:w};return Q.a.createElement("div",{className:"my-diff-editor",ref:_,style:P})}},ZpRC:function(bt,Qe,C){"use strict";function G(M){return typeof M=="object"&&M!=null&&M.nodeType===1}function _e(M,F){return(!F||M!=="hidden")&&M!=="visible"&&M!=="clip"}function de(M,F){if(M.clientHeightF||ee>M&&H=F&&me>=fe?ee-M-ae:H>F&&mefe?H-F+K:0}var ke=function(M,F){var fe=window,ae=F.scrollMode,K=F.block,ee=F.inline,H=F.boundary,me=F.skipOverflowHiddenElements,he=typeof H=="function"?H:function(Me){return Me!==H};if(!G(M))throw new TypeError("Invalid target");for(var ze=document.scrollingElement||document.documentElement,Ke=[],Ee=M;G(Ee)&&he(Ee);){if((Ee=Ee.parentElement)===ze){Ke.push(Ee);break}Ee!=null&&Ee===document.body&&de(Ee)&&!de(document.documentElement)||Ee!=null&&de(Ee,me)&&Ke.push(Ee)}for(var Ce=fe.visualViewport?fe.visualViewport.width:innerWidth,We=fe.visualViewport?fe.visualViewport.height:innerHeight,pe=window.scrollX||pageXOffset,Ae=window.scrollY||pageYOffset,ve=M.getBoundingClientRect(),ie=ve.height,S=ve.width,ne=ve.top,J=ve.right,_=ve.bottom,re=ve.left,z=K==="start"||K==="nearest"?ne:K==="end"?_:ne+ie/2,D=ee==="center"?re+S/2:ee==="end"?J:re,L=[],g=0;g=0&&re>=0&&_<=We&&J<=Ce&&ne>=ge&&_<=be&&re>=Se&&J<=De)return L;var ce=getComputedStyle(p),xe=parseInt(ce.borderLeftWidth,10),Z=parseInt(ce.borderTopWidth,10),j=parseInt(ce.borderRightWidth,10),b=parseInt(ce.borderBottomWidth,10),R=0,E=0,ue="offsetWidth"in p?p.offsetWidth-p.clientWidth-xe-j:0,ye="offsetHeight"in p?p.offsetHeight-p.clientHeight-Z-b:0;if(ze===p)R=K==="start"?z:K==="end"?z-We:K==="nearest"?Re(Ae,Ae+We,We,Z,b,Ae+z,Ae+z+ie,ie):z-We/2,E=ee==="start"?D:ee==="center"?D-Ce/2:ee==="end"?D-Ce:Re(pe,pe+Ce,Ce,xe,j,pe+D,pe+D+S,S),R=Math.max(0,R+Ae),E=Math.max(0,E+pe);else{R=K==="start"?z-ge-Z:K==="end"?z-be+b+ye:K==="nearest"?Re(ge,be,P,Z,b+ye,z,z+ie,ie):z-(ge+P/2)+ye/2,E=ee==="start"?D-Se-xe:ee==="center"?D-(Se+Y/2)+ue/2:ee==="end"?D-De+j+ue:Re(Se,De,Y,xe,j+ue,D,D+S,S);var V=p.scrollLeft,we=p.scrollTop;z+=we-(R=Math.max(0,Math.min(we+R,p.scrollHeight-P+ye))),D+=V-(E=Math.max(0,Math.min(V+E,p.scrollWidth-Y+ue)))}L.push({el:p,top:R,left:E})}return L};function le(M){return M===Object(M)&&Object.keys(M).length!==0}function N(M,F){F===void 0&&(F="auto");var fe="scrollBehavior"in document.body.style;M.forEach(function(ae){var K=ae.el,ee=ae.top,H=ae.left;K.scroll&&fe?K.scroll({top:ee,left:H,behavior:F}):(K.scrollTop=ee,K.scrollLeft=H)})}function Q(M){return M===!1?{block:"end",inline:"nearest"}:le(M)?M:{block:"start",inline:"nearest"}}function U(M,F){var fe=!M.ownerDocument.documentElement.contains(M);if(le(F)&&typeof F.behavior=="function")return F.behavior(fe?[]:ke(M,F));if(fe)return;var ae=Q(F);return N(ke(M,ae),ae.behavior)}var q=Qe.a=U},Zss7:function(bt,Qe,C){var G;(function(_e){var de=/^\s+/,Re=/\s+$/,ke=0,le=_e.round,N=_e.min,Q=_e.max,U=_e.random;function q(b,R){if(b=b||"",R=R||{},b instanceof q)return b;if(!(this instanceof q))return new q(b,R);var E=M(b);this._originalInput=b,this._r=E.r,this._g=E.g,this._b=E.b,this._a=E.a,this._roundA=le(100*this._a)/100,this._format=R.format||E.format,this._gradientType=R.gradientType,this._r<1&&(this._r=le(this._r)),this._g<1&&(this._g=le(this._g)),this._b<1&&(this._b=le(this._b)),this._ok=E.ok,this._tc_id=ke++}q.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var b=this.toRgb();return(b.r*299+b.g*587+b.b*114)/1e3},getLuminance:function(){var b=this.toRgb(),R,E,ue,ye,V,we;return R=b.r/255,E=b.g/255,ue=b.b/255,R<=.03928?ye=R/12.92:ye=_e.pow((R+.055)/1.055,2.4),E<=.03928?V=E/12.92:V=_e.pow((E+.055)/1.055,2.4),ue<=.03928?we=ue/12.92:we=_e.pow((ue+.055)/1.055,2.4),.2126*ye+.7152*V+.0722*we},setAlpha:function(b){return this._a=L(b),this._roundA=le(100*this._a)/100,this},toHsv:function(){var b=K(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=K(this._r,this._g,this._b),R=le(b.h*360),E=le(b.s*100),ue=le(b.v*100);return this._a==1?"hsv("+R+", "+E+"%, "+ue+"%)":"hsva("+R+", "+E+"%, "+ue+"%, "+this._roundA+")"},toHsl:function(){var b=fe(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=fe(this._r,this._g,this._b),R=le(b.h*360),E=le(b.s*100),ue=le(b.l*100);return this._a==1?"hsl("+R+", "+E+"%, "+ue+"%)":"hsla("+R+", "+E+"%, "+ue+"%, "+this._roundA+")"},toHex:function(b){return H(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return me(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:le(this._r),g:le(this._g),b:le(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+le(this._r)+", "+le(this._g)+", "+le(this._b)+")":"rgba("+le(this._r)+", "+le(this._g)+", "+le(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:le(g(this._r,255)*100)+"%",g:le(g(this._g,255)*100)+"%",b:le(g(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+le(g(this._r,255)*100)+"%, "+le(g(this._g,255)*100)+"%, "+le(g(this._b,255)*100)+"%)":"rgba("+le(g(this._r,255)*100)+"%, "+le(g(this._g,255)*100)+"%, "+le(g(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:z[H(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var R="#"+he(this._r,this._g,this._b,this._a),E=R,ue=this._gradientType?"GradientType = 1, ":"";if(b){var ye=q(b);E="#"+he(ye._r,ye._g,ye._b,ye._a)}return"progid:DXImageTransform.Microsoft.gradient("+ue+"startColorstr="+R+",endColorstr="+E+")"},toString:function(b){var R=!!b;b=b||this._format;var E=!1,ue=this._a<1&&this._a>=0,ye=!R&&ue&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return ye?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(E=this.toRgbString()),b==="prgb"&&(E=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(E=this.toHexString()),b==="hex3"&&(E=this.toHexString(!0)),b==="hex4"&&(E=this.toHex8String(!0)),b==="hex8"&&(E=this.toHex8String()),b==="name"&&(E=this.toName()),b==="hsl"&&(E=this.toHslString()),b==="hsv"&&(E=this.toHsvString()),E||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(b,R){var E=b.apply(null,[this].concat([].slice.call(R)));return this._r=E._r,this._g=E._g,this._b=E._b,this.setAlpha(E._a),this},lighten:function(){return this._applyModification(Ce,arguments)},brighten:function(){return this._applyModification(We,arguments)},darken:function(){return this._applyModification(pe,arguments)},desaturate:function(){return this._applyModification(ze,arguments)},saturate:function(){return this._applyModification(Ke,arguments)},greyscale:function(){return this._applyModification(Ee,arguments)},spin:function(){return this._applyModification(Ae,arguments)},_applyCombination:function(b,R){return b.apply(null,[this].concat([].slice.call(R)))},analogous:function(){return this._applyCombination(J,arguments)},complement:function(){return this._applyCombination(ve,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(ne,arguments)},triad:function(){return this._applyCombination(ie,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},q.fromRatio=function(b,R){if(typeof b=="object"){var E={};for(var ue in b)b.hasOwnProperty(ue)&&(ue==="a"?E[ue]=b[ue]:E[ue]=De(b[ue]));b=E}return q(b,R)};function M(b){var R={r:0,g:0,b:0},E=1,ue=null,ye=null,V=null,we=!1,Me=!1;return typeof b=="string"&&(b=Z(b)),typeof b=="object"&&(xe(b.r)&&xe(b.g)&&xe(b.b)?(R=F(b.r,b.g,b.b),we=!0,Me=String(b.r).substr(-1)==="%"?"prgb":"rgb"):xe(b.h)&&xe(b.s)&&xe(b.v)?(ue=De(b.s),ye=De(b.v),R=ee(b.h,ue,ye),we=!0,Me="hsv"):xe(b.h)&&xe(b.s)&&xe(b.l)&&(ue=De(b.s),V=De(b.l),R=ae(b.h,ue,V),we=!0,Me="hsl"),b.hasOwnProperty("a")&&(E=b.a)),E=L(E),{ok:we,format:b.format||Me,r:N(255,Q(R.r,0)),g:N(255,Q(R.g,0)),b:N(255,Q(R.b,0)),a:E}}function F(b,R,E){return{r:g(b,255)*255,g:g(R,255)*255,b:g(E,255)*255}}function fe(b,R,E){b=g(b,255),R=g(R,255),E=g(E,255);var ue=Q(b,R,E),ye=N(b,R,E),V,we,Me=(ue+ye)/2;if(ue==ye)V=we=0;else{var Ue=ue-ye;we=Me>.5?Ue/(2-ue-ye):Ue/(ue+ye);switch(ue){case b:V=(R-E)/Ue+(R1&&(Ne-=1),Ne<1/6?Ie+(Le-Ie)*6*Ne:Ne<1/2?Le:Ne<2/3?Ie+(Le-Ie)*(2/3-Ne)*6:Ie}if(R===0)ue=ye=V=E;else{var Me=E<.5?E*(1+R):E+R-E*R,Ue=2*E-Me;ue=we(Ue,Me,b+1/3),ye=we(Ue,Me,b),V=we(Ue,Me,b-1/3)}return{r:ue*255,g:ye*255,b:V*255}}function K(b,R,E){b=g(b,255),R=g(R,255),E=g(E,255);var ue=Q(b,R,E),ye=N(b,R,E),V,we,Me=ue,Ue=ue-ye;if(we=ue===0?0:Ue/ue,ue==ye)V=0;else{switch(ue){case b:V=(R-E)/Ue+(R>1)+720)%360;--R;)ue.h=(ue.h+ye)%360,V.push(q(ue));return V}function _(b,R){R=R||6;for(var E=q(b).toHsv(),ue=E.h,ye=E.s,V=E.v,we=[],Me=1/R;R--;)we.push(q({h:ue,s:ye,v:V})),V=(V+Me)%1;return we}q.mix=function(b,R,E){E=E===0?0:E||50;var ue=q(b).toRgb(),ye=q(R).toRgb(),V=E/100,we={r:(ye.r-ue.r)*V+ue.r,g:(ye.g-ue.g)*V+ue.g,b:(ye.b-ue.b)*V+ue.b,a:(ye.a-ue.a)*V+ue.a};return q(we)},q.readability=function(b,R){var E=q(b),ue=q(R);return(_e.max(E.getLuminance(),ue.getLuminance())+.05)/(_e.min(E.getLuminance(),ue.getLuminance())+.05)},q.isReadable=function(b,R,E){var ue=q.readability(b,R),ye,V;V=!1,ye=j(E);switch(ye.level+ye.size){case"AAsmall":case"AAAlarge":V=ue>=4.5;break;case"AAlarge":V=ue>=3;break;case"AAAsmall":V=ue>=7;break}return V},q.mostReadable=function(b,R,E){var ue=null,ye=0,V,we,Me,Ue;E=E||{},we=E.includeFallbackColors,Me=E.level,Ue=E.size;for(var Ie=0;Ieye&&(ye=V,ue=q(R[Ie]));return q.isReadable(b,ue,{level:Me,size:Ue})||!we?ue:(E.includeFallbackColors=!1,q.mostReadable(b,["#fff","#000"],E))};var re=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},z=q.hexNames=D(re);function D(b){var R={};for(var E in b)b.hasOwnProperty(E)&&(R[b[E]]=E);return R}function L(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function g(b,R){P(b)&&(b="100%");var E=Y(b);return b=N(R,Q(0,parseFloat(b))),E&&(b=parseInt(b*R,10)/100),_e.abs(b-R)<1e-6?1:b%R/parseFloat(R)}function p(b){return N(1,Q(0,b))}function w(b){return parseInt(b,16)}function P(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function Y(b){return typeof b=="string"&&b.indexOf("%")!=-1}function ge(b){return b.length==1?"0"+b:""+b}function De(b){return b<=1&&(b=b*100+"%"),b}function be(b){return _e.round(parseFloat(b)*255).toString(16)}function Se(b){return w(b)/255}var ce=function(){var b="[-\\+]?\\d+%?",R="[-\\+]?\\d*\\.\\d+%?",E="(?:"+R+")|(?:"+b+")",ue="[\\s|\\(]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?",ye="[\\s|\\(]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?";return{CSS_UNIT:new RegExp(E),rgb:new RegExp("rgb"+ue),rgba:new RegExp("rgba"+ye),hsl:new RegExp("hsl"+ue),hsla:new RegExp("hsla"+ye),hsv:new RegExp("hsv"+ue),hsva:new RegExp("hsva"+ye),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function xe(b){return!!ce.CSS_UNIT.exec(b)}function Z(b){b=b.replace(de,"").replace(Re,"").toLowerCase();var R=!1;if(re[b])b=re[b],R=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var E;return(E=ce.rgb.exec(b))?{r:E[1],g:E[2],b:E[3]}:(E=ce.rgba.exec(b))?{r:E[1],g:E[2],b:E[3],a:E[4]}:(E=ce.hsl.exec(b))?{h:E[1],s:E[2],l:E[3]}:(E=ce.hsla.exec(b))?{h:E[1],s:E[2],l:E[3],a:E[4]}:(E=ce.hsv.exec(b))?{h:E[1],s:E[2],v:E[3]}:(E=ce.hsva.exec(b))?{h:E[1],s:E[2],v:E[3],a:E[4]}:(E=ce.hex8.exec(b))?{r:w(E[1]),g:w(E[2]),b:w(E[3]),a:Se(E[4]),format:R?"name":"hex8"}:(E=ce.hex6.exec(b))?{r:w(E[1]),g:w(E[2]),b:w(E[3]),format:R?"name":"hex"}:(E=ce.hex4.exec(b))?{r:w(E[1]+""+E[1]),g:w(E[2]+""+E[2]),b:w(E[3]+""+E[3]),a:Se(E[4]+""+E[4]),format:R?"name":"hex8"}:(E=ce.hex3.exec(b))?{r:w(E[1]+""+E[1]),g:w(E[2]+""+E[2]),b:w(E[3]+""+E[3]),format:R?"name":"hex"}:!1}function j(b){var R,E;return b=b||{level:"AA",size:"small"},R=(b.level||"AA").toUpperCase(),E=(b.size||"small").toLowerCase(),R!=="AA"&&R!=="AAA"&&(R="AA"),E!=="small"&&E!=="large"&&(E="small"),{level:R,size:E}}bt.exports?bt.exports=q:!(G=function(){return q}.call(Qe,C,Qe,bt),G!==void 0&&(bt.exports=G))})(Math)},bT9E:function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return _e});var G=C("VTBJ");function _e(de,Re){var ke=Object(G.a)({},de);return Array.isArray(Re)&&Re.forEach(function(le){delete ke[le]}),ke}},c5Ni:function(bt,Qe,C){},dejd:function(bt,Qe,C){},dmUQ:function(bt,Qe,C){"use strict";var G=C("Ff2n"),_e=C("rePB"),de=C("1OyB"),Re=C("vuIU"),ke=C("Ji7U"),le=C("md7G"),N=C("foSv"),Q=C("q1tI"),U=C.n(Q),q=C("TSYQ"),M=C.n(q),F=C("4IlW");function fe(ie,S){var ne=Object.keys(ie);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(ie);S&&(J=J.filter(function(_){return Object.getOwnPropertyDescriptor(ie,_).enumerable})),ne.push.apply(ne,J)}return ne}function ae(ie){for(var S=1;S1?Y-1:0),De=1;De1?g-1:0),w=1;w=0)return parseInt(L.slice(L.indexOf("e-")+2),10);var g=0;return L.indexOf(".")>=0&&(g=L.length-L.indexOf(".")-1),g},_.getInputDisplayValue=function(D){var L=D||_.state,g=L.focused,p=L.inputValue,w=L.value,P;g?P=p:P=_.toPrecisionAsStep(w),P==null&&(P="");var Y=_.formatWrapper(P);return Ce(_.props.decimalSeparator)&&(Y=Y.toString().replace(".",_.props.decimalSeparator)),Y},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(D){}},_.restoreByAfter=function(D){if(D===void 0)return!1;var L=_.input.value,g=L.lastIndexOf(D);if(g===-1)return!1;var p=_.cursorBefore.length;return _.lastKeyCode===F.a.DELETE&&_.cursorBefore.charAt(p-1)===D[0]?(_.fixCaret(p,p),!0):g+D.length===L.length?(_.fixCaret(g,g),!0):!1},_.partRestoreByAfter=function(D){return D===void 0?!1:Array.prototype.some.call(D,function(L,g){var p=D.substring(g);return _.restoreByAfter(p)})},_.isNotCompleteNumber=function(D){return isNaN(D)||D===""||D===null||D&&D.toString().indexOf(".")===D.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(D,L,g){_.pressingUpOrDown=!0,_.step("down",D,L,g)},_.up=function(D,L,g){_.pressingUpOrDown=!0,_.step("up",D,L,g)},_.saveInput=function(D){_.input=D};var re=J.value;re===void 0&&(re=J.defaultValue),_.state={focused:J.autoFocus};var z=_.getValidValue(_.toNumber(re));return _.state=ae(ae({},_.state),{},{inputValue:_.toPrecisionAsStep(z),value:z}),_}return Object(Re.a)(ne,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var re=this.props,z=re.value,D=re.onChange,L=re.max,g=re.min,p=this.state.focused;if(_){if(!We(_.value,z)||!We(_.max,L)||!We(_.min,g)){var w=p?z:this.getValidValue(z),P;this.pressingUpOrDown?P=w:this.inputting?P=this.rawInput:P=this.toPrecisionAsStep(w),this.setState({value:w,inputValue:P})}var Y="value"in this.props?z:this.state.value;"max"in this.props&&_.max!==L&&typeof Y=="number"&&Y>L&&D&&D(L),"min"in this.props&&_.min!==g&&typeof Y=="number"&&Y1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,D=parseFloat(_);return isNaN(D)?_:(Dz&&(D=z),D)}},{key:"setValue",value:function(_,re){var z=this.props.precision,D=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),L=this.state.value,g=L===void 0?null:L,p=this.state.inputValue,w=p===void 0?null:p,P=typeof D=="number"?D.toFixed(z):"".concat(D),Y=D!==g||P!=="".concat(w);return"value"in this.props?(w=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:w},re)):this.setState({value:D,inputValue:this.toPrecisionAsStep(_)},re),Y&&this.props.onChange(D),D}},{key:"getMaxPrecision",value:function(_){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,D=z.precision,L=z.step;if(Ce(D))return D;var g=this.getPrecision(re),p=this.getPrecision(L),w=this.getPrecision(_);return _?Math.max(w,g+p):g+p}},{key:"getPrecisionFactor",value:function(_){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(_,re);return Math.pow(10,z)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var re=Math.abs(this.getMaxPrecision(_));return isNaN(re)?_.toString():Number(_).toFixed(re)}},{key:"toNumber",value:function(_){var re=this.props.precision,z=this.state.focused,D=_&&_.length>16&&z;return this.isNotCompleteNumber(_)||D?_:Ce(re)?Math.round(_*Math.pow(10,re))/Math.pow(10,re):Number(_)}},{key:"upStep",value:function(_,re){var z=this.props.step,D=this.getPrecisionFactor(_,re),L=Math.abs(this.getMaxPrecision(_,re)),g=((D*_+D*z*re)/D).toFixed(L);return this.toNumber(g)}},{key:"downStep",value:function(_,re){var z=this.props.step,D=this.getPrecisionFactor(_,re),L=Math.abs(this.getMaxPrecision(_,re)),g=((D*_-D*z*re)/D).toFixed(L);return this.toNumber(g)}},{key:"step",value:function(_,re){var z=this,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=arguments.length>3?arguments[3]:void 0;this.stop(),re&&(re.persist(),re.preventDefault());var g=this.props;if(g.disabled)return;var p=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(p))return;var w=this["".concat(_,"Step")](p,D),P=w>g.max||wg.max?w=g.max:w=ge),Ve=(mt||mt===0)&&(isNaN(mt)||Number(mt)<=De),X=Pe||D||L,B=Ve||D||L,W=M()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(_e.a)({},"".concat(z,"-handler-up-disabled"),X)),y=M()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(_e.a)({},"".concat(z,"-handler-down-disabled"),B)),x=g?{onTouchStart:X?H:this.up,onTouchEnd:this.stop}:{onMouseDown:X?H:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},k=g?{onTouchStart:B?H:this.down,onTouchEnd:this.stop}:{onMouseDown:B?H:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return U.a.createElement("div",{className:rt,style:be,title:Se,onMouseEnter:ce,onMouseLeave:xe,onMouseOver:Z,onMouseOut:j,onFocus:function(){return null},onBlur:function(){return null}},U.a.createElement("div",{className:"".concat(z,"-handler-wrap")},U.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Increase Value","aria-disabled":X,className:W}),w||U.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:me})),U.a.createElement("span",Object.assign({unselectable:"on"},k,{role:"button","aria-label":"Decrease Value","aria-disabled":B,className:y}),P||U.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:me}))),U.a.createElement("div",{className:"".concat(z,"-input-wrap")},U.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":De,"aria-valuemax":ge,"aria-valuenow":mt,required:b,type:ue,placeholder:ye,onPaste:Ye,onClick:R,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:E,autoComplete:p,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:yt?this.onKeyDown:H,onKeyUp:yt?this.onKeyUp:H,autoFocus:Le,maxLength:Ie,readOnly:L,disabled:D,max:ge,min:De,step:Ue,name:Ne,title:Se,id:V,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:Me,inputMode:we,onInput:tt},Te))))}}]),ne}(U.a.Component);pe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:Ee,min:-Ee,step:1,style:{},onChange:H,onKeyDown:H,onPressEnter:H,onFocus:H,onBlur:H,parser:he,required:!1,autoComplete:"off"};var Ae=pe,ve=Qe.a=Ae},h78n:function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return _});var G=C("q1tI"),_e=C.n(G),de=C("TSYQ"),Re=C.n(de),ke={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},le=function(D){var L=D.map(function(){return Object(G.useRef)()}),g=Object(G.useRef)();return Object(G.useEffect)(function(){var p=Date.now(),w=!1;Object.keys(L).forEach(function(P){var Y=L[P].current;if(!Y)return;w=!0;var ge=Y.style;ge.transitionDuration=".3s, .3s, .3s, .06s",g.current&&p-g.current<100&&(ge.transitionDuration="0s, 0s")}),w&&(g.current=Date.now())}),[L]};function N(){return N=Object.assign||function(z){for(var D=1;Dz.length)&&(D=z.length);for(var L=0,g=new Array(D);L=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,g))continue;L[g]=z[g]}}return L}function K(z,D){if(z==null)return{};var L={},g=Object.keys(z),p,w;for(w=0;w=0)continue;L[p]=z[p]}return L}var ee=function(D){var L=D.className,g=D.percent,p=D.prefixCls,w=D.strokeColor,P=D.strokeLinecap,Y=D.strokeWidth,ge=D.style,De=D.trailColor,be=D.trailWidth,Se=D.transition,ce=ae(D,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ce.gapPosition;var xe=Array.isArray(g)?g:[g],Z=Array.isArray(w)?w:[w],j=le(xe),b=Q(j,1),R=b[0],E=Y/2,ue=100-Y/2,ye="M ".concat(P==="round"?E:0,",").concat(E,` L `).concat(P==="round"?ue:100,",").concat(E),V="0 0 100 ".concat(Y),we=0;return _e.a.createElement("svg",N({className:Re()("".concat(p,"-line"),L),viewBox:V,preserveAspectRatio:"none",style:ge},ce),_e.a.createElement("path",{className:"".concat(p,"-line-trail"),d:ye,strokeLinecap:P,stroke:De,strokeWidth:be||Y,fillOpacity:"0"}),xe.map(function(Me,Ue){var Ie={strokeDasharray:"".concat(Me,"px, 100px"),strokeDashoffset:"-".concat(we,"px"),transition:Se||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Le=Z[Ue]||Z[Z.length-1];return we+=Me,_e.a.createElement("path",{key:Ue,className:"".concat(p,"-line-path"),d:ye,strokeLinecap:P,stroke:Le,strokeWidth:Y,fillOpacity:"0",ref:R[Ue],style:Ie})}))};ee.defaultProps=ke;var H=ee;function me(){return me=Object.assign||function(z){for(var D=1;Dz.length)&&(D=z.length);for(var L=0,g=new Array(D);L=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,g))continue;L[g]=z[g]}}return L}function Ae(z,D){if(z==null)return{};var L={},g=Object.keys(z),p,w;for(w=0;w=0)continue;L[p]=z[p]}return L}var ve=0;function ie(z){return+z.replace("%","")}function S(z){return Array.isArray(z)?z:[z]}function ne(z,D,L,g){var p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,w=arguments.length>5?arguments[5]:void 0,P=50-g/2,Y=0,ge=-P,De=0,be=-2*P;switch(w){case"left":Y=-P,ge=0,De=2*P,be=0;break;case"right":Y=P,ge=0,De=-2*P,be=0;break;case"bottom":ge=P,be=2*P;break;default:}var Se="M 50,50 m ".concat(Y,",").concat(ge,` a `).concat(P,",").concat(P," 0 1 1 ").concat(De,",").concat(-be,` a `).concat(P,",").concat(P," 0 1 1 ").concat(-De,",").concat(be),ce=Math.PI*2*P,xe={stroke:L,strokeDasharray:"".concat(D/100*(ce-p),"px ").concat(ce,"px"),strokeDashoffset:"-".concat(p/2+z/100*(ce-p),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Se,pathStyle:xe}}var J=function(D){var L=D.prefixCls,g=D.strokeWidth,p=D.trailWidth,w=D.gapDegree,P=D.gapPosition,Y=D.trailColor,ge=D.strokeLinecap,De=D.style,be=D.className,Se=D.strokeColor,ce=D.percent,xe=pe(D,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Z=Object(G.useMemo)(function(){return ve+=1,ve},[]),j=ne(0,100,Y,g,w,P),b=j.pathString,R=j.pathStyle,E=S(ce),ue=S(Se),ye=ue.find(function(Ie){return Object.prototype.toString.call(Ie)==="[object Object]"}),V=le(E),we=he(V,1),Me=we[0],Ue=function(){var Le=0;return E.map(function(Ne,Ye){var tt=ue[Ye]||ue[ue.length-1],Ze=Object.prototype.toString.call(tt)==="[object Object]"?"url(#".concat(L,"-gradient-").concat(Z,")"):"",nt=ne(Le,Ne,tt,g,w,P);return Le+=Ne,_e.a.createElement("path",{key:Ye,className:"".concat(L,"-circle-path"),d:nt.pathString,stroke:Ze,strokeLinecap:ge,strokeWidth:g,opacity:Ne===0?0:1,fillOpacity:"0",style:nt.pathStyle,ref:Me[Ye]})})};return _e.a.createElement("svg",me({className:Re()("".concat(L,"-circle"),be),viewBox:"0 0 100 100",style:De},xe),ye&&_e.a.createElement("defs",null,_e.a.createElement("linearGradient",{id:"".concat(L,"-gradient-").concat(Z),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ye).sort(function(Ie,Le){return ie(Ie)-ie(Le)}).map(function(Ie,Le){return _e.a.createElement("stop",{key:Le,offset:Ie,stopColor:ye[Ie]})}))),_e.a.createElement("path",{className:"".concat(L,"-circle-trail"),d:b,stroke:Y,strokeLinecap:ge,strokeWidth:p||g,fillOpacity:"0",style:R}),Ue().reverse())};J.defaultProps=ke;var _=J,re={Line:H,Circle:_}},iIVh:function(bt,Qe,C){},kSUc:function(bt,Qe,C){},lZu9:function(bt,Qe,C){(function(G){G(C("VrN/"),C("1eCo"),C("8EBN"))})(function(G){"use strict";G.defineMode("markdown",function(_e,de){var Re=G.getMode(_e,"text/html"),ke=Re.name=="null";function le(g){if(G.findModeByName){var p=G.findModeByName(g);p&&(g=p.mime||p.mimes[0])}var w=G.getMode(_e,g);return w.name=="null"?null:w}de.highlightFormatting===void 0&&(de.highlightFormatting=!1),de.maxBlockquoteDepth===void 0&&(de.maxBlockquoteDepth=0),de.taskLists===void 0&&(de.taskLists=!1),de.strikethrough===void 0&&(de.strikethrough=!1),de.emoji===void 0&&(de.emoji=!1),de.fencedCodeBlockHighlighting===void 0&&(de.fencedCodeBlockHighlighting=!0),de.fencedCodeBlockDefaultMode===void 0&&(de.fencedCodeBlockDefaultMode="text/plain"),de.xml===void 0&&(de.xml=!0),de.tokenTypeOverrides===void 0&&(de.tokenTypeOverrides={});var N={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var Q in N)N.hasOwnProperty(Q)&&de.tokenTypeOverrides[Q]&&(N[Q]=de.tokenTypeOverrides[Q]);var U=/^([*\-_])(?:\s*\1){2,}\s*$/,q=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,M=/^\[(x| )\](?=\s)/i,F=de.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,fe=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ae=/^[^#!\[\]*_\\<>` "'(~:]+/,K=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,ee=/^\s*\[[^\]]+?\]:.*$/,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,me=" ";function he(g,p,w){return p.f=p.inline=w,w(g,p)}function ze(g,p,w){return p.f=p.block=w,w(g,p)}function Ke(g){return!g||!/\S/.test(g.string)}function Ee(g){if(g.linkTitle=!1,g.linkHref=!1,g.linkText=!1,g.em=!1,g.strong=!1,g.strikethrough=!1,g.quote=0,g.indentedCode=!1,g.f==We){var p=ke;if(!p){var w=G.innerMode(Re,g.htmlState);p=w.mode.name=="xml"&&w.state.tagStart===null&&!w.state.context&&w.state.tokenize.isInText}p&&(g.f=ie,g.block=Ce,g.htmlState=null)}return g.trailingSpace=0,g.trailingSpaceNewLine=!1,g.prevLine=g.thisLine,g.thisLine={stream:null},null}function Ce(g,p){var w=g.column()===p.indentation,P=Ke(p.prevLine.stream),Y=p.indentedCode,ge=p.prevLine.hr,De=p.list!==!1,be=(p.listStack[p.listStack.length-1]||0)+3;p.indentedCode=!1;var Se=p.indentation;if(p.indentationDiff===null&&(p.indentationDiff=p.indentation,De)){for(p.list=null;Se=4&&(Y||p.prevLine.fencedCodeEnd||p.prevLine.header||P))return g.skipToEnd(),p.indentedCode=!0,N.code;if(g.eatSpace())return null;if(w&&p.indentation<=be&&(Z=g.match(F))&&Z[1].length<=6)return p.quote=0,p.header=Z[1].length,p.thisLine.header=!0,de.highlightFormatting&&(p.formatting="header"),p.f=p.inline,Ae(p);if(p.indentation<=be&&g.eat(">"))return p.quote=w?1:p.quote+1,de.highlightFormatting&&(p.formatting="quote"),g.eatSpace(),Ae(p);if(!xe&&!p.setext&&w&&p.indentation<=be&&(Z=g.match(q))){var j=Z[1]?"ol":"ul";return p.indentation=Se+g.current().length,p.list=!0,p.quote=0,p.listStack.push(p.indentation),p.em=!1,p.strong=!1,p.code=!1,p.strikethrough=!1,de.taskLists&&g.match(M,!1)&&(p.taskList=!0),p.f=p.inline,de.highlightFormatting&&(p.formatting=["list","list-"+j]),Ae(p)}else{if(w&&p.indentation<=be&&(Z=g.match(K,!0)))return p.quote=0,p.fencedEndRE=new RegExp(Z[1]+"+ *$"),p.localMode=de.fencedCodeBlockHighlighting&&le(Z[2]||de.fencedCodeBlockDefaultMode),p.localMode&&(p.localState=G.startState(p.localMode)),p.f=p.block=pe,de.highlightFormatting&&(p.formatting="code-block"),p.code=-1,Ae(p);if(p.setext||(!ce||!De)&&!p.quote&&p.list===!1&&!p.code&&!xe&&!ee.test(g.string)&&(Z=g.lookAhead(1))&&(Z=Z.match(fe)))return p.setext?(p.header=p.setext,p.setext=0,g.skipToEnd(),de.highlightFormatting&&(p.formatting="header")):(p.header=Z[0].charAt(0)=="="?1:2,p.setext=p.header),p.thisLine.header=!0,p.f=p.inline,Ae(p);if(xe)return g.skipToEnd(),p.hr=!0,p.thisLine.hr=!0,N.hr;if(g.peek()==="[")return he(g,p,re)}return he(g,p,p.inline)}function We(g,p){var w=Re.token(g,p.htmlState);if(!ke){var P=G.innerMode(Re,p.htmlState);(P.mode.name=="xml"&&P.state.tagStart===null&&!P.state.context&&P.state.tokenize.isInText||p.md_inside&&g.current().indexOf(">")>-1)&&(p.f=ie,p.block=Ce,p.htmlState=null)}return w}function pe(g,p){var w=p.listStack[p.listStack.length-1]||0,P=p.indentation=g.quote?p.push(N.formatting+"-"+g.formatting[w]+"-"+g.quote):p.push("error"))}if(g.taskOpen)return p.push("meta"),p.length?p.join(" "):null;if(g.taskClosed)return p.push("property"),p.length?p.join(" "):null;if(g.linkHref?p.push(N.linkHref,"url"):(g.strong&&p.push(N.strong),g.em&&p.push(N.em),g.strikethrough&&p.push(N.strikethrough),g.emoji&&p.push(N.emoji),g.linkText&&p.push(N.linkText),g.code&&p.push(N.code),g.image&&p.push(N.image),g.imageAltText&&p.push(N.imageAltText,"link"),g.imageMarker&&p.push(N.imageMarker)),g.header&&p.push(N.header,N.header+"-"+g.header),g.quote&&(p.push(N.quote),!de.maxBlockquoteDepth||de.maxBlockquoteDepth>=g.quote?p.push(N.quote+"-"+g.quote):p.push(N.quote+"-"+de.maxBlockquoteDepth)),g.list!==!1){var P=(g.listStack.length-1)%3;P?P===1?p.push(N.list2):p.push(N.list3):p.push(N.list1)}return g.trailingSpaceNewLine?p.push("trailing-space-new-line"):g.trailingSpace&&p.push("trailing-space-"+(g.trailingSpace%2?"a":"b")),p.length?p.join(" "):null}function ve(g,p){return g.match(ae,!0)?Ae(p):void 0}function ie(g,p){var w=p.text(g,p);if(typeof w!="undefined")return w;if(p.list)return p.list=null,Ae(p);if(p.taskList){var P=g.match(M,!0)[1]===" ";return P?p.taskOpen=!0:p.taskClosed=!0,de.highlightFormatting&&(p.formatting="task"),p.taskList=!1,Ae(p)}if(p.taskOpen=!1,p.taskClosed=!1,p.header&&g.match(/^#+$/,!0))return de.highlightFormatting&&(p.formatting="header"),Ae(p);var Y=g.next();if(p.linkTitle){p.linkTitle=!1;var ge=Y;Y==="("&&(ge=")"),ge=(ge+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var De="^\\s*(?:[^"+ge+"\\\\]+|\\\\\\\\|\\\\.)"+ge;if(g.match(new RegExp(De),!0))return N.linkHref}if(Y==="`"){var be=p.formatting;de.highlightFormatting&&(p.formatting="code"),g.eatWhile("`");var Se=g.current().length;if(p.code==0&&(!p.quote||Se==1))return p.code=Se,Ae(p);if(Se==p.code){var ce=Ae(p);return p.code=0,ce}else return p.formatting=be,Ae(p)}else if(p.code)return Ae(p);if(Y==="\\"&&(g.next(),de.highlightFormatting)){var xe=Ae(p),Z=N.formatting+"-escape";return xe?xe+" "+Z:Z}if(Y==="!"&&g.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return p.imageMarker=!0,p.image=!0,de.highlightFormatting&&(p.formatting="image"),Ae(p);if(Y==="["&&p.imageMarker&&g.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return p.imageMarker=!1,p.imageAltText=!0,de.highlightFormatting&&(p.formatting="image"),Ae(p);if(Y==="]"&&p.imageAltText){de.highlightFormatting&&(p.formatting="image");var xe=Ae(p);return p.imageAltText=!1,p.image=!1,p.inline=p.f=ne,xe}if(Y==="["&&!p.image)return p.linkText&&g.match(/^.*?\]/)||(p.linkText=!0,de.highlightFormatting&&(p.formatting="link")),Ae(p);if(Y==="]"&&p.linkText){de.highlightFormatting&&(p.formatting="link");var xe=Ae(p);return p.linkText=!1,p.inline=p.f=g.match(/\(.*?\)| ?\[.*?\]/,!1)?ne:ie,xe}if(Y==="<"&&g.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=S,de.highlightFormatting&&(p.formatting="link");var xe=Ae(p);return xe?xe+=" ":xe="",xe+N.linkInline}if(Y==="<"&&g.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=S,de.highlightFormatting&&(p.formatting="link");var xe=Ae(p);return xe?xe+=" ":xe="",xe+N.linkEmail}if(de.xml&&Y==="<"&&g.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var j=g.string.indexOf(">",g.pos);if(j!=-1){var b=g.string.substring(g.start,j);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(p.md_inside=!0)}return g.backUp(1),p.htmlState=G.startState(Re),ze(g,p,We)}if(de.xml&&Y==="<"&&g.match(/^\/\w*?>/))return p.md_inside=!1,"tag";if(Y==="*"||Y==="_"){for(var R=1,E=g.pos==1?" ":g.string.charAt(g.pos-2);R<3&&g.eat(Y);)R++;var ue=g.peek()||" ",ye=!/\s/.test(ue)&&(!H.test(ue)||/\s/.test(E)||H.test(E)),V=!/\s/.test(E)&&(!H.test(E)||/\s/.test(ue)||H.test(ue)),we=null,Me=null;if(R%2&&(!p.em&&ye&&(Y==="*"||!V||H.test(E))?we=!0:p.em==Y&&V&&(Y==="*"||!ye||H.test(ue))&&(we=!1)),R>1&&(!p.strong&&ye&&(Y==="*"||!V||H.test(E))?Me=!0:p.strong==Y&&V&&(Y==="*"||!ye||H.test(ue))&&(Me=!1)),Me!=null||we!=null){de.highlightFormatting&&(p.formatting=we==null?"strong":Me==null?"em":"strong em"),we===!0&&(p.em=Y),Me===!0&&(p.strong=Y);var ce=Ae(p);return we===!1&&(p.em=!1),Me===!1&&(p.strong=!1),ce}}else if(Y===" "&&(g.eat("*")||g.eat("_"))){if(g.peek()===" ")return Ae(p);g.backUp(1)}if(de.strikethrough){if(Y==="~"&&g.eatWhile(Y)){if(p.strikethrough){de.highlightFormatting&&(p.formatting="strikethrough");var ce=Ae(p);return p.strikethrough=!1,ce}else if(g.match(/^[^\s]/,!1))return p.strikethrough=!0,de.highlightFormatting&&(p.formatting="strikethrough"),Ae(p)}else if(Y===" "&&g.match(/^~~/,!0)){if(g.peek()===" ")return Ae(p);g.backUp(2)}}if(de.emoji&&Y===":"&&g.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){p.emoji=!0,de.highlightFormatting&&(p.formatting="emoji");var Ue=Ae(p);return p.emoji=!1,Ue}return Y===" "&&(g.match(/^ +$/,!1)?p.trailingSpace++:p.trailingSpace&&(p.trailingSpaceNewLine=!0)),Ae(p)}function S(g,p){var w=g.next();if(w===">"){p.f=p.inline=ie,de.highlightFormatting&&(p.formatting="link");var P=Ae(p);return P?P+=" ":P="",P+N.linkInline}return g.match(/^[^>]+/,!0),N.linkInline}function ne(g,p){if(g.eatSpace())return null;var w=g.next();return w==="("||w==="["?(p.f=p.inline=_(w==="("?")":"]"),de.highlightFormatting&&(p.formatting="link-string"),p.linkHref=!0,Ae(p)):"error"}var J={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(g){return function(p,w){var P=p.next();if(P===g){w.f=w.inline=ie,de.highlightFormatting&&(w.formatting="link-string");var Y=Ae(w);return w.linkHref=!1,Y}return p.match(J[g]),w.linkHref=!0,Ae(w)}}function re(g,p){return g.match(/^([^\]\\]|\\.)*\]:/,!1)?(p.f=z,g.next(),de.highlightFormatting&&(p.formatting="link"),p.linkText=!0,Ae(p)):he(g,p,ie)}function z(g,p){if(g.match(/^\]:/,!0)){p.f=p.inline=D,de.highlightFormatting&&(p.formatting="link");var w=Ae(p);return p.linkText=!1,w}return g.match(/^([^\]\\]|\\.)+/,!0),N.linkText}function D(g,p){return g.eatSpace()?null:(g.match(/^[^\s]+/,!0),g.peek()===void 0?p.linkTitle=!0:g.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),p.f=p.inline=ie,N.linkHref+" url")}var L={startState:function(){return{f:Ce,prevLine:{stream:null},thisLine:{stream:null},block:Ce,htmlState:null,indentation:0,inline:ie,text:ve,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(g){return{f:g.f,prevLine:g.prevLine,thisLine:g.thisLine,block:g.block,htmlState:g.htmlState&&G.copyState(Re,g.htmlState),indentation:g.indentation,localMode:g.localMode,localState:g.localMode?G.copyState(g.localMode,g.localState):null,inline:g.inline,text:g.text,formatting:!1,linkText:g.linkText,linkTitle:g.linkTitle,linkHref:g.linkHref,code:g.code,em:g.em,strong:g.strong,strikethrough:g.strikethrough,emoji:g.emoji,header:g.header,setext:g.setext,hr:g.hr,taskList:g.taskList,list:g.list,listStack:g.listStack.slice(0),quote:g.quote,indentedCode:g.indentedCode,trailingSpace:g.trailingSpace,trailingSpaceNewLine:g.trailingSpaceNewLine,md_inside:g.md_inside,fencedEndRE:g.fencedEndRE}},token:function(g,p){if(p.formatting=!1,g!=p.thisLine.stream){if(p.header=0,p.hr=!1,g.match(/^\s*$/,!0))return Ee(p),null;if(p.prevLine=p.thisLine,p.thisLine={stream:g},p.taskList=!1,p.trailingSpace=0,p.trailingSpaceNewLine=!1,!p.localState&&(p.f=p.block,p.f!=We)){var w=g.match(/^\s*/,!0)[0].replace(/\t/g,me).length;if(p.indentation=w,p.indentationDiff=null,w>0)return null}}return p.f(g,p)},innerMode:function(g){return g.block==We?{state:g.htmlState,mode:Re}:g.localState?{state:g.localState,mode:g.localMode}:{state:g,mode:L}},indent:function(g,p,w){return g.block==We&&Re.indent?Re.indent(g.htmlState,p,w):g.localState&&g.localMode.indent?g.localMode.indent(g.localState,p,w):G.Pass},blankLine:Ee,getType:Ae,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L},"xml"),G.defineMIME("text/markdown","markdown"),G.defineMIME("text/x-markdown","markdown")})},nojB:function(bt,Qe,C){"use strict";C.r(Qe);var G=C("T2oS"),_e=C("W9HT"),de=C("9og8"),Re=C("tJVT"),ke=C("k1fw"),le=C("WmNS"),N=C.n(le),Q=C("q1tI"),U=C.n(Q),q=C("X0ci"),M=C("iIVh"),F=C("Ty5D"),fe=C("55Ip"),ae=C("+L6B"),K=C("2/Rp"),ee=C("5NDa"),H=C("5rEg"),me=C("2qtc"),he=C("kLXV"),ze=C("miYZ"),Ke=C("tsqr"),Ee=C("PpiC"),Ce=C("y8nQ"),We=C("Vl3Y"),pe=C("DZo9"),Ae=C("8z0m"),ve=C("sRBo"),ie=C("kaz8"),S=C("LtfV"),ne=C("m3rI"),J=C("Ot1p"),_=ie.a.Group,re=Ae.a.Dragger;function z(Y,ge){var De=new FileReader;De.addEventListener("load",function(){return ge(De.result)}),De.readAsDataURL(Y)}var D=function(Y){var ge=Y.callback,De=Y.tags,be=De===void 0?[]:De,Se=Y.initialValues,ce=Se===void 0?{}:Se,xe=Y.removeAttachment,Z=Object(Q.useState)(""),j=Object(Re.a)(Z,2),b=j[0],R=j[1],E=We.a.useForm(),ue=Object(Re.a)(E,1),ye=ue[0];function V(Le){var Ne=Le.cover_id,Ye=Le.attachment_ids,tt=Object(Ee.a)(Le,["cover_id","attachment_ids"]);ge(Object(ke.a)(Object(ke.a)({},tt),{},{cover_id:Ne==null?void 0:Ne.map(function(Ze){return Ze.response?Ze.response.id:Ze.uid})[(Ne==null?void 0:Ne.length)-1],attachment_ids:Ye?Ye==null?void 0:Ye.map(function(Ze){return Ze.response?Ze.response.id:Ze.uid}):[]}))}function we(Le){return Array.isArray(Le)?Le:Le&&Le.fileList}var Me={multiple:!0,beforeUpload:function(Ne){var Ye=Ne.size/1024/1024<100;if(!Ye)return Ke.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(100MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"),Ye},action:"".concat(ne.a.API_SERVER,"/api/attachments.json"),onRemove:function(Ne){he.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){return xe(Ne.response?Ne.response.id:Ne.uid)},onCancel:function(){return!1}})}};function Ue(Le){Le.file.status==="done"&&z(Le.file.originFileObj,function(Ne){return R(Ne)})}var Ie={showUploadList:!1,withCredentials:!0,action:"".concat(ne.a.API_SERVER,"/api/attachments.json"),onChange:Ue};return Object(Q.useEffect)(function(){ce.title&&(ye.setFieldsValue(ce),ce.cover_id.length>0&&R(ne.a.IMG_SERVER+ce.cover_id[0].url))},[ce]),U.a.createElement(We.a,{form:ye,initialValues:ce,className:"moop-panel",onFinish:V},U.a.createElement(We.a.Item,{label:"\u6807\u9898",name:"title",extra:U.a.createElement("p",{className:"tip"},"\u7B80\u660E\u627C\u8981\u4ECB\u7ECD\u6587\u6863/\u89C6\u9891\u6240\u5305\u542B\u7684\u4E3B\u8981\u7684\u5185\u5BB9"),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},U.a.createElement(H.a,{placeholder:"\u4F8B\u5982\uFF1A\u8F6F\u4EF6\u5DE5\u7A0B\u6559\u5B66\u6848\u4F8B"})),U.a.createElement("div",{className:"flex-container"},U.a.createElement(We.a.Item,{label:"\u4F5C\u8005",name:"author_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u540D\u79F0"}]},U.a.createElement(H.a,{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",style:{marginRight:20,width:200}})),U.a.createElement(We.a.Item,{name:"author_school_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0"}]},U.a.createElement(H.a,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0",style:{width:200}}))),U.a.createElement(We.a.Item,{name:"tag_ids",label:"\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6807\u7B7E"}]},U.a.createElement(_,null,be.map(function(Le){return U.a.createElement(ie.a,{key:Le.id,value:Le.id}," ",Le.name," ")}))),U.a.createElement(We.a.Item,{name:"publish",valuePropName:"checked"},U.a.createElement(ie.a,null,"\u662F\u5426\u7533\u8BF7\u53D1\u5E03")),U.a.createElement(We.a.Item,{name:"content",label:"\u63CF\u8FF0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},U.a.createElement(J.a,{id:"moop_cases_content",height:400})),U.a.createElement(We.a.Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:we},U.a.createElement(re,Me,U.a.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4E0A\u4F20\u9644\u4EF6"),U.a.createElement("p",{className:"c-grey-c"},"\u4ECE\u6211\u7684\u7535\u8111\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u6863\uFF1A\u6309\u4F4FCTRL\u53EF\u4EE5\u4E0A\u4F20\u591A\u4EFD\u6587\u6863\u3002\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\uFF1A100MB"))),U.a.createElement(We.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",extra:"\u4E0A\u4F20\u5C3A\u5BF8\uFF1A120*90 px",getValueFromEvent:we,valuePropName:"fileList",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"}]},U.a.createElement(Ae.a,Ie,b?U.a.createElement("img",{src:b,width:120}):U.a.createElement("a",{title:"\u4E0A\u4F20\u5C01\u9762\u56FE",className:"upload-cover"}," ",U.a.createElement(S.a,null)," "))),U.a.createElement("div",{className:"desc"},U.a.createElement("h3",null,"\u5BA1\u6838\u8BF4\u660E"),U.a.createElement("p",null," \u5E73\u53F0\u7BA1\u7406\u5458\u5C06\u5BF9\u6BCF\u5929\u65B0\u4E0A\u4F20\u7684\u6587\u6863\u8FDB\u884C\u5BA1\u6838\uFF0C\u5BA1\u6838\u901A\u8FC7\u7684\u6587\u6863\u5C06\u516C\u5F00\u663E\u793A\uFF0C\u5426\u5219\u5C06\u79C1\u6709\u5316\u6216\u79FB\u9664 ")),U.a.createElement("div",{className:"desc"},U.a.createElement("h3",null,"\u6E29\u99A8\u63D0\u793A"),U.a.createElement("ul",{style:{padding:0}},U.a.createElement("li",null,"1.\u8BF7\u52FF\u4E0A\u4F20\u5DF2\u8BBE\u7F6E\u52A0\u5BC6\u53E3\u4EE4\u7684\u6587\u6863\u8D44\u6E90\uFF1B"),U.a.createElement("li",null,"2.\u53EF\u4EE5\u4E0A\u4F20\u7B26\u5408\u6559\u5B66\u6848\u4F8B\u6807\u51C6\u7684\u6587\u6863\u8D44\u6599\uFF0C\u5982",U.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4F8B\u5165\u5E93\u6807\u51C6 ")," \u3001",U.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4F8B\u4F7F\u7528\u8BF4\u660E\u4E66"),"\u4EE5\u53CA\u5176\u4ED6\u8D44\u6599\u7B49\uFF0C\u4E0A\u4F20\u652F\u6301\u7684\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF1A100MB\uFF1B"),U.a.createElement("li",null,"3.\u8BF7\u786E\u4FDD\u4E0A\u4F20\u5185\u5BB9\u65E0\u4FB5\u6743\u6216\u8FDD\u53CD\u56FD\u5BB6\u5173\u4E8E\u4E92\u8054\u7F51\u653F\u7B56\u7684\u4E0D\u826F\u884C\u4E3A\uFF1B"),U.a.createElement("li",null,"4.\u8BF7\u4F7F\u7528Chrome\uFF0CFirefox\uFF0CSafari\uFF0CIE11\uFF08\u53CA\u4EE5\u4E0A\u7248\u672C\uFF09\u6D4F\u89C8\u5668\uFF1B"))),U.a.createElement(We.a.Item,{style:{marginTop:10}},U.a.createElement(K.a,{type:"primary",htmlType:"submit"},"\u63D0\u4EA4")))},L=C("wzkS"),g={loading:!1,data:{},tags:[]},p;(function(Y){Y[Y.GET_DATA=0]="GET_DATA",Y[Y.SET_LOADING=1]="SET_LOADING",Y[Y.GET_TAGS=2]="GET_TAGS"})(p||(p={}));function w(Y,ge){switch(ge.type){case p.GET_DATA:return Object(ke.a)(Object(ke.a)({},Y),ge.payload);case p.GET_TAGS:return Object(ke.a)(Object(ke.a)({},Y),{},{tags:ge.payload});case p.SET_LOADING:return Object(ke.a)(Object(ke.a)({},Y),{},{loading:ge.payload});default:throw new Error}}var P=Qe.default=function(){var Y=Object(F.i)(),ge=Y.caseId,De=Object(F.g)(),be=Object(Q.useReducer)(w,g),Se=Object(Re.a)(be,2),ce=Se[0],xe=Se[1],Z=ce.loading,j=ce.tags,b=ce.data;Object(Q.useEffect)(function(){function ye(){return V.apply(this,arguments)}function V(){return V=Object(de.a)(N.a.mark(function we(){var Me;return N.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,Object(L.b)();case 2:Me=Ie.sent,xe({type:p.GET_TAGS,payload:Me.library_tags});case 4:case"end":return Ie.stop()}},we)})),V.apply(this,arguments)}ye()},[]),Object(Q.useEffect)(function(){var ye=!1;function V(){return we.apply(this,arguments)}function we(){return we=Object(de.a)(N.a.mark(function Me(){var Ue,Ie,Le,Ne,Ye,tt,Ze,nt,mt;return N.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return xe({type:p.SET_LOADING,payload:!1}),rt.next=3,Object(L.c)(ge);case 3:Ue=rt.sent,Ie=Ue.author_name,Le=Ue.author_school_name,Ne=Ue.content,Ye=Ue.cover,tt=Ue.attachments,Ze=Ue.status,nt=Ue.title,mt=Ue.tags,ye||(Ue.status===404?De.push("/moop_cases"):xe({type:p.GET_DATA,payload:{data:{title:nt,author_name:Ie,author_school_name:Le,content:Ne,tag_ids:mt.map(function(Te){return Te.id}),publish:Ze==="published",attachment_ids:tt.map(function(Te){return{uid:Te.id,id:Te.id,name:Te.title,url:Te.url,filesize:Te.filesize,status:"done"}}),cover_id:Ye!=null&&Ye.id?[{uid:Ye==null?void 0:Ye.id,id:Ye==null?void 0:Ye.id,name:Ye==null?void 0:Ye.title,url:Ye==null?void 0:Ye.url,filesize:Ye==null?void 0:Ye.filesize,status:"done"}]:[]},loading:!1}}));case 6:case"end":return rt.stop()}},Me)})),we.apply(this,arguments)}return!ye&&ge&&V(),function(){ye=!0}},[ge]);function R(ye){return E.apply(this,arguments)}function E(){return E=Object(de.a)(N.a.mark(function ye(V){var we,Me;return N.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(!ge){Ie.next=6;break}return Ie.next=3,Object(L.e)(ge,V);case 3:De.push("/moop_cases/".concat(ge,"/publish-success")),Ie.next=11;break;case 6:return Ie.next=8,Object(L.a)(V);case 8:we=Ie.sent,Me=we.id,Me&&De.push("/moop_cases/".concat(Me,"/publish-success"));case 11:case"end":return Ie.stop()}},ye)})),E.apply(this,arguments)}var ue={initialValues:b,tags:j,removeAttachment:L.d,callback:R};return U.a.createElement(_e.a,{spinning:Z,delay:500},U.a.createElement("div",{className:"moop-info"},U.a.createElement("div",{className:"crumb"},U.a.createElement(fe.a,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),U.a.createElement("span",null,"\u65B0\u5EFA")),U.a.createElement("div",{className:"title"},U.a.createElement("h2",null,"\u4E0A\u4F20\u6559\u5B66\u6848\u4F8B"),U.a.createElement(fe.a,{to:"/moop_cases"},"\u8FD4\u56DE")),U.a.createElement(D,ue)))}},osHv:function(bt,Qe,C){(function(G){G(C("VrN/"))})(function(G){"use strict";var _e=G.Pos;function de(H,me){return H.line-me.line||H.ch-me.ch}var Re="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ke=Re+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",le=new RegExp("<(/?)(["+Re+"]["+ke+"]*)","g");function N(H,me,he,ze){this.line=me,this.ch=he,this.cm=H,this.text=H.getLine(me),this.min=ze?Math.max(ze.from,H.firstLine()):H.firstLine(),this.max=ze?Math.min(ze.to-1,H.lastLine()):H.lastLine()}function Q(H,me){var he=H.cm.getTokenTypeAt(_e(H.line,me));return he&&/\btag\b/.test(he)}function U(H){return H.line>=H.max?void 0:(H.ch=0,H.text=H.cm.getLine(++H.line),!0)}function q(H){return H.line<=H.min?void 0:(H.text=H.cm.getLine(--H.line),H.ch=H.text.length,!0)}function M(H){for(;;){var me=H.text.indexOf(">",H.ch);if(me==-1){if(U(H))continue;return}if(!Q(H,me+1)){H.ch=me+1;continue}var he=H.text.lastIndexOf("/",me),ze=he>-1&&!/\S/.test(H.text.slice(he+1,me));return H.ch=me+1,ze?"selfClose":"regular"}}function F(H){for(;;){var me=H.ch?H.text.lastIndexOf("<",H.ch-1):-1;if(me==-1){if(q(H))continue;return}if(!Q(H,me+1)){H.ch=me;continue}le.lastIndex=me,H.ch=me;var he=le.exec(H.text);if(he&&he.index==me)return he}}function fe(H){for(;;){le.lastIndex=H.ch;var me=le.exec(H.text);if(!me){if(U(H))continue;return}if(!Q(H,me.index+1)){H.ch=me.index+1;continue}return H.ch=me.index+me[0].length,me}}function ae(H){for(;;){var me=H.ch?H.text.lastIndexOf(">",H.ch-1):-1;if(me==-1){if(q(H))continue;return}if(!Q(H,me+1)){H.ch=me;continue}var he=H.text.lastIndexOf("/",me),ze=he>-1&&!/\S/.test(H.text.slice(he+1,me));return H.ch=me+1,ze?"selfClose":"regular"}}function K(H,me){for(var he=[];;){var ze=fe(H),Ke,Ee=H.line,Ce=H.ch-(ze?ze[0].length:0);if(!ze||!(Ke=M(H)))return;if(Ke=="selfClose")continue;if(ze[1]){for(var We=he.length-1;We>=0;--We)if(he[We]==ze[2]){he.length=We;break}if(We<0&&(!me||me==ze[2]))return{tag:ze[2],from:_e(Ee,Ce),to:_e(H.line,H.ch)}}else he.push(ze[2])}}function ee(H,me){for(var he=[];;){var ze=ae(H);if(!ze)return;if(ze=="selfClose"){F(H);continue}var Ke=H.line,Ee=H.ch,Ce=F(H);if(!Ce)return;if(Ce[1])he.push(Ce[2]);else{for(var We=he.length-1;We>=0;--We)if(he[We]==Ce[2]){he.length=We;break}if(We<0&&(!me||me==Ce[2]))return{tag:Ce[2],from:_e(H.line,H.ch),to:_e(Ke,Ee)}}}}G.registerHelper("fold","xml",function(H,me){for(var he=new N(H,me.line,0);;){var ze=fe(he);if(!ze||he.line!=me.line)return;var Ke=M(he);if(!Ke)return;if(!ze[1]&&Ke!="selfClose"){var Ee=_e(he.line,he.ch),Ce=K(he,ze[2]);return Ce&&de(Ce.from,Ee)>0?{from:Ee,to:Ce.from}:null}}}),G.findMatchingTag=function(H,me,he){var ze=new N(H,me.line,me.ch,he);if(ze.text.indexOf(">")==-1&&ze.text.indexOf("<")==-1)return;var Ke=M(ze),Ee=Ke&&_e(ze.line,ze.ch),Ce=Ke&&F(ze);if(!Ke||!Ce||de(ze,me)>0)return;var We={from:_e(ze.line,ze.ch),to:Ee,tag:Ce[2]};return Ke=="selfClose"?{open:We,close:null,at:"open"}:Ce[1]?{open:ee(ze,Ce[2]),close:We,at:"close"}:(ze=new N(H,Ee.line,Ee.ch,he),{open:We,close:K(ze,Ce[2]),at:"open"})},G.findEnclosingTag=function(H,me,he,ze){for(var Ke=new N(H,me.line,me.ch,he);;){var Ee=ee(Ke,ze);if(!Ee)break;var Ce=new N(H,me.line,me.ch,he),We=K(Ce,Ee.tag);if(We)return{open:Ee,close:We}}},G.scanForClosingTag=function(H,me,he,ze){var Ke=new N(H,me.line,me.ch,ze?{from:0,to:ze}:null);return K(Ke,he)}})},p5ED:function(bt,Qe,C){"use strict";var G=C("+L6B"),_e=C("2/Rp"),de=C("5Dmo"),Re=C("3S7+"),ke=C("k1fw"),le=C("9og8"),N=C("tJVT"),Q=C("WmNS"),U=C.n(Q),q=C("q1tI"),M=C.n(q),F=C("vHTk"),fe=C.n(F),ae=C("yEEn"),K=C("ZW9T"),ee=C("1vsH"),H=C("V0Rq"),me=C("m3rI"),he=function(Ke){var Ee=Ke.name,Ce=Ke.data,We=Ke.theme,pe=Ke.type,Ae=Ke.filename,ve=Ke.monacoEditor,ie=Ke.className,S=Ke.style,ne=Ke.close,J=Ke.onClose,_=Ke.hasMask,re=Ke.otherData,z=re===void 0?{}:re,D=Object(q.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=Object(N.a)(D,2),g=L[0],p=L[1],w=Object(q.useState)(""),P=Object(N.a)(w,2),Y=P[0],ge=P[1],De=Object(q.useState)(),be=Object(N.a)(De,2),Se=be[0],ce=be[1],xe=window.ENV==="build"?"/react/build/office.html":"/office.html",Z,j=1024*1024,b=10*j,R=Object(q.useRef)();pe==="office"&&(Z=Object(ee.R)(Ce).filesize,Z>b&&(pe="other")),Ae&&(ve.filename=Ae),Object(q.useEffect)(function(){var V,we,Me=(V=document.cookie)===null||V===void 0||((we=V.replace(/\s/g,""))===null||we===void 0)?void 0:we.split(";");Me==null||Me.map(function(Ue){var Ie=Ue.split("=");Ie[0]==="_educoder_session"&&ge(Ie[1])})},[]),Object(q.useEffect)(function(){pe==="office"&&E()},[pe]);var E=function(){var V=Object(le.a)(U.a.mark(function we(){var Me,Ue,Ie;return U.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return console.log("data:",Ce),Me=Ce,Ce.startsWith("http")||(Me=location.origin+Me),Ue=new URL(Me).pathname.split("/").pop(),Ne.next=6,Object(H.U)({attachment_id:Ue});case 6:Ie=Ne.sent,ce(Ie);case 8:case"end":return Ne.stop()}},we)}));return function(){return V.apply(this,arguments)}}(),ue=function(){if(Ce.startsWith("http")||Ce.startsWith("/api")||Ce.startsWith("blob:")){ye();return}Object(ee.x)(Ae||"educoder",Ce,Ae||"educoder")},ye=function(){Object(ee.v)(Ae||"educoder",decodeURIComponent(Ce))};return M.a.createElement("div",{style:Object(ke.a)({},S||{}),className:"".concat(_&&fe.a.bgBlack," ").concat(pe?fe.a.wrp:"hide")},ne&&M.a.createElement("div",{className:fe.a.close,ref:R},M.a.createElement(Re.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return R.current}},M.a.createElement("span",{onClick:ye},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(Re.a,{title:"\u5173\u95ED",getPopupContainer:function(){return R.current}},M.a.createElement("span",{className:"",onClick:function(){J(),ce(null)}},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(fe.a[ie]," ").concat(ie," ").concat(fe.a.monaco," ").concat(pe==="txt"?"show":"hide")},pe==="txt"&&M.a.createElement(K.b,ve)),pe==="audio"&&M.a.createElement("audio",{src:"".concat((Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(Ce),autoPlay:!0}),pe==="video"&&M.a.createElement(M.a.Fragment,null,(Ce==null?void 0:Ce.indexOf("/api"))>-1?M.a.createElement("video",{controls:!0,src:"".concat(Ce),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(Ce),autoPlay:!0})),pe==="office"&&Se&&M.a.createElement("iframe",{src:"".concat(xe,"?key=").concat(Se.key,"&url=").concat(me.a.API_SERVER+Se.url,"&callbackUrl=").concat(me.a.API_SERVER+Se.callbackUrl,"&fileType=").concat(Se.fileType,"&title=").concat(Se.title,"&model=view")}),(pe==="xlsx"||pe==="doc"||pe==="pptx"||pe==="docx")&&M.a.createElement("iframe",{src:"".concat(xe,"?key=").concat(z.key,"&url=").concat(me.a.API_SERVER+z.url,"&callbackUrl=").concat(me.a.API_SERVER+z.callbackUrl,"&fileType=").concat(z.fileType,"&title=").concat(z.title,"&model=").concat(z.model)}),pe==="html"&&M.a.createElement("iframe",{src:Ce+"&disposition=inline"}),pe==="pdf"&&M.a.createElement("embed",{className:fe.a.embed,src:Ce,type:"application/pdf"}),pe==="image"&&M.a.createElement("img",{src:"".concat((Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(Ce)}),pe==="other"&&M.a.createElement("div",null,M.a.createElement(_e.a,{type:"primary",size:"large",onClick:ue},M.a.createElement(ae.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),pe==="download"&&M.a.createElement(_e.a,{type:"primary",size:"large",onClick:ue},M.a.createElement(ae.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Qe.a=he},"p77/":function(bt,Qe,C){},"rAM+":function(bt,Qe,C){"use strict";C.d(Qe,"a",function(){return _e});var G=C("Qw5x");function _e(de,Re){var ke;if(typeof Symbol=="undefined"||de[Symbol.iterator]==null){if(Array.isArray(de)||(ke=Object(G.a)(de))||Re&&de&&typeof de.length=="number"){ke&&(de=ke);var le=0,N=function(){};return{s:N,n:function(){return le>=de.length?{done:!0}:{done:!1,value:de[le++]}},e:function(F){throw F},f:N}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Q=!0,U=!1,q;return{s:function(){ke=de[Symbol.iterator]()},n:function(){var F=ke.next();return Q=F.done,F},e:function(F){U=!0,q=F},f:function(){try{!Q&&ke.return!=null&&ke.return()}finally{if(U)throw q}}}}},rUJ1:function(bt,Qe){const C=/[&<>"']/,G=/[&<>"']/g,_e=/[<>"']|&(?!#?\w+;)/,de=/[<>"']|&(?!#?\w+;)/g,Re={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=pe=>Re[pe];function le(pe,Ae){if(Ae){if(C.test(pe))return pe.replace(G,ke)}else if(_e.test(pe))return pe.replace(de,ke);return pe}const N=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Q(pe){return pe.replace(N,(Ae,ve)=>(ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""))}const U=/(^|[^\[])\^/g;function q(pe,Ae){pe=pe.source||pe,Ae=Ae||"";const ve={replace:(ie,S)=>(S=S.source||S,S=S.replace(U,"$1"),pe=pe.replace(ie,S),ve),getRegex:()=>new RegExp(pe,Ae)};return ve}const M=/[^\w:]/g,F=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function fe(pe,Ae,ve){if(pe){let ie;try{ie=decodeURIComponent(Q(ve)).replace(M,"").toLowerCase()}catch(S){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}Ae&&!F.test(ve)&&(ve=me(Ae,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(ie){return null}return ve}const ae={},K=/^[^:]+:\/*[^/]*$/,ee=/^([^:]+:)[\s\S]*$/,H=/^([^:]+:\/*[^/]*)[\s\S]*$/;function me(pe,Ae){ae[" "+pe]||(K.test(pe)?ae[" "+pe]=pe+"/":ae[" "+pe]=Ee(pe,"/",!0)),pe=ae[" "+pe];const ve=pe.indexOf(":")===-1;return Ae.substring(0,2)==="//"?ve?Ae:pe.replace(ee,"$1")+Ae:Ae.charAt(0)==="/"?ve?Ae:pe.replace(H,"$1")+Ae:pe+Ae}const he={exec:function(){}};function ze(pe){let Ae=1,ve,ie;for(;Ae{let re=!1,z=J;for(;--z>=0&&_[z]==="\\";)re=!re;return re?"|":" |"}),ie=ve.split(/ \|/);let S=0;if(ie.length>Ae)ie.splice(Ae);else for(;ie.length