You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
350 lines
591 KiB
350 lines
591 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[156,6,7],{"+NIl":function(wt,rt,T){(function(K){K(T("VrN/"))})(function(K){"use strict";K.defineMode("stex",function(Te,de){"use strict";function Pe(oe,Z){oe.cmdState.push(Z)}function _e(oe){return oe.cmdState.length>0?oe.cmdState[oe.cmdState.length-1]:null}function re(oe){var Z=oe.cmdState.pop();Z&&Z.closeBracket()}function j(oe){for(var Z=oe.cmdState,q=Z.length-1;q>=0;q--){var z=Z[q];if(z.name=="DEFAULT")continue;return z}return{styleIdentifier:function(){return null}}}function Q(oe,Z,q){return function(){this.name=oe,this.bracketNo=0,this.style=Z,this.styles=q,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ie={};ie.importmodule=Q("importmodule","tag",["string","builtin"]),ie.documentclass=Q("documentclass","tag",["","atom"]),ie.usepackage=Q("usepackage","tag",["atom"]),ie.begin=Q("begin","tag",["atom"]),ie.end=Q("end","tag",["atom"]),ie.label=Q("label","tag",["atom"]),ie.ref=Q("ref","tag",["atom"]),ie.eqref=Q("eqref","tag",["atom"]),ie.cite=Q("cite","tag",["atom"]),ie.bibitem=Q("bibitem","tag",["atom"]),ie.Bibitem=Q("Bibitem","tag",["atom"]),ie.RBibitem=Q("RBibitem","tag",["atom"]),ie.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function V(oe,Z){oe.f=Z}function M(oe,Z){var q;if(oe.match(/^\\[a-zA-Z@]+/)){var z=oe.current().slice(1);return q=ie.hasOwnProperty(z)?ie[z]:ie.DEFAULT,q=new q,Pe(Z,q),V(Z,ve),q.style}if(oe.match(/^\\[$&%#{}_]/))return"tag";if(oe.match(/^\\[,;!\/\\]/))return"tag";if(oe.match("\\["))return V(Z,function(ue,He){return O(ue,He,"\\]")}),"keyword";if(oe.match("\\("))return V(Z,function(ue,He){return O(ue,He,"\\)")}),"keyword";if(oe.match("$$"))return V(Z,function(ue,He){return O(ue,He,"$$")}),"keyword";if(oe.match("$"))return V(Z,function(ue,He){return O(ue,He,"$")}),"keyword";var me=oe.next();if(me=="%")return oe.skipToEnd(),"comment";if(me=="}"||me=="]"){if(q=_e(Z),q)q.closeBracket(me),V(Z,ve);else return"error";return"bracket"}else return me=="{"||me=="["?(q=ie.DEFAULT,q=new q,Pe(Z,q),"bracket"):/\d/.test(me)?(oe.eatWhile(/[\w.%]/),"atom"):(oe.eatWhile(/[\w\-_]/),q=j(Z),q.name=="begin"&&(q.argument=oe.current()),q.styleIdentifier())}function O(oe,Z,q){if(oe.eatSpace())return null;if(q&&oe.match(q))return V(Z,M),"keyword";if(oe.match(/^\\[a-zA-Z@]+/))return"tag";if(oe.match(/^[a-zA-Z]+/))return"variable-2";if(oe.match(/^\\[$&%#{}_]/))return"tag";if(oe.match(/^\\[,;!\/]/))return"tag";if(oe.match(/^[\^_&]/))return"tag";if(oe.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(oe.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var z=oe.next();return z=="{"||z=="}"||z=="["||z=="]"||z=="("||z==")"?"bracket":z=="%"?(oe.skipToEnd(),"comment"):"error"}function ve(oe,Z){var q=oe.peek(),z;return q=="{"||q=="["?(z=_e(Z),z.openBracket(q),oe.eat(q),V(Z,M),"bracket"):/[ \t\r]/.test(q)?(oe.eat(q),null):(V(Z,M),re(Z),M(oe,Z))}return{startState:function(){var oe=de.inMathMode?function(Z,q){return O(Z,q)}:M;return{cmdState:[],f:oe}},copyState:function(oe){return{cmdState:oe.cmdState.slice(),f:oe.f}},token:function(oe,Z){return Z.f(oe,Z)},blankLine:function(oe){oe.f=M,oe.cmdState.length=0},lineComment:"%"}}),K.defineMIME("text/x-stex","stex"),K.defineMIME("text/x-latex","stex")})},"19Vz":function(wt,rt,T){(function(K){K(T("VrN/"))})(function(K){K.defineOption("placeholder","",function(Q,ie,V){var M=V&&V!=K.Init;if(ie&&!M)Q.on("blur",_e),Q.on("change",re),Q.on("swapDoc",re),K.on(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose=function(){Pe(Q)}),re(Q);else if(!ie&&M){Q.off("blur",_e),Q.off("change",re),Q.off("swapDoc",re),K.off(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose),Te(Q);var O=Q.getWrapperElement();O.className=O.className.replace(" CodeMirror-empty","")}ie&&!Q.hasFocus()&&_e(Q)});function Te(Q){Q.state.placeholder&&(Q.state.placeholder.parentNode.removeChild(Q.state.placeholder),Q.state.placeholder=null)}function de(Q){Te(Q);var ie=Q.state.placeholder=document.createElement("pre");ie.style.cssText="height: 0; overflow: visible",ie.style.direction=Q.getOption("direction"),ie.className="CodeMirror-placeholder CodeMirror-line-like";var V=Q.getOption("placeholder");typeof V=="string"&&(V=document.createTextNode(V)),ie.appendChild(V),Q.display.lineSpace.insertBefore(ie,Q.display.lineSpace.firstChild)}function Pe(Q){setTimeout(function(){var ie=!1,V=Q.getInputField();V.nodeName=="TEXTAREA"?ie=!V.value:Q.lineCount()==1&&(ie=!/[^\u200b]/.test(V.querySelector(".CodeMirror-line").textContent)),ie?de(Q):Te(Q)},20)}function _e(Q){j(Q)&&de(Q)}function re(Q){var ie=Q.getWrapperElement(),V=j(Q);ie.className=ie.className.replace(" CodeMirror-empty","")+(V?" CodeMirror-empty":""),V?de(Q):Te(Q)}function j(Q){return Q.lineCount()===1&&Q.getLine(0)===""}})},"1eCo":function(wt,rt,T){(function(K){K(T("VrN/"))})(function(K){"use strict";var Te={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};K.defineMode("xml",function(Pe,_e){var re=Pe.indentUnit,j={},Q=_e.htmlMode?Te:de;for(var ie in Q)j[ie]=Q[ie];for(var ie in _e)j[ie]=_e[ie];var V,M;function O(C,ae){function Y(F){return ae.tokenize=F,F(C,ae)}var A=C.next();if(A=="<")return C.eat("!")?C.eat("[")?C.match("CDATA[")?Y(Z("atom","]]>")):null:C.match("--")?Y(Z("comment","-->")):C.match("DOCTYPE",!0,!0)?(C.eatWhile(/[\w\._\-]/),Y(q(1))):null:C.eat("?")?(C.eatWhile(/[\w\._\-]/),ae.tokenize=Z("meta","?>"),"meta"):(V=C.eat("/")?"closeTag":"openTag",ae.tokenize=ve,"tag bracket");if(A=="&"){var se;return C.eat("#")?C.eat("x")?se=C.eatWhile(/[a-fA-F\d]/)&&C.eat(";"):se=C.eatWhile(/[\d]/)&&C.eat(";"):se=C.eatWhile(/[\w\.\-:]/)&&C.eat(";"),se?"atom":"error"}else return C.eatWhile(/[^&<]/),null}O.isInText=!0;function ve(C,ae){var Y=C.next();if(Y==">"||Y=="/"&&C.eat(">"))return ae.tokenize=O,V=Y==">"?"endTag":"selfcloseTag","tag bracket";if(Y=="=")return V="equals",null;if(Y=="<"){ae.tokenize=O,ae.state=He,ae.tagName=ae.tagStart=null;var A=ae.tokenize(C,ae);return A?A+" tag error":"tag error"}else return/[\'\"]/.test(Y)?(ae.tokenize=oe(Y),ae.stringStartCol=C.column(),ae.tokenize(C,ae)):(C.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function oe(C){var ae=function(Y,A){for(;!Y.eol();)if(Y.next()==C){A.tokenize=ve;break}return"string"};return ae.isInAttribute=!0,ae}function Z(C,ae){return function(Y,A){for(;!Y.eol();){if(Y.match(ae)){A.tokenize=O;break}Y.next()}return C}}function q(C){return function(ae,Y){for(var A;(A=ae.next())!=null;){if(A=="<")return Y.tokenize=q(C+1),Y.tokenize(ae,Y);if(A==">")if(C==1){Y.tokenize=O;break}else return Y.tokenize=q(C-1),Y.tokenize(ae,Y)}return"meta"}}function z(C,ae,Y){this.prev=C.context,this.tagName=ae,this.indent=C.indented,this.startOfLine=Y,(j.doNotIndent.hasOwnProperty(ae)||C.context&&C.context.noIndent)&&(this.noIndent=!0)}function me(C){C.context&&(C.context=C.context.prev)}function ue(C,ae){for(var Y;;){if(!C.context)return;if(Y=C.context.tagName,!j.contextGrabbers.hasOwnProperty(Y)||!j.contextGrabbers[Y].hasOwnProperty(ae))return;me(C)}}function He(C,ae,Y){return C=="openTag"?(Y.tagStart=ae.column(),$e):C=="closeTag"?we:He}function $e(C,ae,Y){return C=="word"?(Y.tagName=ae.current(),M="tag",fe):j.allowMissingTagName&&C=="endTag"?(M="tag bracket",fe(C,ae,Y)):(M="error",$e)}function we(C,ae,Y){if(C=="word"){var A=ae.current();return Y.context&&Y.context.tagName!=A&&j.implicitlyClosed.hasOwnProperty(Y.context.tagName)&&me(Y),Y.context&&Y.context.tagName==A||j.matchClosing===!1?(M="tag",be):(M="tag error",Ve)}else return j.allowMissingTagName&&C=="endTag"?(M="tag bracket",be(C,ae,Y)):(M="error",Ve)}function be(C,ae,Y){return C!="endTag"?(M="error",be):(me(Y),He)}function Ve(C,ae,Y){return M="error",be(C,ae,Y)}function fe(C,ae,Y){if(C=="word")return M="attribute",ke;if(C=="endTag"||C=="selfcloseTag"){var A=Y.tagName,se=Y.tagStart;return Y.tagName=Y.tagStart=null,C=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(A)?ue(Y,A):(ue(Y,A),Y.context=new z(Y,A,se==Y.indented)),He}return M="error",fe}function ke(C,ae,Y){return C=="equals"?Be:(j.allowMissing||(M="error"),fe(C,ae,Y))}function Be(C,ae,Y){return C=="string"?he:C=="word"&&j.allowUnquoted?(M="string",fe):(M="error",fe(C,ae,Y))}function he(C,ae,Y){return C=="string"?he:fe(C,ae,Y)}return{startState:function(C){var ae={tokenize:O,state:He,indented:C||0,tagName:null,tagStart:null,context:null};return C!=null&&(ae.baseIndent=C),ae},token:function(C,ae){if(!ae.tagName&&C.sol()&&(ae.indented=C.indentation()),C.eatSpace())return null;V=null;var Y=ae.tokenize(C,ae);return(Y||V)&&Y!="comment"&&(M=null,ae.state=ae.state(V||Y,C,ae),M&&(Y=M=="error"?Y+" error":M)),Y},indent:function(C,ae,Y){var A=C.context;if(C.tokenize.isInAttribute)return C.tagStart==C.indented?C.stringStartCol+1:C.indented+re;if(A&&A.noIndent)return K.Pass;if(C.tokenize!=ve&&C.tokenize!=O)return Y?Y.match(/^(\s*)/)[0].length:0;if(C.tagName)return j.multilineTagIndentPastTag!==!1?C.tagStart+C.tagName.length+2:C.tagStart+re*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(ae))return 0;var se=ae&&/^<(\/)?([\w_:\.-]*)/.exec(ae);if(se&&se[1])for(;A;)if(A.tagName==se[2]){A=A.prev;break}else if(j.implicitlyClosed.hasOwnProperty(A.tagName))A=A.prev;else break;else if(se)for(;A;){var F=j.contextGrabbers[A.tagName];if(F&&F.hasOwnProperty(se[2]))A=A.prev;else break}for(;A&&A.prev&&!A.startOfLine;)A=A.prev;return A?A.indent+re:C.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(C){C.state==Be&&(C.state=fe)},xmlCurrentTag:function(C){return C.tagName?{name:C.tagName,close:C.type=="closeTag"}:null},xmlCurrentContext:function(C){for(var ae=[],Y=C.context;Y;Y=Y.prev)Y.tagName&&ae.push(Y.tagName);return ae.reverse()}}}),K.defineMIME("text/xml","xml"),K.defineMIME("application/xml","xml"),K.mimeModes.hasOwnProperty("text/html")||K.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(wt,rt,T){"use strict";var K=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Te=new Uint8Array(16);function de(){if(!K)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K(Te)}var Pe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function _e(ve){return typeof ve=="string"&&Pe.test(ve)}for(var re=_e,j=[],Q=0;Q<256;++Q)j.push((Q+256).toString(16).substr(1));function ie(ve){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Z=(j[ve[oe+0]]+j[ve[oe+1]]+j[ve[oe+2]]+j[ve[oe+3]]+"-"+j[ve[oe+4]]+j[ve[oe+5]]+"-"+j[ve[oe+6]]+j[ve[oe+7]]+"-"+j[ve[oe+8]]+j[ve[oe+9]]+"-"+j[ve[oe+10]]+j[ve[oe+11]]+j[ve[oe+12]]+j[ve[oe+13]]+j[ve[oe+14]]+j[ve[oe+15]]).toLowerCase();if(!re(Z))throw TypeError("Stringified UUID is invalid");return Z}var V=ie;function M(ve,oe,Z){ve=ve||{};var q=ve.random||(ve.rng||de)();if(q[6]=q[6]&15|64,q[8]=q[8]&63|128,oe){Z=Z||0;for(var z=0;z<16;++z)oe[Z+z]=q[z];return oe}return V(q)}var O=rt.a=M},"7ahc":function(wt,rt,T){"use strict";T.d(rt,"a",function(){return $e});var K=T("k1fw"),Te=T("0Owb"),de=T("+L6B"),Pe=T("2/Rp"),_e=T("y8nQ"),re=T("Vl3Y"),j=T("tJVT"),Q=T("OaEy"),ie=T("2fM7"),V=T("q1tI"),M=T.n(V),O=T("VrN/"),ve=T.n(O),oe=T("p77/"),Z=T.n(oe),q=T("c5Ni"),z=T.n(q),me=ie.a.Option,ue={labelCol:{span:4},wrapperCol:{span:20}},He={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"]};rt.b=function(we){var be=we.callback,Ve=we.onCancel,fe=Object(V.useState)("python"),ke=Object(j.a)(fe,2),Be=ke[0],he=ke[1];function C(Y){he(He[Y][1])}function ae(Y){be(Y)}return M.a.createElement(re.a,Object(Te.a)({},ue,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ae}),M.a.createElement(re.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},M.a.createElement(ie.a,{onChange:C},Object.keys(He).map(function(Y){return M.a.createElement(me,{key:Y,value:Y},He[Y][0])}))),M.a.createElement(re.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},M.a.createElement($e,{mode:Be})),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(Pe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(Pe.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function $e(we){var be=we.value,Ve=we.onChange,fe=we.mode,ke=we.options,Be=ke===void 0?{}:ke,he=Object(V.useRef)(),C=Object(V.useState)(),ae=Object(j.a)(C,2),Y=ae[0],A=ae[1];return Object(V.useEffect)(function(){if(Y){function se(F){var N=F.getValue();Ve&&Ve(N)}return Y.on("change",se),function(){Y.off("change",se)}}},[Y,Ve]),Object(V.useEffect)(function(){Y&&Y.setOption("mode",fe)},[Y,fe]),Object(V.useEffect)(function(){Y&&((be!==Y.getValue()||be==="")&&setTimeout(function(){Y.setValue(be||" ")},300))},[Y,be]),Object(V.useEffect)(function(){if(he.current&&!Y){var se=ve.a.fromTextArea(he.current,Object(K.a)({mode:fe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Be));A(se)}},[he.current,Y]),M.a.createElement("div",{className:"my-codemirror-container"},M.a.createElement("textarea",{ref:he}))}},"7ixt":function(wt,rt,T){"use strict";T.d(rt,"a",function(){return de});var K={adjustX:1,adjustY:1},Te=[0,0],de={left:{points:["cr","cl"],overflow:K,offset:[-4,0],targetOffset:Te},right:{points:["cl","cr"],overflow:K,offset:[4,0],targetOffset:Te},top:{points:["bc","tc"],overflow:K,offset:[0,-4],targetOffset:Te},bottom:{points:["tc","bc"],overflow:K,offset:[0,4],targetOffset:Te},topLeft:{points:["bl","tl"],overflow:K,offset:[0,-4],targetOffset:Te},leftTop:{points:["tr","tl"],overflow:K,offset:[-4,0],targetOffset:Te},topRight:{points:["br","tr"],overflow:K,offset:[0,-4],targetOffset:Te},rightTop:{points:["tl","tr"],overflow:K,offset:[4,0],targetOffset:Te},bottomRight:{points:["tr","br"],overflow:K,offset:[0,4],targetOffset:Te},rightBottom:{points:["bl","br"],overflow:K,offset:[4,0],targetOffset:Te},bottomLeft:{points:["tl","bl"],overflow:K,offset:[0,4],targetOffset:Te},leftBottom:{points:["br","bl"],overflow:K,offset:[-4,0],targetOffset:Te}},Pe=de},"8EBN":function(wt,rt,T){(function(K){K(T("VrN/"))})(function(K){"use strict";K.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 Te=0;Te<K.modeInfo.length;Te++){var de=K.modeInfo[Te];de.mimes&&(de.mime=de.mimes[0])}K.findModeByMIME=function(Pe){Pe=Pe.toLowerCase();for(var _e=0;_e<K.modeInfo.length;_e++){var re=K.modeInfo[_e];if(re.mime==Pe)return re;if(re.mimes){for(var j=0;j<re.mimes.length;j++)if(re.mimes[j]==Pe)return re}}if(/\+xml$/.test(Pe))return K.findModeByMIME("application/xml");if(/\+json$/.test(Pe))return K.findModeByMIME("application/json")},K.findModeByExtension=function(Pe){Pe=Pe.toLowerCase();for(var _e=0;_e<K.modeInfo.length;_e++){var re=K.modeInfo[_e];if(re.ext){for(var j=0;j<re.ext.length;j++)if(re.ext[j]==Pe)return re}}},K.findModeByFileName=function(Pe){for(var _e=0;_e<K.modeInfo.length;_e++){var re=K.modeInfo[_e];if(re.file&&re.file.test(Pe))return re}var j=Pe.lastIndexOf("."),Q=j>-1&&Pe.substring(j+1,Pe.length);if(Q)return K.findModeByExtension(Q)},K.findModeByName=function(Pe){Pe=Pe.toLowerCase();for(var _e=0;_e<K.modeInfo.length;_e++){var re=K.modeInfo[_e];if(re.name.toLowerCase()==Pe)return re;if(re.alias){for(var j=0;j<re.alias.length;j++)if(re.alias[j].toLowerCase()==Pe)return re}}}})},"8hTe":function(wt,rt,T){wt.exports={button:"button___1wy9m"}},"9Bee":function(wt,rt,T){"use strict";var K=T("DYRE"),Te=T("zeV3"),de=T("+L6B"),Pe=T("2/Rp"),_e=T("k1fw"),re=T("9og8"),j=T("tJVT"),Q=T("WmNS"),ie=T.n(Q),V=T("q1tI"),M=T.n(V),O=T("vg9a"),ve=T("DlQD"),oe=T.n(ve),Z=T("rUJ1");function q(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(d){var h=d.match(/^\s+/);if(h===null)return d;var I=Object(j.a)(h,1),De=I[0];return De.length>=u.length?d.slice(u.length):d}).join(`
|
|
`)}var z=[],me=["<ul>"],ue=new oe.a.Renderer,He=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function $e(){z.length=0,me=["<ul>"]}var we={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function be(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var d=c[o];u.push("<li><a href='#"+d.anchor+"'>"+d.text+"</a>"),o++;var h=[];return o=be(c,o,d.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(I){u.push(I)}),u.push("</ul>")),u.push("</li>"),o=be(c,o,a,u),o}function Ve(){return be(z,0,0,me),me.push("</ul>"),me.join("")}var fe={heading:function(o){var a=He.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=q(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var I=he(),De=d;d=I,C[I]={type:"block",expression:De}}return{type:"code",raw:u,lang:h,text:d}}}},ke=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Be=0,he=function(){return"__special_katext_id_".concat(Be++,"__")},C={};function ae(){return C}function Y(){Be=0,C={}}function A(c){return c=c.replace(ke,function(o,a){var u=he();return C[u]={type:"inline",expression:a},u}),c}var se=ue.listitem;ue.listitem=function(c){return se(A(c))};var F=ue.paragraph;ue.paragraph=function(c){return F(A(c))};var N=ue.tablecell;ue.tablecell=function(c,o){return N(A(c),o)},ue.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(c,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?c:Object(Z.escape)(c,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(Z.escape)(c,!0))+"</code></pre>"},ue.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return z.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},oe.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),oe.a.use({tokenizer:fe,renderer:ue});var L=oe.a,m=T("SJMd"),f=T("ulZh"),w=T.n(f),P=T("m3rI"),J=T("Oy/b"),Se=T("p5ED"),Re=T("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 pe=function(c,o){return(pe=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 ye(c,o){function a(){this.constructor=c}pe(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ge(c,o,a,u){return new(a||(a=Promise))(function(d,h){function I(lt){try{Ze(u.next(lt))}catch(Ie){h(Ie)}}function De(lt){try{Ze(u.throw(lt))}catch(Ie){h(Ie)}}function Ze(lt){var Ie;lt.done?d(lt.value):(Ie=lt.value,Ie instanceof a?Ie:new a(function(xt){xt(Ie)})).then(I,De)}Ze((u=u.apply(c,o||[])).next())})}function ce(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:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function De(Ze){return function(lt){return function(Ie){if(a)throw new TypeError("Generator is already executing.");for(;I;)try{if(a=1,u&&(d=2&Ie[0]?u.return:Ie[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Ie[1])).done)return d;switch(u=0,d&&(Ie=[2&Ie[0],d.value]),Ie[0]){case 0:case 1:d=Ie;break;case 4:return I.label++,{value:Ie[1],done:!1};case 5:I.label++,u=Ie[1],Ie=[0];continue;case 7:Ie=I.ops.pop(),I.trys.pop();continue;default:if(!(d=I.trys,(d=d.length>0&&d[d.length-1])||Ie[0]!==6&&Ie[0]!==2)){I=0;continue}if(Ie[0]===3&&(!d||Ie[1]>d[0]&&Ie[1]<d[3])){I.label=Ie[1];break}if(Ie[0]===6&&I.label<d[1]){I.label=d[1],d=Ie;break}if(d&&I.label<d[2]){I.label=d[2],I.ops.push(Ie);break}d[2]&&I.ops.pop(),I.trys.pop();continue}Ie=o.call(c,I)}catch(xt){Ie=[6,xt],u=0}finally{a=d=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([Ze,lt])}}}function $(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),d=0;for(o=0;o<a;o++)for(var h=arguments[o],I=0,De=h.length;I<De;I++,d++)u[d]=h[I];return u}var U=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,d=a;u<d.length;u++){var h=d[u],I=h[0],De=h[1];o.setAttribute(I,De)}},c.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&c.setAttributes(d,u),d},c.createLine=function(o,a,u,d,h){var I=document.createElementNS("http://www.w3.org/2000/svg","line");return I.setAttribute("x1",o.toString()),I.setAttribute("y1",a.toString()),I.setAttribute("x2",u.toString()),I.setAttribute("y2",d.toString()),h&&c.setAttributes(I,h),I},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(d,u),d},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,d,h,I,De){var Ze=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Ze,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",I.toString()]]),Ze.appendChild(De),Ze},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c}(),b=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),R=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var d=this;return new Promise(function(h){var I=u!==void 0?u:document.createElement("canvas");o===null&&(d.markersOnly=!0,d.naturalSize=!1);var De=document.createElementNS("http://www.w3.org/2000/svg","svg");De.setAttribute("xmlns","http://www.w3.org/2000/svg"),De.setAttribute("width",a.width.baseVal.valueAsString),De.setAttribute("height",a.height.baseVal.valueAsString),De.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),De.innerHTML=a.innerHTML,d.naturalSize===!0?(De.width.baseVal.value=o.naturalWidth,De.height.baseVal.value=o.naturalHeight):d.width!==void 0&&d.height!==void 0&&(De.width.baseVal.value=d.width,De.height.baseVal.value=d.height),I.width=De.width.baseVal.value,I.height=De.height.baseVal.value;var Ze=De.outerHTML,lt=I.getContext("2d");d.markersOnly!==!0&<.drawImage(o,0,0,I.width,I.height);var Ie=window.URL,xt=new Image(I.width,I.height);xt.setAttribute("crossOrigin","anonymous");var Rt=new Blob([Ze],{type:"image/svg+xml"}),Xt=Ie.createObjectURL(Rt);xt.onload=function(){lt.drawImage(xt,0,0),Ie.revokeObjectURL(Xt);var jn=I.toDataURL(d.imageType,d.imageQuality);h(jn)},xt.src=Xt})},c}(),k=function(){},le=function(){function c(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new X("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new X("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),xe=function(c,o){this.selector=c,this.style=o},X=function(c,o){this.localName=c,this.style=o},Ce=function(){function c(o,a,u,d,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=d,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return c.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',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,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(d,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"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;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},c.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},c.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},c.prototype.addActionButton=function(o,a,u){var d=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){d.actionToolbarButtonClicked(h,u)}),u){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new X("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new X("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new X("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new X("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new X("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new X("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new X("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new X("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new xe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},c.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&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 X("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 X("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new X("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new X("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new X("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 X("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new X("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 X("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new X("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new xe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xe("."+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 De=document.createElement("div");De.className=d.toolboxButtonStyleClass.name+" "+((I=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&I!==void 0?I:d.toolboxButtonStyleColorsClass.name),De.innerHTML=h.icon,De.title=h.title,De.addEventListener("click",function(){d.panelButtonClick(h)}),d.panelButtons.push(De),d.buttonRow.appendChild(De)}),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 De,Ze;h.className=a.toolboxButtonStyleClass.name+" "+(I===u?""+((De=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&De!==void 0?De:a.toolboxActiveButtonStyleColorsClass.name):""+((Ze=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:a.toolboxButtonStyleColorsClass.name))})},c}(),Ge=function(c,o){this.title=c,this.icon=o},je=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||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 ye(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 De=document.createElement("div");return De.style.display="inline-block",De.style.width=h-2+"px",De.style.height=h-2+"px",De.style.backgroundColor=a,De.style.borderRadius=h/2+"px",a==="transparent"&&(De.style.fill=this.uiStyleSettings.toolboxAccentColor,De.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),I.appendChild(De),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}(Ge),Ne=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}(),Fe=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}(),dt=function(){function c(){this.GRIP_SIZE=10,this.visual=U.createGroup(),this.visual.appendChild(U.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(U.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}(),Qe=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}(),et=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(U.createTransform()),h.setupControlBox(),h}return ye(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=U.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=U.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=U.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=U.createGroup();var a=U.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=U.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=U.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Fe,this.addControlGrips(),this.controlBox.style.display="none"},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 dt;return a.visual.transform.baseVal.appendItem(U.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,De=this.height+this.CB_DISTANCE-a/2,Ze=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,Ze,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,I),this.positionGrip(this.controlGrips.centerRight.visual,Ze,I),this.positionGrip(this.controlGrips.bottomLeft.visual,u,De),this.positionGrip(this.controlGrips.bottomCenter.visual,h,De),this.positionGrip(this.controlGrips.bottomRight.visual,Ze,De),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:Qe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Qe.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(Qe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Qe.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}(Ne),tt=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 ye(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=U.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),U.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&&U.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&U.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&U.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&U.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}(et),mt=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return I.widths=[],I.widthBoxes=[],I.widths=u,I.currentWidth=d,I.setCurrentWidth=I.setCurrentWidth.bind(I),I}return ye(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 De=document.createElement("div");De.style.minHeight="20px",De.style.flexGrow="2",De.style.display="flex",De.style.alignItems="center";var Ze=document.createElement("hr");Ze.style.minWidth="20px",Ze.style.border="0px",Ze.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,Ze.style.flexGrow="2",De.appendChild(Ze),h.appendChild(De),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}(Ge),ht=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return I.styles=[],I.styleBoxes=[],I.styles=u,I.currentStyle=d,I.setCurrentStyle=I.setCurrentStyle.bind(I),I}return ye(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 De=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(d!==""?'stroke-dasharray="'+d+'"':"")+` />
|
|
</svg>`;I.innerHTML=De,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}(Ge),st=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 je("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 ht("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ye(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='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(tt),Ee=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},pt=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 ye(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=U.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 dt;return a.visual.transform.baseVal.appendItem(U.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}(Ne),ot=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 je("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 ht("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ye(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=U.createGroup(),this.selectorLine=U.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=U.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()),U.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),U.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),U.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='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(pt),Le=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return I.fonts=[],I.fontBoxes=[],I.fonts=u,I.currentFont=d,I.setCurrentFont=I.setCurrentFont.bind(I),I}return ye(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 De=document.createElement("div");De.style.whiteSpace="nowrap",De.style.overflow="hidden",De.style.textOverflow="ellipsis",De.innerHTML="The quick brown fox jumps over the lazy dog",I.appendChild(De),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}(Ge),ze=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 je("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Le("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return ye(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=U.createGroup(),this.bgRectangle=U.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=U.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(U.createTransform()),this.textElement.transform.baseVal.appendItem(U.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(U.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&&(U.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),U.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&&U.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&&U.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='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(et),W=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 je("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 ye(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=U.createGroup(),this.drawingImage=U.createImage(),this.visual.appendChild(this.drawingImage);var a=U.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),U.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),U.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],De=u[3],Ze=!1,lt=0;lt<this.canvasElement.height;lt++)for(var Ie=0;Ie<this.canvasElement.width;Ie++)a.data[lt*this.canvasElement.width*4+4*Ie+3]>0&&(Ze=!0,lt<h&&(h=lt),Ie<d&&(d=Ie),lt>De&&(De=lt),Ie>I&&(I=Ie));if(Ze){this.left=d/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(I-d)/this.pixelRatio,this.height=(De-h)/this.pixelRatio;var xt=document.createElement("canvas");xt.width=I-d,xt.height=De-h,xt.getContext("2d").putImageData(this.canvasContext.getImageData(d,h,I-d,De-h),0,0),this.drawingImgUrl=xt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){U.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),U.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='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(et),B=function(c){function o(a,u,d){var h=c.call(this,a,d||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return ye(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(De){var Ze="both";switch(De){case 0:Ze="both";break;case 1:Ze="start";break;case 2:Ze="end";break;case 3:Ze="none"}var lt=document.createElement("div");if(lt.style.display="flex",lt.style.flexGrow="2",lt.style.alignItems="center",lt.style.justifyContent="space-between",lt.style.padding="5px",lt.style.borderWidth="2px",lt.style.borderStyle="solid",lt.style.borderColor=Ze===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",lt.addEventListener("click",function(){a.setCurrentType(Ze,lt)}),u.appendChild(lt),Ze==="both"||Ze==="start"){var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.alignItems="center",Ie.style.minHeight="20px",Ie.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ie.style.marginLeft="5px",lt.appendChild(Ie)}var xt=document.createElement("div");xt.style.display="flex",xt.style.alignItems="center",xt.style.minHeight="20px",xt.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",xt.appendChild(Rt),lt.appendChild(xt),Ze==="both"||Ze==="end"){var Xt=document.createElement("div");Xt.style.display="flex",Xt.style.alignItems="center",Xt.style.minHeight="20px",Xt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Xt.style.marginRight="5px",lt.appendChild(Xt)}h.typeBoxes.push(lt)},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}(Ge),H=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 ye(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=U.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(U.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=U.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(U.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",U.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),U.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='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(ot),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 je("Color",d.defaultColorSet,d.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return ye(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='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(tt),x=function(c){function o(a,u,d,h){var I=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return I.opacities=[],I.opacityBoxes=[],I.opacities=u,I.currentOpacity=d,I.setCurrentOpacity=I.setCurrentOpacity.bind(I),I}return ye(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}(Ge),S=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 je("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 ye(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&U.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='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(y),E='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',ne=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 je("Text color",d.defaultColorSet,h.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new je("Fill color",d.defaultColorSet,h.bgColor,E),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Le("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new dt,h.tipGrip.visual.transform.baseVal.appendItem(U.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return ye(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(){U.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=U.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&&(U.setAttributes(this.bgRectangle,[["fill",a]]),U.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.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+d,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+d}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+d}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-d},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+d,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-d})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){U.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),c.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,c.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(ze),G=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.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.fillColor=d.defaultFillColor,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.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new je("Line color",$(d.defaultColorSet,["transparent"]),d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new je("Fill color",$(d.defaultColorSet,["transparent"]),h.fillColor,E),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new mt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ht("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new x("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ye(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=U.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},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),U.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&U.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&U.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&U.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&U.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&U.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this));return a.typeName=o.typeName,a},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.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(et),Oe=function(c){function o(a,u,d){return c.call(this,a,u,d)||this}return ye(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=U.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(U.createTransform()),this.visual.appendChild(this.tip1),this.tip2=U.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(U.createTransform()),this.visual.appendChild(this.tip2)},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.tip1&&this.tip2&&(U.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),U.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var 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='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(ot),Ye=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 ye(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='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(G),nt=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}(),Ke=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 je("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 ht("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ye(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=U.createGroup(),this.selectorCurve=U.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=U.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()),U.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),U.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),U.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=U.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=U.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='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(pt),Et=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}(),Ct=function(c){function o(a,u,d){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=d,h}return ye(o,c),o}(Et),at=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 ye(o,c),o}(Et),Ht=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 Ee,this._isOpen=!1,this.undoRedoManager=new nt,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 Ht,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new le(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[st,W,H,ze,Ye,G,S,ne,Oe,y,ot,Ke]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[st,W,H,ze,G,S,ne]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[st,W,H,ze,S]},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&&k.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=k.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Et(o))})},c.prototype.render=function(){return ge(this,void 0,void 0,function(){var o;return ce(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 Et(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 Et(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},c.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},c.prototype.removeRenderEventListener=function(o){},c.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},c.prototype.removeCloseEventListener=function(o){},c.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,d=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,d),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,d=this;this._currentMarker&&this._currentMarker instanceof ze?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==d._currentMarker&&h.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},c.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},c.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},c.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},c.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=U.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},c.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},c.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},c.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},c.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},c.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},c.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},c.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},c.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',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 Ce(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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Me(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},c.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-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 at(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 at(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(I){var De=new at(o,void 0,!0);I(De),De.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(I){var De=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(Ze){return Ze(new at(o,De))})},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),d<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new Et(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new Et(o))})}},c.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},c.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new Et(o))}))},c.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},c.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new Et(o))}))},c.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},c.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},c.prototype.startRenderAndClose=function(){return ge(this,void 0,void 0,function(){var o,a,u=this;return ce(this,function(d){switch(d.label){case 0:return[4,this.render()];case 1:return o=d.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new Ct(u,o,a))}),this.close(!0),[2]}})})},c.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},c.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var d=a._availableMarkerTypes.find(function(I){return I.typeName===u.typeName});if(d!==void 0){var h=a.addNewMarker(d);h.restoreState(u),a.markers.push(h)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new Et(a))})},c.prototype.addNewMarker=function(o){var a=U.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},c.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(d){return d.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(d){return d(new at(u,u._currentMarker))}))},c.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof W&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(W):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new at(a,a._currentMarker))})},c.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},c.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},c.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new at(a,o))})},c.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new at(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new at(a,a._currentMarker))}))},c.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},c.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},c.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&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 Et(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 Et(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 Tt=function(c,o){return(Tt=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 Ot(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}Tt(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(lt){try{Ze(u.next(lt))}catch(Ie){h(Ie)}}function De(lt){try{Ze(u.throw(lt))}catch(Ie){h(Ie)}}function Ze(lt){var Ie;lt.done?d(lt.value):(Ie=lt.value,Ie instanceof a?Ie:new a(function(xt){xt(Ie)})).then(I,De)}Ze((u=u.apply(c,o||[])).next())})}function bn(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:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function De(Ze){return function(lt){return function(Ie){if(a)throw new TypeError("Generator is already executing.");for(;I;)try{if(a=1,u&&(d=2&Ie[0]?u.return:Ie[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Ie[1])).done)return d;switch(u=0,d&&(Ie=[2&Ie[0],d.value]),Ie[0]){case 0:case 1:d=Ie;break;case 4:return I.label++,{value:Ie[1],done:!1};case 5:I.label++,u=Ie[1],Ie=[0];continue;case 7:Ie=I.ops.pop(),I.trys.pop();continue;default:if(!(d=I.trys,(d=d.length>0&&d[d.length-1])||Ie[0]!==6&&Ie[0]!==2)){I=0;continue}if(Ie[0]===3&&(!d||Ie[1]>d[0]&&Ie[1]<d[3])){I.label=Ie[1];break}if(Ie[0]===6&&I.label<d[1]){I.label=d[1],d=Ie;break}if(d&&I.label<d[2]){I.label=d[2],I.ops.push(Ie);break}d[2]&&I.ops.pop(),I.trys.pop();continue}Ie=o.call(c,I)}catch(xt){Ie=[6,xt],u=0}finally{a=d=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([Ze,lt])}}}var ai=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),vt=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,d=a;u<d.length;u++){var h=d[u],I=h[0],De=h[1];o.setAttribute(I,De)}},c.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&c.setAttributes(d,u),d},c.createLine=function(o,a,u,d,h){var I=document.createElementNS("http://www.w3.org/2000/svg","line");return I.setAttribute("x1",o.toString()),I.setAttribute("y1",a.toString()),I.setAttribute("x2",u.toString()),I.setAttribute("y2",d.toString()),h&&c.setAttributes(I,h),I},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(d,u),d},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,d,h,I,De){var Ze=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Ze,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",I.toString()]]),Ze.appendChild(De),Ze},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&c.setAttributes(u,a),u},c.getHollowRectanglePath=function(o,a,u,d,h,I,De,Ze){return"M"+o+","+a+"V"+(a+d)+"H"+(o+u)+"V"+a+"H"+h+"V"+I+"H"+(h+De)+"V"+(I+Ze)+"H"+h+"V"+a+"Z"},c}(),Kn=function(){function c(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new on("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new on("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new on("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new fn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new fn("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),on=function(c,o){this.selector=c,this.style=o},fn=function(c,o){this.localName=c,this.style=o},Wn=function(){function c(){this.blocks=[],this.display=""}return c.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},c.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},c.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},c}(),si=function(){function c(){}return c.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},c}(),li=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return Ot(o,c),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(si),It=function(){function c(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(c.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},c.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},c.prototype.hide=function(){this._isHidden=!0},c}(),ct=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return Ot(o,c),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(si),Nn=function(){function c(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(c.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),c.prototype.getVerticalLength=function(o){return o/this.ratio},c.prototype.getHorizontalLength=function(o){return o*this.ratio},c}(),ui=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Nn(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 De=vt.createDefs();I.appendChild(De);var Ze=vt.createElement("clipPath",[["id","text-bg-clip"]]);De.appendChild(Ze);var lt=vt.createPath(vt.getHollowRectanglePath((24-d)/2,(24-h)/2,d,h,(24-d)/2+2,(24-h)/2+2,d-4,h-4));I.appendChild(lt);var Ie=vt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ie.appendChild(vt.createTSpan(o+":"+a)),I.appendChild(Ie);var xt=Ie.getBBox();vt.setAttributes(Ie,[["x",((24-xt.width)/2).toString()],["y",((24-xt.height)/2-xt.y).toString()]]);var Rt=vt.createPath(vt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(xt.width))/2,(24-Math.ceil(xt.height))/2,Math.ceil(xt.width),Math.ceil(xt.height)));return Ze.appendChild(Rt),vt.setAttributes(lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(I),I.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},c}(),Cn=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 Ot(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}(It),Lt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=vt.createGroup(),this.visual.appendChild(vt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(vt.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 vt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),In=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&&vt.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=vt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=vt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(vt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(vt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=vt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},c.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),vt.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 De=a.y+u*(I+1);vt.setAttributes(h,[["x1",""+a.x],["y1",""+De],["x2",""+(a.x+a.width)],["y2",""+De]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,I){var De=a.x+d*(I+1);vt.setAttributes(h,[["x1",""+De],["y1",""+a.y],["x2",""+De],["y2",""+(a.y+a.height)]])}),vt.setAttributes(this.cropShadeElement,[["d",vt.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+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.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.canvasWidth<d/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=d,this.cropRect.width>this.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 De=u/o,Ze=d/a;return{x:(h.x-I)*De+I,y:(h.y-I)*Ze+I,width:h.width*De,height:h.height*Ze}},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();vt.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=vt.createPath(a);var h=vt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=vt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=vt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var I=vt.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,De){var Ze=this;return new Promise(function(lt){var Ie=document.createElement("canvas");Ie.width=o.width.baseVal.value-2*d,Ie.height=o.height.baseVal.value-2*d;var xt=1,Rt=1;Ze.naturalSize===!0?(xt=a.naturalWidth/(o.width.baseVal.value-2*d)/I,Rt=a.naturalHeight/(o.height.baseVal.value-2*d)/De,Ie.width=a.naturalWidth/I,Ie.height=a.naturalHeight/De):Ze.width!==void 0&&Ze.height!==void 0&&(xt=Ze.width/u.width,Rt=Ze.height/u.height,Ie.width*=xt,Ie.height*=Rt);var Xt=Ie.getContext("2d");Xt.translate(Ie.width/2,Ie.height/2),Xt.rotate(h*Math.PI/180),Xt.scale(I,De),Xt.translate(-Ie.width/2,-Ie.height/2),Xt.drawImage(a,0,0,Ie.width,Ie.height);var jn=document.createElement("canvas");jn.width=u.width*xt,jn.height=u.height*Rt,jn.getContext("2d").putImageData(Xt.getImageData((u.x-d)*xt,(u.y-d)*Rt,u.width*xt,u.height*Rt),0,0),lt(jn.toDataURL(Ze.imageType,Ze.imageQuality))})},c}(),We=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_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",vt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},c.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},c.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();vt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},c.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},c.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=vt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=vt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=vt.createGroup(),this.editingTargetRotationScaleContainer=vt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=vt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=vt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=vt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},c.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},c.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=vt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new In(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},c.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},c.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},c.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},c.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},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.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+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 Xt=new It(ui.getIcon(Rt.horizontal,Rt.vertical),Rt.horizontal===0&&Rt.vertical===0?"FREE":Rt.horizontal+":"+Rt.vertical);Xt.onClick=function(){return o.ratioButtonClicked(Rt)},u.push(Xt)}),this.aspectRatioButton=new Cn(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 It('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");d.isActive=this.isGridVisible,d.onClick=function(){o.isGridVisible=!o.isGridVisible,d.isActive=o.isGridVisible},a.addButton(d);var h=new It('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"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 ct;this.topToolbar.addElementBlock(I);var De=document.createElement("div");De.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ze=document.createElement("a");Ze.style.color="currentColor",Ze.href="https://markerjs.com/products/cropro",Ze.target="_blank",Ze.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',De.appendChild(Ze),I.addElement(De)}var lt=new li;lt.minWidth=3*this.toolbarHeight+"px",lt.contentAlign="end",this.topToolbar.addButtonBlock(lt);var Ie=new It('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ie.onClick=this.startRenderAndClose,lt.addButton(Ie),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ie.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var xt=new It('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");xt.onClick=this.close,lt.addButton(xt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(xt.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 It('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var d=new It('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");d.onClick=this.rotateRightButtonClicked,a.addButton(d);var h=new ct;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(lt){o.rotateBy(lt),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 De=new It('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");De.onClick=this.flipHorizontallyButtonClicked,I.addButton(De);var Ze=new It('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Ze.onClick=this.flipVerticallyButtonClicked,I.addButton(Ze)},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 Nn(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 bn(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 bn(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(),vt.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}(),St=T("8hTe"),ci=T.n(St),Ai=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Li=rt.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,De=c.showLines,Ze=c.replaces,lt=c.zoomImg,Ie=c.hasMask,xt=c.style,Rt=xt===void 0?{}:xt,Xt=c.stylesPrev,jn=Xt===void 0?{}:Xt,Bn=String(a),an=Object(V.useRef)(),Gn=Object(V.useRef)(),Wi=Object(V.useState)(""),Sn=Object(j.a)(Wi,2),Un=Sn[0],On=Sn[1],vi=Object(V.useState)("office"),$n=Object(j.a)(vi,2),fi=$n[0],ti=$n[1],cr=function(){var Bt=new We(Gn.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var pn=Object(re.a)(ie.a.mark(function jt(en){var zt;return ie.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return an.current.style.display="none",qt.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:en}});case 3:zt=qt.sent,zt!=null&&zt.id&&Ze(Gn.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 5:case"end":return qt.stop()}},jt)}));return function(jt){return pn.apply(this,arguments)}}()),Bt.show()},Gi=function(){var Bt=new Nt(Gn.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var pn=Object(re.a)(ie.a.mark(function jt(en){var zt;return ie.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(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:en.dataUrl}});case 4:zt=qt.sent,zt!=null&&zt.id&&Ze(Gn.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 6:case"end":return qt.stop()}},jt)}));return function(jt){return pn.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Zn=Object(V.useMemo)(function(){try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Bn=Bn.replace(Zt,"("+P.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+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,`
|
|
`),Bn=Bn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(ni){}var jt=L(Bn),en=ae();if(Bn.match(/\[TOC\]/)&&(jt=jt.replace("<p>[TOC]</p>",Ve()),$e()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(ni,qt){var kn=en[qt],Vi=kn.type,Xi=kn.expression;return Object(J.renderToString)(di(Xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),Y(),I){var zt=document.createElement("div");return zt.innerHTML=jt,zt.innerText}return setTimeout(function(){return Oi()},500),jt},[Bn]),Fn=Object(V.useRef)();we.WebkitLineClamp=De,De&&(Rt=Object(_e.a)(Object(_e.a)({},Rt),we));function Mi(Zt){var Bt=Zt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(lt){var pn=Bt.getAttribute("src");On(pn),ti("image")}}else if(Bt.tagName.toUpperCase()==="A"){var jt=Bt.getAttribute("href");if(jt.indexOf("office")>-1)Zt.preventDefault(),On(jt),ti("office");else if(jt.indexOf("application/pdf")>-1)Zt.preventDefault(),On(jt),ti("pdf");else if(jt.indexOf("type=text")>-1)Zt.preventDefault(),On(jt),ti("html");else if(jt.startsWith("#")){Zt.preventDefault();var en=document.getElementById(jt.replace("#",""));en&&en.scrollIntoView(!0)}}}var Oi=function(){var Bt,pn=(Bt=Fn.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");pn==null||pn.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(w.a.isSupported()){var en=new w.a;en.loadSource(jt.src),en.attachMedia(jt)}}})};Object(V.useEffect)(function(){if(Fn.current&&Zn&&(Zn.match(Ai)&&window.PR.prettyPrint()),Fn.current)return Fn.current.addEventListener("click",Mi),function(){Fn.current.removeEventListener("click",Mi),Y(),$e()}},[Zn,Fn.current,Mi]);var dr=function(Bt){if(!d)return;Bt.target.nodeName==="IMG"?(an.current.style.display="flex",an.current.style.width=Bt.target.clientWidth+"px",an.current.style.height=Bt.target.clientHeight+"px",an.current.style.top=Bt.target.offsetTop+"px",an.current.style.left=Bt.target.offsetLeft+"px",Gn.current.src=Bt.target.getAttribute("src")):an.current.style.display="none"};return M.a.createElement("div",{style:{position:"relative"}},M.a.createElement("div",{ref:Fn,style:Object(_e.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(Te.a,null,M.a.createElement(Pe.a,{onClick:function(){return cr()}},"\u88C1\u526A"),M.a.createElement(Pe.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(Se.a,{close:!0,data:Un,hasMask:Ie,type:Un!=null&&Un.length?fi:"",style:Object(_e.a)({},jn),onClose:function(){return On("")}}))}},"9VGf":function(wt,rt,T){"use strict";T.d(rt,"a",function(){return de});var K=T("q1tI"),Te=T.n(K);function de(Pe,_e){var re=Object(K.useRef)();Object(K.useEffect)(function(){re.current=Pe}),Object(K.useEffect)(function(){function j(){re.current()}if(_e!==null){var Q=setInterval(j,_e);return function(){return clearInterval(Q)}}},[_e])}},"9ivq":function(wt,rt,T){},Bd2K:function(wt,rt,T){(function(K){K(T("VrN/"),T("osHv"))})(function(K){K.defineOption("autoCloseTags",!1,function(ie,V,M){if(M!=K.Init&&M&&ie.removeKeyMap("autoCloseTags"),!V)return;var O={name:"autoCloseTags"};(typeof V!="object"||V.whenClosing!==!1)&&(O["'/'"]=function(ve){return re(ve)}),(typeof V!="object"||V.whenOpening!==!1)&&(O["'>'"]=function(ve){return Pe(ve)}),ie.addKeyMap(O)});var Te=["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 Pe(ie){if(ie.getOption("disableInput"))return K.Pass;for(var V=ie.listSelections(),M=[],O=ie.getOption("autoCloseTags"),ve=0;ve<V.length;ve++){if(!V[ve].empty())return K.Pass;var oe=V[ve].head,Z=ie.getTokenAt(oe),q=K.innerMode(ie.getMode(),Z.state),z=q.state,me=q.mode.xmlCurrentTag&&q.mode.xmlCurrentTag(z),ue=me&&me.name;if(!ue)return K.Pass;var He=q.mode.configuration=="html",$e=typeof O=="object"&&O.dontCloseTags||He&&Te,we=typeof O=="object"&&O.indentTags||He&&de;Z.end>oe.ch&&(ue=ue.slice(0,ue.length-Z.end+oe.ch));var be=ue.toLowerCase();if(!ue||Z.type=="string"&&(Z.end!=oe.ch||!/[\"\']/.test(Z.string.charAt(Z.string.length-1))||Z.string.length==1)||Z.type=="tag"&&me.close||Z.string.indexOf("/")==oe.ch-Z.start-1||$e&&j($e,be)>-1||Q(ie,q.mode.xmlCurrentContext&&q.mode.xmlCurrentContext(z)||[],ue,oe,!0))return K.Pass;var Ve=typeof O=="object"&&O.emptyTags;if(Ve&&j(Ve,ue)>-1){M[ve]={text:"/>",newPos:K.Pos(oe.line,oe.ch+2)};continue}var fe=we&&j(we,be)>-1;M[ve]={indent:fe,text:">"+(fe?`
|
|
|
|
`:"")+"</"+ue+">",newPos:fe?K.Pos(oe.line+1,0):K.Pos(oe.line,oe.ch+1)}}for(var ke=typeof O=="object"&&O.dontIndentOnAutoClose,ve=V.length-1;ve>=0;ve--){var Be=M[ve];ie.replaceRange(Be.text,V[ve].head,V[ve].anchor,"+insert");var he=ie.listSelections().slice(0);he[ve]={head:Be.newPos,anchor:Be.newPos},ie.setSelections(he),!ke&&Be.indent&&(ie.indentLine(Be.newPos.line,null,!0),ie.indentLine(Be.newPos.line+1,null,!0))}}function _e(ie,V){for(var M=ie.listSelections(),O=[],ve=V?"/":"</",oe=ie.getOption("autoCloseTags"),Z=typeof oe=="object"&&oe.dontIndentOnSlash,q=0;q<M.length;q++){if(!M[q].empty())return K.Pass;var z=M[q].head,me=ie.getTokenAt(z),ue=K.innerMode(ie.getMode(),me.state),He=ue.state;if(V&&(me.type=="string"||me.string.charAt(0)!="<"||me.start!=z.ch-1))return K.Pass;var $e,we=ue.mode.name!="xml"&&ie.getMode().name=="htmlmixed";if(we&&ue.mode.name=="javascript")$e=ve+"script";else if(we&&ue.mode.name=="css")$e=ve+"style";else{var be=ue.mode.xmlCurrentContext&&ue.mode.xmlCurrentContext(He);if(!be||be.length&&Q(ie,be,be[be.length-1],z))return K.Pass;$e=ve+be[be.length-1]}ie.getLine(z.line).charAt(me.end)!=">"&&($e+=">"),O[q]=$e}if(ie.replaceSelections(O),M=ie.listSelections(),!Z)for(var q=0;q<M.length;q++)(q==M.length-1||M[q].head.line<M[q+1].head.line)&&ie.indentLine(M[q].head.line)}function re(ie){return ie.getOption("disableInput")?K.Pass:_e(ie,!0)}K.commands.closeTag=function(ie){return _e(ie)};function j(ie,V){if(ie.indexOf)return ie.indexOf(V);for(var M=0,O=ie.length;M<O;++M)if(ie[M]==V)return M;return-1}function Q(ie,V,M,O,ve){if(!K.scanForClosingTag)return!1;var oe=Math.min(ie.lastLine()+1,O.line+500),Z=K.scanForClosingTag(ie,O,null,oe);if(!Z||Z.tag!=M)return!1;for(var q=ve?1:0,z=V.length-1;z>=0&&V[z]==M;z--)++q;O=Z.to;for(var z=1;z<q;z++){var me=K.scanForClosingTag(ie,O,null,oe);if(!me||me.tag!=M)return!1;O=me.to}return!0}})},BjJ7:function(wt,rt,T){"use strict";T.d(rt,"d",function(){return Te}),T.d(rt,"c",function(){return de}),T.d(rt,"e",function(){return Pe}),T.d(rt,"b",function(){return _e}),T.d(rt,"a",function(){return j});var K=T("m3rI");function Te(Q){var ie=!0;if(Q.length>0){for(var V=0;V<Q.length;V++)if(Q[V].compile_success==0||!Q[V].compile_success){ie=!1;break}}else ie=!1;return ie}function de(Q){for(var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",V=[],M=0;M<Q.length;M++){var O=Q[M],ve=ie?"".concat(ie,"/").concat(O.name):"".concat(O.name);V.push({title:O.name,isLeaf:!(O.type==="tree"),key:ve})}return V}function Pe(Q,ie,V){for(var M=0;M<Q.length;M++){var O=Q[M];if(O.key===ie){O.children=V;break}O.children&&Pe(O.children,ie,V)}return Q}function _e(Q,ie,V){var M;return function(){var O=this,ve=arguments,oe=function(){M=null,V||Q.apply(O,ve)},Z=V&&!M;clearTimeout(M),M=setTimeout(oe,ie),Z&&Q.apply(O,ve)}}var re=!0,j=K.a.API_SERVER},"C+DQ":function(wt,rt,T){},DlQD:function(wt,rt,T){(function(K,Te){wt.exports=Te()})(this,function(){"use strict";function K(W,B){for(var H=0;H<B.length;H++){var y=B[H];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(W,y.key,y)}}function Te(W,B,H){return B&&K(W.prototype,B),H&&K(W,H),W}function de(W,B){if(!W)return;if(typeof W=="string")return Pe(W,B);var H=Object.prototype.toString.call(W).slice(8,-1);if(H==="Object"&&W.constructor&&(H=W.constructor.name),H==="Map"||H==="Set")return Array.from(W);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return Pe(W,B)}function Pe(W,B){(B==null||B>W.length)&&(B=W.length);for(var H=0,y=new Array(B);H<B;H++)y[H]=W[H];return y}function _e(W,B){var H;if(typeof Symbol=="undefined"||W[Symbol.iterator]==null){if(Array.isArray(W)||(H=de(W))||B&&W&&typeof W.length=="number"){H&&(W=H);var y=0;return function(){return y>=W.length?{done:!0}:{done:!1,value:W[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 H=W[Symbol.iterator](),H.next.bind(H)}function re(W,B){return B={exports:{}},W(B,B.exports),B.exports}var j=re(function(W){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 H(y){W.exports.defaults=y}W.exports={defaults:B(),getDefaults:B,changeDefaults:H}}),Q=j.defaults,ie=j.getDefaults,V=j.changeDefaults,M=/[&<>"']/,O=/[&<>"']/g,ve=/[<>"']|&(?!#?\w+;)/,oe=/[<>"']|&(?!#?\w+;)/g,Z={"&":"&","<":"<",">":">",'"':""","'":"'"},q=function(B){return Z[B]};function z(W,B){if(B){if(M.test(W))return W.replace(O,q)}else if(ve.test(W))return W.replace(oe,q);return W}var me=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ue(W){return W.replace(me,function(B,H){return H=H.toLowerCase(),H==="colon"?":":H.charAt(0)==="#"?H.charAt(1)==="x"?String.fromCharCode(parseInt(H.substring(2),16)):String.fromCharCode(+H.substring(1)):""})}var He=/(^|[^\[])\^/g;function $e(W,B){W=W.source||W,B=B||"";var H={replace:function(x,S){return S=S.source||S,S=S.replace(He,"$1"),W=W.replace(x,S),H},getRegex:function(){return new RegExp(W,B)}};return H}var we=/[^\w:]/g,be=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ve(W,B,H){if(W){var y;try{y=decodeURIComponent(ue(H)).replace(we,"").toLowerCase()}catch(x){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}B&&!be.test(H)&&(H=C(B,H));try{H=encodeURI(H).replace(/%25/g,"%")}catch(x){return null}return H}var fe={},ke=/^[^:]+:\/*[^/]*$/,Be=/^([^:]+:)[\s\S]*$/,he=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C(W,B){fe[" "+W]||(ke.test(W)?fe[" "+W]=W+"/":fe[" "+W]=se(W,"/",!0)),W=fe[" "+W];var H=W.indexOf(":")===-1;return B.substring(0,2)==="//"?H?B:W.replace(Be,"$1")+B:B.charAt(0)==="/"?H?B:W.replace(he,"$1")+B:W+B}var ae={exec:function(){}};function Y(W){for(var B=1,H,y;B<arguments.length;B++){H=arguments[B];for(y in H)Object.prototype.hasOwnProperty.call(H,y)&&(W[y]=H[y])}return W}function A(W,B){var H=W.replace(/\|/g,function(S,E,ne){for(var G=!1,Oe=E;--Oe>=0&&ne[Oe]==="\\";)G=!G;return G?"|":" |"}),y=H.split(/ \|/),x=0;if(y.length>B)y.splice(B);else for(;y.length<B;)y.push("");for(;x<y.length;x++)y[x]=y[x].trim().replace(/\\\|/g,"|");return y}function se(W,B,H){var y=W.length;if(y===0)return"";for(var x=0;x<y;){var S=W.charAt(y-x-1);if(S===B&&!H)x++;else if(S!==B&&H)x++;else break}return W.substr(0,y-x)}function F(W,B){if(W.indexOf(B[1])===-1)return-1;for(var H=W.length,y=0,x=0;x<H;x++)if(W[x]==="\\")x++;else if(W[x]===B[0])y++;else if(W[x]===B[1]&&(y--,y<0))return x;return-1}function N(W){W&&W.sanitize&&!W.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var L={escape:z,unescape:ue,edit:$e,cleanUrl:Ve,resolveUrl:C,noopTest:ae,merge:Y,splitCells:A,rtrim:se,findClosingBracket:F,checkSanitizeDeprecation:N},m=j.defaults,f=L.rtrim,w=L.splitCells,P=L.escape,J=L.findClosingBracket;function Se(W,B,H){var y=B.href,x=B.title?P(B.title):null,S=W[1].replace(/\\([\[\]])/g,"$1");return W[0].charAt(0)!=="!"?{type:"link",raw:H,href:y,title:x,text:S}:{type:"image",raw:H,href:y,title:x,text:P(S)}}function Re(W,B){var H=W.match(/^(\s+)(?:```)/);if(H===null)return B;var y=H[1];return B.split(`
|
|
`).map(function(x){var S=x.match(/^\s+/);if(S===null)return x;var E=S[0];return E.length>=y.length?x.slice(y.length):x}).join(`
|
|
`)}var pe=function(){function W(H){this.options=H||m}var B=W.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 S=this.rules.block.code.exec(y);if(S){var E=x[x.length-1];if(E&&E.type==="paragraph")return{raw:S[0],text:S[0].trimRight()};var ne=S[0].replace(/^ {4}/gm,"");return{type:"code",raw:S[0],codeBlockStyle:"indented",text:this.options.pedantic?ne:f(ne,`
|
|
`)}}},B.fences=function(y){var x=this.rules.block.fences.exec(y);if(x){var S=x[0],E=Re(S,x[3]||"");return{type:"code",raw:S,lang:x[2]?x[2].trim():x[2],text:E}}},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 S={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(S.header.length===S.align.length){var E=S.align.length,ne;for(ne=0;ne<E;ne++)/^ *-+: *$/.test(S.align[ne])?S.align[ne]="right":/^ *:-+: *$/.test(S.align[ne])?S.align[ne]="center":/^ *:-+ *$/.test(S.align[ne])?S.align[ne]="left":S.align[ne]=null;for(E=S.cells.length,ne=0;ne<E;ne++)S.cells[ne]=w(S.cells[ne],S.header.length);return S}}},B.hr=function(y){var x=this.rules.block.hr.exec(y);if(x)return{type:"hr",raw:x[0]}},B.blockquote=function(y){var x=this.rules.block.blockquote.exec(y);if(x){var S=x[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:x[0],text:S}}},B.list=function(y){var x=this.rules.block.list.exec(y);if(x){for(var S=x[0],E=x[2],ne=E.length>1,G=E[E.length-1]===")",Oe={type:"list",raw:S,ordered:ne,start:ne?+E.slice(0,-1):"",loose:!1,items:[]},Ye=x[0].match(this.rules.block.item),nt=!1,Ke,Et,Ct,at,Ht,Nt,Tt,Ot=Ye.length,_t=0;_t<Ot;_t++)Ke=Ye[_t],S=Ke,Et=Ke.length,Ke=Ke.replace(/^ *([*+-]|\d+[.)]) */,""),~Ke.indexOf(`
|
|
`)&&(Et-=Ke.length,Ke=this.options.pedantic?Ke.replace(/^ {1,4}/gm,""):Ke.replace(new RegExp("^ {1,"+Et+"}","gm"),"")),_t!==Ot-1&&(Ct=this.rules.block.bullet.exec(Ye[_t+1])[0],(ne?Ct.length===1||!G&&Ct[Ct.length-1]===")":Ct.length>1||this.options.smartLists&&Ct!==E)&&(at=Ye.slice(_t+1).join(`
|
|
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-at.length),_t=Ot-1)),Ht=nt||/\n\n(?!\s*$)/.test(Ke),_t!==Ot-1&&(nt=Ke.charAt(Ke.length-1)===`
|
|
`,Ht||(Ht=nt)),Ht&&(Oe.loose=!0),Nt=/^\[[ xX]\] /.test(Ke),Tt=void 0,Nt&&(Tt=Ke[1]!==" ",Ke=Ke.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:S,task:Nt,checked:Tt,loose:Ht,text:Ke});return Oe}},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 S=x[1].toLowerCase().replace(/\s+/g," ");return{tag:S,raw:x[0],href:x[2],title:x[3]}}},B.table=function(y){var x=this.rules.block.table.exec(y);if(x){var S={type:"table",header:w(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
|
|
`):[]};if(S.header.length===S.align.length){S.raw=x[0];var E=S.align.length,ne;for(ne=0;ne<E;ne++)/^ *-+: *$/.test(S.align[ne])?S.align[ne]="right":/^ *:-+: *$/.test(S.align[ne])?S.align[ne]="center":/^ *:-+ *$/.test(S.align[ne])?S.align[ne]="left":S.align[ne]=null;for(E=S.cells.length,ne=0;ne<E;ne++)S.cells[ne]=w(S.cells[ne].replace(/^ *\| *| *\| *$/g,""),S.header.length);return S}}},B.lheading=function(y){var x=this.rules.block.lheading.exec(y);if(x)return{type:"heading",raw:x[0],depth:x[2].charAt(0)==="="?1:2,text:x[1]}},B.paragraph=function(y){var x=this.rules.block.paragraph.exec(y);if(x)return{type:"paragraph",raw:x[0],text:x[1].charAt(x[1].length-1)===`
|
|
`?x[1].slice(0,-1):x[1]}},B.text=function(y,x){var S=this.rules.block.text.exec(y);if(S){var E=x[x.length-1];return E&&E.type==="text"?{raw:S[0],text:S[0]}:{type:"text",raw:S[0],text:S[0]}}},B.escape=function(y){var x=this.rules.inline.escape.exec(y);if(x)return{type:"escape",raw:x[0],text:P(x[1])}},B.tag=function(y,x,S){var E=this.rules.inline.tag.exec(y);if(E)return!x&&/^<a /i.test(E[0])?x=!0:x&&/^<\/a>/i.test(E[0])&&(x=!1),!S&&/^<(pre|code|kbd|script)(\s|>)/i.test(E[0])?S=!0:S&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(E[0])&&(S=!1),{type:this.options.sanitize?"text":"html",raw:E[0],inLink:x,inRawBlock:S,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(E[0]):P(E[0]):E[0]}},B.link=function(y){var x=this.rules.inline.link.exec(y);if(x){var S=J(x[2],"()");if(S>-1){var E=x[0].indexOf("!")===0?5:4,ne=E+x[1].length+S;x[2]=x[2].substring(0,S),x[0]=x[0].substring(0,ne).trim(),x[3]=""}var G=x[2],Oe="";if(this.options.pedantic){var Ye=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(G);Ye?(G=Ye[1],Oe=Ye[3]):Oe=""}else Oe=x[3]?x[3].slice(1,-1):"";G=G.trim().replace(/^<([\s\S]*)>$/,"$1");var nt=Se(x,{href:G&&G.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},x[0]);return nt}},B.reflink=function(y,x){var S;if((S=this.rules.inline.reflink.exec(y))||(S=this.rules.inline.nolink.exec(y))){var E=(S[2]||S[1]).replace(/\s+/g," ");if(E=x[E.toLowerCase()],!E||!E.href){var ne=S[0].charAt(0);return{type:"text",raw:ne,text:ne}}var G=Se(S,E,S[0]);return G}},B.strong=function(y,x,S){S===void 0&&(S="");var E=this.rules.inline.strong.start.exec(y);if(E&&(!E[1]||E[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){x=x.slice(-1*y.length);var ne=E[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ne.lastIndex=0;for(var G;(E=ne.exec(x))!=null;)if(G=this.rules.inline.strong.middle.exec(x.slice(0,E.index+3)),G)return{type:"strong",raw:y.slice(0,G[0].length),text:y.slice(2,G[0].length-2)}}},B.em=function(y,x,S){S===void 0&&(S="");var E=this.rules.inline.em.start.exec(y);if(E&&(!E[1]||E[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){x=x.slice(-1*y.length);var ne=E[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ne.lastIndex=0;for(var G;(E=ne.exec(x))!=null;)if(G=this.rules.inline.em.middle.exec(x.slice(0,E.index+2)),G)return{type:"em",raw:y.slice(0,G[0].length),text:y.slice(1,G[0].length-1)}}},B.codespan=function(y){var x=this.rules.inline.code.exec(y);if(x){var S=x[2].replace(/\n/g," "),E=/[^ ]/.test(S),ne=S.startsWith(" ")&&S.endsWith(" ");return E&&ne&&(S=S.substring(1,S.length-1)),S=P(S,!0),{type:"codespan",raw:x[0],text:S}}},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 S=this.rules.inline.autolink.exec(y);if(S){var E,ne;return S[2]==="@"?(E=P(this.options.mangle?x(S[1]):S[1]),ne="mailto:"+E):(E=P(S[1]),ne=E),{type:"link",raw:S[0],text:E,href:ne,tokens:[{type:"text",raw:E,text:E}]}}},B.url=function(y,x){var S;if(S=this.rules.inline.url.exec(y)){var E,ne;if(S[2]==="@")E=P(this.options.mangle?x(S[0]):S[0]),ne="mailto:"+E;else{var G;do G=S[0],S[0]=this.rules.inline._backpedal.exec(S[0])[0];while(G!==S[0]);E=P(S[0]),S[1]==="www."?ne="http://"+E:ne=E}return{type:"link",raw:S[0],text:E,href:ne,tokens:[{type:"text",raw:E,text:E}]}}},B.inlineText=function(y,x,S){var E=this.rules.inline.text.exec(y);if(E){var ne;return x?ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(E[0]):P(E[0]):E[0]:ne=P(this.options.smartypants?S(E[0]):E[0]),{type:"text",raw:E[0],text:ne}}},W}(),ye=L.noopTest,ge=L.edit,ce=L.merge,$={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ye,table:ye,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};$._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,$._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,$.def=ge($.def).replace("label",$._label).replace("title",$._title).getRegex(),$.bullet=/(?:[*+-]|\d{1,9}[.)])/,$.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,$.item=ge($.item,"gm").replace(/bull/g,$.bullet).getRegex(),$.list=ge($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex(),$._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",$._comment=/<!--(?!-?>)[\s\S]*?-->/,$.html=ge($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$.paragraph=ge($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",$._tag).getRegex(),$.blockquote=ge($.blockquote).replace("paragraph",$.paragraph).getRegex(),$.normal=ce({},$),$.gfm=ce({},$.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*|$)"}),$.gfm.nptable=ge($.gfm.nptable).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",$._tag).getRegex(),$.gfm.table=ge($.gfm.table).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",$._tag).getRegex(),$.pedantic=ce({},$.normal,{html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ye,paragraph:ge($.normal._paragraph).replace("hr",$.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var U={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ye,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\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:ye,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};U._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",U.punctuation=ge(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U.em.start=ge(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=ge(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=ge(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=ge(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=ge(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=ge(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/blockSkip/g,U._blockSkip).getRegex(),U.strong.endAst=ge(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=ge(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=ge(U._blockSkip,"g").getRegex(),U.overlapSkip=ge(U._overlapSkip,"g").getRegex(),U._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,U._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,U._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])?)+(?![-_])/,U.autolink=ge(U.autolink).replace("scheme",U._scheme).replace("email",U._email).getRegex(),U._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,U.tag=ge(U.tag).replace("comment",$._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=ge(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=ge(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=ge(U.reflinkSearch,"g").replace("reflink",U.reflink).replace("nolink",U.nolink).getRegex(),U.normal=ce({},U),U.pedantic=ce({},U.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:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=ce({},U.normal,{escape:ge(U.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]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),U.gfm.url=ge(U.gfm.url,"i").replace("email",U.gfm._extended_email).getRegex(),U.breaks=ce({},U.gfm,{br:ge(U.br).replace("{2,}","*").getRegex(),text:ge(U.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:$,inline:U},R=j.defaults,k=b.block,le=b.inline;function xe(W){return W.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function X(W){var B="",H,y,x=W.length;for(H=0;H<x;H++)y=W.charCodeAt(H),Math.random()>.5&&(y="x"+y.toString(16)),B+="&#"+y+";";return B}var Ce=function(){function W(H){this.tokens=[],this.tokens.links=Object.create(null),this.options=H||R,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var y={block:k.normal,inline:le.normal};this.options.pedantic?(y.block=k.pedantic,y.inline=le.pedantic):this.options.gfm&&(y.block=k.gfm,this.options.breaks?y.inline=le.breaks:y.inline=le.gfm),this.tokenizer.rules=y}W.lex=function(y,x){var S=new W(x);return S.lex(y)};var B=W.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,S){x===void 0&&(x=[]),S===void 0&&(S=!0),y=y.replace(/^ +$/gm,"");for(var E,ne,G,Oe;y;){if(E=this.tokenizer.space(y)){y=y.substring(E.raw.length),E.type&&x.push(E);continue}if(E=this.tokenizer.code(y,x)){y=y.substring(E.raw.length),E.type?x.push(E):(Oe=x[x.length-1],Oe.raw+=`
|
|
`+E.raw,Oe.text+=`
|
|
`+E.text);continue}if(E=this.tokenizer.fences(y)){y=y.substring(E.raw.length),x.push(E);continue}if(E=this.tokenizer.heading(y)){y=y.substring(E.raw.length),x.push(E);continue}if(E=this.tokenizer.nptable(y)){y=y.substring(E.raw.length),x.push(E);continue}if(E=this.tokenizer.hr(y)){y=y.substring(E.raw.length),x.push(E);continue}if(E=this.tokenizer.blockquote(y)){y=y.substring(E.raw.length),E.tokens=this.blockTokens(E.text,[],S),x.push(E);continue}if(E=this.tokenizer.list(y)){for(y=y.substring(E.raw.length),G=E.items.length,ne=0;ne<G;ne++)E.items[ne].tokens=this.blockTokens(E.items[ne].text,[],!1);x.push(E);continue}if(E=this.tokenizer.html(y)){y=y.substring(E.raw.length),x.push(E);continue}if(S&&(E=this.tokenizer.def(y))){y=y.substring(E.raw.length),this.tokens.links[E.tag]||(this.tokens.links[E.tag]={href:E.href,title:E.title});continue}if(E=this.tokenizer.table(y)){y=y.substring(E.raw.length),x.push(E);continue}if(E=this.tokenizer.lheading(y)){y=y.substring(E.raw.length),x.push(E);continue}if(S&&(E=this.tokenizer.paragraph(y))){y=y.substring(E.raw.length),x.push(E);continue}if(E=this.tokenizer.text(y,x)){y=y.substring(E.raw.length),E.type?x.push(E):(Oe=x[x.length-1],Oe.raw+=`
|
|
`+E.raw,Oe.text+=`
|
|
`+E.text);continue}if(y){var Ye="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return x},B.inline=function(y){var x,S,E,ne,G,Oe,Ye=y.length;for(x=0;x<Ye;x++){Oe=y[x];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},ne=Oe.header.length,S=0;S<ne;S++)Oe.tokens.header[S]=[],this.inlineTokens(Oe.header[S],Oe.tokens.header[S]);for(ne=Oe.cells.length,S=0;S<ne;S++)for(G=Oe.cells[S],Oe.tokens.cells[S]=[],E=0;E<G.length;E++)Oe.tokens.cells[S][E]=[],this.inlineTokens(G[E],Oe.tokens.cells[S][E]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(ne=Oe.items.length,S=0;S<ne;S++)this.inline(Oe.items[S].tokens);break}}}return y},B.inlineTokens=function(y,x,S,E,ne){x===void 0&&(x=[]),S===void 0&&(S=!1),E===void 0&&(E=!1),ne===void 0&&(ne="");var G,Oe=y,Ye;if(this.tokens.links){var nt=Object.keys(this.tokens.links);if(nt.length>0)for(;(Ye=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)nt.includes(Ye[0].slice(Ye[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ye=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;y;){if(G=this.tokenizer.escape(y)){y=y.substring(G.raw.length),x.push(G);continue}if(G=this.tokenizer.tag(y,S,E)){y=y.substring(G.raw.length),S=G.inLink,E=G.inRawBlock,x.push(G);continue}if(G=this.tokenizer.link(y)){y=y.substring(G.raw.length),G.type==="link"&&(G.tokens=this.inlineTokens(G.text,[],!0,E)),x.push(G);continue}if(G=this.tokenizer.reflink(y,this.tokens.links)){y=y.substring(G.raw.length),G.type==="link"&&(G.tokens=this.inlineTokens(G.text,[],!0,E)),x.push(G);continue}if(G=this.tokenizer.strong(y,Oe,ne)){y=y.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],S,E),x.push(G);continue}if(G=this.tokenizer.em(y,Oe,ne)){y=y.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],S,E),x.push(G);continue}if(G=this.tokenizer.codespan(y)){y=y.substring(G.raw.length),x.push(G);continue}if(G=this.tokenizer.br(y)){y=y.substring(G.raw.length),x.push(G);continue}if(G=this.tokenizer.del(y)){y=y.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],S,E),x.push(G);continue}if(G=this.tokenizer.autolink(y,X)){y=y.substring(G.raw.length),x.push(G);continue}if(!S&&(G=this.tokenizer.url(y,X))){y=y.substring(G.raw.length),x.push(G);continue}if(G=this.tokenizer.inlineText(y,E,xe)){y=y.substring(G.raw.length),ne=G.raw.slice(-1),x.push(G);continue}if(y){var Ke="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return x},Te(W,null,[{key:"rules",get:function(){return{block:k,inline:le}}}]),W}(),Me=j.defaults,Ge=L.cleanUrl,je=L.escape,Ne=function(){function W(H){this.options=H||Me}var B=W.prototype;return B.code=function(y,x,S){var E=(x||"").match(/\S*/)[0];if(this.options.highlight){var ne=this.options.highlight(y,E);ne!=null&&ne!==y&&(S=!0,y=ne)}return E?'<pre><code class="'+this.options.langPrefix+je(E,!0)+'">'+(S?y:je(y,!0))+`</code></pre>
|
|
`:"<pre><code>"+(S?y:je(y,!0))+`</code></pre>
|
|
`},B.blockquote=function(y){return`<blockquote>
|
|
`+y+`</blockquote>
|
|
`},B.html=function(y){return y},B.heading=function(y,x,S,E){return this.options.headerIds?"<h"+x+' id="'+this.options.headerPrefix+E.slug(S)+'">'+y+"</h"+x+`>
|
|
`:"<h"+x+">"+y+"</h"+x+`>
|
|
`},B.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},B.list=function(y,x,S){var E=x?"ol":"ul",ne=x&&S!==1?' start="'+S+'"':"";return"<"+E+ne+`>
|
|
`+y+"</"+E+`>
|
|
`},B.listitem=function(y){return"<li>"+y+`</li>
|
|
`},B.checkbox=function(y){return"<input "+(y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},B.paragraph=function(y){return"<p>"+y+`</p>
|
|
`},B.table=function(y,x){return x&&(x="<tbody>"+x+"</tbody>"),`<table>
|
|
<thead>
|
|
`+y+`</thead>
|
|
`+x+`</table>
|
|
`},B.tablerow=function(y){return`<tr>
|
|
`+y+`</tr>
|
|
`},B.tablecell=function(y,x){var S=x.header?"th":"td",E=x.align?"<"+S+' align="'+x.align+'">':"<"+S+">";return E+y+"</"+S+`>
|
|
`},B.strong=function(y){return"<strong>"+y+"</strong>"},B.em=function(y){return"<em>"+y+"</em>"},B.codespan=function(y){return"<code>"+y+"</code>"},B.br=function(){return this.options.xhtml?"<br/>":"<br>"},B.del=function(y){return"<del>"+y+"</del>"},B.link=function(y,x,S){if(y=Ge(this.options.sanitize,this.options.baseUrl,y),y===null)return S;var E='<a href="'+je(y)+'"';return x&&(E+=' title="'+x+'"'),E+=">"+S+"</a>",E},B.image=function(y,x,S){if(y=Ge(this.options.sanitize,this.options.baseUrl,y),y===null)return S;var E='<img src="'+y+'" alt="'+S+'"';return x&&(E+=' title="'+x+'"'),E+=this.options.xhtml?"/>":">",E},B.text=function(y){return y},W}(),Fe=function(){function W(){}var B=W.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,S){return""+S},B.image=function(y,x,S){return""+S},B.br=function(){return""},W}(),dt=function(){function W(){this.seen={}}var B=W.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 S=x;do this.seen[S]++,x=S+"-"+this.seen[S];while(this.seen.hasOwnProperty(x))}return this.seen[x]=0,x},W}(),Qe=j.defaults,et=L.unescape,tt=function(){function W(H){this.options=H||Qe,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fe,this.slugger=new dt}W.parse=function(y,x){var S=new W(x);return S.parse(y)};var B=W.prototype;return B.parse=function(y,x){x===void 0&&(x=!0);var S="",E,ne,G,Oe,Ye,nt,Ke,Et,Ct,at,Ht,Nt,Tt,Ot,_t,bn,ai,vt,Kn=y.length;for(E=0;E<Kn;E++){at=y[E];switch(at.type){case"space":continue;case"hr":{S+=this.renderer.hr();continue}case"heading":{S+=this.renderer.heading(this.parseInline(at.tokens),at.depth,et(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{S+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(Et="",Ke="",Oe=at.header.length,ne=0;ne<Oe;ne++)Ke+=this.renderer.tablecell(this.parseInline(at.tokens.header[ne]),{header:!0,align:at.align[ne]});for(Et+=this.renderer.tablerow(Ke),Ct="",Oe=at.cells.length,ne=0;ne<Oe;ne++){for(nt=at.tokens.cells[ne],Ke="",Ye=nt.length,G=0;G<Ye;G++)Ke+=this.renderer.tablecell(this.parseInline(nt[G]),{header:!1,align:at.align[G]});Ct+=this.renderer.tablerow(Ke)}S+=this.renderer.table(Et,Ct);continue}case"blockquote":{Ct=this.parse(at.tokens),S+=this.renderer.blockquote(Ct);continue}case"list":{for(Ht=at.ordered,Nt=at.start,Tt=at.loose,Oe=at.items.length,Ct="",ne=0;ne<Oe;ne++)_t=at.items[ne],bn=_t.checked,ai=_t.task,Ot="",_t.task&&(vt=this.renderer.checkbox(bn),Tt?_t.tokens.length>0&&_t.tokens[0].type==="text"?(_t.tokens[0].text=vt+" "+_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=vt+" "+_t.tokens[0].tokens[0].text)):_t.tokens.unshift({type:"text",text:vt}):Ot+=vt),Ot+=this.parse(_t.tokens,Tt),Ct+=this.renderer.listitem(Ot,ai,bn);S+=this.renderer.list(Ct,Ht,Nt);continue}case"html":{S+=this.renderer.html(at.text);continue}case"paragraph":{S+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(Ct=at.tokens?this.parseInline(at.tokens):at.text;E+1<Kn&&y[E+1].type==="text";)at=y[++E],Ct+=`
|
|
`+(at.tokens?this.parseInline(at.tokens):at.text);S+=x?this.renderer.paragraph(Ct):Ct;continue}default:{var on='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(on);return}else throw new Error(on)}}}return S},B.parseInline=function(y,x){x=x||this.renderer;var S="",E,ne,G=y.length;for(E=0;E<G;E++){ne=y[E];switch(ne.type){case"escape":{S+=x.text(ne.text);break}case"html":{S+=x.html(ne.text);break}case"link":{S+=x.link(ne.href,ne.title,this.parseInline(ne.tokens,x));break}case"image":{S+=x.image(ne.href,ne.title,ne.text);break}case"strong":{S+=x.strong(this.parseInline(ne.tokens,x));break}case"em":{S+=x.em(this.parseInline(ne.tokens,x));break}case"codespan":{S+=x.codespan(ne.text);break}case"br":{S+=x.br();break}case"del":{S+=x.del(this.parseInline(ne.tokens,x));break}case"text":{S+=x.text(ne.text);break}default:{var Oe='Token with "'+ne.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return S},W}(),mt=L.merge,ht=L.checkSanitizeDeprecation,st=L.escape,Ee=j.getDefaults,pt=j.changeDefaults,ot=j.defaults;function Le(W,B,H){if(typeof W=="undefined"||W===null)throw new Error("marked(): input parameter is undefined or null");if(typeof W!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(W)+", string expected");if(typeof B=="function"&&(H=B,B=null),B=mt({},Le.defaults,B||{}),ht(B),H){var y=B.highlight,x;try{x=Ce.lex(W,B)}catch(G){return H(G)}var S=function(Oe){var Ye;if(!Oe)try{Ye=tt.parse(x,B)}catch(nt){Oe=nt}return B.highlight=y,Oe?H(Oe):H(null,Ye)};if(!y||y.length<3)return S();if(delete B.highlight,!x.length)return S();var E=0;Le.walkTokens(x,function(G){G.type==="code"&&(E++,setTimeout(function(){y(G.text,G.lang,function(Oe,Ye){if(Oe)return S(Oe);Ye!=null&&Ye!==G.text&&(G.text=Ye,G.escaped=!0),E--,E===0&&S()})},0))}),E===0&&S();return}try{var ne=Ce.lex(W,B);return B.walkTokens&&Le.walkTokens(ne,B.walkTokens),tt.parse(ne,B)}catch(G){if(G.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,B.silent)return"<p>An error occurred:</p><pre>"+st(G.message+"",!0)+"</pre>";throw G}}Le.options=Le.setOptions=function(W){return mt(Le.defaults,W),pt(Le.defaults),Le},Le.getDefaults=Ee,Le.defaults=ot,Le.use=function(W){var B=mt({},W);if(W.renderer&&function(){var y=Le.defaults.renderer||new Ne,x=function(ne){var G=y[ne];y[ne]=function(){for(var Oe=arguments.length,Ye=new Array(Oe),nt=0;nt<Oe;nt++)Ye[nt]=arguments[nt];var Ke=W.renderer[ne].apply(y,Ye);return Ke===!1&&(Ke=G.apply(y,Ye)),Ke}};for(var S in W.renderer)x(S);B.renderer=y}(),W.tokenizer&&function(){var y=Le.defaults.tokenizer||new pe,x=function(ne){var G=y[ne];y[ne]=function(){for(var Oe=arguments.length,Ye=new Array(Oe),nt=0;nt<Oe;nt++)Ye[nt]=arguments[nt];var Ke=W.tokenizer[ne].apply(y,Ye);return Ke===!1&&(Ke=G.apply(y,Ye)),Ke}};for(var S in W.tokenizer)x(S);B.tokenizer=y}(),W.walkTokens){var H=Le.defaults.walkTokens;B.walkTokens=function(y){W.walkTokens(y),H&&H(y)}}Le.setOptions(B)},Le.walkTokens=function(W,B){for(var H=_e(W),y;!(y=H()).done;){var x=y.value;B(x);switch(x.type){case"table":{for(var S=_e(x.tokens.header),E;!(E=S()).done;){var ne=E.value;Le.walkTokens(ne,B)}for(var G=_e(x.tokens.cells),Oe;!(Oe=G()).done;)for(var Ye=Oe.value,nt=_e(Ye),Ke;!(Ke=nt()).done;){var Et=Ke.value;Le.walkTokens(Et,B)}break}case"list":{Le.walkTokens(x.items,B);break}default:x.tokens&&Le.walkTokens(x.tokens,B)}}},Le.Parser=tt,Le.parser=tt.parse,Le.Renderer=Ne,Le.TextRenderer=Fe,Le.Lexer=Ce,Le.lexer=Ce.lex,Le.Tokenizer=pe,Le.Slugger=dt,Le.parse=Le;var ze=Le;return ze})},ELLl:function(wt,rt,T){(function(K){K(T("VrN/"))})(function(K){var Te={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},de=K.Pos;K.defineOption("autoCloseBrackets",!1,function(Z,q,z){z&&z!=K.Init&&(Z.removeKeyMap(_e),Z.state.closeBrackets=null),q&&(re(Pe(q,"pairs")),Z.state.closeBrackets=q,Z.addKeyMap(_e))});function Pe(Z,q){return q=="pairs"&&typeof Z=="string"?Z:typeof Z=="object"&&Z[q]!=null?Z[q]:Te[q]}var _e={Backspace:ie,Enter:V};function re(Z){for(var q=0;q<Z.length;q++){var z=Z.charAt(q),me="'"+z+"'";_e[me]||(_e[me]=j(z))}}re(Te.pairs+"`");function j(Z){return function(q){return O(q,Z)}}function Q(Z){var q=Z.state.closeBrackets;if(!q||q.override)return q;var z=Z.getModeAt(Z.getCursor());return z.closeBrackets||q}function ie(Z){var q=Q(Z);if(!q||Z.getOption("disableInput"))return K.Pass;for(var z=Pe(q,"pairs"),me=Z.listSelections(),ue=0;ue<me.length;ue++){if(!me[ue].empty())return K.Pass;var He=ve(Z,me[ue].head);if(!He||z.indexOf(He)%2!=0)return K.Pass}for(var ue=me.length-1;ue>=0;ue--){var $e=me[ue].head;Z.replaceRange("",de($e.line,$e.ch-1),de($e.line,$e.ch+1),"+delete")}}function V(Z){var q=Q(Z),z=q&&Pe(q,"explode");if(!z||Z.getOption("disableInput"))return K.Pass;for(var me=Z.listSelections(),ue=0;ue<me.length;ue++){if(!me[ue].empty())return K.Pass;var He=ve(Z,me[ue].head);if(!He||z.indexOf(He)%2!=0)return K.Pass}Z.operation(function(){var $e=Z.lineSeparator()||`
|
|
`;Z.replaceSelection($e+$e,null),Z.execCommand("goCharLeft"),me=Z.listSelections();for(var we=0;we<me.length;we++){var be=me[we].head.line;Z.indentLine(be,null,!0),Z.indentLine(be+1,null,!0)}})}function M(Z){var q=K.cmpPos(Z.anchor,Z.head)>0;return{anchor:new de(Z.anchor.line,Z.anchor.ch+(q?-1:1)),head:new de(Z.head.line,Z.head.ch+(q?1:-1))}}function O(Z,q){var z=Q(Z);if(!z||Z.getOption("disableInput"))return K.Pass;var me=Pe(z,"pairs"),ue=me.indexOf(q);if(ue==-1)return K.Pass;for(var He=Pe(z,"closeBefore"),$e=Pe(z,"triples"),we=me.charAt(ue+1)==q,be=Z.listSelections(),Ve=ue%2==0,fe,ke=0;ke<be.length;ke++){var Be=be[ke],he=Be.head,C,ae=Z.getRange(he,de(he.line,he.ch+1));if(Ve&&!Be.empty())C="surround";else if((we||!Ve)&&ae==q)we&&oe(Z,he)?C="both":$e.indexOf(q)>=0&&Z.getRange(he,de(he.line,he.ch+3))==q+q+q?C="skipThree":C="skip";else if(we&&he.ch>1&&$e.indexOf(q)>=0&&Z.getRange(de(he.line,he.ch-2),he)==q+q){if(he.ch>2&&/\bstring/.test(Z.getTokenTypeAt(de(he.line,he.ch-2))))return K.Pass;C="addFour"}else if(we){var Y=he.ch==0?" ":Z.getRange(de(he.line,he.ch-1),he);if(!K.isWordChar(ae)&&Y!=q&&!K.isWordChar(Y))C="both";else return K.Pass}else if(Ve&&(ae.length===0||/\s/.test(ae)||He.indexOf(ae)>-1))C="both";else return K.Pass;if(!fe)fe=C;else if(fe!=C)return K.Pass}var A=ue%2?me.charAt(ue-1):q,se=ue%2?q:me.charAt(ue+1);Z.operation(function(){if(fe=="skip")Z.execCommand("goCharRight");else if(fe=="skipThree")for(var F=0;F<3;F++)Z.execCommand("goCharRight");else if(fe=="surround"){for(var N=Z.getSelections(),F=0;F<N.length;F++)N[F]=A+N[F]+se;Z.replaceSelections(N,"around"),N=Z.listSelections().slice();for(var F=0;F<N.length;F++)N[F]=M(N[F]);Z.setSelections(N)}else fe=="both"?(Z.replaceSelection(A+se,null),Z.triggerElectric(A+se),Z.execCommand("goCharLeft")):fe=="addFour"&&(Z.replaceSelection(A+A+A+A,"before"),Z.execCommand("goCharRight"))})}function ve(Z,q){var z=Z.getRange(de(q.line,q.ch-1),de(q.line,q.ch+1));return z.length==2?z:null}function oe(Z,q){var z=Z.getTokenAt(de(q.line,q.ch+1));return/\bstring/.test(z.type)&&z.start==q.ch&&(q.ch==0||!/\bstring/.test(Z.getTokenTypeAt(q)))}})},GfqC:function(wt,rt,T){"use strict";var K=T("q1tI"),Te=T.n(K),de=T("TSYQ"),Pe=T.n(de);function _e(L,m){var f="cannot "+L.method+" "+L.action+" "+m.status+"'",w=new Error(f);return w.status=m.status,w.method=L.method,w.url=L.action,w}function re(L){var m=L.responseText||L.response;if(!m)return m;try{return JSON.parse(m)}catch(f){return m}}function j(L){var m=new XMLHttpRequest;L.onProgress&&m.upload&&(m.upload.onprogress=function(J){J.total>0&&(J.percent=J.loaded/J.total*100),L.onProgress(J)});var f=new FormData;L.data&&Object.keys(L.data).forEach(function(P){var J=L.data[P];if(Array.isArray(J)){J.forEach(function(Se){f.append(P+"[]",Se)});return}f.append(P,L.data[P])}),L.file instanceof Blob?f.append(L.filename,L.file,L.file.name):f.append(L.filename,L.file),m.onerror=function(J){L.onError(J)},m.onload=function(){return m.status<200||m.status>=300?L.onError(_e(L,m),re(m)):L.onSuccess(re(m),m)},m.open(L.method,L.action,!0),L.withCredentials&&"withCredentials"in m&&(m.withCredentials=!0);var w=L.headers||{};return w["X-Requested-With"]!==null&&m.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(w).forEach(function(P){w[P]!==null&&m.setRequestHeader(P,w[P])}),m.send(f),{abort:function(){m.abort()}}}var Q=+new Date,ie=0;function V(){return"rc-upload-"+Q+"-"+ ++ie}function M(L,m){return L.indexOf(m,L.length-m.length)!==-1}var O=function(L,m){if(L&&m){var f=Array.isArray(m)?m:m.split(","),w=L.name||"",P=L.type||"",J=P.replace(/\/.*$/,"");return f.some(function(Se){var Re=Se.trim();return Re.charAt(0)==="."?M(w.toLowerCase(),Re.toLowerCase()):/\/\*$/.test(Re)?J===Re.replace(/\/.*$/,""):P===Re})}return!0};function ve(L,m){var f=L.createReader(),w=[];function P(){f.readEntries(function(J){var Se=Array.prototype.slice.apply(J);w=w.concat(Se);var Re=!Se.length;Re?m(w):P()})}P()}var oe=function(m,f,w){var P=function J(Se,Re){Re=Re||"",Se.isFile?Se.file(function(pe){w(pe)&&(Se.fullPath&&!pe.webkitRelativePath&&(Object.defineProperties(pe,{webkitRelativePath:{writable:!0}}),pe.webkitRelativePath=Se.fullPath.replace(/^\//,""),Object.defineProperties(pe,{webkitRelativePath:{writable:!1}})),f([pe]))}):Se.isDirectory&&ve(Se,function(pe){pe.forEach(function(ye){J(ye,""+Re+Se.name+"/")})})};m.forEach(function(J){P(J.webkitGetAsEntry())})},Z=oe,q=Object.assign||function(L){for(var m=1;m<arguments.length;m++){var f=arguments[m];for(var w in f)Object.prototype.hasOwnProperty.call(f,w)&&(L[w]=f[w])}return L},z=function(){function L(m,f){var w=[],P=!0,J=!1,Se=void 0;try{for(var Re=m[Symbol.iterator](),pe;!(P=(pe=Re.next()).done)&&!(w.push(pe.value),f&&w.length===f);P=!0);}catch(ye){J=!0,Se=ye}finally{try{!P&&Re.return&&Re.return()}finally{if(J)throw Se}}return w}return function(m,f){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return L(m,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),me=function(){function L(m,f){for(var w=0;w<f.length;w++){var P=f[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,f,w){return f&&L(m.prototype,f),w&&L(m,w),m}}();function ue(L,m,f){return m in L?Object.defineProperty(L,m,{value:f,enumerable:!0,configurable:!0,writable:!0}):L[m]=f,L}function He(L,m){var f={};for(var w in L){if(m.indexOf(w)>=0)continue;if(!Object.prototype.hasOwnProperty.call(L,w))continue;f[w]=L[w]}return f}function $e(L,m){if(!(L instanceof m))throw new TypeError("Cannot call a class as a function")}function we(L,m){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:L}function be(L,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);L.prototype=Object.create(m&&m.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(L,m):L.__proto__=m)}var Ve=function(m){return Object.keys(m).reduce(function(f,w){return(w.substr(0,5)==="data-"||w.substr(0,5)==="aria-"||w==="role")&&(f[w]=m[w]),f},{})},fe=function(L){be(m,L);function m(){var f,w,P,J;$e(this,m);for(var Se=arguments.length,Re=Array(Se),pe=0;pe<Se;pe++)Re[pe]=arguments[pe];return J=(w=(P=we(this,(f=m.__proto__||Object.getPrototypeOf(m)).call.apply(f,[this].concat(Re))),P),P.state={uid:V()},P.reqs={},P.onChange=function(ye){var ge=ye.target.files;P.uploadFiles(ge),P.reset()},P.onClick=function(ye){var ge=P.fileInput;if(!ge)return;var ce=P.props,$=ce.children,U=ce.onClick;$&&$.type==="button"&&(ge.parentNode.focus(),ge.parentNode.querySelector("button").blur()),ge.click(),U&&U(ye)},P.onKeyDown=function(ye){ye.key==="Enter"&&P.onClick()},P.onFileDrop=function(ye){var ge=P.props.multiple;if(ye.preventDefault(),ye.type==="dragover")return;if(P.props.directory)Z(Array.prototype.slice.call(ye.dataTransfer.items),P.uploadFiles,function($){return O($,P.props.accept)});else{var ce=Array.prototype.slice.call(ye.dataTransfer.files).filter(function($){return O($,P.props.accept)});ge===!1&&(ce=ce.slice(0,1)),P.uploadFiles(ce)}},P.uploadFiles=function(ye){var ge=Array.prototype.slice.call(ye);ge.map(function(ce){return ce.uid=V(),ce}).forEach(function(ce){P.upload(ce,ge)})},P.saveFileInput=function(ye){P.fileInput=ye},w),we(P,J)}return me(m,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(w,P){var J=this,Se=this.props;if(!Se.beforeUpload)return setTimeout(function(){return J.post(w)},0);var Re=Se.beforeUpload(w,P);Re&&Re.then?Re.then(function(pe){var ye=Object.prototype.toString.call(pe);return ye==="[object File]"||ye==="[object Blob]"?J.post(pe):J.post(w)}).catch(function(pe){console.log(pe)}):Re!==!1&&setTimeout(function(){return J.post(w)},0);return}},{key:"post",value:function(w){var P=this;if(!this._isMounted)return;var J=this.props,Se=J.onStart,Re=J.onProgress,pe=J.transformFile,ye=pe===void 0?function(ge){return ge}:pe;new Promise(function(ge){var ce=J.action;return typeof ce=="function"&&(ce=ce(w)),ge(ce)}).then(function(ge){var ce=w.uid,$=J.customRequest||j,U=Promise.resolve(ye(w)).then(function(b){var R=J.data;return typeof R=="function"&&(R=R(b)),Promise.all([b,R])}).catch(function(b){console.error(b)});U.then(function(b){var R=z(b,2),k=R[0],le=R[1],xe={action:ge,filename:J.name,data:le,file:k,headers:J.headers,withCredentials:J.withCredentials,method:J.method||"post",onProgress:Re?function(X){Re(X,w)}:null,onSuccess:function(Ce,Me){delete P.reqs[ce],J.onSuccess(Ce,w,Me)},onError:function(Ce,Me){delete P.reqs[ce],J.onError(Ce,Me,w)}};Se(w),P.reqs[ce]=$(xe)})})}},{key:"reset",value:function(){this.setState({uid:V()})}},{key:"abort",value:function(w){var P=this.reqs;if(w){var J=w;w&&w.uid&&(J=w.uid),P[J]&&P[J].abort&&P[J].abort(),delete P[J]}else Object.keys(P).forEach(function(Se){P[Se]&&P[Se].abort&&P[Se].abort(),delete P[Se]})}},{key:"render",value:function(){var w,P=this.props,J=P.component,Se=P.prefixCls,Re=P.className,pe=P.disabled,ye=P.id,ge=P.style,ce=P.multiple,$=P.accept,U=P.children,b=P.directory,R=P.openFileDialogOnClick,k=P.onMouseEnter,le=P.onMouseLeave,xe=He(P,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),X=Pe()((w={},ue(w,Se,!0),ue(w,Se+"-disabled",pe),ue(w,Re,Re),w)),Ce=pe?{}:{onClick:R?this.onClick:function(){},onKeyDown:R?this.onKeyDown:function(){},onMouseEnter:k,onMouseLeave:le,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Te.a.createElement(J,q({},Ce,{className:X,role:"button",style:ge}),Te.a.createElement("input",q({},Ve(xe),{id:ye,type:"file",ref:this.saveFileInput,onClick:function(Ge){return Ge.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:$,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:ce,onChange:this.onChange})),U)}}]),m}(K.Component),ke=fe,Be=Object.assign||function(L){for(var m=1;m<arguments.length;m++){var f=arguments[m];for(var w in f)Object.prototype.hasOwnProperty.call(f,w)&&(L[w]=f[w])}return L},he=function(){function L(m,f){for(var w=0;w<f.length;w++){var P=f[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,f,w){return f&&L(m.prototype,f),w&&L(m,w),m}}();function C(L,m){if(!(L instanceof m))throw new TypeError("Cannot call a class as a function")}function ae(L,m){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:L}function Y(L,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);L.prototype=Object.create(m&&m.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(L,m):L.__proto__=m)}function A(){}var se=function(L){Y(m,L);function m(){var f,w,P,J;C(this,m);for(var Se=arguments.length,Re=Array(Se),pe=0;pe<Se;pe++)Re[pe]=arguments[pe];return J=(w=(P=ae(this,(f=m.__proto__||Object.getPrototypeOf(m)).call.apply(f,[this].concat(Re))),P),P.saveUploader=function(ye){P.uploader=ye},w),ae(P,J)}return he(m,[{key:"abort",value:function(w){this.uploader.abort(w)}},{key:"render",value:function(){return Te.a.createElement(ke,Be({},this.props,{ref:this.saveUploader}))}}]),m}(K.Component);se.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:A,onError:A,onSuccess:A,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=se,N=rt.a=F},Gytx:function(wt,rt){wt.exports=function(K,Te,de,Pe){var _e=de?de.call(Pe,K,Te):void 0;if(_e!==void 0)return!!_e;if(K===Te)return!0;if(typeof K!="object"||!K||typeof Te!="object"||!Te)return!1;var re=Object.keys(K),j=Object.keys(Te);if(re.length!==j.length)return!1;for(var Q=Object.prototype.hasOwnProperty.bind(Te),ie=0;ie<re.length;ie++){var V=re[ie];if(!Q(V))return!1;var M=K[V],O=Te[V];if(_e=de?de.call(Pe,M,O,V):void 0,_e===!1||_e===void 0&&M!==O)return!1}return!0}},HmJG:function(wt,rt,T){},LdHM:function(wt,rt,T){"use strict";T.d(rt,"b",function(){return He}),T.d(rt,"a",function(){return we});var K=T("1OyB"),Te=T("vuIU"),de=T("Ji7U"),Pe=T("LK+K"),_e=T("q1tI"),re=T("rePB"),j=T("Ff2n"),Q=T("ODXe"),ie=T("4IlW"),V=T("bX4T"),M=T("YrtM"),O=T("TSYQ"),ve=T.n(O),oe=T("+nKL"),Z=T("8OUc"),q=function(w,P){var J=w.prefixCls,Se=w.id,Re=w.flattenOptions,pe=w.childrenAsData,ye=w.values,ge=w.searchValue,ce=w.multiple,$=w.defaultActiveFirstOption,U=w.height,b=w.itemHeight,R=w.notFoundContent,k=w.open,le=w.menuItemSelectedIcon,xe=w.virtual,X=w.onSelect,Ce=w.onToggleOpen,Me=w.onActiveValue,Ge=w.onScroll,je=w.onMouseEnter,Ne="".concat(J,"-item"),Fe=Object(M.a)(function(){return Re},[k,Re],function(ze,W){return W[0]&&ze[1]!==W[1]}),dt=_e.useRef(null),Qe=function(W){W.preventDefault()},et=function(W){dt.current&&dt.current.scrollTo({index:W})},tt=function(W){for(var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=Fe.length,y=0;y<H;y+=1){var x=(W+y*B+H)%H,S=Fe[x],E=S.group,ne=S.data;if(!E&&!ne.disabled)return x}return-1},mt=_e.useState(function(){return tt(0)}),ht=Object(Q.a)(mt,2),st=ht[0],Ee=ht[1],pt=function(W){Ee(W);var B=Fe[W];if(!B){Me(null,-1);return}Me(B.data.value,W)};_e.useEffect(function(){pt($!==!1?tt(0):-1)},[Fe.length,ge]),_e.useEffect(function(){var ze=setTimeout(function(){if(!ce&&k&&ye.size===1){var W=Array.from(ye)[0],B=Fe.findIndex(function(H){var y=H.data;return y.value===W});pt(B),et(B)}});return function(){return clearTimeout(ze)}},[k]);var ot=function(W){W!==void 0&&X(W,{selected:!ye.has(W)}),ce||Ce(!1)};if(_e.useImperativeHandle(P,function(){return{onKeyDown:function(W){var B=W.which;switch(B){case ie.a.UP:case ie.a.DOWN:{var H=0;if(B===ie.a.UP?H=-1:B===ie.a.DOWN&&(H=1),H!==0){var y=tt(st+H,H);et(y),pt(y)}break}case ie.a.ENTER:{var x=Fe[st];x&&!x.data.disabled?ot(x.data.value):ot(void 0),k&&W.preventDefault();break}case ie.a.ESC:Ce(!1)}},onKeyUp:function(){},scrollTo:function(W){et(W)}}}),Fe.length===0)return _e.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),className:"".concat(Ne,"-empty"),onMouseDown:Qe},R);function Le(ze){var W=Fe[ze];if(!W)return null;var B=W.data||{},H=B.value,y=B.label,x=B.children,S=Object(V.a)(B,!0),E=pe?x:y;return W?_e.createElement("div",Object.assign({"aria-label":typeof E=="string"?E:null},S,{key:ze,role:"option",id:"".concat(Se,"_list_").concat(ze),"aria-selected":ye.has(H)}),H):null}return _e.createElement(_e.Fragment,null,_e.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),style:{height:0,width:0,overflow:"hidden"}},Le(st-1),Le(st),Le(st+1)),_e.createElement(oe.a,{itemKey:"key",ref:dt,data:Fe,height:U,itemHeight:b,fullHeight:!1,onMouseDown:Qe,onScroll:Ge,virtual:xe,onMouseEnter:je},function(ze,W){var B,H=ze.group,y=ze.groupOption,x=ze.data,S=x.label,E=x.key;if(H)return _e.createElement("div",{className:ve()(Ne,"".concat(Ne,"-group"))},S!==void 0?S:E);var ne=x.disabled,G=x.value,Oe=x.title,Ye=x.children,nt=x.style,Ke=x.className,Et=Object(j.a)(x,["disabled","value","title","children","style","className"]),Ct=ye.has(G),at="".concat(Ne,"-option"),Ht=ve()(Ne,at,Ke,(B={},Object(re.a)(B,"".concat(at,"-grouped"),y),Object(re.a)(B,"".concat(at,"-active"),st===W&&!ne),Object(re.a)(B,"".concat(at,"-disabled"),ne),Object(re.a)(B,"".concat(at,"-selected"),Ct),B)),Nt=pe?Ye:S,Tt=!le||typeof le=="function"||Ct;return _e.createElement("div",Object.assign({},Et,{"aria-selected":Ct,className:Ht,title:Oe,onMouseMove:function(){if(st===W||ne)return;pt(W)},onClick:function(){ne||ot(G)},style:nt}),_e.createElement("div",{className:"".concat(at,"-content")},Nt||G),_e.isValidElement(le)||Ct,Tt&&_e.createElement(Z.a,{className:"".concat(Ne,"-option-state"),customizeIcon:le,customizeIconProps:{isSelected:Ct}},Ct?"\u2713":null))}))},z=_e.forwardRef(q);z.displayName="OptionList";var me=z,ue=function(){return null};ue.isSelectOption=!0;var He=ue,$e=function(){return null};$e.isSelectOptGroup=!0;var we=$e,be=T("VTBJ"),Ve=T("Zm9Q");function fe(f){var w=f.key,P=f.props,J=P.children,Se=P.value,Re=Object(j.a)(P,["children","value"]);return Object(be.a)({key:w,value:Se!==void 0?Se:w,children:J},Re)}function ke(f){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ve.a)(f).map(function(P,J){if(!_e.isValidElement(P)||!P.type)return null;var Se=P.type.isSelectOptGroup,Re=P.key,pe=P.props,ye=pe.children,ge=Object(j.a)(pe,["children"]);return w||!Se?fe(P):Object(be.a)(Object(be.a)({key:"__RC_SELECT_GRP__".concat(Re===null?J:Re,"__"),label:Re},ge),{},{options:ke(ye)})}).filter(function(P){return P})}var Be=T("2Qr1"),he=T("qNPg"),C=T("U8pU"),ae=T("Kwbf"),Y=T("WKfj");function A(f){var w=f.mode,P=f.options,J=f.children,Se=f.backfill,Re=f.allowClear,pe=f.placeholder,ye=f.getInputElement,ge=f.showSearch,ce=f.onSearch,$=f.defaultOpen,U=f.autoFocus,b=f.labelInValue,R=f.value,k=f.inputValue,le=f.optionLabelProp,xe=w==="multiple"||w==="tags",X=ge!==void 0?ge:xe||w==="combobox",Ce=P||ke(J);if(Object(ae.a)(w!=="tags"||Ce.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),w==="tags"||w==="combobox"){var Me=Ce.some(function(Ne){return Ne.options?Ne.options.some(function(Fe){return typeof("value"in Fe?Fe.value:Fe.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(ae.a)(!Me,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ae.a)(w!=="combobox"||!le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ae.a)(w==="combobox"||!Se,"`backfill` only works with `combobox` mode."),Object(ae.a)(w==="combobox"||!ye,"`getInputElement` only work with `combobox` mode."),Object(ae.b)(w!=="combobox"||!ye||!Re||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ce&&!X&&w!=="combobox"&&w!=="tags"&&Object(ae.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ae.b)(!$||U,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),R!=null){var Ge=Object(Y.d)(R);Object(ae.a)(!b||Ge.every(function(Ne){return Object(C.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ae.a)(!xe||Array.isArray(R),"`value` should be array when `mode` is `multiple` or `tags`")}if(J){var je=null;Object(Ve.a)(J).some(function(Ne){if(!_e.isValidElement(Ne)||!Ne.type)return!1;var Fe=Ne.type;if(Fe.isSelectOption)return!1;if(Fe.isSelectOptGroup){var dt=Object(Ve.a)(Ne.props.children).every(function(Qe){return!_e.isValidElement(Qe)||!Ne.type||Qe.type.isSelectOption?!0:(je=Qe.type,!1)});return!dt}return je=Fe,!0}),je&&Object(ae.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(je.displayName||je.name||je,"`.")),Object(ae.a)(k===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var se=A,F=Object(he.a)({prefixCls:"rc-select",components:{optionList:me},convertChildrenToData:ke,flattenOptions:Be.d,getLabeledValue:Be.e,filterOptions:Be.b,isValueDisabled:Be.g,findValueOption:Be.c,warningProps:se,fillOptionsWithMissingValue:Be.a}),N=function(f){Object(de.a)(P,f);var w=Object(Pe.a)(P);function P(){var J;return Object(K.a)(this,P),J=w.apply(this,arguments),J.selectRef=_e.createRef(),J.focus=function(){J.selectRef.current.focus()},J.blur=function(){J.selectRef.current.blur()},J}return Object(Te.a)(P,[{key:"render",value:function(){return _e.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),P}(_e.Component);N.Option=He,N.OptGroup=we;var L=N,m=rt.c=L},M8RZ:function(wt,rt,T){"use strict";T.d(rt,"a",function(){return ie});var K=T("fWQN"),Te=T("mtLc"),de=T("yKVA"),Pe=T("879j"),_e=T("q1tI"),re=T.n(_e),j=T("i8i4"),Q=T.n(j),ie=function(V){Object(de.a)(O,V);var M=Object(Pe.a)(O);function O(ve){var oe;Object(K.a)(this,O),oe=M.call(this,ve);var Z=window.document;return oe.node=Z.createElement("div"),Z.body.appendChild(oe.node),oe}return Object(Te.a)(O,[{key:"render",value:function(){var oe=this.props.children;return Object(j.createPortal)(oe,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),O}(re.a.Component)},OLES:function(wt,rt,T){"use strict";var K=T("U8pU"),Te=T("VTBJ"),de=T("Ff2n"),Pe=T("q1tI"),_e=T("uciX"),re=T("7ixt"),j=function(ve){var oe=ve.overlay,Z=ve.prefixCls,q=ve.id,z=ve.overlayInnerStyle;return Pe.createElement("div",{className:"".concat(Z,"-inner"),id:q,role:"tooltip",style:z},typeof oe=="function"?oe():oe)},Q=j,ie=function(ve,oe){var Z=ve.overlayClassName,q=ve.trigger,z=q===void 0?["hover"]:q,me=ve.mouseEnterDelay,ue=me===void 0?0:me,He=ve.mouseLeaveDelay,$e=He===void 0?.1:He,we=ve.overlayStyle,be=ve.prefixCls,Ve=be===void 0?"rc-tooltip":be,fe=ve.children,ke=ve.onVisibleChange,Be=ve.afterVisibleChange,he=ve.transitionName,C=ve.animation,ae=ve.placement,Y=ae===void 0?"right":ae,A=ve.align,se=A===void 0?{}:A,F=ve.destroyTooltipOnHide,N=F===void 0?!1:F,L=ve.defaultVisible,m=ve.getTooltipContainer,f=ve.overlayInnerStyle,w=Object(de.a)(ve,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),P=Object(Pe.useRef)(null);Object(Pe.useImperativeHandle)(oe,function(){return P.current});var J=Object(Te.a)({},w);"visible"in ve&&(J.popupVisible=ve.visible);var Se=function(){var ce=ve.arrowContent,$=ce===void 0?null:ce,U=ve.overlay,b=ve.id;return[Pe.createElement("div",{className:"".concat(Ve,"-arrow"),key:"arrow"},$),Pe.createElement(Q,{key:"content",prefixCls:Ve,id:b,overlay:U,overlayInnerStyle:f})]},Re=!1,pe=!1;if(typeof N=="boolean")Re=N;else if(N&&Object(K.a)(N)==="object"){var ye=N.keepParent;Re=ye===!0,pe=ye===!1}return Pe.createElement(_e.a,Object.assign({popupClassName:Z,prefixCls:Ve,popup:Se,action:z,builtinPlacements:re.a,popupPlacement:Y,ref:P,popupAlign:se,getPopupContainer:m,onPopupVisibleChange:ke,afterPopupVisibleChange:Be,popupTransitionName:he,popupAnimation:C,defaultPopupVisible:L,destroyPopupOnHide:Re,autoDestroy:pe,mouseLeaveDelay:$e,popupStyle:we,mouseEnterDelay:ue},J),fe)},V=Object(Pe.forwardRef)(ie),M=rt.a=V},Ot1p:function(wt,rt,T){"use strict";var K=T("2qtc"),Te=T("kLXV"),de=T("rAM+"),Pe=T("miYZ"),_e=T("tsqr"),re=T("9og8"),j=T("tJVT"),Q=T("jrin"),ie=T("WmNS"),V=T.n(ie),M=T("q1tI"),O=T.n(M),ve=T("VrN/"),oe=T.n(ve),Z=T("bdgK"),q=T("p77/"),z=T("Bd2K"),me=T("ELLl"),ue=T("19Vz"),He=T("lZu9"),$e=T("+NIl"),we=T("kSUc"),be=T("9Bee"),Ve=function(G){var Oe=G.value,Ye=Oe===void 0?"":Oe,nt=G.className,Ke=G.showTextOnly,Et=G.showLines,Ct=G.style,at=Ct===void 0?{}:Ct,Ht=Object(M.useMemo)(function(){return""},[Ye]);return O.a.createElement(O.a.Fragment,null,O.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ht}}))},fe=T("0Owb"),ke=T("dejd"),Be=T("C+DQ"),he=T("1vsH"),C=T("m3rI"),ae=[{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 Y(G){var Oe=G.onActionCallback,Ye=G.title,nt=G.icon,Ke=G.actionName,Et=G.className,Ct=Et===void 0?"":Et,at=G.children;function Ht(){Oe(Ke)}return O.a.createElement("a",{title:Ye,className:Ct,onClick:Ht},O.a.createElement("i",{className:"md-iconfont ".concat(nt)}),at)}var A=function(G){var Oe=G.watch,Ye=G.showNullButton,nt=G.onActionCallback,Ke=G.fullScreen,Et=G.insertTemp,Ct=G.hidetoolBar,at=G.uuid,Ht=G.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(he.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(he.D)("_educoder_session"),"&key=").concat(at,"&api=").concat(encodeURIComponent(C.a.PROXY_SERVER)));var Nt=[].concat(ae,[{title:"".concat(Oe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Oe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return O.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&Nt.map(function(Tt,Ot){return O.a.createElement("li",{key:Ot},Tt.actionName?O.a.createElement(Y,Object(fe.a)({},Tt,{onActionCallback:nt})):O.a.createElement("span",{className:"v-line"}))}),Ye?O.a.createElement("li",null,O.a.createElement(Y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:nt},O.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\u586B\u7A7A\u9879"))):null,Et&&O.a.createElement("li",null,O.a.createElement(Y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Et),onActionCallback:nt},O.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),O.a.createElement("li",{className:"btn-full-screen"},O.a.createElement(Y,{icon:"".concat(Ke?"icon-shrink":"icon-enlarge"),title:Ke?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:nt})))},se=T("M8RZ"),F=T("+L6B"),N=T("2/Rp"),L=T("y8nQ"),m=T("Vl3Y"),f=T("5NDa"),w=T("5rEg"),P={labelCol:{span:4},wrapperCol:{span:20}},J=function(G){var Oe=G.callback,Ye=G.onCancel;function nt(Ke){Oe(Ke)}return O.a.createElement(m.a,Object(fe.a)({},P,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:nt}),O.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},O.a.createElement(w.a,null)),O.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},O.a.createElement(w.a,null)),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(N.a,{type:"ghost",onClick:Ye},"\u53D6\u6D88")))},Se=T("7ahc"),Re=T("k1fw"),pe=T("HmJG"),ye=T("BjJ7"),ge=m.a.useForm,ce={width:280,marginRight:10},$={labelCol:{span:5},wrapperCol:{span:19}},U=function(G){var Oe=G.callback,Ye=G.onCancel,nt=ge(),Ke=Object(j.a)(nt,1),Et=Ke[0],Ct=Object(M.useRef)();function at(Tt){Oe(Object(Re.a)(Object(Re.a)({},Tt),{},{name:Ct.current}))}function Ht(Tt,Ot){Et.setFieldsValue({src:"/api/attachments/".concat(Tt.id,"?type=").concat(Tt.content_type),type:Ot.type})}function Nt(Tt){var Ot=Tt.target.files[0];Ct.current=Ot.name,R(Ot,Ht)}return O.a.createElement(m.a,Object(fe.a)({form:Et},$,{className:"upload-image-panel",onFinish:at}),O.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},O.a.createElement("div",{className:"flex-container"},O.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},O.a.createElement(w.a,{style:ce})),O.a.createElement(b,{onFileChange:Nt}))),O.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},O.a.createElement(w.a,{style:{width:264}})),O.a.createElement(m.a.Item,{style:{textAlign:"right"}},O.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(N.a,{type:"ghost",onClick:Ye},"\u53D6\u6D88")))};function b(G){var Oe=G.onFileChange;return O.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",O.a.createElement("input",{type:"file",onChange:Oe}))}function R(G,Oe){if(!G)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ye=new FormData;Ye.append("editormd-image-file",G),Ye.append("file_param_name","editormd-image-file"),Ye.append("byxhr","true");var nt=new window.XMLHttpRequest;nt.withCredentials=!0,nt.addEventListener("load",function(Ke){Oe(JSON.parse(Ke.target.responseText),G)},!1),nt.addEventListener("error",function(Ke){console.error(Ke)},!1),nt.open("POST","".concat(ye.a,"/api/attachments.json")),nt.send(Ye)}var k=T("giR+"),le=T("fyUT"),xe=T("7Kak"),X=T("9yH6"),Ce=X.a.Group,Me={margin:"0 8px"},Ge=function(G){var Oe=G.callback,Ye=G.onCancel;function nt(Ke){Oe(Ke)}return O.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:nt},O.a.createElement("div",{className:"flex-container"},O.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),O.a.createElement("span",{style:Me},"\u884C\u6570"),O.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},O.a.createElement(le.a,null)),O.a.createElement("span",{style:Me},"\u5217\u6570"),O.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},O.a.createElement(le.a,null))),O.a.createElement("div",{className:"flex-container",style:{marginTop:12}},O.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),O.a.createElement(m.a.Item,{name:"align"},O.a.createElement(Ce,null,O.a.createElement(X.a,{value:"default"},O.a.createElement("i",{className:"fa fa-align-justify"})),O.a.createElement(X.a,{value:"left"},O.a.createElement("i",{className:"fa fa-align-left"})),O.a.createElement(X.a,{value:"center"},O.a.createElement("i",{className:"fa fa-align-center"})),O.a.createElement(X.a,{value:"right"},O.a.createElement("i",{className:"fa fa-align-right"}))))),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(N.a,{type:"ghost",onClick:Ye},"\u53D6\u6D88")))},je=T("ErOA"),Ne=T("7Cbv"),Fe="link",dt="upload-image",Qe="code-block",et="add-table",tt="------------",mt={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},ht=T("9VGf"),st,Ee;function pt(){}var ot=0,Le=1e4,ze="\u2581",W=`
|
|
**\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(G){return/^\d+$/.test(G)?"".concat(G,"px"):G}var H=navigator.platform.toUpperCase().indexOf("MAC")>=0,y=H?"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"],S=(st={},Object(Q.a)(st,y+"-B","bold"),Object(Q.a)(st,y+"-I","italic"),st),E=(Ee={},Object(Q.a)(Ee,Fe,"\u6DFB\u52A0\u94FE\u63A5"),Object(Q.a)(Ee,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(Q.a)(Ee,dt,"\u6DFB\u52A0\u6587\u4EF6"),Object(Q.a)(Ee,et,"\u6DFB\u52A0\u8868\u683C"),Ee),ne=rt.a=function(G){var Oe=G.defaultValue,Ye=Oe===void 0?"":Oe,nt=G.onChange,Ke=G.width,Et=Ke===void 0?"100%":Ke,Ct=G.height,at=Ct===void 0?400:Ct,Ht=G.miniToolbar,Nt=Ht===void 0?!1:Ht,Tt=G.isFocus,Ot=Tt===void 0?!1:Tt,_t=G.watch,bn=G.insertTemp,ai=G.mode,vt=ai===void 0?"markdown":ai,Kn=G.id,on=Kn===void 0?"markdown-editor-id":Kn,fn=G.showResizeBar,Wn=fn===void 0?!1:fn,si=G.noStorage,li=si===void 0?!1:si,It=G.showNullButton,ct=It===void 0?!1:It,Nn=G.hidetoolBar,ui=Nn===void 0?!1:Nn,Cn=G.fullScreen,Lt=Cn===void 0?!1:Cn,In=G.onBlur,Yn=G.onCMBeforeChange,hi=G.onFullScreen,We=G.className,St=We===void 0?"":We,ci=G.disablePaste,Ai=ci===void 0?!1:ci,di=G.placeholder,Li=di===void 0?"":di,c=G.values,o=c===void 0?"":c,a=Object(M.useState)(null),u=Object(j.a)(a,2),d=u[0],h=u[1],I=Object(M.useState)(Ye),De=Object(j.a)(I,2),Ze=De[0],lt=De[1],Ie=Object(M.useState)(_t),xt=Object(j.a)(Ie,2),Rt=xt[0],Xt=xt[1],jn=Object(M.useState)(Lt),Bn=Object(j.a)(jn,2),an=Bn[0],Gn=Bn[1],Wi=Object(M.useState)(""),Sn=Object(j.a)(Wi,2),Un=Sn[0],On=Sn[1],vi=Object(M.useState)(0),$n=Object(j.a)(vi,2),fi=$n[0],ti=$n[1],cr=Object(M.useState)(at),Gi=Object(j.a)(cr,2),Zn=Gi[0],Fn=Gi[1],Mi=Object(M.useState)(!1),Oi=Object(j.a)(Mi,2),dr=Oi[0],Zt=Oi[1],Bt=Object(M.useRef)(Object(Ne.a)()),pn=Object(M.useRef)(!1),jt=Object(M.useRef)(),en=Object(M.useRef)(),zt=Object(M.useRef)(),ni=Object(M.useRef)(),qt=Object(M.useRef)(),kn=function(){var ft=Object(re.a)(V.a.mark(function kt(){var yt,Mt;return V.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(je.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Bt.current}});case 2:Mt=Gt.sent,Mt!=null&&(yt=Mt.attachments)!==null&&yt!==void 0&&yt.length&&(console.log("cm:",d,en),Mt.attachments.map(function(Pt){Pt.content_type.indexOf("image")>-1?d.replaceSelection(".concat(Pt.content_type,")")):Pt.content_type.indexOf("video")>-1?d.replaceSelection('<video width="100%" controls src="'.concat(C.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Pt.content_type.indexOf("pdf")>-1?d.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(Pt.content_type,'&disposition=inline" target="_blank">').concat(Pt.name,"</a>")):d.replaceSelection("[".concat(Pt.name,"](").concat(C.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(Pt.content_type,")"))}));case 4:case"end":return Gt.stop()}},kt)}));return function(){return ft.apply(this,arguments)}}();Object(M.useEffect)(function(){lt(o),d==null||d.setValue(o)},[o]),Object(M.useEffect)(function(){hi==null||hi(an)},[an]),Object(M.useEffect)(function(){if(en.current){var ft=oe.a.fromTextArea(en.current,{mode:vt,lineNumbers:!Nt,lineWrapping:!0,value:Ye,autoCloseTags:!0,autoCloseBrackets:!0});Ot&&ft.focus();function kt(yt,Mt){if(Ai){Mt.preventDefault();return}var Ut=Mt.clipboardData;if(Ut){var Gt=Ut.types.toString(),Pt=Ut.items;if(Gt==="Files"||Ut.types.indexOf("Files")>-1){if(Mt.preventDefault(),vt=="stex")return;try{var tn,En=Pt[1];((tn=Pt[0])===null||tn===void 0?void 0:tn.kind)==="file"&&(En=Pt[0]);var Dt=En.getAsFile(),bi=Dt.name.split(".").pop();R(Dt,function(Ft){if(Ft.id){var ln,Vn,Xn;(Dt==null||((ln=Dt.type)===null||ln===void 0)?void 0:ln.indexOf("image"))>-1?ft.replaceSelection(".concat(Ft.content_type,")")):(Dt==null||((Vn=Dt.type)===null||Vn===void 0)?void 0:Vn.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(Dt==null||((Xn=Dt.type)===null||Xn===void 0)?void 0:Xn.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):x.includes(bi)?ft.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ft.replaceSelection("[".concat(Dt.name,"](").concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})}catch(Ft){_e.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",kt),ft.on("dragleave",function(yt,Mt){zt.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function(yt,Mt){zt.current.classList.add("mouse-hover-md")}),ft.on("drop",function(yt,Mt){zt.current.classList.add("mouse-hover-md");var Ut;if(Ut=Mt.dataTransfer.files,Ut.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var Gt=function(En){var Dt=Ut[En],bi=Dt.name.split(".").pop();R(Dt,function(Ft){if(Ft.id){var ln,Vn,Xn;(Dt==null||((ln=Dt.type)===null||ln===void 0)?void 0:ln.indexOf("image"))>-1?ft.replaceSelection(".concat(Ft.content_type,")")):(Dt==null||((Vn=Dt.type)===null||Vn===void 0)?void 0:Vn.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(Dt==null||((Xn=Dt.type)===null||Xn===void 0)?void 0:Xn.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):x.includes(bi)?ft.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ft.replaceSelection("[".concat(Dt.name,"](").concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})},Pt=0;Pt<Ut.length;Pt++)Gt(Pt)}}),h(ft),function(){ft.off("paste",kt)}}},[]);var Vi=Object(M.useCallback)(function(){if(zt.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[Zn,zt,an]);Object(M.useEffect)(function(){function ft(){var yt=new Z.default(function(Mt){var Ut=Object(de.a)(Mt),Gt;try{for(Ut.s();!(Gt=Ut.n()).done;){var Pt=Gt.value;(Pt.target.offsetHeight>0||Pt.target.offsetWidth>0)&&(Vi(),d.setSize("100%","100%"),d.refresh())}}catch(tn){Ut.e(tn)}finally{Ut.f()}});return yt.observe(en.current.parentElement),yt}if(d){var kt=ft();return function(){kt.unobserve(en.current.parentElement)}}},[d,Vi]),Object(M.useEffect)(function(){if(d){for(var ft=[],kt=function(){var Pt=Mt[yt];Ut=Object(j.a)(Pt,2);var tn=Ut[0],En=Ut[1],Dt=Object(Q.a)({},tn,function(){Xi(En)});ft.push(Dt),d.addKeyMap(Dt)},yt=0,Mt=Object.entries(S);yt<Mt.length;yt++){var Ut;kt()}return jt.current=setInterval(function(){pn.current&&kn()},4e3),function(){clearInterval(jt.current);var Gt=Object(de.a)(ft),Pt;try{for(Gt.s();!(Pt=Gt.n()).done;){var tn=Pt.value;d.removeKeyMap(tn)}}catch(En){Gt.e(En)}finally{Gt.f()}}}},[d]),Object(M.useEffect)(function(){Lt!==an&&Gn(Lt)},[Lt]),Object(ht.a)(function(){if(!li&&fi>0){var ft=new Date().getTime(),kt=window.sessionStorage.getItem(on);ft>=fi+Le&&(!kt||kt!==Ze)&&(window.sessionStorage.setItem(on,Ze),Zt(!0))}},Le),Object(M.useEffect)(function(){Xt(_t)},[d,_t]),Object(M.useEffect)(function(){d&&(Ot&&d.focus())},[d,Ot]),Object(M.useEffect)(function(){if(Rt&&d){var ft=d.getScrollerElement();function kt(yt){var Mt=yt.target;if(qt.current){var Ut=Mt.scrollTop/Mt.scrollHeight;qt.current.scrollTop=qt.current.scrollHeight*Ut}}return ft.addEventListener("scroll",kt),function(){ft.removeEventListener("scroll",kt)}}},[d,Rt]),Object(M.useEffect)(function(){if(d&&Yn){function ft(kt,yt){Yn(kt,yt)}return d.on("beforeChange",ft),function(){d.off("beforeChange",ft)}}},[d,Yn]),Object(M.useEffect)(function(){if(d&&In){function ft(){In(d.getValue())}return d.on("blur",ft),function(){d.off("blur",ft)}}},[d,In]),Object(M.useEffect)(function(){if(d){function ft(kt){var yt=kt.getValue();lt(yt),ti(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),nt&&nt(yt)}return d.on("change",ft),function(){d.off("change",ft)}}},[d,nt]),Object(M.useEffect)(function(){d&&(Ye==null?(d.setValue(""),lt("")):Ye!==d.getValue()&&(d.setValue(Ye),lt(Ye),d.setCursor(d.lineCount(),0)))},[d,Ye]);var Xi=Object(M.useCallback)(function(ft){var kt=d.getCursor(),yt=d.getSelection(),Mt=yt.split(`
|
|
`);switch(ft){case"bold":return d.replaceSelection("**"+yt+"**"),yt===""&&d.setCursor(kt.line,kt.ch+2),d.focus();case"italic":return d.replaceSelection("*"+yt+"*"),yt===""&&d.setCursor(kt.line,kt.ch+1),d.focus();case"code":return d.replaceSelection("`"+yt+"`"),yt===""&&d.setCursor(kt.line,kt.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+yt+"$$`"),yt===""&&d.setCursor(kt.line,kt.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+yt+"\n```"),d.setCursor(kt.line+1,yt.length+1),d.focus();case"line-break":return d.replaceSelection(`<br/>
|
|
`),d.focus();case"list-ul":return yt===""?d.replaceSelection("- "+yt):d.replaceSelection(Mt.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(`
|
|
`)),d.focus();case"list-ol":return yt===""?d.replaceSelection("1. "+yt):d.replaceSelection(Mt.map(function(Ut,Gt){return Ut===""?"":"".concat(Gt+1,". ").concat(Ut)}).join(`
|
|
`)),d.focus();case"add-null-ch":return yt===""&&d.setCursor(kt.line,kt.ch+1),d.replaceSelection(ze),d.focus();case"inster-template-1":return yt===""&&d.setCursor(kt.line,kt.ch),d.replaceSelection(W),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return Xt(!Rt),d.focus();case"trigger-full-screen":return Gn(!an),d.focus();case Fe:On(Fe);return;case Qe:On(Qe);return;case dt:On(dt);return;case et:On(et);return;default:throw new Error}},[d,Rt,an]),yi=Object(M.useCallback)(function(ft){On("");switch(Un){case Fe:var kt=ft.title,yt=ft.link;return d.replaceSelection("[".concat(kt,"](").concat(yt,")")),d.focus();case Qe:var Mt=ft.language,Ut=ft.content;return d.replaceSelection(["```"+Mt,Ut,"```"].join(`
|
|
`)),d.focus();case dt:var Gt=ft.src,Pt=ft.alt,tn=ft.name;return Gt.indexOf("type=image")>-1?d.replaceSelection(".concat(Gt,' "').concat(Pt||"",'" )')):Gt.indexOf("type=application/pdf")>-1?d.replaceSelection('<a href="'.concat(Gt,'&disposition=inline" target="_blank">').concat(tn,"</a>")):d.replaceSelection('<a href="'.concat(Gt,'" target="_blank">').concat(tn,"</a>")),d.focus();case et:for(var En=ft.row,Dt=ft.col,bi=ft.align,Ft=`
|
|
`,ln=0;ln<En;ln++){for(var Vn=[],Xn=[],Hr=0;Hr<Dt;Hr++)ln===1&&Xn.push(mt[bi]),Vn.push(" ");ln===1&&(Ft+="| ".concat(Xn.join(" | "),` |
|
|
`)),Ft+="| ".concat(Vn.join(Dt===1?"":" | "),` |
|
|
`)}return d.replaceSelection(Ft+`
|
|
`),d.focus();default:throw new Error}},[d,Un]),Ur=Object(M.useMemo)(function(){switch(Un){case Fe:return O.a.createElement(J,{callback:yi,onCancel:Rn});case Qe:return O.a.createElement(Se.b,{callback:yi,onCancel:Rn});case dt:return O.a.createElement(U,{callback:yi,onCancel:Rn});case et:return O.a.createElement(Ge,{callback:yi,onCancel:Rn});default:return null}},[Un]);function Rn(){On("")}Object(M.useEffect)(function(){if(ni.current){var ft=ni.current,kt=!1,yt=0;function Mt(Pt){kt=!0,yt=Pt.pageY}function Ut(){kt=!1}function Gt(Pt){if(kt){var tn=Pt.pageY-yt;tn<0&&(tn=0),tn>300&&(tn=300);var En=at+tn+"px";Fn(En)}}return ft.addEventListener("mousedown",Mt),document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",Ut),function(){ft.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",Ut)}}},[d,ni]),Object(M.useEffect)(function(){Fn(at)},[at]);var fr=B(Et),Jn=B(Zn),Ki={width:fr,height:Jn},Fr=Object(M.useMemo)(function(){if(fi){var ft=new Date(fi),kt=ft.getHours(),yt=ft.getMinutes(),Mt=ft.getSeconds();return kt=kt<10?"0"+kt:kt,yt=yt<10?"0"+yt:yt,Mt=Mt<10?"0"+Mt:Mt,"".concat(kt,":").concat(yt,":").concat(Mt)}return 0},[fi]);function Ri(){window.sessionStorage.removeItem(on),Zt(!1),ti(0)}function Zo(){Zt(!1),ti(0),d.setValue(window.sessionStorage.getItem(on))}function ho(ft,kt){var yt=d.getValue();yt=yt.replace(ft,kt),lt(yt),d==null||d.setValue(yt)}return O.a.createElement(M.Fragment,null,O.a.createElement("div",{className:"markdown-editor-wrapper",ref:zt},O.a.createElement("div",{className:"markdown-editor-container ".concat(St," ").concat(Rt?"on-preview":""," ").concat(Nt?"mini":""," ").concat(an?"full-screen":""),style:Ki},O.a.createElement(A,{insertTemp:bn,watch:Rt,fullScreen:an,showNullButton:ct,onActionCallback:Xi,hidetoolBar:ui,uuid:Bt.current,setOpenPhones:function(){pn.current=!0}}),O.a.createElement("div",{className:"markdown-editor-body"},O.a.createElement("div",{className:"codemirror-container"},O.a.createElement("textarea",{ref:en,placeholder:Li})),Rt?O.a.createElement("div",{ref:qt,className:"preview-container"},vt==="stex"&&O.a.createElement(Ve,{value:Ze}),vt!=="stex"&&O.a.createElement(be.a,{edit:!0,value:Ze,replaces:ho})):null))),Wn?O.a.createElement("a",{ref:ni,className:"editor-resize"}):null,O.a.createElement(se.a,null,E[Un]?O.a.createElement(Te.a,{centered:!0,title:E[Un],visible:!0,onCancel:Rn,footer:null},Ur):null))}},SJMd:function(wt,rt){/**
|
|
* @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 T,K,Te,de=!1,Pe,_e;window.PR_SHOULD_USE_CONTINUATION=!0;var re,j;(function(){var Q=window,ie=["break,continue,do,else,for,if,return,while"],V=[ie,"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=[V,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],O=[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"],ve=[M,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],oe=[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"],Z="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",q=[M,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],z="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=[ie,"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"],ue=[ie,"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"],He=[ie,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],$e=[O,oe,ve,q,z,me,ue,He],we=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,be="str",Ve="kwd",fe="com",ke="typ",Be="lit",he="pun",C="pln",ae="tag",Y="dec",A="src",se="atn",F="atv",N="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(X){for(var Ce=0,Me=!1,Ge=!1,je=0,Ne=X.length;je<Ne;++je){var Fe=X[je];if(Fe.ignoreCase)Ge=!0;else if(/[a-z]/i.test(Fe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Me=!0,Ge=!1;break}}var dt={b:8,t:9,n:10,v:11,f:12,r:13};function Qe(st){var Ee=st.charCodeAt(0);if(Ee!==92)return Ee;var pt=st.charAt(1);return Ee=dt[pt],Ee||("0"<=pt&&pt<="7"?parseInt(st.substring(1),8):pt==="u"||pt==="x"?parseInt(st.substring(2),16):st.charCodeAt(1))}function et(st){if(st<32)return(st<16?"\\x0":"\\x")+st.toString(16);var Ee=String.fromCharCode(st);return Ee==="\\"||Ee==="-"||Ee==="]"||Ee==="^"?"\\"+Ee:Ee}function tt(st){var Ee=st.substring(1,st.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),pt=[],ot=Ee[0]==="^",Le=["["];ot&&Le.push("^");for(var ze=ot?1:0,W=Ee.length;ze<W;++ze){var B=Ee[ze];if(/\\[bdsw]/i.test(B))Le.push(B);else{var H=Qe(B),y;ze+2<W&&Ee[ze+1]==="-"?(y=Qe(Ee[ze+2]),ze+=2):y=H,pt.push([H,y]),y<65||H>122||(y<65||H>90||pt.push([Math.max(65,H)|32,Math.min(y,90)|32]),y<97||H>122||pt.push([Math.max(97,H)&~32,Math.min(y,122)&~32]))}}pt.sort(function(ne,G){return ne[0]-G[0]||G[1]-ne[1]});for(var x=[],S=[],ze=0;ze<pt.length;++ze){var E=pt[ze];E[0]<=S[1]+1?S[1]=Math.max(S[1],E[1]):x.push(S=E)}for(var ze=0;ze<x.length;++ze){var E=x[ze];Le.push(et(E[0])),E[1]>E[0]&&(E[1]+1>E[0]&&Le.push("-"),Le.push(et(E[1])))}return Le.push("]"),Le.join("")}function mt(st){for(var Ee=st.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")),pt=Ee.length,ot=[],Le=0,ze=0;Le<pt;++Le){var W=Ee[Le];if(W==="(")++ze;else if(W.charAt(0)==="\\"){var B=+W.substring(1);B&&(B<=ze?ot[B]=-1:Ee[Le]=et(B))}}for(var Le=1;Le<ot.length;++Le)ot[Le]===-1&&(ot[Le]=++Ce);for(var Le=0,ze=0;Le<pt;++Le){var W=Ee[Le];if(W==="(")++ze,ot[ze]||(Ee[Le]="(?:");else if(W.charAt(0)==="\\"){var B=+W.substring(1);B&&B<=ze&&(Ee[Le]="\\"+ot[B])}}for(var Le=0;Le<pt;++Le)Ee[Le]==="^"&&Ee[Le+1]!=="^"&&(Ee[Le]="");if(st.ignoreCase&&Me)for(var Le=0;Le<pt;++Le){var W=Ee[Le],H=W.charAt(0);W.length>=2&&H==="["?Ee[Le]=tt(W):H!=="\\"&&(Ee[Le]=W.replace(/[a-zA-Z]/g,function(S){var E=S.charCodeAt(0);return"["+String.fromCharCode(E&~32,E|32)+"]"}))}return Ee.join("")}for(var ht=[],je=0,Ne=X.length;je<Ne;++je){var Fe=X[je];if(Fe.global||Fe.multiline)throw new Error(""+Fe);ht.push("(?:"+mt(Fe)+")")}return new RegExp(ht.join("|"),Ge?"gi":"g")}function f(X,Ce){var Me=/(?:^|\s)nocode(?:\s|$)/,Ge=[],je=0,Ne=[],Fe=0;function dt(Qe){var et=Qe.nodeType;if(et==1){if(Me.test(Qe.className))return;for(var tt=Qe.firstChild;tt;tt=tt.nextSibling)dt(tt);var mt=Qe.nodeName.toLowerCase();(mt==="br"||mt==="li")&&(Ge[Fe]=`
|
|
`,Ne[Fe<<1]=je++,Ne[Fe++<<1|1]=Qe)}else if(et==3||et==4){var ht=Qe.nodeValue;ht.length&&(Ce?ht=ht.replace(/\r\n?/g,`
|
|
`):ht=ht.replace(/[ \t\r\n]+/g," "),Ge[Fe]=ht,Ne[Fe<<1]=je,je+=ht.length,Ne[Fe++<<1|1]=Qe)}}return dt(X),{sourceCode:Ge.join("").replace(/\n$/,""),spans:Ne}}function w(X,Ce,Me,Ge,je){if(!Me)return;var Ne={sourceNode:X,pre:1,langExtension:null,numberLines:null,sourceCode:Me,spans:null,basePos:Ce,decorations:null};Ge(Ne),je.push.apply(je,Ne.decorations)}var P=/\S/;function J(X){for(var Ce=void 0,Me=X.firstChild;Me;Me=Me.nextSibling){var Ge=Me.nodeType;Ce=Ge===1?Ce?X:Me:Ge===3&&P.test(Me.nodeValue)?X:Ce}return Ce===X?void 0:Ce}function Se(X,Ce){var Me={},Ge;(function(){for(var Fe=X.concat(Ce),dt=[],Qe={},et=0,tt=Fe.length;et<tt;++et){var mt=Fe[et],ht=mt[3];if(ht)for(var st=ht.length;--st>=0;)Me[ht.charAt(st)]=mt;var Ee=mt[1],pt=""+Ee;Qe.hasOwnProperty(pt)||(dt.push(Ee),Qe[pt]=null)}dt.push(/[\0-\uffff]/),Ge=m(dt)})();var je=Ce.length,Ne=function(Fe){for(var dt=Fe.sourceCode,Qe=Fe.basePos,et=Fe.sourceNode,tt=[Qe,C],mt=0,ht=dt.match(Ge)||[],st={},Ee=0,pt=ht.length;Ee<pt;++Ee){var ot=ht[Ee],Le=st[ot],ze=void 0,W;if(typeof Le=="string")W=!1;else{var B=Me[ot.charAt(0)];if(B)ze=ot.match(B[1]),Le=B[0];else{for(var H=0;H<je;++H)if(B=Ce[H],ze=ot.match(B[1]),ze){Le=B[0];break}ze||(Le=C)}W=Le.length>=5&&Le.substring(0,5)==="lang-",W&&!(ze&&typeof ze[1]=="string")&&(W=!1,Le=A),W||(st[ot]=Le)}var y=mt;if(mt+=ot.length,!W)tt.push(Qe+y,Le);else{var x=ze[1],S=ot.indexOf(x),E=S+x.length;ze[2]&&(E=ot.length-ze[2].length,S=E-x.length);var ne=Le.substring(5);w(et,Qe+y,ot.substring(0,S),Ne,tt),w(et,Qe+y+S,x,U(ne,x),tt),w(et,Qe+y+E,ot.substring(E),Ne,tt)}}Fe.decorations=tt};return Ne}function Re(X){var Ce=[],Me=[];X.tripleQuotedStrings?Ce.push([be,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):X.multiLineStrings?Ce.push([be,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ce.push([be,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),X.verbatimStrings&&Me.push([be,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ge=X.hashComments;Ge&&(X.cStyleComments?(Ge>1?Ce.push([fe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ce.push([fe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Me.push([be,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ce.push([fe,/^#[^\r\n]*/,null,"#"])),X.cStyleComments&&(Me.push([fe,/^\/\/[^\r\n]*/,null]),Me.push([fe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var je=X.regexLiterals;if(je){var Ne=je>1?"":`
|
|
\r`,Fe=Ne?".":"[\\S\\s]",dt="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Fe+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Fe+")*(?:\\x5D|$))+/";Me.push(["lang-regex",RegExp("^"+L+"("+dt+")")])}var Qe=X.types;Qe&&Me.push([ke,Qe]);var et=(""+X.keywords).replace(/^ | $/g,"");et.length&&Me.push([Ve,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Ce.push([C,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return X.regexLiterals&&(tt+="(?!s*/)"),Me.push([Be,/^@[a-z_$][a-z_$@0-9]*/i,null],[ke,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[C,/^[a-z_$][a-z_$@0-9]*/i,null],[Be,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[C,/^\\[\s\S]?/,null],[he,new RegExp(tt),null]),Se(Ce,Me)}var pe=Re({keywords:$e,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ye(X,Ce,Me){for(var Ge=/(?:^|\s)nocode(?:\s|$)/,je=/\r\n?|\n/,Ne=X.ownerDocument,Fe=Ne.createElement("li");X.firstChild;)Fe.appendChild(X.firstChild);var dt=[Fe];function Qe(Ee){var pt=Ee.nodeType;if(pt==1&&!Ge.test(Ee.className))if(Ee.nodeName==="br")et(Ee),Ee.parentNode&&Ee.parentNode.removeChild(Ee);else for(var ot=Ee.firstChild;ot;ot=ot.nextSibling)Qe(ot);else if((pt==3||pt==4)&&Me){var Le=Ee.nodeValue,ze=Le.match(je);if(ze){var W=Le.substring(0,ze.index);Ee.nodeValue=W;var B=Le.substring(ze.index+ze[0].length);if(B){var H=Ee.parentNode;H.insertBefore(Ne.createTextNode(B),Ee.nextSibling)}et(Ee),W||Ee.parentNode.removeChild(Ee)}}}function et(Ee){for(;!Ee.nextSibling;)if(Ee=Ee.parentNode,!Ee)return;function pt(ze,W){var B=W?ze.cloneNode(!1):ze,H=ze.parentNode;if(H){var y=pt(H,1),x=ze.nextSibling;y.appendChild(B);for(var S=x;S;S=x)x=S.nextSibling,y.appendChild(S)}return B}for(var ot=pt(Ee.nextSibling,0),Le;(Le=ot.parentNode)&&Le.nodeType===1;)ot=Le;dt.push(ot)}for(var tt=0;tt<dt.length;++tt)Qe(dt[tt]);Ce===(Ce|0)&&dt[0].setAttribute("value",Ce);var mt=Ne.createElement("ol");mt.className="linenums";for(var ht=Math.max(0,Ce-1|0)||0,tt=0,st=dt.length;tt<st;++tt)Fe=dt[tt],Fe.className="L"+(tt+ht)%10,Fe.firstChild||Fe.appendChild(Ne.createTextNode("\xA0")),mt.appendChild(Fe);X.appendChild(mt)}function ge(X){var Ce=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ce=Ce&&+Ce[1]<=8;var Me=/\n/g,Ge=X.sourceCode,je=Ge.length,Ne=0,Fe=X.spans,dt=Fe.length,Qe=0,et=X.decorations,tt=et.length,mt=0;et[tt]=je;var ht,st;for(st=ht=0;st<tt;)et[st]!==et[st+2]?(et[ht++]=et[st++],et[ht++]=et[st++]):st+=2;for(tt=ht,st=ht=0;st<tt;){for(var Ee=et[st],pt=et[st+1],ot=st+2;ot+2<=tt&&et[ot+1]===pt;)ot+=2;et[ht++]=Ee,et[ht++]=pt,st=ot}tt=et.length=ht;var Le=X.sourceNode,ze="";Le&&(ze=Le.style.display,Le.style.display="none");try{for(var W=null;Qe<dt;){var B=Fe[Qe],H=Fe[Qe+2]||je,y=et[mt+2]||je,ot=Math.min(H,y),x=Fe[Qe+1],S;if(x.nodeType!==1&&(S=Ge.substring(Ne,ot))){Ce&&(S=S.replace(Me,"\r")),x.nodeValue=S;var E=x.ownerDocument,ne=E.createElement("span");ne.className=et[mt+1];var G=x.parentNode;G.replaceChild(ne,x),ne.appendChild(x),Ne<H&&(Fe[Qe+1]=x=E.createTextNode(Ge.substring(ot,H)),G.insertBefore(x,ne.nextSibling))}Ne=ot,Ne>=H&&(Qe+=2),Ne>=y&&(mt+=2)}}finally{Le&&(Le.style.display=ze)}}var ce={};function $(X,Ce){for(var Me=Ce.length;--Me>=0;){var Ge=Ce[Me];ce.hasOwnProperty(Ge)?Q.console&&console.warn("cannot override language handler %s",Ge):ce[Ge]=X}}function U(X,Ce){return X&&ce.hasOwnProperty(X)||(X=/^\s*</.test(Ce)?"default-markup":"default-code"),ce[X]}$(pe,["default-code"]),$(Se([],[[C,/^[^<?]+/],[Y,/^<!\w[^>]*(?:>|$)/],[fe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[he,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),$(Se([[C,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ae,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[se,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[he,/^[=<>\/]+/],["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"]),$(Se([],[[F,/^[\s\S]+/]]),["uq.val"]),$(Re({keywords:O,hashComments:!0,cStyleComments:!0,types:we}),["c","cc","cpp","cxx","cyc","m"]),$(Re({keywords:"null,true,false"}),["json"]),$(Re({keywords:oe,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:we}),["cs"]),$(Re({keywords:ve,cStyleComments:!0}),["java"]),$(Re({keywords:He,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),$(Re({keywords:me,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),$(Re({keywords:z,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),$(Re({keywords:ue,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),$(Re({keywords:q,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),$(Re({keywords:Z,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),$(Se([],[[be,/^[\s\S]+/]]),["regex"]);function b(X){var Ce=X.langExtension;try{var Me=f(X.sourceNode,X.pre),Ge=Me.sourceCode;X.sourceCode=Ge,X.spans=Me.spans,X.basePos=0,U(Ce,Ge)(X),ge(X)}catch(je){Q.console&&console.log(je&&je.stack||je)}}function R(X,Ce,Me){var Ge=Me||!1,je=Ce||null,Ne=document.createElement("div");Ne.innerHTML="<pre>"+X+"</pre>",Ne=Ne.firstChild,Ge&&ye(Ne,Ge,!0);var Fe={langExtension:je,numberLines:Ge,sourceNode:Ne,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Fe),Ne.innerHTML}function k(X,Ce){var Me=Ce||document.body,Ge=Me.ownerDocument||document;function je(B){return Me.getElementsByTagName(B)}for(var Ne=[je("pre"),je("code"),je("xmp")],Fe=[],dt=0;dt<Ne.length;++dt)for(var Qe=0,et=Ne[dt].length;Qe<et;++Qe)Fe.push(Ne[dt][Qe]);Ne=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var mt=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,st=/\bprettyprint\b/,Ee=/\bprettyprinted\b/,pt=/pre|xmp/i,ot=/^code$/i,Le=/^(?:pre|code|xmp)$/i,ze={};function W(){for(var B=Q.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;mt<Fe.length&&tt.now()<B;mt++){for(var H=Fe[mt],y=ze,x=H;x=x.previousSibling;){var S=x.nodeType,E=(S===7||S===8)&&x.nodeValue;if(E?!/^\??prettify\b/.test(E):S!==3||/\S/.test(x.nodeValue))break;if(E){y={},E.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ot,_t,bn){y[_t]=bn});break}}var ne=H.className;if((y!==ze||st.test(ne))&&!Ee.test(ne)){for(var G=!1,Oe=H.parentNode;Oe;Oe=Oe.parentNode){var Ye=Oe.tagName;if(Le.test(Ye)&&Oe.className&&st.test(Oe.className)){G=!0;break}}if(!G){H.className+=" prettyprinted";var nt=y.lang;if(!nt){nt=ne.match(ht);var Ke;!nt&&(Ke=J(H))&&ot.test(Ke.tagName)&&(nt=Ke.className.match(ht)),nt&&(nt=nt[1])}var Et;if(pt.test(H.tagName))Et=1;else{var Ct=H.currentStyle,at=Ge.defaultView,Ht=Ct?Ct.whiteSpace:at&&at.getComputedStyle?at.getComputedStyle(H,null).getPropertyValue("white-space"):0;Et=Ht&&Ht.substring(0,3)==="pre"}var Nt=y.linenums;(Nt=Nt==="true"||+Nt)||(Nt=ne.match(/\blinenums\b(?::(\d+))?/),Nt=Nt?Nt[1]&&Nt[1].length?+Nt[1]:!0:!1),Nt&&ye(H,Nt,Et);var Tt={langExtension:nt,sourceNode:H,numberLines:Nt,pre:Et,sourceCode:null,basePos:null,spans:null,decorations:null};b(Tt)}}}mt<Fe.length?Q.setTimeout(W,250):typeof X=="function"&&X()}W()}var le=Q.PR={createSimpleLexer:Se,registerLangHandler:$,sourceDecorator:Re,PR_ATTRIB_NAME:se,PR_ATTRIB_VALUE:F,PR_COMMENT:fe,PR_DECLARATION:Y,PR_KEYWORD:Ve,PR_LITERAL:Be,PR_NOCODE:N,PR_PLAIN:C,PR_PUNCTUATION:he,PR_SOURCE:A,PR_STRING:be,PR_TAG:ae,PR_TYPE:ke,prettyPrintOne:de?Q.prettyPrintOne=R:re=R,prettyPrint:j=de?Q.prettyPrint=k:j=k},xe=Q.define;typeof xe=="function"&&xe.amd&&xe("google-code-prettify",[],function(){return le})})()},"VrN/":function(wt,rt,T){(function(K,Te){wt.exports=Te()})(this,function(){"use strict";var K=navigator.userAgent,Te=navigator.platform,de=/gecko\/\d/i.test(K),Pe=/MSIE \d/.test(K),_e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(K),re=/Edge\/(\d+)/.exec(K),j=Pe||_e||re,Q=j&&(Pe?document.documentMode||6:+(re||_e)[1]),ie=!re&&/WebKit\//.test(K),V=ie&&/Qt\/\d+\.\d+/.test(K),M=!re&&/Chrome\//.test(K),O=/Opera\//.test(K),ve=/Apple Computer/.test(navigator.vendor),oe=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(K),Z=/PhantomJS/.test(K),q=!re&&/AppleWebKit/.test(K)&&/Mobile\/\w+/.test(K),z=/Android/.test(K),me=q||z||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(K),ue=q||/Mac/.test(Te),He=/\bCrOS\b/.test(K),$e=/win/i.test(Te),we=O&&K.match(/Version\/(\d*\.\d*)/);we&&(we=Number(we[1])),we&&we>=15&&(O=!1,ie=!0);var be=ue&&(V||O&&(we==null||we<12.11)),Ve=de||j&&Q>=9;function fe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ke=function(e,t){var i=e.className,n=fe(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 Be(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function he(e,t){return Be(e).appendChild(t)}function C(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.length;++s)r.appendChild(t[s]);return r}function ae(e,t,i,n){var r=C(e,t,i,n);return r.setAttribute("role","presentation"),r}var Y;document.createRange?Y=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:Y=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function A(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function se(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var i=e.className;fe(t).test(i)||(e.className+=(i?" ":"")+t)}function N(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!fe(i[n]).test(t)&&(t+=" "+i[n]);return t}var L=function(e){e.select()};q?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:j&&(L=function(e){try{e.select()}catch(t){}});function m(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function f(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function w(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var p=e.indexOf(" ",s);if(p<0||p>=t)return l+(t-s);l+=p-s,l+=i-l%i,s=p+1}}var P=function(){this.id=null,this.f=null,this.time=0,this.handler=m(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<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function J(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Se=50,Re={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},ye={origin:"*mouse"},ge={origin:"+move"};function ce(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var $=[""];function U(e){for(;$.length<=e;)$.push(b($)+" ");return $[e]}function b(e){return e[e.length-1]}function R(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function k(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function le(){}function xe(e,t){var i;return Object.create?i=Object.create(e):(le.prototype=e,i=new le),t&&f(t,i),i}var X=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ce(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||X.test(e))}function Me(e,t){return t?t.source.indexOf("\\w")>-1&&Ce(e)?!0:t.test(e):Ce(e)}function Ge(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var je=/[\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 Ne(e){return e.charCodeAt(0)>=768&&je.test(e)}function Fe(e,t,i){for(;(i<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=i;return t}function dt(e,t,i){for(var n=t>i?-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 Qe(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||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 et=null;function tt(e,t,i){var n;et=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:et=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:et=r)}return n!=null?n:et}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]/,p=/[1n]/;function g(v,_,D){this.level=v,this.from=_,this.to=D}return function(v,_){var D=_=="ltr"?"L":"R";if(v.length==0||_=="ltr"&&!n.test(v))return!1;for(var te=v.length,ee=[],Ae=0;Ae<te;++Ae)ee.push(i(v.charCodeAt(Ae)));for(var Ue=0,Xe=D;Ue<te;++Ue){var Je=ee[Ue];Je=="m"?ee[Ue]=Xe:Xe=Je}for(var it=0,qe=D;it<te;++it){var ut=ee[it];ut=="1"&&qe=="r"?ee[it]="n":s.test(ut)&&(qe=ut,ut=="r"&&(ee[it]="R"))}for(var bt=1,gt=ee[0];bt<te-1;++bt){var At=ee[bt];At=="+"&>=="1"&&ee[bt+1]=="1"?ee[bt]="1":At==","&>==ee[bt+1]&&(gt=="1"||gt=="n")&&(ee[bt]=gt),gt=At}for(var Kt=0;Kt<te;++Kt){var cn=ee[Kt];if(cn==",")ee[Kt]="N";else if(cn=="%"){var $t=void 0;for($t=Kt+1;$t<te&&ee[$t]=="%";++$t);for(var Pn=Kt&&ee[Kt-1]=="!"||$t<te&&ee[$t]=="1"?"1":"N",An=Kt;An<$t;++An)ee[An]=Pn;Kt=$t-1}}for(var nn=0,Ln=D;nn<te;++nn){var mn=ee[nn];Ln=="L"&&mn=="1"?ee[nn]="L":s.test(mn)&&(Ln=mn)}for(var sn=0;sn<te;++sn)if(r.test(ee[sn])){var rn=void 0;for(rn=sn+1;rn<te&&r.test(ee[rn]);++rn);for(var Jt=(sn?ee[sn-1]:D)=="L",Mn=(rn<te?ee[rn]:D)=="L",ur=Jt==Mn?Jt?"L":"R":D,_i=sn;_i<rn;++_i)ee[_i]=ur;sn=rn-1}for(var yn=[],oi,dn=0;dn<te;)if(l.test(ee[dn])){var Yo=dn;for(++dn;dn<te&&l.test(ee[dn]);++dn);yn.push(new g(0,Yo,dn))}else{var mi=dn,Hi=yn.length,zi=_=="rtl"?1:0;for(++dn;dn<te&&ee[dn]!="L";++dn);for(var wn=mi;wn<dn;)if(p.test(ee[wn])){mi<wn&&(yn.splice(Hi,0,new g(1,mi,wn)),Hi+=zi);var hr=wn;for(++wn;wn<dn&&p.test(ee[wn]);++wn);yn.splice(Hi,0,new g(2,hr,wn)),Hi+=zi,mi=wn}else++wn;mi<dn&&yn.splice(Hi,0,new g(1,mi,dn))}return _=="ltr"&&(yn[0].level==1&&(oi=v.match(/^\s+/))&&(yn[0].from=oi[0].length,yn.unshift(new g(0,0,oi[0].length))),b(yn).level==1&&(oi=v.match(/\s+$/))&&(b(yn).to-=oi[0].length,yn.push(new g(0,te-oi[0].length,te)))),_=="rtl"?yn.reverse():yn}}();function ht(e,t){var i=e.order;return i==null&&(i=e.order=mt(e.text,t)),i}var st=[],Ee=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||st).concat(i)}};function pt(e,t){return e._handlers&&e._handlers[t]||st}function ot(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=J(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Le(e,t){var i=pt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function ze(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Le(e,i||t.type,e,t),S(t)||t.codemirrorIgnore}function W(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)J(i,t[n])==-1&&i.push(t[n])}function B(e,t){return pt(e,t).length>0}function H(e){e.prototype.on=function(t,i){Ee(this,t,i)},e.prototype.off=function(t,i){ot(this,t,i)}}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function x(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function S(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function E(e){y(e),x(e)}function ne(e){return e.target||e.srcElement}function G(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ue&&e.ctrlKey&&t==1&&(t=3),t}var Oe=function(){if(j&&Q<9)return!1;var e=C("div");return"draggable"in e||"dragDrop"in e}(),Ye;function nt(e){if(Ye==null){var t=C("span","\u200B");he(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ye=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&Q<8))}var i=Ye?C("span","\u200B"):C("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ke;function Et(e){if(Ke!=null)return Ke;var t=he(e,document.createTextNode("A\u062EA")),i=Y(t,0,1).getBoundingClientRect(),n=Y(t,1,2).getBoundingClientRect();return Be(e),!i||i.left==i.right?!1:Ke=n.right-i.right<3}var Ct=`
|
|
|
|
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/)},at=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},Ht=function(){var e=C("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Nt=null;function Tt(e){if(Nt!=null)return Nt;var t=he(e,C("span","x")),i=t.getBoundingClientRect(),n=Y(t,0,1).getBoundingClientRect();return Nt=Math.abs(i.left-n.left)>1}var Ot={},_t={};function bn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ot[e]=t}function ai(e,t){_t[e]=t}function vt(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=xe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return vt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return vt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Kn(e,t){t=vt(t);var i=Ot[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]={};f(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 It=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};It.prototype.eol=function(){return this.pos>=this.string.length},It.prototype.sol=function(){return this.pos==this.lineStart},It.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},It.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},It.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},It.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},It.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},It.prototype.skipToEnd=function(){this.pos=this.string.length},It.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},It.prototype.backUp=function(e){this.pos-=e},It.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=w(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?w(this.string,this.lineStart,this.tabSize):0)},It.prototype.indentation=function(){return w(this.string,null,this.tabSize)-(this.lineStart?w(this.string,this.lineStart,this.tabSize):0)},It.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},It.prototype.current=function(){return this.string.slice(this.start,this.pos)},It.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},It.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},It.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(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<s){i=r;break}t-=s}return i.lines[t]}function Nn(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function ui(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function Cn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Lt(e){if(e.parent==null)return null;for(var t=e.parent,i=J(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function In(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var p=e.lines[l],g=p.height;if(t<g)break;t-=g}return i+l}function Yn(e,t){return t>=e.first&&t<e.first+e.size}function hi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function We(e,t,i){if(i===void 0&&(i=null),!(this instanceof We))return new We(e,t,i);this.line=e,this.ch=t,this.sticky=i}function St(e,t){return e.line-t.line||e.ch-t.ch}function ci(e,t){return e.sticky==t.sticky&&St(e,t)==0}function Ai(e){return We(e.line,e.ch)}function di(e,t){return St(e,t)<0?t:e}function Li(e,t){return St(e,t)<0?e:t}function c(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return We(e.first,0);var i=e.first+e.size-1;return t.line>i?We(i,ct(e,i).text.length):a(t,ct(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?We(e.line,t):i<0?We(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var d=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.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={};Bn(e,t.text,e.doc.mode,i,function(v,_){return r.push(v,_)},s,n);for(var l=i.state,p=function(v){i.baseTokens=r;var _=e.state.overlays[v],D=1,te=0;i.state=!0,Bn(e,t.text,_.mode,i,function(ee,Ae){for(var Ue=D;te<ee;){var Xe=r[D];Xe>ee&&r.splice(D,1,ee,r[D+1],Xe),D+=2,te=Math.min(ee,Xe)}if(!Ae)return;if(_.opaque)r.splice(Ue,D-Ue,ee,"overlay "+Ae),D=Ue+2;else for(;Ue<D;Ue+=2){var Je=r[Ue+1];r[Ue+1]=(Je?Je+" ":"")+"overlay "+Ae}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)p(g);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function De(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ze(e,Lt(t)),r=t.text.length>e.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 Ze(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&&ct(n,s-1).stateAfter,p=l?h.fromSaved(n,l,s):new h(n,li(n.mode),s);return n.iter(s,t,function(g){lt(e,g.text,p);var v=p.line;g.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?p.save():null,p.nextLine()}),i&&(n.modeFrontier=p.line),p}function lt(e,t,i,n){var r=e.doc.mode,s=new It(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Ie(r,i.state);!s.eol();)xt(r,s,i.state),s.start=s.pos}function Ie(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=si(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function xt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=si(e,i).mode);var s=e.token(t,i);if(t.pos>t.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 Xt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var p=ct(r,t.line),g=Ze(e,t.line,i),v=new It(p.text,e.options.tabSize,g),_;for(n&&(_=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=xt(s,v,g.state),n&&_.push(new Rt(v,l,Wn(r.mode,g.state)));return n?_:new Rt(v,l,g.state)}function jn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Bn(e,t,i,n,r,s,l){var p=i.flattenSpans;p==null&&(p=e.options.flattenSpans);var g=0,v=null,_=new It(t,e.options.tabSize,n),D,te=e.options.addModeClass&&[null];for(t==""&&jn(Ie(i,n.state),s);!_.eol();){if(_.pos>e.options.maxHighlightLength?(p=!1,l&<(e,t,n,_.pos),_.pos=t.length,D=null):D=jn(xt(i,_,n.state,te),s),te){var ee=te[0].name;ee&&(D="m-"+(D?ee+" "+D:ee))}if(!p||v!=D){for(;g<_.start;)g=Math.min(_.start,g+5e3),r(g,v);v=D}_.start=_.pos}for(;g<_.pos;){var Ae=Math.min(_.pos,g+5e3);r(Ae,v),g=Ae}}function an(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),p=t;p>l;--p){if(p<=s.first)return s.first;var g=ct(s,p-1),v=g.stateAfter;if(v&&(!i||p+(v instanceof d?v.lookAhead:0)<=s.modeFrontier))return p;var _=w(g.text,null,e.options.tabSize);(r==null||n>_)&&(r=p-1,n=_)}return r}function Gn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var r=ct(e,n).stateAfter;if(r&&(!(r instanceof d)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Wi=!1,Sn=!1;function Un(){Wi=!0}function On(){Sn=!0}function vi(e,t,i){this.marker=e,this.from=t,this.to=i}function $n(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function fi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function ti(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,p=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(p||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var g=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new vi(l,s.from,g?null:s.to))}}return n}function Gi(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,p=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(p||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new vi(l,g?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Zn(e,t){if(t.full)return null;var i=Yn(e,t.from.line)&&ct(e,t.from.line).markedSpans,n=Yn(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=St(t.from,t.to)==0,p=cr(i,r,l),g=Gi(n,s,l),v=t.text.length==1,_=b(t.text).length+(v?r:0);if(p)for(var D=0;D<p.length;++D){var te=p[D];if(te.to==null){var ee=$n(g,te.marker);ee?v&&(te.to=ee.to==null?null:ee.to+_):te.to=r}}if(g)for(var Ae=0;Ae<g.length;++Ae){var Ue=g[Ae];if(Ue.to!=null&&(Ue.to+=_),Ue.from==null){var Xe=$n(p,Ue.marker);Xe||(Ue.from=_,v&&(p||(p=[])).push(Ue))}else Ue.from+=_,v&&(p||(p=[])).push(Ue)}p&&(p=Fn(p)),g&&g!=p&&(g=Fn(g));var Je=[p];if(!v){var it=t.text.length-2,qe;if(it>0&&p)for(var ut=0;ut<p.length;++ut)p[ut].to==null&&(qe||(qe=[])).push(new vi(p[ut].marker,null,null));for(var bt=0;bt<it;++bt)Je.push(qe);Je.push(g)}return Je}function Fn(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ee){if(ee.markedSpans)for(var Ae=0;Ae<ee.markedSpans.length;++Ae){var Ue=ee.markedSpans[Ae].marker;Ue.readOnly&&(!n||J(n,Ue)==-1)&&(n||(n=[])).push(Ue)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],p=l.find(0),g=0;g<r.length;++g){var v=r[g];if(St(v.to,p.from)<0||St(v.from,p.to)>0)continue;var _=[g,1],D=St(v.from,p.from),te=St(v.to,p.to);(D<0||!l.inclusiveLeft&&!D)&&_.push({from:v.from,to:p.from}),(te>0||!l.inclusiveRight&&!te)&&_.push({from:p.to,to:v.to}),r.splice.apply(r,_),g+=_.length-3}return r}function Oi(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function dr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Zt(e){return e.inclusiveLeft?-1:0}function Bt(e){return e.inclusiveRight?1:0}function pn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=St(n.from,r.from)||Zt(e)-Zt(t);if(s)return-s;var l=St(n.to,r.to)||Bt(e)-Bt(t);return l||t.id-e.id}function jt(e,t){var i=Sn&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||pn(n,r.marker)<0)&&(n=r.marker);return n}function en(e){return jt(e,!0)}function zt(e){return jt(e,!1)}function ni(e,t){var i=Sn&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||pn(n,s.marker)<0)&&(n=s.marker)}return n}function qt(e,t,i,n,r){var s=ct(e,t),l=Sn&&s.markedSpans;if(l)for(var p=0;p<l.length;++p){var g=l[p];if(!g.marker.collapsed)continue;var v=g.marker.find(0),_=St(v.from,i)||Zt(g.marker)-Zt(r),D=St(v.to,n)||Bt(g.marker)-Bt(r);if(_>=0&&D<=0||_<=0&&D>=0)continue;if(_<=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?St(v.to,i)>=0:St(v.to,i)>0)||_>=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?St(v.from,n)<=0:St(v.from,n)<0))return!0}}function kn(e){for(var t;t=en(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=zt(e);)e=t.find(1,!0).line;return e}function Xi(e){for(var t,i;t=zt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function yi(e,t){var i=ct(e,t),n=kn(i);return i==n?t:Lt(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=ct(e,t),n;if(!Rn(e,i))return t;for(;n=zt(i);)i=n.find(1,!0).line;return Lt(i)+1}function Rn(e,t){var i=Sn&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fr(e,t,n))return!0}}function fr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fr(e,n.line,$n(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&fr(e,t,r))return!0}function Jn(e){e=kn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var p=s.children[l];if(p==i)break;t+=p.height}return t}function Ki(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=en(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=zt(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function Fr(e){var t=e.display,i=e.doc;t.maxLine=ct(i,i.first),t.maxLineLength=Ki(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Ki(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Ri=function(e,t,i){this.text=e,dr(this,t),this.height=i?i(this):1};Ri.prototype.lineNo=function(){return Lt(this)},H(Ri);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),Oi(e),dr(e,i);var r=n?n(e):1;r!=e.height&&Cn(e,r)}function ho(e){e.parent=null,Oi(e)}var ft={},kt={};function yt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?kt:ft;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Mt(e,t){var i=ae("span",null,null,ie?"padding-right: .1px":null),n={pre:ae("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=Gt,Et(e.display.measure)&&(l=ht(s,e.doc.direction))&&(n.addToken=tn(n.addToken,l)),n.map=[];var p=t!=e.display.externalMeasured&&Lt(s);Dt(s,n,De(e,s,p)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=N(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=N(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(nt(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(ie){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Le(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=N(n.pre.className,n.textClass||"")),n}function Ut(e){var t=C("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Gt(e,t,i,n,r,s,l){if(!t)return;var p=e.splitSpaces?Pt(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,_;if(!g.test(t))e.col+=t.length,_=document.createTextNode(p),e.map.push(e.pos,e.pos+t.length,_),j&&Q<9&&(v=!0),e.pos+=t.length;else{_=document.createDocumentFragment();for(var D=0;;){g.lastIndex=D;var te=g.exec(t),ee=te?te.index-D:t.length-D;if(ee){var Ae=document.createTextNode(p.slice(D,D+ee));j&&Q<9?_.appendChild(C("span",[Ae])):_.appendChild(Ae),e.map.push(e.pos,e.pos+ee,Ae),e.col+=ee,e.pos+=ee}if(!te)break;D+=ee+1;var Ue=void 0;if(te[0]==" "){var Xe=e.cm.options.tabSize,Je=Xe-e.col%Xe;Ue=_.appendChild(C("span",U(Je),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=Je}else te[0]=="\r"||te[0]==`
|
|
`?(Ue=_.appendChild(C("span",te[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",te[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(te[0]),Ue.setAttribute("cm-text",te[0]),j&&Q<9?_.appendChild(C("span",[Ue])):_.appendChild(Ue),e.col+=1);e.map.push(e.pos,e.pos+1,Ue),e.pos++}}if(e.trailingSpace=p.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var it=i||"";n&&(it+=n),r&&(it+=r);var qe=C("span",[_],it,s);if(l)for(var ut in l)l.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&qe.setAttribute(ut,l[ut]);return e.content.appendChild(qe)}e.content.appendChild(_)}function Pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function tn(e,t){return function(i,n,r,s,l,p,g){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,_=v+n.length;;){for(var D=void 0,te=0;te<t.length&&!(D=t[te],D.to>v&&D.from<=v);te++);if(D.to>=_)return e(i,n,r,s,l,p,g);e(i,n.slice(0,D.to-v),r,s,null,p,g),s=null,n=n.slice(D.to-v),v=D.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 Dt(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),yt(i[l+1],t.cm.options));return}for(var p=r.length,g=0,v=1,_="",D,te,ee=0,Ae,Ue,Xe,Je,it;;){if(ee==g){Ae=Ue=Xe=te="",it=null,Je=null,ee=Infinity;for(var qe=[],ut=void 0,bt=0;bt<n.length;++bt){var gt=n[bt],At=gt.marker;if(At.type=="bookmark"&>.from==g&&At.widgetNode)qe.push(At);else if(gt.from<=g&&(gt.to==null||gt.to>g||At.collapsed&>.to==g&>.from==g)){if(gt.to!=null&>.to!=g&&ee>gt.to&&(ee=gt.to,Ue=""),At.className&&(Ae+=" "+At.className),At.css&&(te=(te?te+";":"")+At.css),At.startStyle&>.from==g&&(Xe+=" "+At.startStyle),At.endStyle&>.to==ee&&(ut||(ut=[])).push(At.endStyle,gt.to),At.title&&((it||(it={})).title=At.title),At.attributes)for(var Kt in At.attributes)(it||(it={}))[Kt]=At.attributes[Kt];At.collapsed&&(!Je||pn(Je.marker,At)<0)&&(Je=gt)}else gt.from>g&&ee>gt.from&&(ee=gt.from)}if(ut)for(var cn=0;cn<ut.length;cn+=2)ut[cn+1]==ee&&(Ue+=" "+ut[cn]);if(!Je||Je.from==g)for(var $t=0;$t<qe.length;++$t)En(t,0,qe[$t]);if(Je&&(Je.from||0)==g){if(En(t,(Je.to==null?p+1:Je.to)-g,Je.marker,Je.from==null),Je.to==null)return;Je.to==g&&(Je=!1)}}if(g>=p)break;for(var Pn=Math.min(p,ee);;){if(_){var An=g+_.length;if(!Je){var nn=An>Pn?_.slice(0,Pn-g):_;t.addToken(t,nn,D?D+Ae:Ae,Xe,g+nn.length==ee?Ue:"",te,it)}if(An>=Pn){_=_.slice(Pn-g),g=Pn;break}g=An,Xe=""}_=r.slice(s,s=i[v++]),D=yt(i[v++],t.cm.options)}}}function bi(e,t,i){this.line=t,this.rest=Xi(t),this.size=this.rest?Lt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Rn(e,t)}function Ft(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new bi(e.doc,ct(e.doc,s),s);r=s+l.size,n.push(l)}return n}var ln=null;function Vn(e){ln?ln.ops.push(e):e.ownsGroup=ln={ops:[e],delayedCallbacks:[]}}function Xn(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function Hr(e,t){var i=e.ownsGroup;if(!i)return;try{Xn(i)}finally{ln=null,t(i)}}var pr=null;function gn(e,t){var i=pt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;ln?r=ln.delayedCallbacks:pr?r=pr:(r=pr=[],setTimeout(Rs,0));for(var s=function(p){r.push(function(){return i[p].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Rs(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function Jo(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?Qo(e,t,i,n):s=="class"?co(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=C("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),j&&Q<8&&(e.node.style.zIndex=2)),e.node}function Ds(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=gr(t);t.background=n.insertBefore(C("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Mt(e,t)}function Ps(e,t){var i=t.text.className,n=qo(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,co(e,t)):i&&(t.text.className=i)}function co(e,t){Ds(e,t),t.line.wrapClass?gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Qo(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=gr(t);t.gutterBackground=C("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=gr(t),p=t.gutter=C("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(p),l.insertBefore(p,t.text),t.line.gutterClass&&(p.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=p.appendChild(C("div",hi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,_=s.hasOwnProperty(v)&&s[v];_&&p.appendChild(C("div",[_],"CodeMirror-gutter-elt","left: "+n.gutterLeft[v]+"px; width: "+n.gutterWidth[v]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=fe("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ea(e,t,i)}function Is(e,t,i,n){var r=qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),co(e,t),Qo(e,t,i,n),ea(e,t,n),t.node}function ea(e,t,i){if(ta(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)ta(e,t.rest[n],t,i,!1)}function ta(e,t,i,n,r){if(!t.widgets)return;for(var s=gr(i),l=0,p=t.widgets;l<p.length;++l){var g=p[l],v=C("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),js(g,v,i,n),e.display.input.setUneditable(v),r&&g.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),gn(g,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function mr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),he(t.display.measure,C("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=ne(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function zr(e){return e.lineSpace.offsetTop}function fo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function na(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=he(e.measure,C("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function ii(e){return Se-e.display.nativeBarWidth}function Di(e){return e.display.scroller.clientWidth-ii(e)-e.display.barWidth}function po(e){return e.display.scroller.clientHeight-ii(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Di(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),p=0;p<l.length-1;p++){var g=l[p],v=l[p+1];Math.abs(g.bottom-v.bottom)>2&&s.push((g.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;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(Lt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=kn(t);var i=Lt(t),n=e.display.externalMeasured=new bi(e.doc,t,i);n.lineN=i;var r=n.built=Mt(e,n);return n.text=r.pre,he(e.display.lineMeasure,r.pre),n}function ra(e,t,i,n){return ri(e,Yi(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ii(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Yi(e,t){var i=Lt(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(Jo(e,n,i,wo(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ia(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ri(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Hs(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var oa={left:0,right:0,top:0,bottom:0};function aa(e,t,i){for(var n,r,s,l,p,g,v=0;v<e.length;v+=3)if(p=e[v],g=e[v+1],t<p?(r=0,s=1,l="left"):t<g?(r=t-p,s=r+1):(v==e.length-3||t==g&&e[v+3]>t)&&(s=g-p,r=s-1,t>=g&&(l="right")),r!=null){if(n=e[v+2],p==g&&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==g-p)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)n=e[(v+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:p,coverEnd:g}}function Fs(e,t){var i=oa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=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,p=r.end,g=r.collapse,v;if(s.nodeType==3){for(var _=0;_<4;_++){for(;l&&Ne(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+p<r.coverEnd&&Ne(t.line.text.charAt(r.coverStart+p));)++p;if(j&&Q<9&&l==0&&p==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=Fs(Y(s,l,p).getClientRects(),n),v.left||v.right||l==0)break;p=l,l=l-1,g="right"}j&&Q<11&&(v=zs(e.display.measure,v))}else{l>0&&(g=n="right");var D;e.options.lineWrapping&&(D=s.getClientRects()).length>1?v=D[n=="right"?D.length-1:0]:v=s.getBoundingClientRect()}if(j&&Q<9&&!l&&(!v||!v.left&&!v.right)){var te=s.parentNode.getClientRects()[0];te?v={left:te.left,right:te.left+Zi(e.display),top:te.top,bottom:te.bottom}:v=oa}for(var ee=v.top-t.rect.top,Ae=v.bottom-t.rect.top,Ue=(ee+Ae)/2,Xe=t.view.measure.heights,Je=0;Je<Xe.length-1&&!(Ue<Xe[Je]);Je++);var it=Je?Xe[Je-1]:0,qe=Xe[Je],ut={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:it,bottom:qe};return!v.left&&!v.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=ee,ut.rbottom=Ae),ut}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Tt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function sa(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function la(e){e.display.externalMeasure=null,Be(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)sa(e.display.view[t])}function vr(e){la(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ua(){return M&&z?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return M&&z?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=mr(e.widgets[i]));return t}function Wr(e,t,i,n,r){if(!r){var s=mo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Jn(t);if(n=="local"?l+=zr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var p=e.display.lineSpace.getBoundingClientRect();l+=p.top+(n=="window"?0:ha());var g=p.left+(n=="window"?0:ua());i.left+=g,i.right+=g}return i.top+=l,i.bottom+=l,i}function ca(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ua(),r-=ha();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function vo(e,t,i,n,r){return n||(n=ct(e.doc,t.line)),Wr(e,n,ra(e,n,t.ch,r),i)}function qn(e,t,i,n,r,s){n=n||ct(e.doc,t.line),r||(r=Yi(e,n));function l(Ae,Ue){var Xe=ri(e,r,Ae,Ue?"right":"left",s);return Ue?Xe.left=Xe.right:Xe.right=Xe.left,Wr(e,n,Xe,i)}var p=ht(n,e.doc.direction),g=t.ch,v=t.sticky;if(g>=n.text.length?(g=n.text.length,v="before"):g<=0&&(g=0,v="after"),!p)return l(v=="before"?g-1:g,v=="before");function _(Ae,Ue,Xe){var Je=p[Ue],it=Je.level==1;return l(Xe?Ae-1:Ae,it!=Xe)}var D=tt(p,g,v),te=et,ee=_(g,D,v=="before");return te!=null&&(ee.other=_(g,te,v!="before")),ee}function da(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Zi(e.display)*t.ch);var n=ct(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=We(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=In(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,ct(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ct(n,r);;){var p=Ws(e,l,r,t,i),g=ni(l,p.ch+(p.xRel>0||p.outside>0?1:0));if(!g)return p;var v=g.find(1);if(v.line==r)return v;l=ct(n,r=v.line)}}function fa(e,t,i,n){n-=mo(t);var r=t.text.length,s=dt(function(l){return ri(e,i,l-1).bottom<=n},r,0);return r=dt(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=mo(t),p=0,g=t.text.length,v=!0,_=ht(t,e.doc.direction);if(_){var D=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,_,n,r);v=D.level!=1,p=v?D.from:D.to-1,g=v?D.to:D.from-1}var te=null,ee=null,Ae=dt(function(bt){var gt=ri(e,s,bt);return gt.top+=l,gt.bottom+=l,xo(gt,n,r,!1)?(gt.top<=r&>.left<=n&&(te=bt,ee=gt),!0):!1},p,g),Ue,Xe,Je=!1;if(ee){var it=n-ee.left<ee.right-n,qe=it==v;Ae=te+(qe?0:1),Xe=qe?"after":"before",Ue=it?ee.left:ee.right}else{!v&&(Ae==g||Ae==p)&&Ae++,Xe=Ae==0?"after":Ae==t.text.length?"before":ri(e,s,Ae-(v?1:0)).bottom+l<=r==v?"after":"before";var ut=qn(e,We(i,Ae,Xe),"line",t,s);Ue=ut.left,Je=r<ut.top?-1:r>=ut.bottom?1:0}return Ae=Fe(t.text,Ae,1),yo(i,Ae,Xe,Je,n-Ue)}function Gs(e,t,i,n,r,s,l){var p=dt(function(D){var te=r[D],ee=te.level!=1;return xo(qn(e,We(i,ee?te.to:te.from,ee?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),g=r[p];if(p>0){var v=g.level!=1,_=qn(e,We(i,v?g.from:g.to,v?"after":"before"),"line",t,n);xo(_,s,l,!0)&&_.top>l&&(g=r[p-1])}return g}function Vs(e,t,i,n,r,s,l){var p=fa(e,t,n,l),g=p.begin,v=p.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var _=null,D=null,te=0;te<r.length;te++){var ee=r[te];if(ee.from>=v||ee.to<=g)continue;var Ae=ee.level!=1,Ue=ri(e,n,Ae?Math.min(v,ee.to)-1:Math.max(g,ee.from)).right,Xe=Ue<s?s-Ue+1e9:Ue-s;(!_||D>Xe)&&(_=ee,D=Xe)}return _||(_=r[r.length-1]),_.from<g&&(_={from:g,to:_.to,level:_.level}),_.to>v&&(_={from:_.from,to:v,level:_.level}),_}var Pi;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=C("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(C("br"));Pi.appendChild(document.createTextNode("x"))}he(e.measure,Pi);var i=Pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Be(e.measure),i||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=C("span","xxxxxxxxxx"),i=C("pre",[t],"CodeMirror-line-like");he(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 p=e.display.gutterSpecs[l].className;i[p]=s.offsetLeft+s.clientLeft+r,n[p]=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 ga(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(Rn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function So(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&Cn(n,r)})}function Ni(e,t,i,n){var r=e.display;if(!i&&ne(t).getAttribute("cm-not-content")=="true")return null;var s,l,p=r.lineSpace.getBoundingClientRect();try{s=t.clientX-p.left,l=t.clientY-p.top}catch(D){return null}var g=bo(e,s,l),v;if(n&&g.xRel>0&&(v=ct(e.doc,g.line).text).length==g.ch){var _=w(v,v.length,e.options.tabSize)-v.length;g=We(g.line,Math.max(0,Math.round((s-na(e.display).left)/Zi(e.display))-_))}return g}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;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Tn(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Sn&&yi(e.doc,t)<r.viewTo&&wi(e);else if(i<=r.viewFrom)Sn&&Ur(e.doc,i+n)>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 p=Gr(e,t,t,-1),g=Gr(e,i,i+n,1);p&&g?(r.view=r.view.slice(0,p.index).concat(Ft(e,p.lineN,g.lineN)).concat(r.view.slice(g.index)),r.viewTo+=n):wi(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function xi(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Ii(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);J(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(!Sn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var p=e.display.viewFrom,g=0;g<r;g++)p+=l[g].size;if(p!=t){if(n>0){if(r==l.length-1)return null;s=p+l[r].size-t,r++}else s=p-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=Ft(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Ft(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ii(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Ft(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ii(e,i)))),n.viewTo=i}function ma(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function va(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var p=i.sel.ranges[l];if(p.from().line>=e.display.viewTo||p.to().line<e.display.viewFrom)continue;var g=p.empty();(g||e.options.showCursorWhenSelecting)&&ya(e,p.head,r),g||Ks(e,p,s)}return n}function ya(e,t,i){var n=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(C("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(C("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=na(e.display),p=l.left,g=Math.max(n.sizerWidth,Di(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function _(qe,ut,bt,gt){ut<0&&(ut=0),ut=Math.round(ut),gt=Math.round(gt),s.appendChild(C("div",null,"CodeMirror-selected","position: absolute; left: "+qe+`px;
|
|
top: `+ut+"px; width: "+(bt==null?g-qe:bt)+`px;
|
|
height: `+(gt-ut)+"px"))}function D(qe,ut,bt){var gt=ct(r,qe),At=gt.text.length,Kt,cn;function $t(nn,Ln){return vo(e,We(qe,nn),"div",gt,Ln)}function Pn(nn,Ln,mn){var sn=pa(e,gt,null,nn),rn=Ln=="ltr"==(mn=="after")?"left":"right",Jt=mn=="after"?sn.begin:sn.end-(/\s/.test(gt.text.charAt(sn.end-1))?2:1);return $t(Jt,rn)[rn]}var An=ht(gt,r.direction);return Qe(An,ut||0,bt==null?At:bt,function(nn,Ln,mn,sn){var rn=mn=="ltr",Jt=$t(nn,rn?"left":"right"),Mn=$t(Ln-1,rn?"right":"left"),ur=ut==null&&nn==0,_i=bt==null&&Ln==At,yn=sn==0,oi=!An||sn==An.length-1;if(Mn.top-Jt.top<=3){var dn=(v?ur:_i)&&yn,Yo=(v?_i:ur)&&oi,mi=dn?p:(rn?Jt:Mn).left,Hi=Yo?g:(rn?Mn:Jt).right;_(mi,Jt.top,Hi-mi,Jt.bottom)}else{var zi,wn,hr,$o;rn?(zi=v&&ur&&yn?p:Jt.left,wn=v?g:Pn(nn,mn,"before"),hr=v?p:Pn(Ln,mn,"after"),$o=v&&_i&&oi?g:Mn.right):(zi=v?Pn(nn,mn,"before"):p,wn=!v&&ur&&yn?g:Jt.right,hr=!v&&_i&&oi?p:Mn.left,$o=v?Pn(Ln,mn,"after"):g),_(zi,Jt.top,wn-zi,Jt.bottom),Jt.bottom<Mn.top&&_(p,Jt.bottom,null,Mn.top),_(hr,Mn.top,$o-hr,Mn.bottom)}(!Kt||Vr(Jt,Kt)<0)&&(Kt=Jt),Vr(Mn,Kt)<0&&(Kt=Mn),(!cn||Vr(Jt,cn)<0)&&(cn=Jt),Vr(Mn,cn)<0&&(cn=Mn)}),{start:Kt,end:cn}}var te=t.from(),ee=t.to();if(te.line==ee.line)D(te.line,te.ch,ee.ch);else{var Ae=ct(r,te.line),Ue=ct(r,ee.line),Xe=kn(Ae)==kn(Ue),Je=D(te.line,te.ch,Xe?Ae.text.length+1:null).end,it=D(ee.line,Xe?0:null,ee.ch).start;Xe&&(Je.top<it.top-2?(_(Je.right,Je.top,null,Je.bottom),_(p,it.top,it.left,it.bottom)):_(Je.right,Je.top,it.left-Je.right,Je.bottom)),Je.bottom<it.top&&_(p,Je.bottom,null,it.top)}i.appendChild(s)}function ko(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?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(),Eo(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ji(e))},100)}function Eo(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Le(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),ie&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Le(e,"blur",e,t),e.state.focused=!1,ke(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<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,p=0;if(r.hidden)continue;if(j&&Q<8){var g=r.node.offsetTop+r.node.offsetHeight;l=g-i,i=g}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(p=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var _=r.line.height-l;if((_>.005||_<-.005)&&(Cn(r.line,l),wa(r.line),r.rest))for(var D=0;D<r.rest.length;D++)wa(r.rest[D]);if(p>e.display.sizerWidth){var te=Math.ceil(p/Zi(e.display));te>e.display.maxLineLength&&(e.display.maxLineLength=te,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Kr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-zr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=In(t,n),l=In(t,r);if(i&&i.ensure){var p=i.ensure.from.line,g=i.ensure.to.line;p<s?(s=p,l=In(t,Jn(ct(t,p))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=l&&(s=In(t,Jn(ct(t,g))-e.wrapper.clientHeight),l=g)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(ze(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&&!Z){var s=C("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?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,p=qn(e,t),g=!i||i==t?p:qn(e,i);r={left:Math.min(p.left,g.left),top:Math.min(p.top,g.top)-n,right:Math.max(p.left,g.left),bottom:Math.max(p.bottom,g.bottom)+n};var v=To(e,r),_=e.doc.scrollTop,D=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-_)>1&&(l=!0)),v.scrollLeft!=null&&(ji(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-D)>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 p=e.doc.height+fo(i),g=t.top<n,v=t.bottom>p-n;if(t.top<r)l.scrollTop=g?0:t.top;else if(t.bottom>r+s){var _=Math.min(t.top,(v?p:t.bottom)-s);_!=r&&(l.scrollTop=_)}var D=e.options.fixedGutter?0:i.gutters.offsetWidth,te=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-D,ee=Di(e)-i.gutters.offsetWidth,Ae=t.right-t.left>ee;return Ae&&(t.right=t.left+ee),t.left<10?l.scrollLeft=0:t.left<te?l.scrollLeft=Math.max(0,t.left+D-(Ae?0:10)):t.right>ee+te-3&&(l.scrollLeft=t.right+(Ae?0:10)-ee),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=C("div",[C("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=C("div",[C("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Ee(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ee(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,j&&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=ue&&!oe?"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;ka(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),ka(e,wr(e)),i=e.display.barWidth,n=e.display.barHeight}function ka(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 Ea={native:Bi,null:Cr};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ke(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ea[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ee(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&&F(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Ui(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 Fi(e){var t=e.curOp;t&&Hr(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;Qs(i)})}function Qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&Fr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=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<t.doc.scrollLeft&&ji(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==se();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Qi(t,e.barMeasure),e.updatedDisplay&&Oo(t,e.barMeasure),e.selectionChanged&&ko(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&ba(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&_a(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ji(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var p=0;p<s.length;++p)s[p].lines.length||Le(s[p],"hide");if(l)for(var g=0;g<l.length;++g)l[g].lines.length&&Le(l[g],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Le(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Dn(e,t){if(e.curOp)return t();Ui(e);try{return t()}finally{Fi(e)}}function un(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ui(e);try{return t.apply(e,arguments)}finally{Fi(e)}}}function xn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ui(this);try{return e.apply(this,arguments)}finally{Fi(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ui(t);try{return e.apply(this,arguments)}finally{Fi(t)}}}function Sr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,m(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Ze(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,p=s.text.length>e.options.maxHighlightLength?Wn(t.mode,n.state):null,g=I(e,s,n,!0);p&&(n.state=p),s.styles=g.styles;var v=s.styleClasses,_=g.classes;_?s.styleClasses=_:v&&(s.styleClasses=null);for(var D=!l||l.length!=s.styles.length||v!=_&&(!v||!_||v.bgClass!=_.bgClass||v.textClass!=_.textClass),te=0;!D&&te<l.length;++te)D=l[te]!=s.styles[te];D&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&<(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Sr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&Dn(e,function(){for(var s=0;s<r.length;s++)xi(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Kr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Di(e),this.force=i,this.dims=wo(e),this.events=[]};$r.prototype.signal=function(e,t){B(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Le.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ii(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ii(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=se();if(!t||!A(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&A(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==se())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ao(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return wi(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&ma(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.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),Sn&&(s=yi(e.doc,s),l=Ur(e.doc,l));var p=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=Jn(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=ma(e);if(!p&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),Be(i.cursorDiv),Be(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,p&&(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),Oo(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),Oo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function p(Ae){var Ue=Ae.nextSibling;return ie&&ue&&e.display.currentWheelTarget==Ae?Ae.style.display="none":Ae.parentNode.removeChild(Ae),Ue}for(var g=n.view,v=n.viewFrom,_=0;_<g.length;_++){var D=g[_];if(!D.hidden)if(!D.node||D.node.parentNode!=s){var te=Is(e,D,v,i);s.insertBefore(te,l)}else{for(;l!=D.node;)l=p(l);var ee=r&&t!=null&&t<=v&&D.lineNumber;D.changes&&(J(D.changes,"gutter")>-1&&(ee=!1),Jo(e,D,v,i)),ee&&(Be(D.lineNumber),D.lineNumber.appendChild(document.createTextNode(hi(e.options,v)))),l=D.node.nextSibling}v+=D.size}for(;l;)l=p(l)}function Mo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(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;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var p=i[l].alignable;if(p)for(var g=0;g<p.length;g++)p[g].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function La(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=hi(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(C("div",[C("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Mo(e.display),!0}return!1}function Ro(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ma(e){var t=e.gutters,i=e.gutterSpecs;Be(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,p=t.appendChild(C("div",null,"CodeMirror-gutter "+s));l&&(p.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=p,p.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Mo(e)}function kr(e){Ma(e.display),Tn(e),Aa(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=C("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=C("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ae("div",null,"CodeMirror-code"),r.selectionDiv=C("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=C("div",null,"CodeMirror-cursors"),r.measure=C("div",null,"CodeMirror-measure"),r.lineMeasure=C("div",null,"CodeMirror-measure"),r.lineSpace=ae("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ae("div",[r.lineSpace],"CodeMirror-lines");r.mover=C("div",[s],null,"position: relative"),r.sizer=C("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=C("div",null,null,"position: absolute; height: "+Se+"px; width: 1px;"),r.gutters=C("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=C("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=C("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),j&&Q<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!ie&&!(de&&me)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Ro(n.gutters,n.lineNumbers),Ma(r),i.init(r)}var Zr=0,Hn=null;j?Hn=-.53:de?Hn=15:M?Hn=-.7:ve&&(Hn=-1/3);function Oa(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Oa(e);return t.x*=Hn,t.y*=Hn,t}function Ra(e,t){var i=Oa(t),n=i.x,r=i.y,s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&p||r&&g))return;if(r&&ue&&ie){e:for(var v=t.target,_=s.view;v!=l;v=v.parentNode)for(var D=0;D<_.length;D++)if(_[D].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!de&&!O&&Hn!=null){r&&g&&xr(e,Math.max(0,l.scrollTop+r*Hn)),ji(e,Math.max(0,l.scrollLeft+n*Hn)),(!r||r&&g)&&y(t),s.wheelStartX=null;return}if(r&&Hn!=null){var te=r*Hn,ee=e.doc.scrollTop,Ae=ee+s.wrapper.clientHeight;te<0?ee=Math.max(0,ee+te-50):Ae=Math.min(e.doc.height,Ae+te+50),Lo(e,{top:ee,bottom:Ae})}Zr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var Ue=l.scrollLeft-s.wheelStartX,Xe=l.scrollTop-s.wheelStartY,Je=Xe&&s.wheelDY&&Xe/s.wheelDY||Ue&&s.wheelDX&&Ue/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Je)return;Hn=(Hn*Zr+Je)/(Zr+1),++Zr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var zn=function(e,t){this.ranges=e,this.primIndex=t};zn.prototype.primary=function(){return this.ranges[this.primIndex]},zn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!ci(i.anchor,n.anchor)||!ci(i.head,n.head))return!1}return!0},zn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Wt(Ai(this.ranges[t].anchor),Ai(this.ranges[t].head));return new zn(e,this.primIndex)},zn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},zn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(St(t,n.from())>=0&&St(e,n.to())<=0)return i}return-1};var Wt=function(e,t){this.anchor=e,this.head=t};Wt.prototype.from=function(){return Li(this.anchor,this.head)},Wt.prototype.to=function(){return di(this.anchor,this.head)},Wt.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(te,ee){return St(te.from(),ee.from())}),i=J(t,r);for(var s=1;s<t.length;s++){var l=t[s],p=t[s-1],g=St(p.to(),l.from());if(n&&!l.empty()?g>0:g>=0){var v=Li(p.from(),l.from()),_=di(p.to(),l.to()),D=p.empty()?l.from()==l.head:p.from()==p.head;s<=i&&--i,t.splice(--s,2,new Wt(D?_:v,D?v:_))}}return new zn(t,i)}function Ci(e,t){return new zn([new Wt(e,t||e)],0)}function Si(e){return e.text?We(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(St(e,t.from)<0)return e;if(St(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),We(i,n)}function Do(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Wt(Da(r.anchor,t),Da(r.head,t)))}return Qn(e.cm,i,e.sel.primIndex)}function Pa(e,t,i){return e.line==t.line?We(i.line,e.ch-t.ch+i.ch):We(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=We(e.first,0),s=r,l=0;l<t.length;l++){var p=t[l],g=Pa(p.from,r,s),v=Pa(Si(p),r,s);if(r=p.to,s=v,i=="around"){var _=e.sel.ranges[l],D=St(_.head,_.anchor)<0;n[l]=new Wt(D?v:g,D?g:v)}else n[l]=new Wt(g,g)}return new zn(n,e.sel.primIndex)}function Po(e){e.doc.mode=Kn(e.options,e.doc.modeOption),Er(e)}function Er(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Sr(e,100),e.state.modeGen++,e.curOp&&Tn(e)}function Na(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function No(e,t,i,n){function r(it){return i?i[it]:null}function s(it,qe,ut){Zo(it,qe,ut,n),gn(it,"change",it,t)}function l(it,qe){for(var ut=[],bt=it;bt<qe;++bt)ut.push(new Ri(v[bt],r(bt),n));return ut}var p=t.from,g=t.to,v=t.text,_=ct(e,p.line),D=ct(e,g.line),te=b(v),ee=r(v.length-1),Ae=g.line-p.line;if(t.full)e.insert(0,l(0,v.length)),e.remove(v.length,e.size-v.length);else if(Na(e,t)){var Ue=l(0,v.length-1);s(D,D.text,ee),Ae&&e.remove(p.line,Ae),Ue.length&&e.insert(p.line,Ue)}else if(_==D)if(v.length==1)s(_,_.text.slice(0,p.ch)+te+_.text.slice(g.ch),ee);else{var Xe=l(1,v.length-1);Xe.push(new Ri(te+_.text.slice(g.ch),ee,n)),s(_,_.text.slice(0,p.ch)+v[0],r(0)),e.insert(p.line+1,Xe)}else if(v.length==1)s(_,_.text.slice(0,p.ch)+v[0]+D.text.slice(g.ch),r(0)),e.remove(p.line+1,Ae);else{s(_,_.text.slice(0,p.ch)+v[0],r(0)),s(D,te+D.text.slice(g.ch),ee);var Je=l(1,v.length-1);Ae>1&&e.remove(p.line+1,Ae-1),e.insert(p.line+1,Je)}gn(e,"change",e,t)}function ki(e,t,i){function n(r,s,l){if(r.linked)for(var p=0;p<r.linked.length;++p){var g=r.linked[p];if(g.doc==s)continue;var v=l&&g.sharedHist;if(i&&!v)continue;t(g.doc,v),n(g.doc,r,v)}}n(e,null,!0)}function Ia(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,So(e),Po(e),ja(e),e.options.lineWrapping||Fr(e),e.options.mode=t.modeOption,Tn(e)}function ja(e){(e.doc.direction=="rtl"?F:ke)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Dn(e,function(){ja(e),Tn(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Io(e,t){var i={from:Ai(t.from),to:Si(t),text:Nn(e,t.from,t.to)};return Fa(e,i,t.from.line,t.to.line+1),ki(e,function(n){return Fa(n,i,t.from.line,t.to.line+1)},!0),i}function Ba(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ba(e.done),b(e.done);if(e.done.length&&!b(e.done).ranges)return b(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Ua(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,p;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)))p=b(l.changes),St(t.from,t.to)==0&&St(t.from,p.to)==0?p.to=Si(t):l.changes.push(Io(e,t));else{var g=b(r.done);for((!g||!g.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,p||Le(e,"historyAdded")}function gl(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 ml(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||gl(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 Fa(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<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function Ha(e,t){var i=yl(e,t),n=Zn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var p=0;p<l.length;++p){for(var g=l[p],v=0;v<s.length;++v)if(s[v].marker==g.marker)continue e;s.push(g)}}else l&&(i[r]=l)}return i}function er(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?zn.prototype.deepCopy.call(s):s);continue}var l=s.changes,p=[];n.push({changes:p});for(var g=0;g<l.length;++g){var v=l[g],_=void 0;if(p.push({from:v.from,to:v.to,text:v.text}),t)for(var D in v)(_=D.match(/^spans_(\d+)$/))&&(J(t,Number(_[1]))>-1&&(b(p)[D]=v[D],delete v[D]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=St(t,r)<0;s!=St(i,r)<0?(r=t,t=i):s!=St(t,i)<0&&(t=i)}return new Wt(r,t)}else return new Wt(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),vn(e,new zn([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<e.sel.ranges.length;s++)n[s]=jo(e.sel.ranges[s],t[s],null,r);var l=Qn(e.cm,n,e.sel.primIndex);vn(e,l,i)}function Bo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,vn(e,Qn(e.cm,r,e.sel.primIndex),n)}function Wa(e,t,i,n){vn(e,Ci(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Wt(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Le(e,"beforeSelectionChange",e,n),e.cm&&Le(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Qn(e.cm,n.ranges,n.ranges.length-1):t}function Ga(e,t,i){var n=e.history.done,r=b(n);r&&r.ranges?(n[n.length-1]=t,eo(e,t,i)):vn(e,t,i)}function vn(e,t,i){eo(e,t,i),ml(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function eo(e,t,i){(B(e,"beforeSelectionChange")||e.cm&&B(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(St(t.primary().head,e.sel.primary().head)<0?-1:1);Va(e,Ka(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&qi(e.cm)}function Va(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,W(e.cm)),gn(e,"cursorActivity",e)}function Xa(e){Va(e,Ka(e,e.sel,null,!1))}function Ka(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],p=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],g=to(e,l.anchor,p&&p.anchor,i,n),v=to(e,l.head,p&&p.head,i,n);(r||g!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Wt(g,v))}return r?Qn(e.cm,r,t.primIndex):t}function tr(e,t,i,n,r){var s=ct(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var p=s.markedSpans[l],g=p.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,_="selectRight"in g?!g.selectRight:g.inclusiveRight;if((p.from==null||(v?p.from<=t.ch:p.from<t.ch))&&(p.to==null||(_?p.to>=t.ch:p.to>t.ch))){if(r&&(Le(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var D=g.find(n<0?1:-1),te=void 0;if((n<0?_:v)&&(D=Ya(e,D,-n,D&&D.line==t.line?s:null)),D&&D.line==t.line&&(te=St(D,i))&&(n<0?te<0:te>0))return tr(e,D,t,n,r)}var ee=g.find(n<0?-1:1);return(n<0?v:_)&&(ee=Ya(e,ee,n,ee.line==t.line?s:null)),ee?tr(e,ee,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,We(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,We(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line<e.first+e.size-1?We(t.line+1,0):null:new We(t.line,t.ch+i)}function $a(e){e.setSelection(We(e.firstLine(),0),We(e.lastLine()),pe)}function Za(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,p){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),p!==void 0&&(n.origin=p)}),Le(e,"beforeChange",e,n),e.cm&&Le(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function nr(e,t,i){if(e.cm){if(!e.cm.curOp)return un(e.cm,nr)(e,t,i);if(e.cm.state.suppressEdits)return}if((B(e,"beforeChange")||e.cm&&B(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Wi&&!i&&Mi(e,t.from,t.to);if(n)for(var r=n.length-1;r>=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]==""&&St(t.from,t.to)==0)return;var i=Do(e,t);Ua(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,Zn(e,t));var n=[];ki(e,function(r,s){!s&&J(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,p=t=="undo"?r.done:r.undone,g=t=="undo"?r.undone:r.done,v=0;v<p.length&&!(s=p[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==p.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=p.pop(),s.ranges){if(qr(s,g),i&&!s.equals(e.sel)){vn(e,s,{clearRedo:!1});return}l=s}else if(n){p.push(s);return}else break;var _=[];qr(l,g),g.push({changes:_,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var D=B(e,"beforeChange")||e.cm&&B(e.cm,"beforeChange"),te=function(Ue){var Xe=s.changes[Ue];if(Xe.origin=t,D&&!Za(e,Xe,!1))return p.length=0,{};_.push(Io(e,Xe));var Je=Ue?Do(e,Xe):b(p);Tr(e,Xe,Je,Ha(e,Xe)),!Ue&&e.cm&&e.cm.scrollIntoView({from:Xe.from,to:Si(Xe)});var it=[];ki(e,function(qe,ut){!ut&&J(it,qe.history)==-1&&(ts(qe.history,Xe),it.push(qe.history)),Tr(qe,Xe,null,Ha(qe,Xe))})},ee=s.changes.length-1;ee>=0;--ee){var Ae=te(ee);if(Ae)return Ae.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new zn(R(e.sel.ranges,function(r){return new Wt(We(r.anchor.line+t,r.anchor.ch),We(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Tn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)xi(e.cm,n,"gutter")}}function Tr(e,t,i,n){if(e.cm&&!e.cm.curOp)return un(e.cm,Tr)(e,t,i,n);if(t.to.line<e.first){qa(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);qa(e,r),t={from:We(e.first,0),to:We(t.to.line+r,t.to.ch),text:[b(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:We(s,ct(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Nn(e,t.from,t.to),i||(i=Do(e,t)),e.cm?xl(e.cm,t,n):No(e,t,n),eo(e,i,pe),e.cantEdit&&to(e,We(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,p=!1,g=s.line;e.options.lineWrapping||(g=Lt(kn(ct(n,s.line))),n.iter(g,l.line+1,function(ee){if(ee==r.maxLine)return p=!0,!0})),n.sel.contains(t.from,t.to)>-1&&W(e),No(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(ee){var Ae=Ki(ee);Ae>r.maxLineLength&&(r.maxLine=ee,r.maxLineLength=Ae,r.maxLineChanged=!0,p=!1)}),p&&(e.curOp.updateMaxLine=!0)),Gn(n,s.line),Sr(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Tn(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?xi(e,s.line,"text"):Tn(e,s.line,l.line+1,v);var _=B(e,"changes"),D=B(e,"change");if(D||_){var te={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};D&&gn(e,"change",e,te),_&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(te)}e.display.selForContextMenu=null}function ir(e,t,i,n,r){var s;n||(n=i),St(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){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function es(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var p=0;p<s.ranges.length;p++)Qa(s.ranges[p].anchor,t,i,n),Qa(s.ranges[p].head,t,i,n);continue}for(var g=0;g<s.changes.length;++g){var v=s.changes[g];if(i<v.from.line)v.from=We(v.from.line+n,v.from.ch),v.to=We(v.to.line+n,v.to.ch);else if(t<=v.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ts(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;es(e.done,i,n,r),es(e.undone,i,n,r)}function _r(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ct(e,c(e,t)):r=Lt(t),r==null?null:(n(s,r)&&e.cm&&xi(e.cm,r,i),s)}function Ar(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ar.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,ho(r),gn(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Lr(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}Lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ar))){var p=[];this.collapse(p),this.children=[new Ar(p)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,p=l;p<r.lines.length;){var g=new Ar(r.lines.slice(p,p+=25));r.height-=g.height,this.children.splice(++n,0,g),g.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Lr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=J(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Lr(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Mr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Mr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Lt(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=mr(this);Cn(i,Math.max(0,i.height-s)),e&&(Dn(e,function(){ns(e,i,-s),xi(e,n,"widget")}),gn(e,"lineWidgetCleared",e,this,n))},Mr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=mr(this)-t;if(!r)return;Rn(this.doc,n)||Cn(n,n.height+r),i&&Dn(i,function(){i.curOp.forceUpdate=!0,ns(i,n,r),gn(i,"lineWidgetChanged",i,e,Lt(n))})},H(Mr);function ns(e,t,i){Jn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_o(e,i)}function wl(e,t,i,n){var r=new Mr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),_r(e,t,"widget",function(l){var p=l.widgets||(l.widgets=[]);if(r.insertAt==null?p.push(r):p.splice(Math.min(p.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Rn(e,l)){var g=Jn(l)<e.scrollTop;Cn(l,l.height+mr(r)),g&&_o(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&gn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Lt(t)),r}var is=0,Ei=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++is};Ei.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ui(e),B(this,"clear")){var i=this.find();i&&gn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],p=$n(l.markedSpans,this);e&&!this.collapsed?xi(e,Lt(l),"text"):e&&(p.to!=null&&(r=Lt(l)),p.from!=null&&(n=Lt(l))),l.markedSpans=fi(l.markedSpans,p),p.from==null&&this.collapsed&&!Rn(this.doc,l)&&e&&Cn(l,$i(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var v=kn(this.lines[g]),_=Ki(v);_>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=_,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Tn(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&&gn(e,"markerCleared",e,this,n,r),t&&Fi(e),this.parent&&this.parent.clear()},Ei.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=$n(s.markedSpans,this);if(l.from!=null&&(i=We(t?s:Lt(s),l.from),e==-1))return i;if(l.to!=null&&(n=We(t?s:Lt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ei.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Dn(n,function(){var r=t.line,s=Lt(t.line),l=go(n,s);if(l&&(sa(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Rn(i.doc,r)&&i.height!=null){var p=i.height;i.height=null;var g=mr(i)-p;g&&Cn(r,r.height+g)}gn(n,"markerChanged",n,e)})},Ei.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||J(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ei.prototype.detachLine=function(e){if(this.lines.splice(J(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},H(Ei);function rr(e,t,i,n,r){if(n&&n.shared)return Cl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return un(e.cm,rr)(e,t,i,n,r);var s=new Ei(e,r),l=St(t,i);if(n&&f(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ae("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");On()}s.addToHistory&&Ua(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var p=t.line,g=e.cm,v;if(e.iter(p,i.line+1,function(D){g&&s.collapsed&&!g.options.lineWrapping&&kn(D)==g.display.maxLine&&(v=!0),s.collapsed&&p!=t.line&&Cn(D,0),ti(D,new vi(s,p==t.line?t.ch:null,p==i.line?i.ch:null)),++p}),s.collapsed&&e.iter(t.line,i.line+1,function(D){Rn(e,D)&&Cn(D,0)}),s.clearOnEnter&&Ee(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Un(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++is,s.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),s.collapsed)Tn(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var _=t.line;_<=i.line;_++)xi(g,_,"text");s.atomic&&Xa(g.doc),gn(g,"markerAdded",g,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();gn(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},H(Or);function Cl(e,t,i,n,r){n=f(n),n.shared=!1;var s=[rr(e,t,i,n,r)],l=s[0],p=n.widgetNode;return ki(e,function(g){p&&(n.widgetNode=p.cloneNode(!0)),s.push(rr(g,o(g,t),o(g,i),n,r));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;l=b(s)}),new Or(s,l)}function rs(e){return e.findMarks(We(e.first,0),e.clipPos(We(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(St(s,l)){var p=rr(e,s,l,n.primary,n.primary.type);n.markers.push(p),p.parent=n}}}function kl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];ki(r.primary.doc,function(g){return s.push(g)});for(var l=0;l<r.markers.length;l++){var p=r.markers[l];J(s,p.doc)==-1&&(p.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var El=0,_n=function(e,t,i,n,r){if(!(this instanceof _n))return new _n(e,t,i,n,r);i==null&&(i=0),Lr.call(this,[new Ar([new Ri("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=We(i,0);this.sel=Ci(s),this.history=new Jr(null),this.id=++El,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),No(this,{from:s,to:s,text:e}),vn(this,Ci(s),pe)};_n.prototype=xe(Lr.prototype,{constructor:_n,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ui(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=We(this.first,0),i=this.first+this.size-1;nr(this,{from:t,to:We(i,ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),vn(this,Ci(t),pe)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ir(this,e,t,i,n)},getRange:function(e,t,i){var n=Nn(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Yn(this,e))return ct(this,e)},getLineNumber:function(e){return Lt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),kn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hn(function(e,t,i){Wa(this,o(this,typeof e=="number"?We(e,t||0):e),null,i)}),setSelection:hn(function(e,t,i){Wa(this,o(this,e),o(this,t||e),i)}),extendSelection:hn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:hn(function(e,t){za(this,u(this,e),t)}),extendSelectionsBy:hn(function(e,t){var i=R(this.sel.ranges,e);za(this,u(this,i),t)}),setSelections:hn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Wt(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),vn(this,Qn(this.cm,n,t),i)}),addSelection:hn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Wt(o(this,e),o(this,t||e))),vn(this,Qn(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=Nn(this,t[n].from(),t[n].to());i=i?i.concat(r):r}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=Nn(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:hn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var p=t&&t!="end"&&dl(this,n,t),g=n.length-1;g>=0;g--)nr(this,n[g]);p?Ga(this,p):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.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),ki(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:hn(function(e,t,i){return _r(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Ge(r)&&(n.gutterMarkers=null),!0})}),clearGutter:hn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&_r(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ge(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Yn(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Lt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:hn(function(e,t,i){return _r(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(fe(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:hn(function(e,t,i){return _r(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(fe(i));if(!l)return!1;var p=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||p==s.length?"":" ")+s.slice(p)||null}else return!1;return!0})}),addLineWidget:hn(function(e,t,i){return wl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return rr(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),rr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=ct(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=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 p=0;p<l.length;p++){var g=l[p];!(g.to!=null&&r==e.line&&e.ch>=g.to||g.from==null&&r!=e.line||g.from!=null&&r==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,We(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new _n(ui(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new _n(ui(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(n,rs(this)),n},unlinkDoc:function(e){if(e instanceof Yt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),kl(rs(this));break}if(e.history==this.history){var n=[e.id];ki(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=er(this.history.done,n),e.history.undone=er(this.history.undone,n)}},iterLinkedDocs:function(e){ki(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ct(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:hn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),_n.prototype.eachLine=_n.prototype.iter;var os=0;function Tl(e){var t=this;if(as(t),ze(t,e)||pi(t.display,e))return;y(e),j&&(os=+new Date);var i=Ni(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,p=function(){++l==r&&un(t,function(){i=o(t.doc,i);var ee={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ae){return Ae!=null}).join(t.doc.lineSeparator())),origin:"paste"};nr(t.doc,ee),Ga(t.doc,Ci(o(t.doc,i),o(t.doc,Si(ee))))})()},g=function(ee,Ae){if(t.options.allowDropFileTypes&&J(t.options.allowDropFileTypes,ee.type)==-1){p();return}var Ue=new FileReader;Ue.onerror=function(){return p()},Ue.onload=function(){var Xe=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Xe)){p();return}s[Ae]=Xe,p()},Ue.readAsText(ee)},v=0;v<n.length;v++)g(n[v],v);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var _=e.dataTransfer.getData("Text");if(_){var D;if(t.state.draggingText&&!t.state.draggingText.copy&&(D=t.listSelections()),eo(t.doc,Ci(i,i)),D)for(var te=0;te<D.length;++te)ir(t.doc,"",D[te].anchor,D[te].head,"drag");t.replaceSelection(_,"around","paste"),t.display.input.focus()}}catch(ee){}}}function _l(e,t){if(j&&(!e.state.draggingText||+new Date-os<100)){E(t);return}if(ze(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ve){var i=C("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",O&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),O&&i.parentNode.removeChild(i)}}function Al(e,t){var i=Ni(e,t);if(!i)return;var n=document.createDocumentFragment();ya(e,i,n),e.display.dragCursor||(e.display.dragCursor=C("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),he(e.display.dragCursor,n)}function as(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var ls=!1;function Ll(){if(ls)return;Ml(),ls=!0}function Ml(){var e;Ee(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ol)},100))}),Ee(window,"blur",function(){return ss(Ji)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ti={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Rr=0;Rr<10;Rr++)Ti[Rr+48]=Ti[Rr+96]=String(Rr);for(var io=65;io<=90;io++)Ti[io]=String.fromCharCode(io);for(var Dr=1;Dr<=12;Dr++)Ti[Dr+111]=Ti[Dr+63235]="F"+Dr;var gi={};gi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},gi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},gi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},gi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},gi.default=ue?gi.macDefault:gi.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var p=t[l];if(/^(cmd|meta|m)$/i.test(p))s=!0;else if(/^a(lt)?$/i.test(p))i=!0;else if(/^(c|ctrl|control)$/i.test(p))n=!0;else if(/^s(hift)?$/i.test(p))r=!0;else throw new Error("Unrecognized modifier name: "+p)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var r=R(i.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,p=void 0;s==r.length-1?(p=r.join(" "),l=n):(p=r.slice(0,s+1).join(" "),l="...");var g=t[p];if(!g)t[p]=l;else if(g!=l)throw new Error("Inconsistent bindings for "+p)}delete e[i]}for(var v in t)e[v]=t[v];return e}function or(e,t,i,n){t=ro(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return or(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=or(e,t.fallthrough[s],i,n);if(l)return l}}}function us(e){var t=typeof e=="string"?e:Ti[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(be?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(be?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(O&&e.keyCode==34&&e.char)return!1;var i=Ti[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function ro(e){return typeof e=="string"?gi[e]:e}function ar(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&St(s.from,b(n).to)<=0;){var l=n.pop();if(St(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Dn(e,function(){for(var p=n.length-1;p>=0;p--)ir(e.doc,"",n[p].from,n[p].to,"+delete");qi(e)})}function Uo(e,t,i){var n=Fe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Fo(e,t,i){var n=Uo(e,t.ch,i);return n==null?null:new We(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=ht(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],p=r<0==(l.level==1),g=p?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var _=Yi(t,i);v=r<0?i.text.length-1:0;var D=ri(t,_,v).top;v=dt(function(te){return ri(t,_,te).top==D},r<0==(l.level==1)?l.from:l.to-1,v),g=="before"&&(v=Uo(i,v,1))}else v=r<0?l.to:l.from;return new We(n,v,g)}}return new We(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=ht(t,e.doc.direction);if(!r)return Fo(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=tt(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<i.ch))return Fo(t,i,n);var p=function(Je,it){return Uo(t,Je instanceof We?Je.ch:Je,it)},g,v=function(Je){return e.options.lineWrapping?(g=g||Yi(e,t),pa(e,t,g,Je)):{begin:0,end:t.text.length}},_=v(i.sticky=="before"?p(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var D=l.level==1==n<0,te=p(i,D?1:-1);if(te!=null&&(D?te<=l.to&&te<=_.end:te>=l.from&&te>=_.begin)){var ee=D?"before":"after";return new We(i.line,te,ee)}}var Ae=function(Je,it,qe){for(var ut=function(Kt,cn){return cn?new We(i.line,p(Kt,1),"before"):new We(i.line,Kt,"after")};Je>=0&&Je<r.length;Je+=it){var bt=r[Je],gt=it>0==(bt.level!=1),At=gt?qe.begin:p(qe.end,-1);if(bt.from<=At&&At<bt.to)return ut(At,gt);if(At=gt?bt.from:p(bt.to,-1),qe.begin<=At&&At<qe.end)return ut(At,gt)}},Ue=Ae(s+n,n,_);if(Ue)return Ue;var Xe=n>0?_.end:p(_.begin,-1);return Xe!=null&&!(n>0&&Xe==t.text.length)&&(Ue=Ae(n>0?0:r.length-1,n,v(Xe)),Ue)?Ue:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return ar(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:We(t.head.line+1,0)}:{from:t.head,to:We(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ar(e,function(t){return{from:We(t.from().line,0),to:o(e.doc,We(t.to().line+1,0))}})},delLineLeft:function(e){return ar(e,function(t){return{from:We(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ar(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ar(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(We(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(We(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},ge)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},ge)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?fs(e,t.head):n},ge)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=w(e.getLine(s.line),s.ch,n);t.push(U(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Dn(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=ct(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new We(r.line,r.ch-1)),r.ch>0)r=new We(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),We(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ct(e.doc,r.line-1).text;l&&(r=new We(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),We(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Wt(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Dn(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;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);qi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var i=ct(e.doc,t),n=kn(i);return n!=i&&(t=Lt(n)),Ho(!0,e,n,t,1)}function Nl(e,t){var i=ct(e.doc,t),n=Vi(i);return n!=i&&(t=Lt(n)),Ho(!0,e,i,t,-1)}function fs(e,t){var i=ds(e,t.line),n=ct(e.doc,i.line),r=ht(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return We(i.line,l?0:s,i.sticky)}return i}function oo(e,t,i){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=Re}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=or(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&or(t,e.options.extraKeys,i,e)||or(t,e.options.keyMap,i,e)}var jl=new P;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ps(e,r+" "+t,i,n))return!0}return ps(e,t,i,n)}function ps(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&gn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(y(i),ko(e)),!!r}function gs(e,t){var i=cs(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return oo(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return oo(e,n)}):Nr(e,i,t,function(n){return oo(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return oo(e,n,!0)})}var zo=null;function ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=se(),ze(t,e))return;j&&Q<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);O&&(zo=n?i:null,!n&&i==88&&!Ht&&(ue?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),de&&!ue&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(ke(t,"CodeMirror-crosshair"),ot(document,"keyup",i),ot(document,"mouseover",i))}Ee(document,"keyup",i),Ee(document,"mouseover",i)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ze(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||ze(t,e)||e.ctrlKey&&!e.altKey||ue&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(O&&i==zo){zo=null,y(e);return}if(O&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Wo=function(e,t,i){this.time=e,this.pos=t,this.button=i};Wo.prototype.compare=function(e,t,i){return this.time+Fl>e&&St(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(ze(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){ie||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Go(t,e))return;var n=Ni(t,e),r=G(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):ne(e)==i.scroller&&y(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ve?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 p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),p=l(e,i)!=Re}finally{e.state.suppressEdits=!1}return p})}function Wl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=He?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=ue?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ue?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){j?setTimeout(m(ba,e),0):e.curOp.focus=se();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Oe&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(St((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(St(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){ie&&(r.scroller.draggable=!1),e.state.draggingText=!1,ot(r.wrapper.ownerDocument,"mouseup",l),ot(r.wrapper.ownerDocument,"mousemove",p),ot(r.scroller,"dragstart",g),ot(r.scroller,"drop",l),s||(y(v),n.addNew||Qr(e.doc,i,null,null,n.extend),ie&&!ve||j&&Q==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),p=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},g=function(){return s=!0};ie&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Ee(r.wrapper.ownerDocument,"mouseup",l),Ee(r.wrapper.ownerDocument,"mousemove",p),Ee(r.scroller,"dragstart",g),Ee(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Wt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Wt(We(t.line,0),o(e.doc,We(t.line+1,0)));var n=i(e,t);return new Wt(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;y(t);var l,p,g=s.sel,v=g.ranges;if(n.addNew&&!n.extend?(p=s.sel.contains(i),p>-1?l=v[p]:l=new Wt(i,i)):(l=s.sel.primary(),p=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Wt(i,i)),i=Ni(e,t,!0,!0),p=-1;else{var _=xs(e,i,n.unit);n.extend?l=jo(l,_.anchor,_.head,n.extend):l=_}n.addNew?p==-1?(p=v.length,vn(s,Qn(e,v.concat([l]),p),{scroll:!1,origin:"*mouse"})):v.length>1&&v[p].empty()&&n.unit=="char"&&!n.extend?(vn(s,Qn(e,v.slice(0,p).concat(v.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):Bo(s,p,l,ye):(p=0,vn(s,new zn([l],0),ye),g=s.sel);var D=i;function te(qe){if(St(D,qe)==0)return;if(D=qe,n.unit=="rectangle"){for(var ut=[],bt=e.options.tabSize,gt=w(ct(s,i.line).text,i.ch,bt),At=w(ct(s,qe.line).text,qe.ch,bt),Kt=Math.min(gt,At),cn=Math.max(gt,At),$t=Math.min(i.line,qe.line),Pn=Math.min(e.lastLine(),Math.max(i.line,qe.line));$t<=Pn;$t++){var An=ct(s,$t).text,nn=ce(An,Kt,bt);Kt==cn?ut.push(new Wt(We($t,nn),We($t,nn))):An.length>nn&&ut.push(new Wt(We($t,nn),We($t,ce(An,cn,bt))))}ut.length||ut.push(new Wt(i,i)),vn(s,Qn(e,g.ranges.slice(0,p).concat(ut),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(qe)}else{var Ln=l,mn=xs(e,qe,n.unit),sn=Ln.anchor,rn;St(mn.anchor,sn)>0?(rn=mn.head,sn=Li(Ln.from(),mn.anchor)):(rn=mn.anchor,sn=di(Ln.to(),mn.head));var Jt=g.ranges.slice(0);Jt[p]=Kl(e,new Wt(o(s,sn),rn)),vn(s,Qn(e,Jt,p),ye)}}var ee=r.wrapper.getBoundingClientRect(),Ae=0;function Ue(qe){var ut=++Ae,bt=Ni(e,qe,!0,n.unit=="rectangle");if(!bt)return;if(St(bt,D)!=0){e.curOp.focus=se(),te(bt);var gt=Kr(r,s);(bt.line>=gt.to||bt.line<gt.from)&&setTimeout(un(e,function(){Ae==ut&&Ue(qe)}),150)}else{var At=qe.clientY<ee.top?-20:qe.clientY>ee.bottom?20:0;At&&setTimeout(un(e,function(){if(Ae!=ut)return;r.scroller.scrollTop+=At,Ue(qe)}),50)}}function Xe(qe){e.state.selectingText=!1,Ae=Infinity,qe&&(y(qe),r.input.focus()),ot(r.wrapper.ownerDocument,"mousemove",Je),ot(r.wrapper.ownerDocument,"mouseup",it),s.history.lastSelOrigin=null}var Je=un(e,function(qe){qe.buttons===0||!G(qe)?Xe(qe):Ue(qe)}),it=un(e,Xe);e.state.selectingText=it,Ee(r.wrapper.ownerDocument,"mousemove",Je),Ee(r.wrapper.ownerDocument,"mouseup",it)}function Kl(e,t){var i=t.anchor,n=t.head,r=ct(e.doc,i.line);if(St(i,n)==0&&i.sticky==n.sticky)return t;var s=ht(r);if(!s)return t;var l=tt(s,i.ch,i.sticky),p=s[l];if(p.from!=i.ch&&p.to!=i.ch)return t;var g=l+(p.from==i.ch==(p.level!=1)?0:1);if(g==0||g==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 _=tt(s,n.ch,n.sticky),D=_-l||(n.ch-i.ch)*(p.level==1?-1:1);_==g-1||_==g?v=D<0:v=D>0}var te=s[g+(v?-1:0)],ee=v==(te.level==1),Ae=ee?te.from:te.to,Ue=ee?"after":"before";return i.ch==Ae&&i.sticky==Ue?t:new Wt(new We(i.line,Ae,Ue),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(te){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&y(t);var l=e.display,p=l.lineDiv.getBoundingClientRect();if(s>p.bottom||!B(e,i))return S(t);s-=p.top-l.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=l.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=r){var _=In(e.doc,s),D=e.display.gutterSpecs[g];return Le(e,i,e,_,D.className,t),S(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(ze(e,t,"contextmenu"))return;Ve||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"}},ks={},ao={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(p,g,v){v!=sr&&s(p,g,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){Er(n),vr(n),Tn(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(g){for(var v=0;;){var _=g.text.indexOf(r,v);if(_==-1)break;v=_+r.length,s.push(We(l,_))}l++});for(var p=s.length-1;p>=0;p--)ir(n.doc,r,s[p],We(s[p].line,s[p].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",Ut,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",!$e),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Ss(n),kr(n)},!0),i("keyMap","default",function(n,r,s){var l=ro(r),p=s!=sr&&ro(s);p&&p.detach&&p.detach(n,l),l.attach&&l.attach(n,p||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Jl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Ro(r,n.options.lineNumbers),kr(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=Ro(n.options.gutters,r),kr(n)},!0),i("firstLineNumber",1,kr,!0),i("lineNumberFormatter",function(n){return n},kr,!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,Er,!0),i("addModeClass",!1,Er,!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,Er,!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?Ee:ot;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?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ke(e.display.wrapper,"CodeMirror-wrap"),Fr(e)),So(e),Tn(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?f(t):{},f(ks,t,!1);var n=t.value;typeof n=="string"?n=new _n(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(),j&&Q<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Ll(),Ui(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!me||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Eo(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 p=0;p<Vo.length;++p)Vo[p](this);Fi(this),ie&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Yt.defaults=ks,Yt.optionHandlers=ao;function ql(e){var t=e.display;Ee(t.scroller,"mousedown",un(e,bs)),j&&Q<11?Ee(t.scroller,"dblclick",un(e,function(g){if(ze(e,g))return;var v=Ni(e,g);if(!v||Go(e,g)||pi(e.display,g))return;y(g);var _=e.findWordAt(v);Qr(e.doc,_.anchor,_.head)})):Ee(t.scroller,"dblclick",function(g){return ze(e,g)||y(g)}),Ee(t.scroller,"contextmenu",function(g){return Cs(e,g)}),Ee(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||Cs(e,g)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(g,v){if(v.left==null)return!0;var _=v.left-g.left,D=v.top-g.top;return _*_+D*D>20*20}Ee(t.scroller,"touchstart",function(g){if(!ze(e,g)&&!s(g)&&!Go(e,g)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),Ee(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ee(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!pi(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var _=e.coordsChar(t.activeTouch,"page"),D;!v.prev||l(v,v.prev)?D=new Wt(_,_):!v.prev.prev||l(v,v.prev.prev)?D=e.findWordAt(_):D=new Wt(We(_.line,0),o(e.doc,We(_.line+1,0))),e.setSelection(D.anchor,D.head),e.focus(),y(g)}r()}),Ee(t.scroller,"touchcancel",r),Ee(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),ji(e,t.scroller.scrollLeft,!0),Le(e,"scroll",e))}),Ee(t.scroller,"mousewheel",function(g){return Ra(e,g)}),Ee(t.scroller,"DOMMouseScroll",function(g){return Ra(e,g)}),Ee(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){ze(e,g)||E(g)},over:function(g){ze(e,g)||(Al(e,g),E(g))},start:function(g){return _l(e,g)},drop:un(e,Tl),leave:function(g){ze(e,g)||as(e)}};var p=t.input.getField();Ee(p,"keyup",function(g){return vs.call(e,g)}),Ee(p,"keydown",un(e,ms)),Ee(p,"keypress",un(e,ys)),Ee(p,"focus",function(g){return Eo(e,g)}),Ee(p,"blur",function(g){return Ji(e,g)})}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=Ze(e,t).state:i="prev");var l=e.options.tabSize,p=ct(r,t),g=w(p.text,null,l);p.stateAfter&&(p.stateAfter=null);var v=p.text.match(/^\s*/)[0],_;if(!n&&!/\S/.test(p.text))_=0,i="not";else if(i=="smart"&&(_=r.mode.indent(s,p.text.slice(v.length),p.text),_==Re||_>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?_=w(ct(r,t-1).text,null,l):_=0:i=="add"?_=g+e.options.indentUnit:i=="subtract"?_=g-e.options.indentUnit:typeof i=="number"&&(_=g+i),_=Math.max(0,_);var D="",te=0;if(e.options.indentWithTabs)for(var ee=Math.floor(_/l);ee;--ee)te+=l,D+=" ";if(te<_&&(D+=U(_-te)),D!=v)return ir(r,D,We(t,0),We(t,v.length),"+input"),p.stateAfter=null,!0;for(var Ae=0;Ae<r.sel.ranges.length;Ae++){var Ue=r.sel.ranges[Ae];if(Ue.head.line==t&&Ue.head.ch<v.length){var Xe=We(t,v.length);Bo(r,Ae,new Wt(Xe,Xe));break}}}var ei=null;function so(e){ei=e}function Xo(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,p=r=="paste"||e.state.pasteIncoming>l,g=Ct(t),v=null;if(p&&n.ranges.length>1)if(ei&&ei.text.join(`
|
|
`)==t){if(n.ranges.length%ei.text.length==0){v=[];for(var _=0;_<ei.text.length;_++)v.push(s.splitLines(ei.text[_]))}}else g.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=R(g,function(Je){return[Je]}));for(var D=e.curOp.updateInput,te=n.ranges.length-1;te>=0;te--){var ee=n.ranges[te],Ae=ee.from(),Ue=ee.to();ee.empty()&&(i&&i>0?Ae=We(Ae.line,Ae.ch-i):e.state.overwrite&&!p?Ue=We(Ue.line,Math.min(ct(s,Ue.line).text.length,Ue.ch+b(g).length)):p&&ei&&ei.lineWise&&ei.text.join(`
|
|
`)==g.join(`
|
|
`)&&(Ae=Ue=We(Ae.line,0)));var Xe={from:Ae,to:Ue,text:v?v[te%v.length]:g,origin:r||(p?"paste":e.state.cutIncoming>l?"cut":"+input")};nr(e.doc,Xe),gn(e,"inputRead",e,Xe)}t&&!p&&Ts(e,t),qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=D),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Es(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Dn(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 p=0;p<s.electricChars.length;p++)if(t.indexOf(s.electricChars.charAt(p))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ct(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&gn(e,"electricInput",e,r.head.line)}}function _s(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:We(r,0),head:We(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function As(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ls(){var e=C("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=C("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ie?e.style.width="1000px":e.setAttribute("wrap","off"),q&&(e.style.border="1px solid black"),As(e),t}function Ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&un(this,t[n])(this,r,l),Le(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](ro(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:xn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");k(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Tn(this)}),removeOverlay:xn(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,Tn(this);return}}}),indentLine:xn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Yn(this.doc,n)&&Br(this,n,r,s)}),indentSelection:xn(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var p=r[l];if(p.empty())p.head.line>s&&(Br(this,p.head.line,n,!0),s=p.head.line,l==this.doc.sel.primIndex&&qi(this));else{var g=p.from(),v=p.to(),_=Math.max(s,g.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var D=_;D<s;++D)Br(this,D,n);var te=this.doc.sel.ranges;g.ch==0&&r.length==te.length&&te[l].from().ch>0&&Bo(this.doc,l,new Wt(g,te[l].to()),pe)}}}),getTokenAt:function(n,r){return Xt(this,n,r)},getLineTokens:function(n,r){return Xt(this,We(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=De(this,ct(this.doc,n.line)),s=0,l=(r.length-1)/2,p=n.ch,g;if(p==0)g=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=p)l=v;else if(r[v*2+1]<p)s=v+1;else{g=r[v*2+2];break}}var _=g?g.indexOf("overlay "):-1;return _<0?g:_==0?null:g.slice(0,_-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],p=this.getModeAt(n);if(typeof p[r]=="string")l[p[r]]&&s.push(l[p[r]]);else if(p[r])for(var g=0;g<p[r].length;g++){var v=l[p[r][g]];v&&s.push(v)}else p.helperType&&l[p.helperType]?s.push(l[p.helperType]):l[p.name]&&s.push(l[p.name]);for(var _=0;_<l._global.length;_++){var D=l._global[_];D.pred(p,this)&&J(s,D.val)==-1&&s.push(D.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),Ze(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),qn(this,s,r||"page")},charCoords:function(n,r){return vo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=ca(this,n,r||"page"),bo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=ca(this,{top:n,left:0},r||"page").top,In(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,p;if(typeof n=="number"){var g=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>g&&(n=g,l=!0),p=ct(this.doc,n)}else p=n;return Wr(this,p,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Jn(p):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,p){var g=this.display;n=qn(this,o(this.doc,n));var v=n.bottom,_=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),g.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var D=Math.max(g.wrapper.clientHeight,this.doc.height),te=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>D)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=D&&(v=n.bottom),_+r.offsetWidth>te&&(_=te-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",p=="right"?(_=g.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(p=="left"?_=0:p=="middle"&&(_=(g.sizer.clientWidth-r.offsetWidth)/2),r.style.left=_+"px"),s&&Zs(this,{left:_,top:v,right:_+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:xn(ms),triggerOnKeyPress:xn(ys),triggerOnKeyUp:vs,triggerOnMouseDown:xn(bs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:xn(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var p=1;r<0&&(p=-1,r=-r);for(var g=o(this.doc,n),v=0;v<r&&!(g=Ko(this.doc,g,p,s,l),g.hitSide);++v);return g},moveH:xn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Ko(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},ge)}),deleteH:xn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ar(this,function(p){var g=Ko(l,p.head,n,r,!1);return n<0?{from:g,to:p.head}:{from:p.head,to:g}})}),findPosV:function(n,r,s,l){var p=1,g=l;r<0&&(p=-1,r=-r);for(var v=o(this.doc,n),_=0;_<r;++_){var D=qn(this,v,"div");if(g==null?g=D.left:D.left=g,v=Ms(this,D,p,s),v.hitSide)break}return v},moveV:xn(function(n,r){var s=this,l=this.doc,p=[],g=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(_){if(g)return n<0?_.from():_.to();var D=qn(s,_.head,"div");_.goalColumn!=null&&(D.left=_.goalColumn),p.push(D.left);var te=Ms(s,D,n,r);return r=="page"&&_==l.sel.primary()&&_o(s,vo(s,te,"div").top-D.top),te},ge),p.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=p[v]}),findWordAt:function(n){var r=this.doc,s=ct(r,n.line).text,l=n.ch,p=n.ch;if(s){var g=this.getHelper(n,"wordChars");(n.sticky=="before"||p==s.length)&&l?--l:++p;for(var v=s.charAt(l),_=Me(v,g)?function(D){return Me(D,g)}:/\s/.test(v)?function(D){return/\s/.test(D)}:function(D){return!/\s/.test(D)&&!Me(D)};l>0&&_(s.charAt(l-1));)--l;for(;p<s.length&&_(s.charAt(p));)++p}return new Wt(We(n.line,l),We(n.line,p))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):ke(this.display.cursorDiv,"CodeMirror-overwrite"),Le(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==se()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:xn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-ii(this)-this.display.barHeight,width:n.scrollWidth-ii(this)-this.display.barWidth,clientHeight:po(this),clientWidth:Di(this)}},scrollIntoView:xn(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:We(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Js(this,n):Ca(this,n.from,n.to,n.margin)}),setSize:xn(function(n,r){var s=this,l=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&la(this);var p=this.display.viewFrom;this.doc.iter(p,this.display.viewTo,function(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){xi(s,p,"widget");break}}++p}),this.curOp.forceUpdate=!0,Le(this,"refresh",this)}),operation:function(n){return Dn(this,n)},startOperation:function(){return Ui(this)},endOperation:function(){return Fi(this)},refresh:xn(function(){var n=this.display.cachedTextHeight;Tn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Mo(this.display),(n==null||Math.abs(n-$i(this.display))>.5||this.options.lineWrapping)&&So(this),Le(this,"refresh",this)}),swapDoc:xn(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,gn(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}},H(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,p=ct(e,t.line),g=r&&e.direction=="rtl"?-i:i;function v(){var it=t.line+g;return it<e.first||it>=e.first+e.size?!1:(t=new We(it,t.ch,t.sticky),p=ct(e,it))}function _(it){var qe;if(n=="codepoint"){var ut=p.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ut)?qe=null:qe=new We(t.line,Math.max(0,Math.min(p.text.length,t.ch+i*(ut>=55296&&ut<56320?2:1))),-i)}else r?qe=Pl(e.cm,p,t,i):qe=Fo(p,t,i);if(qe==null)if(!it&&v())t=Ho(r,e.cm,p,t.line,g);else return!1;else t=qe;return!0}if(n=="char"||n=="codepoint")_();else if(n=="column")_(!0);else if(n=="word"||n=="group")for(var D=null,te=n=="group",ee=e.cm&&e.cm.getHelper(t,"wordChars"),Ae=!0;!(i<0&&!_(!Ae));Ae=!1){var Ue=p.text.charAt(t.ch)||`
|
|
`,Xe=Me(Ue,ee)?"w":te&&Ue==`
|
|
`?"n":!te||/\s/.test(Ue)?null:"p";if(te&&!Ae&&!Xe&&(Xe="s"),D&&D!=Xe){i<0&&(i=1,_(),t.sticky="after");break}if(Xe&&(D=Xe),i>0&&!_(!Ae))break}var Je=to(e,t,s,l,!0);return ci(s,Je)&&(Je.hitSide=!0),Je}function Ms(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var p=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=Math.max(p-.5*$i(e.display),3);l=(i>0?t.bottom:t.top)+i*g}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 Vt=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};Vt.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(p){for(var g=p.target;g;g=g.parentNode){if(g==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}Ee(r,"paste",function(p){if(!s(p)||ze(n,p)||Es(p,n))return;Q<=11&&setTimeout(un(n,function(){return t.updateFromDOM()}),20)}),Ee(r,"compositionstart",function(p){t.composing={data:p.data,done:!1}}),Ee(r,"compositionupdate",function(p){t.composing||(t.composing={data:p.data,done:!1})}),Ee(r,"compositionend",function(p){t.composing&&(p.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ee(r,"touchstart",function(){return i.forceCompositionEnd()}),Ee(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(p){if(!s(p)||ze(n,p))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()}),p.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var g=_s(n);so({lineWise:!0,text:g.text}),p.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,pe),n.replaceSelection("",null,"cut")})}else return;if(p.clipboardData){p.clipboardData.clearData();var v=ei.text.join(`
|
|
`);if(p.clipboardData.setData("Text",v),p.clipboardData.getData("Text")==v){p.preventDefault();return}}var _=Ls(),D=_.firstChild;n.display.lineSpace.insertBefore(_,n.display.lineSpace.firstChild),D.value=ei.text.join(`
|
|
`);var te=document.activeElement;L(D),setTimeout(function(){n.display.lineSpace.removeChild(_),te.focus(),te==r&&i.showPrimarySelection()},50)}Ee(r,"copy",l),Ee(r,"cut",l)},Vt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Vt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},Vt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Vt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Vt.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){e.removeAllRanges();return}var s=lo(t,e.anchorNode,e.anchorOffset),l=lo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&St(Li(s,l),n)==0&&St(di(s,l),r)==0)return;var p=t.display.view,g=n.line>=t.display.viewFrom&&Os(t,n)||{node:p[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&Os(t,r);if(!v){var _=p[p.length-1].measure,D=_.maps?_.maps[_.maps.length-1]:_.map;v={node:D[D.length-1],offset:D[D.length-2]-D[D.length-3]}}if(!g||!v){e.removeAllRanges();return}var te=e.rangeCount&&e.getRangeAt(0),ee;try{ee=Y(g.node,g.offset,v.offset,v.node)}catch(Ae){}ee&&(!de&&t.state.focused?(e.collapse(g.node,g.offset),ee.collapsed||(e.removeAllRanges(),e.addRange(ee))):(e.removeAllRanges(),e.addRange(ee)),te&&e.anchorNode==null?e.addRange(te):de&&this.startGracePeriod()),this.rememberSelection()},Vt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Vt.prototype.showMultipleSelections=function(e){he(this.cm.display.cursorDiv,e.cursors),he(this.cm.display.selectionDiv,e.selection)},Vt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Vt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},Vt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Vt.prototype.blur=function(){this.div.blur()},Vt.prototype.getField=function(){return this.div},Vt.prototype.supportsTouch=function(){return!0},Vt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Dn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Vt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Vt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(z&&M&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=lo(t,e.anchorNode,e.anchorOffset),n=lo(t,e.focusNode,e.focusOffset);i&&n&&Dn(t,function(){vn(t.doc,Ci(i,n),pe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Vt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=We(n.line-1,ct(e.doc,n.line-1).length)),r.ch==ct(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=We(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,p;n.line==t.viewFrom||(s=Ii(e,n.line))==0?(l=Lt(t.view[0].line),p=t.view[0].node):(l=Lt(t.view[s].line),p=t.view[s-1].node.nextSibling);var g=Ii(e,r.line),v,_;if(g==t.view.length-1?(v=t.viewTo-1,_=t.lineDiv.lastChild):(v=Lt(t.view[g+1].line)-1,_=t.view[g+1].node.previousSibling),!p)return!1;for(var D=e.doc.splitLines(tu(e,p,_,l,v)),te=Nn(e.doc,We(l,0),We(v,ct(e.doc,v).text.length));D.length>1&&te.length>1;)if(b(D)==b(te))D.pop(),te.pop(),v--;else if(D[0]==te[0])D.shift(),te.shift(),l++;else break;for(var ee=0,Ae=0,Ue=D[0],Xe=te[0],Je=Math.min(Ue.length,Xe.length);ee<Je&&Ue.charCodeAt(ee)==Xe.charCodeAt(ee);)++ee;for(var it=b(D),qe=b(te),ut=Math.min(it.length-(D.length==1?ee:0),qe.length-(te.length==1?ee:0));Ae<ut&&it.charCodeAt(it.length-Ae-1)==qe.charCodeAt(qe.length-Ae-1);)++Ae;if(D.length==1&&te.length==1&&l==n.line)for(;ee&&ee>n.ch&&it.charCodeAt(it.length-Ae-1)==qe.charCodeAt(qe.length-Ae-1);)ee--,Ae++;D[D.length-1]=it.slice(0,it.length-Ae).replace(/^\u200b+/,""),D[0]=D[0].slice(ee).replace(/\u200b+$/,"");var bt=We(l,ee),gt=We(v,te.length?b(te).length-Ae:0);if(D.length>1||D[0]||St(bt,gt))return ir(e.doc,D,bt,gt,"+input"),!0},Vt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Vt.prototype.reset=function(){this.forceCompositionEnd()},Vt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Vt.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)},Vt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Dn(this.cm,function(){return Tn(e.cm)})},Vt.prototype.setUneditable=function(e){e.contentEditable="false"},Vt.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)},Vt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Vt.prototype.onContextMenu=function(){},Vt.prototype.resetPosition=function(){},Vt.prototype.needsContentAttribute=!0;function Os(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),r=ia(i,n,t.line),s=ht(n,e.doc.direction),l="left";if(s){var p=tt(s,t.ch);l=p%2?"right":"left"}var g=aa(r.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}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,p=e.doc.lineSeparator(),g=!1;function v(ee){return function(Ae){return Ae.id==ee}}function _(){l&&(s+=p,g&&(s+=p),l=g=!1)}function D(ee){ee&&(_(),s+=ee)}function te(ee){if(ee.nodeType==1){var Ae=ee.getAttribute("cm-text");if(Ae){D(Ae);return}var Ue=ee.getAttribute("cm-marker"),Xe;if(Ue){var Je=e.findMarks(We(n,0),We(r+1,0),v(+Ue));Je.length&&(Xe=Je[0].find(0))&&D(Nn(e.doc,Xe.from,Xe.to).join(p));return}if(ee.getAttribute("contenteditable")=="false")return;var it=/^(pre|div|p|li|table|br)$/i.test(ee.nodeName);if(!/^br$/i.test(ee.nodeName)&&ee.textContent.length==0)return;it&&_();for(var qe=0;qe<ee.childNodes.length;qe++)te(ee.childNodes[qe]);/^(pre|p)$/i.test(ee.nodeName)&&(g=!0),it&&(l=!0)}else ee.nodeType==3&&D(ee.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(te(t),t==i);)t=t.nextSibling,g=!1;return s}function lo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return lr(e.clipPos(We(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!A(n,t))return lr(We(Lt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?b(e.rest):e.line;return lr(We(Lt(s),s.text.length),r)}var l=t.nodeType==3?t:null,p=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));p.parentNode!=n;)p=p.parentNode;var g=e.measure,v=g.maps;function _(Xe,Je,it){for(var qe=-1;qe<(v?v.length:0);qe++)for(var ut=qe<0?g.map:v[qe],bt=0;bt<ut.length;bt+=3){var gt=ut[bt+2];if(gt==Xe||gt==Je){var At=Lt(qe<0?e.line:e.rest[qe]),Kt=ut[bt]+it;return(it<0||gt!=Xe)&&(Kt=ut[bt+(it?1:0)]),We(At,Kt)}}}var D=_(l,p,i);if(D)return lr(D,r);for(var te=p.nextSibling,ee=l?l.nodeValue.length-i:0;te;te=te.nextSibling){if(D=_(te,te.firstChild,0),D)return lr(We(D.line,D.ch-ee),r);ee+=te.textContent.length}for(var Ae=p.previousSibling,Ue=i;Ae;Ae=Ae.previousSibling){if(D=_(Ae,Ae.firstChild,-1),D)return lr(We(D.line,D.ch+Ue),r);Ue+=Ae.textContent.length}}var Qt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new P,this.hasSelection=!1,this.composing=null};Qt.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),q&&(r.style.width="0px"),Ee(r,"input",function(){j&&Q>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ee(r,"paste",function(l){if(ze(n,l)||Es(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(ze(n,l))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var p=_s(n);so({lineWise:!0,text:p.text}),l.type=="cut"?n.setSelections(p.ranges,null,pe):(i.prevInput="",r.value=p.text.join(`
|
|
`),L(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Ee(r,"cut",s),Ee(r,"copy",s),Ee(e.scroller,"paste",function(l){if(pi(e,l)||ze(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var p=new Event("paste");p.clipboardData=l.clipboardData,r.dispatchEvent(p)}),Ee(e.lineSpace,"selectstart",function(l){pi(e,l)||y(l)}),Ee(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"})}}),Ee(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;he(i.cursorDiv,e.cursors),he(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),j&&Q>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",j&&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||se()!=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||at(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(j&&Q>=9&&this.hasSelection===r||ue&&/[\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,p=Math.min(n.length,r.length);l<p&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return Dn(t,function(){Xo(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||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(){j&&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||O)return;var p=i.options.resetSelectionOnContextMenu;p&&i.doc.sel.contains(s)==-1&&un(i,vn)(i.doc,Ci(s),pe);var g=r.style.cssText,v=t.wrapper.style.cssText,_=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-_.top-5)+"px; left: "+(e.clientX-_.left-5)+`px;
|
|
z-index: 1000; background: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var D;ie&&(D=window.scrollY),n.input.focus(),ie&&window.scrollTo(null,D),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ee,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function te(){if(r.selectionStart!=null){var Ue=i.somethingSelected(),Xe="\u200B"+(Ue?r.value:"");r.value="\u21DA",r.value=Xe,t.prevInput=Ue?"":"\u200B",r.selectionStart=1,r.selectionEnd=Xe.length,n.selForContextMenu=i.doc.sel}}function ee(){if(t.contextMenuPending!=ee)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=g,j&&Q<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!j||j&&Q<9)&&te();var Ue=0,Xe=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?un(i,$a)(i):Ue++<10?n.detectingSelectAll=setTimeout(Xe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Xe,200)}}if(j&&Q>=9&&te(),Ve){E(e);var Ae=function(){ot(window,"mouseup",Ae),setTimeout(ee,20)};Ee(window,"mouseup",Ae)}else setTimeout(ee,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?f(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=se();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=p.getValue()}var r;if(e.form&&(Ee(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(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var p=Yt(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return p}function ru(e){e.off=ot,e.on=Ee,e.wheelEventPixels=cl,e.Doc=_n,e.splitLines=Ct,e.countColumn=w,e.findColumn=ce,e.isWordChar=Ce,e.Pass=Re,e.signal=Le,e.Line=Ri,e.changeEnd=Si,e.scrollbarModel=Ea,e.Pos=We,e.cmpPos=St,e.modes=Ot,e.mimeModes=_t,e.resolveMode=vt,e.getMode=Kn,e.modeExtensions=on,e.extendMode=fn,e.copyState=Wn,e.startState=li,e.innerMode=si,e.commands=Pr,e.keyMap=gi,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=Dl,e.StringStream=It,e.SharedTextMarker=Or,e.TextMarker=Ei,e.LineWidget=Mr,e.e_preventDefault=y,e.e_stopPropagation=x,e.e_stop=E,e.addClass=F,e.contains=A,e.rmClass=ke,e.keyNames=Ti}$l(Yt),Ql(Yt);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in _n.prototype)_n.prototype.hasOwnProperty(uo)&&J(ou,uo)<0&&(Yt.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(_n.prototype[uo]));return H(_n),Yt.inputStyles={textarea:Qt,contenteditable:Vt},Yt.defineMode=function(e){!Yt.defaults.mode&&e!="null"&&(Yt.defaults.mode=e),bn.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){_n.prototype[e]=t},Yt.fromTextArea=iu,ru(Yt),Yt.version="5.58.2",Yt})},Y1PL:function(wt,rt,T){"use strict";T.r(rt),T.d(rt,"ResizableTextArea",function(){return J});var K=T("wx14"),Te=T("1OyB"),de=T("vuIU"),Pe=T("Ji7U"),_e=T("LK+K"),re=T("q1tI"),j=T("VTBJ"),Q=T("rePB"),ie=T("Zm9Q"),V=T("Kwbf"),M=T("c+Xe"),O=T("m+aA"),ve=T("bdgK"),oe=new Map;function Z(pe){pe.forEach(function(ye){var ge,ce=ye.target;(ge=oe.get(ce))===null||ge===void 0||ge.forEach(function($){return $(ce)})})}var q=new ve.default(Z),z=null,me=null;function ue(pe,ye){oe.has(pe)||(oe.set(pe,new Set),q.observe(pe)),oe.get(pe).add(ye)}function He(pe,ye){oe.has(pe)&&(oe.get(pe).delete(ye),oe.get(pe).size||(q.unobserve(pe),oe.delete(pe)))}var $e=function(pe){Object(Pe.a)(ge,pe);var ye=Object(_e.a)(ge);function ge(){return Object(Te.a)(this,ge),ye.apply(this,arguments)}return Object(de.a)(ge,[{key:"render",value:function(){return this.props.children}}]),ge}(re.Component),we=re.createContext(null);function be(pe){var ye=pe.children,ge=pe.onBatchResize,ce=re.useRef(0),$=re.useRef([]),U=re.useContext(we),b=re.useCallback(function(R,k,le){ce.current+=1;var xe=ce.current;$.current.push({size:R,element:k,data:le}),Promise.resolve().then(function(){xe===ce.current&&(ge==null||ge($.current),$.current=[])}),U==null||U(R,k,le)},[ge,U]);return re.createElement(we.Provider,{value:b},ye)}function Ve(pe){var ye=pe.children,ge=pe.disabled,ce=re.useRef(null),$=re.useRef(null),U=re.useContext(we),b=re.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),R=re.isValidElement(ye)&&Object(M.c)(ye),k=R?ye.ref:null,le=re.useMemo(function(){return Object(M.a)(k,ce)},[k,ce]),xe=re.useRef(pe);xe.current=pe;var X=re.useCallback(function(Ce){var Me=xe.current,Ge=Me.onResize,je=Me.data,Ne=Ce.getBoundingClientRect(),Fe=Ne.width,dt=Ne.height,Qe=Ce.offsetWidth,et=Ce.offsetHeight,tt=Math.floor(Fe),mt=Math.floor(dt);if(b.current.width!==tt||b.current.height!==mt||b.current.offsetWidth!==Qe||b.current.offsetHeight!==et){var ht={width:tt,height:mt,offsetWidth:Qe,offsetHeight:et};b.current=ht;var st=Qe===Math.round(Fe)?Fe:Qe,Ee=et===Math.round(dt)?dt:et,pt=Object(j.a)(Object(j.a)({},ht),{},{offsetWidth:st,offsetHeight:Ee});U==null||U(pt,Ce,je),Ge&&Promise.resolve().then(function(){Ge(pt,Ce)})}},[]);return re.useEffect(function(){var Ce=Object(O.a)(ce.current)||Object(O.a)($.current);return Ce&&!ge&&ue(Ce,X),function(){return He(Ce,X)}},[ce.current,ge]),re.createElement($e,{ref:$},R?re.cloneElement(ye,{ref:le}):ye)}var fe="rc-observer-key";function ke(pe){var ye=pe.children,ge=Object(ie.a)(ye);return ge.map(function(ce,$){var U=(ce==null?void 0:ce.key)||"".concat(fe,"-").concat($);return re.createElement(Ve,Object(K.a)({},pe,{key:U}),ce)})}ke.Collection=be;var Be=ke,he=T("bT9E"),C=T("TSYQ"),ae=T.n(C),Y=`
|
|
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
|
|
`,A=["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"],se={},F;function N(pe){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(ye&&se[ge])return se[ge];var ce=window.getComputedStyle(pe),$=ce.getPropertyValue("box-sizing")||ce.getPropertyValue("-moz-box-sizing")||ce.getPropertyValue("-webkit-box-sizing"),U=parseFloat(ce.getPropertyValue("padding-bottom"))+parseFloat(ce.getPropertyValue("padding-top")),b=parseFloat(ce.getPropertyValue("border-bottom-width"))+parseFloat(ce.getPropertyValue("border-top-width")),R=A.map(function(le){return"".concat(le,":").concat(ce.getPropertyValue(le))}).join(";"),k={sizingStyle:R,paddingSize:U,borderSize:b,boxSizing:$};return ye&&ge&&(se[ge]=k),k}function L(pe){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ce=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),pe.getAttribute("wrap")?F.setAttribute("wrap",pe.getAttribute("wrap")):F.removeAttribute("wrap");var $=N(pe,ye),U=$.paddingSize,b=$.borderSize,R=$.boxSizing,k=$.sizingStyle;F.setAttribute("style","".concat(k,";").concat(Y)),F.value=pe.value||pe.placeholder||"";var le=Number.MIN_SAFE_INTEGER,xe=Number.MAX_SAFE_INTEGER,X=F.scrollHeight,Ce;if(R==="border-box"?X+=b:R==="content-box"&&(X-=U),ge!==null||ce!==null){F.value=" ";var Me=F.scrollHeight-U;ge!==null&&(le=Me*ge,R==="border-box"&&(le=le+U+b),X=Math.max(le,X)),ce!==null&&(xe=Me*ce,R==="border-box"&&(xe=xe+U+b),Ce=X>xe?"":"hidden",X=Math.min(xe,X))}return{height:X,minHeight:le,maxHeight:xe,overflowY:Ce,resize:"none"}}var m=T("Gytx"),f=T.n(m),w;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(w||(w={}));var P=function(pe){Object(Pe.a)(ge,pe);var ye=Object(_e.a)(ge);function ge(ce){var $;return Object(Te.a)(this,ge),$=ye.call(this,ce),$.nextFrameActionId=void 0,$.resizeFrameId=void 0,$.textArea=void 0,$.saveTextArea=function(U){$.textArea=U},$.handleResize=function(U){var b=$.state.resizeStatus,R=$.props,k=R.autoSize,le=R.onResize;if(b!==w.NONE)return;typeof le=="function"&&le(U),k&&$.resizeOnNextFrame()},$.resizeOnNextFrame=function(){cancelAnimationFrame($.nextFrameActionId),$.nextFrameActionId=requestAnimationFrame($.resizeTextarea)},$.resizeTextarea=function(){var U=$.props.autoSize;if(!U||!$.textArea)return;var b=U.minRows,R=U.maxRows,k=L($.textArea,!1,b,R);$.setState({textareaStyles:k,resizeStatus:w.RESIZING},function(){cancelAnimationFrame($.resizeFrameId),$.resizeFrameId=requestAnimationFrame(function(){$.setState({resizeStatus:w.RESIZED},function(){$.resizeFrameId=requestAnimationFrame(function(){$.setState({resizeStatus:w.NONE}),$.fixFirefoxAutoScroll()})})})})},$.renderTextArea=function(){var U=$.props,b=U.prefixCls,R=b===void 0?"rc-textarea":b,k=U.autoSize,le=U.onResize,xe=U.className,X=U.disabled,Ce=$.state,Me=Ce.textareaStyles,Ge=Ce.resizeStatus,je=Object(he.a)($.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ne=ae()(R,xe,Object(Q.a)({},"".concat(R,"-disabled"),X));"value"in je&&(je.value=je.value||"");var Fe=Object(j.a)(Object(j.a)(Object(j.a)({},$.props.style),Me),Ge===w.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return re.createElement(Be,{onResize:$.handleResize,disabled:!(k||le)},re.createElement("textarea",Object(K.a)({},je,{className:Ne,style:Fe,ref:$.saveTextArea})))},$.state={textareaStyles:{},resizeStatus:w.NONE},$}return Object(de.a)(ge,[{key:"componentDidUpdate",value:function($){($.value!==this.props.value||!f()($.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 $=this.textArea.selectionStart,U=this.textArea.selectionEnd;this.textArea.setSelectionRange($,U)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ge}(re.Component),J=P,Se=function(pe){Object(Pe.a)(ge,pe);var ye=Object(_e.a)(ge);function ge(ce){var $;Object(Te.a)(this,ge),$=ye.call(this,ce),$.resizableTextArea=void 0,$.focus=function(){$.resizableTextArea.textArea.focus()},$.saveTextArea=function(b){$.resizableTextArea=b},$.handleChange=function(b){var R=$.props.onChange;$.setValue(b.target.value,function(){$.resizableTextArea.resizeTextarea()}),R&&R(b)},$.handleKeyDown=function(b){var R=$.props,k=R.onPressEnter,le=R.onKeyDown;b.keyCode===13&&k&&k(b),le&&le(b)};var U=typeof ce.value=="undefined"||ce.value===null?ce.defaultValue:ce.value;return $.state={value:U},$}return Object(de.a)(ge,[{key:"setValue",value:function($,U){"value"in this.props||this.setState({value:$},U)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return re.createElement(J,Object(K.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function($){return"value"in $?{value:$.value}:null}}]),ge}(re.Component),Re=rt.default=Se},ZW9T:function(wt,rt,T){"use strict";T.d(rt,"a",function(){return $e});var K=T("k1fw"),Te=T("miYZ"),de=T("tsqr"),Pe=T("rAM+"),_e=T("tJVT"),re=T("PpiC"),j=T("q1tI"),Q=T.n(j),ie=T("bdgK");function V(we,be,Ve,fe,ke){var Be=be.getWordUntilPosition(Ve),he={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:Be.startColumn,endColumn:Be.endColumn},C=fe.map(function(ae){return{label:ae,kind:we.languages.CompletionItemKind.Keyword,insertText:ae,insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}});return ke.map(function(ae){C.push(Object(K.a)(Object(K.a)({},ae),{},{range:he}))}),C}var M=function(we){var be={label:"ifelse",kind:we.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet},Ve=["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"];we.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(he,C){var ae=V(we,he,C,Ve,[be]);return{suggestions:ae}}});var fe=["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"];we.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(he,C){var ae=[{label:"print",kind:we.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Y=V(we,he,C,fe,ae);return{suggestions:Y}}});var ke=["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"];we.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(he,C){var ae=[be,{label:"main",kind:we.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:we.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Y=V(we,he,C,ke,ae);return{suggestions:Y}}})},O="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ve=T("LvDl");function oe(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}function Z(){}var q=!1,z={"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 we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=we;if(Array.isArray(we)){for(var Ve=0;Ve<we.length;Ve++){var fe=z[we[Ve]];if(fe)return fe}return be[0]}return z[be]||be}var ue=null,He=rt.b=function(we){var be=we.width,Ve=be===void 0?"100%":be,fe=we.height,ke=fe===void 0?"100%":fe,Be=we.value,he=we.language,C=he===void 0?"javascript":he,ae=we.style,Y=ae===void 0?{}:ae,A=we.options,se=A===void 0?{}:A,F=we.overrideServices,N=F===void 0?{}:F,L=we.theme,m=L===void 0?"vs-dark":L,f=we.onEditBlur,w=we.onSave,P=we.autoHeight,J=P===void 0?!1:P,Se=we.forbidCopy,Re=Se===void 0?!1:Se,pe=we.onChange,ye=pe===void 0?Z:pe,ge=we.editorDidMount,ce=ge===void 0?Z:ge,$=we.onFocus,U=$===void 0?Z:$,b=we.filename,R=b===void 0?"educoder.txt":b,k=Object(re.a)(we,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),le=Object(j.useRef)(),xe=Object(j.useRef)({}),X=Object(j.useRef)(),Ce=Object(j.useRef)(!1),Me=Object(j.useRef)(),Ge=Object(j.useState)(!1),je=Object(_e.a)(Ge,2),Ne=je[0],Fe=je[1];function dt(){var S;return le.current&&(S=new ie.default(function(E){var ne=Object(Pe.a)(E),G;try{for(ne.s();!(G=ne.n()).done;){var Oe=G.value;(Oe.target.offsetHeight>0||Oe.target.offsetWidth>0)&&xe.current.instance.layout()}}catch(Ye){ne.e(Ye)}finally{ne.f()}}),S.observe(le.current)),S}function Qe(){de.b.warn(decodeURIComponent(O))}var et=function(){var E=xe.current.instance;if(Be!=null&&E&&Ne){var ne=E.getModel();ne&&Be!==ne.getValue()&&(q=!0,ne.setValue(Be),E.layout(),q=!1)}};Object(j.useEffect)(function(){X.current&&clearTimeout(X.current),X.current=setTimeout(function(){et()},500)},[Be,Ne,xe.current]);function tt(){var S=xe.current.instance;if(S){var E=S.getSelection(),ne=xe.current.pastePos||{},G=new ue.Range(ne.startLineNumber||E.endLineNumber,ne.startColumn||E.endColumn,ne.endLineNumber||E.endLineNumber,ne.endColumn||E.endColumn);setTimeout(function(){S.executeEdits("",[{range:G,text:""}])},300)}}function mt(S){(window.navigator.platform.match("Mac")?S.metaKey:S.ctrlKey)&&S.keyCode==83&&(S.preventDefault(),w())}var ht=function(){if(J&&xe.current.instance){var E=xe.current.instance.getContentHeight();y(E<ke?ke:E)}else y(ke)};function st(S){var E=document.createEvent("MouseEvents");E.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),S.dispatchEvent(E)}function Ee(S,E){var ne=window.URL||window.webkitURL||window,G=new Blob([E]),Oe=document.createElementNS("http://www.w3.org/1999/xhtml","a");Oe.href=ne.createObjectURL(G),Oe.download=S,st(Oe)}Object(j.useEffect)(function(){ht()},[ht]),Object(j.useEffect)(function(){le.current&&!Ne&&T.e(27).then(T.t.bind(null,"M/lh",7)).then(function(S){try{ue=S,xe.current.instance=ue.editor.create(le.current,{value:Be,language:me(C),theme:m,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},N);var E=xe.current.instance;if(ce(E,ue),setTimeout(function(){ht(),xe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ee(R||"educoder.txt",E.getValue())}})},500),xe.current.subscription=E.onDidChangeModelContent(function(G){Ce.current?clearTimeout(Me.current):(ht(),ye(E.getValue(),G)),Me.current=setTimeout(function(){Ce.current=!1},500)}),window.Monaco||M(ue),Re&&(E.addCommand(ue.KeyMod.CtrlCmd|ue.KeyMod.Shift|ue.KeyCode.KEY_V,function(){return Qe(),null}),E.addCommand(ue.KeyMod.CtrlCmd|ue.KeyCode.KEY_C,function(){return Qe(),null})),window.Monaco=ue,f&&E.onDidBlurEditorWidget(function(){f(E.getValue())}),U&&E.onDidFocusEditorText(function(){U(E.getValue())}),Re){E.addCommand(ue.KeyMod.CtrlCmd|ue.KeyCode.KEY_V,function(){return Qe(),null}),E.onDidPaste(function(G){xe.current.pastePos=G});try{window.addEventListener("paste",tt)}catch(G){}}var ne=dt();return Fe(!0),function(){var G=xe.current.instance;G.dispose();var Oe=G.getModel();Oe&&Oe.dispose(),xe.current.subscription&&xe.current.subscription.dispose(),Re&&window.removeEventListener("paste",tt),ne.unobserve(le.current)}}catch(G){}})},[]),Object(j.useEffect)(function(){var S=xe.current.instance;if(S&&Ne)return document.addEventListener("keydown",mt,!1),function(){document.removeEventListener("keydown",mt)}},[w,Ne]),Object(j.useEffect)(function(){var S=xe.current.instance;if(S&&Ne){var E=me(C);ue.editor.setModelLanguage(S.getModel(),E),console.log("language:",C,S.getModel(),E)}},[C,Ne]),Object(j.useEffect)(function(){var S=xe.current.instance;S&&Ne&&ue.editor.setTheme(m)},[m,Ne]),Object(j.useEffect)(function(){var S=xe.current.instance;S&&Ne&&(S.updateOptions(Object(K.a)({},se)),setTimeout(function(){S.getModel().updateOptions(Object(K.a)({},se))},200))},[JSON.stringify(se),Ne]),Object(j.useEffect)(function(){var S=xe.current.instance;S&&Ne&&S.layout()},[Ve,ke,Ne]);var pt=Object(j.useState)(oe(Ve)),ot=Object(_e.a)(pt,2),Le=ot[0],ze=ot[1],W=Object(j.useState)(oe(ke)),B=Object(_e.a)(W,2),H=B[0],y=B[1],x=Object(K.a)(Object(K.a)({},Y),{},{width:Le,height:H});return Q.a.createElement("div",{className:"my-monaco-editor",ref:le,style:x})};function $e(we){var be=we.width,Ve=be===void 0?"100%":be,fe=we.height,ke=fe===void 0?"100%":fe,Be=we.original,he=we.modified,C=we.language,ae=we.options,Y=ae===void 0?{}:ae,A=Object(j.useRef)(),se=Object(j.useState)(null),F=Object(_e.a)(se,2),N=F[0],L=F[1];function m(J){var Se;return A.current&&(Se=new ie.default(function(Re){var pe=Object(Pe.a)(Re),ye;try{for(pe.s();!(ye=pe.n()).done;){var ge=ye.value;(ge.target.offsetHeight>0||ge.target.offsetWidth>0)&&J.layout()}}catch(ce){pe.e(ce)}finally{pe.f()}}),Se.observe(A.current)),Se}Object(j.useEffect)(function(){A.current&&T.e(27).then(T.t.bind(null,"M/lh",7)).then(function(J){ue=J;var Se=ue.editor.createDiffEditor(A.current,Object(K.a)(Object(K.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},Y),{},{wordWrap:!0}));L(Se);var Re=m(Se);return function(){Se.dispose();var pe=Se.getModel();pe&&pe.dispose(),Re.unobserve(A.current)}})},[]),Object(j.useEffect)(function(){N&&N.setModel({original:ue.editor.createModel(Be,C),modified:ue.editor.createModel(he,C)})},[Be,he,C,N]);var f=oe(Ve),w=oe(ke),P={width:f,height:w};return Q.a.createElement("div",{className:"my-diff-editor",ref:A,style:P})}},ZpRC:function(wt,rt,T){"use strict";function K(M){return typeof M=="object"&&M!=null&&M.nodeType===1}function Te(M,O){return(!O||M!=="hidden")&&M!=="visible"&&M!=="clip"}function de(M,O){if(M.clientHeight<M.scrollHeight||M.clientWidth<M.scrollWidth){var ve=getComputedStyle(M,null);return Te(ve.overflowY,O)||Te(ve.overflowX,O)||function(oe){var Z=function(q){if(!q.ownerDocument||!q.ownerDocument.defaultView)return null;try{return q.ownerDocument.defaultView.frameElement}catch(z){return null}}(oe);return!!Z&&(Z.clientHeight<oe.scrollHeight||Z.clientWidth<oe.scrollWidth)}(M)}return!1}function Pe(M,O,ve,oe,Z,q,z,me){return q<M&&z>O||q>M&&z<O?0:q<=M&&me<=ve||z>=O&&me>=ve?q-M-oe:z>O&&me<ve||q<M&&me>ve?z-O+Z:0}var _e=function(M,O){var ve=window,oe=O.scrollMode,Z=O.block,q=O.inline,z=O.boundary,me=O.skipOverflowHiddenElements,ue=typeof z=="function"?z:function(Me){return Me!==z};if(!K(M))throw new TypeError("Invalid target");for(var He=document.scrollingElement||document.documentElement,$e=[],we=M;K(we)&&ue(we);){if((we=we.parentElement)===He){$e.push(we);break}we!=null&&we===document.body&&de(we)&&!de(document.documentElement)||we!=null&&de(we,me)&&$e.push(we)}for(var be=ve.visualViewport?ve.visualViewport.width:innerWidth,Ve=ve.visualViewport?ve.visualViewport.height:innerHeight,fe=window.scrollX||pageXOffset,ke=window.scrollY||pageYOffset,Be=M.getBoundingClientRect(),he=Be.height,C=Be.width,ae=Be.top,Y=Be.right,A=Be.bottom,se=Be.left,F=Z==="start"||Z==="nearest"?ae:Z==="end"?A:ae+he/2,N=q==="center"?se+C/2:q==="end"?Y:se,L=[],m=0;m<$e.length;m++){var f=$e[m],w=f.getBoundingClientRect(),P=w.height,J=w.width,Se=w.top,Re=w.right,pe=w.bottom,ye=w.left;if(oe==="if-needed"&&ae>=0&&se>=0&&A<=Ve&&Y<=be&&ae>=Se&&A<=pe&&se>=ye&&Y<=Re)return L;var ge=getComputedStyle(f),ce=parseInt(ge.borderLeftWidth,10),$=parseInt(ge.borderTopWidth,10),U=parseInt(ge.borderRightWidth,10),b=parseInt(ge.borderBottomWidth,10),R=0,k=0,le="offsetWidth"in f?f.offsetWidth-f.clientWidth-ce-U:0,xe="offsetHeight"in f?f.offsetHeight-f.clientHeight-$-b:0;if(He===f)R=Z==="start"?F:Z==="end"?F-Ve:Z==="nearest"?Pe(ke,ke+Ve,Ve,$,b,ke+F,ke+F+he,he):F-Ve/2,k=q==="start"?N:q==="center"?N-be/2:q==="end"?N-be:Pe(fe,fe+be,be,ce,U,fe+N,fe+N+C,C),R=Math.max(0,R+ke),k=Math.max(0,k+fe);else{R=Z==="start"?F-Se-$:Z==="end"?F-pe+b+xe:Z==="nearest"?Pe(Se,pe,P,$,b+xe,F,F+he,he):F-(Se+P/2)+xe/2,k=q==="start"?N-ye-ce:q==="center"?N-(ye+J/2)+le/2:q==="end"?N-Re+U+le:Pe(ye,Re,J,ce,U+le,N,N+C,C);var X=f.scrollLeft,Ce=f.scrollTop;F+=Ce-(R=Math.max(0,Math.min(Ce+R,f.scrollHeight-P+xe))),N+=X-(k=Math.max(0,Math.min(X+k,f.scrollWidth-J+le)))}L.push({el:f,top:R,left:k})}return L};function re(M){return M===Object(M)&&Object.keys(M).length!==0}function j(M,O){O===void 0&&(O="auto");var ve="scrollBehavior"in document.body.style;M.forEach(function(oe){var Z=oe.el,q=oe.top,z=oe.left;Z.scroll&&ve?Z.scroll({top:q,left:z,behavior:O}):(Z.scrollTop=q,Z.scrollLeft=z)})}function Q(M){return M===!1?{block:"end",inline:"nearest"}:re(M)?M:{block:"start",inline:"nearest"}}function ie(M,O){var ve=!M.ownerDocument.documentElement.contains(M);if(re(O)&&typeof O.behavior=="function")return O.behavior(ve?[]:_e(M,O));if(ve)return;var oe=Q(O);return j(_e(M,oe),oe.behavior)}var V=rt.a=ie},Zss7:function(wt,rt,T){var K;(function(Te){var de=/^\s+/,Pe=/\s+$/,_e=0,re=Te.round,j=Te.min,Q=Te.max,ie=Te.random;function V(b,R){if(b=b||"",R=R||{},b instanceof V)return b;if(!(this instanceof V))return new V(b,R);var k=M(b);this._originalInput=b,this._r=k.r,this._g=k.g,this._b=k.b,this._a=k.a,this._roundA=re(100*this._a)/100,this._format=R.format||k.format,this._gradientType=R.gradientType,this._r<1&&(this._r=re(this._r)),this._g<1&&(this._g=re(this._g)),this._b<1&&(this._b=re(this._b)),this._ok=k.ok,this._tc_id=_e++}V.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,k,le,xe,X,Ce;return R=b.r/255,k=b.g/255,le=b.b/255,R<=.03928?xe=R/12.92:xe=Te.pow((R+.055)/1.055,2.4),k<=.03928?X=k/12.92:X=Te.pow((k+.055)/1.055,2.4),le<=.03928?Ce=le/12.92:Ce=Te.pow((le+.055)/1.055,2.4),.2126*xe+.7152*X+.0722*Ce},setAlpha:function(b){return this._a=L(b),this._roundA=re(100*this._a)/100,this},toHsv:function(){var b=Z(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=Z(this._r,this._g,this._b),R=re(b.h*360),k=re(b.s*100),le=re(b.v*100);return this._a==1?"hsv("+R+", "+k+"%, "+le+"%)":"hsva("+R+", "+k+"%, "+le+"%, "+this._roundA+")"},toHsl:function(){var b=ve(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=ve(this._r,this._g,this._b),R=re(b.h*360),k=re(b.s*100),le=re(b.l*100);return this._a==1?"hsl("+R+", "+k+"%, "+le+"%)":"hsla("+R+", "+k+"%, "+le+"%, "+this._roundA+")"},toHex:function(b){return z(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:re(this._r),g:re(this._g),b:re(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+re(this._r)+", "+re(this._g)+", "+re(this._b)+")":"rgba("+re(this._r)+", "+re(this._g)+", "+re(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:re(m(this._r,255)*100)+"%",g:re(m(this._g,255)*100)+"%",b:re(m(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+re(m(this._r,255)*100)+"%, "+re(m(this._g,255)*100)+"%, "+re(m(this._b,255)*100)+"%)":"rgba("+re(m(this._r,255)*100)+"%, "+re(m(this._g,255)*100)+"%, "+re(m(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[z(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var R="#"+ue(this._r,this._g,this._b,this._a),k=R,le=this._gradientType?"GradientType = 1, ":"";if(b){var xe=V(b);k="#"+ue(xe._r,xe._g,xe._b,xe._a)}return"progid:DXImageTransform.Microsoft.gradient("+le+"startColorstr="+R+",endColorstr="+k+")"},toString:function(b){var R=!!b;b=b||this._format;var k=!1,le=this._a<1&&this._a>=0,xe=!R&&le&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return xe?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(k=this.toRgbString()),b==="prgb"&&(k=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(k=this.toHexString()),b==="hex3"&&(k=this.toHexString(!0)),b==="hex4"&&(k=this.toHex8String(!0)),b==="hex8"&&(k=this.toHex8String()),b==="name"&&(k=this.toName()),b==="hsl"&&(k=this.toHslString()),b==="hsv"&&(k=this.toHsvString()),k||this.toHexString())},clone:function(){return V(this.toString())},_applyModification:function(b,R){var k=b.apply(null,[this].concat([].slice.call(R)));return this._r=k._r,this._g=k._g,this._b=k._b,this.setAlpha(k._a),this},lighten:function(){return this._applyModification(be,arguments)},brighten:function(){return this._applyModification(Ve,arguments)},darken:function(){return this._applyModification(fe,arguments)},desaturate:function(){return this._applyModification(He,arguments)},saturate:function(){return this._applyModification($e,arguments)},greyscale:function(){return this._applyModification(we,arguments)},spin:function(){return this._applyModification(ke,arguments)},_applyCombination:function(b,R){return b.apply(null,[this].concat([].slice.call(R)))},analogous:function(){return this._applyCombination(Y,arguments)},complement:function(){return this._applyCombination(Be,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(ae,arguments)},triad:function(){return this._applyCombination(he,arguments)},tetrad:function(){return this._applyCombination(C,arguments)}},V.fromRatio=function(b,R){if(typeof b=="object"){var k={};for(var le in b)b.hasOwnProperty(le)&&(le==="a"?k[le]=b[le]:k[le]=Re(b[le]));b=k}return V(b,R)};function M(b){var R={r:0,g:0,b:0},k=1,le=null,xe=null,X=null,Ce=!1,Me=!1;return typeof b=="string"&&(b=$(b)),typeof b=="object"&&(ce(b.r)&&ce(b.g)&&ce(b.b)?(R=O(b.r,b.g,b.b),Ce=!0,Me=String(b.r).substr(-1)==="%"?"prgb":"rgb"):ce(b.h)&&ce(b.s)&&ce(b.v)?(le=Re(b.s),xe=Re(b.v),R=q(b.h,le,xe),Ce=!0,Me="hsv"):ce(b.h)&&ce(b.s)&&ce(b.l)&&(le=Re(b.s),X=Re(b.l),R=oe(b.h,le,X),Ce=!0,Me="hsl"),b.hasOwnProperty("a")&&(k=b.a)),k=L(k),{ok:Ce,format:b.format||Me,r:j(255,Q(R.r,0)),g:j(255,Q(R.g,0)),b:j(255,Q(R.b,0)),a:k}}function O(b,R,k){return{r:m(b,255)*255,g:m(R,255)*255,b:m(k,255)*255}}function ve(b,R,k){b=m(b,255),R=m(R,255),k=m(k,255);var le=Q(b,R,k),xe=j(b,R,k),X,Ce,Me=(le+xe)/2;if(le==xe)X=Ce=0;else{var Ge=le-xe;Ce=Me>.5?Ge/(2-le-xe):Ge/(le+xe);switch(le){case b:X=(R-k)/Ge+(R<k?6:0);break;case R:X=(k-b)/Ge+2;break;case k:X=(b-R)/Ge+4;break}X/=6}return{h:X,s:Ce,l:Me}}function oe(b,R,k){var le,xe,X;b=m(b,360),R=m(R,100),k=m(k,100);function Ce(je,Ne,Fe){return Fe<0&&(Fe+=1),Fe>1&&(Fe-=1),Fe<1/6?je+(Ne-je)*6*Fe:Fe<1/2?Ne:Fe<2/3?je+(Ne-je)*(2/3-Fe)*6:je}if(R===0)le=xe=X=k;else{var Me=k<.5?k*(1+R):k+R-k*R,Ge=2*k-Me;le=Ce(Ge,Me,b+1/3),xe=Ce(Ge,Me,b),X=Ce(Ge,Me,b-1/3)}return{r:le*255,g:xe*255,b:X*255}}function Z(b,R,k){b=m(b,255),R=m(R,255),k=m(k,255);var le=Q(b,R,k),xe=j(b,R,k),X,Ce,Me=le,Ge=le-xe;if(Ce=le===0?0:Ge/le,le==xe)X=0;else{switch(le){case b:X=(R-k)/Ge+(R<k?6:0);break;case R:X=(k-b)/Ge+2;break;case k:X=(b-R)/Ge+4;break}X/=6}return{h:X,s:Ce,v:Me}}function q(b,R,k){b=m(b,360)*6,R=m(R,100),k=m(k,100);var le=Te.floor(b),xe=b-le,X=k*(1-R),Ce=k*(1-xe*R),Me=k*(1-(1-xe)*R),Ge=le%6,je=[k,Ce,X,X,Me,k][Ge],Ne=[Me,k,k,Ce,X,X][Ge],Fe=[X,X,Me,k,k,Ce][Ge];return{r:je*255,g:Ne*255,b:Fe*255}}function z(b,R,k,le){var xe=[Se(re(b).toString(16)),Se(re(R).toString(16)),Se(re(k).toString(16))];return le&&xe[0].charAt(0)==xe[0].charAt(1)&&xe[1].charAt(0)==xe[1].charAt(1)&&xe[2].charAt(0)==xe[2].charAt(1)?xe[0].charAt(0)+xe[1].charAt(0)+xe[2].charAt(0):xe.join("")}function me(b,R,k,le,xe){var X=[Se(re(b).toString(16)),Se(re(R).toString(16)),Se(re(k).toString(16)),Se(pe(le))];return xe&&X[0].charAt(0)==X[0].charAt(1)&&X[1].charAt(0)==X[1].charAt(1)&&X[2].charAt(0)==X[2].charAt(1)&&X[3].charAt(0)==X[3].charAt(1)?X[0].charAt(0)+X[1].charAt(0)+X[2].charAt(0)+X[3].charAt(0):X.join("")}function ue(b,R,k,le){var xe=[Se(pe(le)),Se(re(b).toString(16)),Se(re(R).toString(16)),Se(re(k).toString(16))];return xe.join("")}V.equals=function(b,R){return!b||!R?!1:V(b).toRgbString()==V(R).toRgbString()},V.random=function(){return V.fromRatio({r:ie(),g:ie(),b:ie()})};function He(b,R){R=R===0?0:R||10;var k=V(b).toHsl();return k.s-=R/100,k.s=f(k.s),V(k)}function $e(b,R){R=R===0?0:R||10;var k=V(b).toHsl();return k.s+=R/100,k.s=f(k.s),V(k)}function we(b){return V(b).desaturate(100)}function be(b,R){R=R===0?0:R||10;var k=V(b).toHsl();return k.l+=R/100,k.l=f(k.l),V(k)}function Ve(b,R){R=R===0?0:R||10;var k=V(b).toRgb();return k.r=Q(0,j(255,k.r-re(255*-(R/100)))),k.g=Q(0,j(255,k.g-re(255*-(R/100)))),k.b=Q(0,j(255,k.b-re(255*-(R/100)))),V(k)}function fe(b,R){R=R===0?0:R||10;var k=V(b).toHsl();return k.l-=R/100,k.l=f(k.l),V(k)}function ke(b,R){var k=V(b).toHsl(),le=(k.h+R)%360;return k.h=le<0?360+le:le,V(k)}function Be(b){var R=V(b).toHsl();return R.h=(R.h+180)%360,V(R)}function he(b){var R=V(b).toHsl(),k=R.h;return[V(b),V({h:(k+120)%360,s:R.s,l:R.l}),V({h:(k+240)%360,s:R.s,l:R.l})]}function C(b){var R=V(b).toHsl(),k=R.h;return[V(b),V({h:(k+90)%360,s:R.s,l:R.l}),V({h:(k+180)%360,s:R.s,l:R.l}),V({h:(k+270)%360,s:R.s,l:R.l})]}function ae(b){var R=V(b).toHsl(),k=R.h;return[V(b),V({h:(k+72)%360,s:R.s,l:R.l}),V({h:(k+216)%360,s:R.s,l:R.l})]}function Y(b,R,k){R=R||6,k=k||30;var le=V(b).toHsl(),xe=360/k,X=[V(b)];for(le.h=(le.h-(xe*R>>1)+720)%360;--R;)le.h=(le.h+xe)%360,X.push(V(le));return X}function A(b,R){R=R||6;for(var k=V(b).toHsv(),le=k.h,xe=k.s,X=k.v,Ce=[],Me=1/R;R--;)Ce.push(V({h:le,s:xe,v:X})),X=(X+Me)%1;return Ce}V.mix=function(b,R,k){k=k===0?0:k||50;var le=V(b).toRgb(),xe=V(R).toRgb(),X=k/100,Ce={r:(xe.r-le.r)*X+le.r,g:(xe.g-le.g)*X+le.g,b:(xe.b-le.b)*X+le.b,a:(xe.a-le.a)*X+le.a};return V(Ce)},V.readability=function(b,R){var k=V(b),le=V(R);return(Te.max(k.getLuminance(),le.getLuminance())+.05)/(Te.min(k.getLuminance(),le.getLuminance())+.05)},V.isReadable=function(b,R,k){var le=V.readability(b,R),xe,X;X=!1,xe=U(k);switch(xe.level+xe.size){case"AAsmall":case"AAAlarge":X=le>=4.5;break;case"AAlarge":X=le>=3;break;case"AAAsmall":X=le>=7;break}return X},V.mostReadable=function(b,R,k){var le=null,xe=0,X,Ce,Me,Ge;k=k||{},Ce=k.includeFallbackColors,Me=k.level,Ge=k.size;for(var je=0;je<R.length;je++)X=V.readability(b,R[je]),X>xe&&(xe=X,le=V(R[je]));return V.isReadable(b,le,{level:Me,size:Ge})||!Ce?le:(k.includeFallbackColors=!1,V.mostReadable(b,["#fff","#000"],k))};var se=V.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"},F=V.hexNames=N(se);function N(b){var R={};for(var k in b)b.hasOwnProperty(k)&&(R[b[k]]=k);return R}function L(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function m(b,R){P(b)&&(b="100%");var k=J(b);return b=j(R,Q(0,parseFloat(b))),k&&(b=parseInt(b*R,10)/100),Te.abs(b-R)<1e-6?1:b%R/parseFloat(R)}function f(b){return j(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 J(b){return typeof b=="string"&&b.indexOf("%")!=-1}function Se(b){return b.length==1?"0"+b:""+b}function Re(b){return b<=1&&(b=b*100+"%"),b}function pe(b){return Te.round(parseFloat(b)*255).toString(16)}function ye(b){return w(b)/255}var ge=function(){var b="[-\\+]?\\d+%?",R="[-\\+]?\\d*\\.\\d+%?",k="(?:"+R+")|(?:"+b+")",le="[\\s|\\(]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")\\s*\\)?",xe="[\\s|\\(]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")\\s*\\)?";return{CSS_UNIT:new RegExp(k),rgb:new RegExp("rgb"+le),rgba:new RegExp("rgba"+xe),hsl:new RegExp("hsl"+le),hsla:new RegExp("hsla"+xe),hsv:new RegExp("hsv"+le),hsva:new RegExp("hsva"+xe),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 ce(b){return!!ge.CSS_UNIT.exec(b)}function $(b){b=b.replace(de,"").replace(Pe,"").toLowerCase();var R=!1;if(se[b])b=se[b],R=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var k;return(k=ge.rgb.exec(b))?{r:k[1],g:k[2],b:k[3]}:(k=ge.rgba.exec(b))?{r:k[1],g:k[2],b:k[3],a:k[4]}:(k=ge.hsl.exec(b))?{h:k[1],s:k[2],l:k[3]}:(k=ge.hsla.exec(b))?{h:k[1],s:k[2],l:k[3],a:k[4]}:(k=ge.hsv.exec(b))?{h:k[1],s:k[2],v:k[3]}:(k=ge.hsva.exec(b))?{h:k[1],s:k[2],v:k[3],a:k[4]}:(k=ge.hex8.exec(b))?{r:w(k[1]),g:w(k[2]),b:w(k[3]),a:ye(k[4]),format:R?"name":"hex8"}:(k=ge.hex6.exec(b))?{r:w(k[1]),g:w(k[2]),b:w(k[3]),format:R?"name":"hex"}:(k=ge.hex4.exec(b))?{r:w(k[1]+""+k[1]),g:w(k[2]+""+k[2]),b:w(k[3]+""+k[3]),a:ye(k[4]+""+k[4]),format:R?"name":"hex8"}:(k=ge.hex3.exec(b))?{r:w(k[1]+""+k[1]),g:w(k[2]+""+k[2]),b:w(k[3]+""+k[3]),format:R?"name":"hex"}:!1}function U(b){var R,k;return b=b||{level:"AA",size:"small"},R=(b.level||"AA").toUpperCase(),k=(b.size||"small").toLowerCase(),R!=="AA"&&R!=="AAA"&&(R="AA"),k!=="small"&&k!=="large"&&(k="small"),{level:R,size:k}}wt.exports?wt.exports=V:!(K=function(){return V}.call(rt,T,rt,wt),K!==void 0&&(wt.exports=K))})(Math)},bT9E:function(wt,rt,T){"use strict";T.d(rt,"a",function(){return Te});var K=T("VTBJ");function Te(de,Pe){var _e=Object(K.a)({},de);return Array.isArray(Pe)&&Pe.forEach(function(re){delete _e[re]}),_e}},c5Ni:function(wt,rt,T){},dejd:function(wt,rt,T){},dmUQ:function(wt,rt,T){"use strict";var K=T("Ff2n"),Te=T("rePB"),de=T("1OyB"),Pe=T("vuIU"),_e=T("Ji7U"),re=T("md7G"),j=T("foSv"),Q=T("q1tI"),ie=T.n(Q),V=T("TSYQ"),M=T.n(V),O=T("4IlW");function ve(he,C){var ae=Object.keys(he);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(he);C&&(Y=Y.filter(function(A){return Object.getOwnPropertyDescriptor(he,A).enumerable})),ae.push.apply(ae,Y)}return ae}function oe(he){for(var C=1;C<arguments.length;C++){var ae=arguments[C]!=null?arguments[C]:{};C%2?ve(Object(ae),!0).forEach(function(Y){Object(Te.a)(he,Y,ae[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(ae)):ve(Object(ae)).forEach(function(Y){Object.defineProperty(he,Y,Object.getOwnPropertyDescriptor(ae,Y))})}return he}function Z(he){var C=q();return function(){var Y=Object(j.a)(he),A;if(C){var se=Object(j.a)(this).constructor;A=Reflect.construct(Y,arguments,se)}else A=Y.apply(this,arguments);return Object(re.a)(this,A)}}function q(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(he){return!1}}function z(){}function me(he){he.preventDefault()}var ue=function(C){return C.replace(/[^\w.-]+/g,"")},He=200,$e=600,we=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,be=function(C){return C!=null},Ve=function(C,ae){return ae===C||typeof ae=="number"&&typeof C=="number"&&isNaN(ae)&&isNaN(C)},fe=function(he){Object(_e.a)(ae,he);var C=Z(ae);function ae(Y){var A;Object(de.a)(this,ae),A=C.call(this,Y),A.onKeyDown=function(N){var L=A.props,m=L.onKeyDown,f=L.onPressEnter;if(N.keyCode===O.a.UP){var w=A.getRatio(N);A.up(N,w,null),A.stop()}else if(N.keyCode===O.a.DOWN){var P=A.getRatio(N);A.down(N,P,null),A.stop()}else N.keyCode===O.a.ENTER&&f&&f(N);if(A.recordCursorPosition(),A.lastKeyCode=N.keyCode,m){for(var J=arguments.length,Se=new Array(J>1?J-1:0),Re=1;Re<J;Re++)Se[Re-1]=arguments[Re];m.apply(void 0,[N].concat(Se))}},A.onKeyUp=function(N){var L=A.props.onKeyUp;if(A.stop(),A.recordCursorPosition(),L){for(var m=arguments.length,f=new Array(m>1?m-1:0),w=1;w<m;w++)f[w-1]=arguments[w];L.apply(void 0,[N].concat(f))}},A.onChange=function(N){var L=A.props.onChange;A.state.focused&&(A.inputting=!0),A.rawInput=A.props.parser(A.getValueFromEvent(N)),A.setState({inputValue:A.rawInput}),L(A.toNumber(A.rawInput))},A.onMouseUp=function(){var N=A.props.onMouseUp;A.recordCursorPosition(),N&&N.apply(void 0,arguments)},A.onFocus=function(){var N;A.setState({focused:!0}),(N=A.props).onFocus.apply(N,arguments)},A.onBlur=function(){var N=A.props.onBlur;A.inputting=!1,A.setState({focused:!1});var L=A.getCurrentValidValue(A.state.inputValue),m=A.setValue(L,z);if(N){var f=A.input.value,w=A.getInputDisplayValue({focus:!1,value:m});A.input.value=w&&Number(w),N.apply(void 0,arguments),A.input.value=f}},A.getRatio=function(N){var L=1;return N.metaKey||N.ctrlKey?L=.1:N.shiftKey&&(L=10),L},A.getFullNum=function(N){return isNaN(N)?N:/e/i.test(String(N))?Number(N).toFixed(18).replace(/\.?0+$/,""):N},A.getPrecision=function(N){if(be(A.props.precision))return A.props.precision;var L=String(N);if(L.indexOf("e-")>=0)return parseInt(L.slice(L.indexOf("e-")+2),10);var m=0;return L.indexOf(".")>=0&&(m=L.length-L.indexOf(".")-1),m},A.getInputDisplayValue=function(N){var L=N||A.state,m=L.focused,f=L.inputValue,w=L.value,P;m?P=f:P=A.toPrecisionAsStep(w),P==null&&(P="");var J=A.formatWrapper(P);return be(A.props.decimalSeparator)&&(J=J.toString().replace(".",A.props.decimalSeparator)),J},A.recordCursorPosition=function(){try{A.cursorStart=A.input.selectionStart,A.cursorEnd=A.input.selectionEnd,A.currentValue=A.input.value,A.cursorBefore=A.input.value.substring(0,A.cursorStart),A.cursorAfter=A.input.value.substring(A.cursorEnd)}catch(N){}},A.restoreByAfter=function(N){if(N===void 0)return!1;var L=A.input.value,m=L.lastIndexOf(N);if(m===-1)return!1;var f=A.cursorBefore.length;return A.lastKeyCode===O.a.DELETE&&A.cursorBefore.charAt(f-1)===N[0]?(A.fixCaret(f,f),!0):m+N.length===L.length?(A.fixCaret(m,m),!0):!1},A.partRestoreByAfter=function(N){return N===void 0?!1:Array.prototype.some.call(N,function(L,m){var f=N.substring(m);return A.restoreByAfter(f)})},A.isNotCompleteNumber=function(N){return isNaN(N)||N===""||N===null||N&&N.toString().indexOf(".")===N.toString().length-1},A.stop=function(){A.autoStepTimer&&clearTimeout(A.autoStepTimer)},A.down=function(N,L,m){A.pressingUpOrDown=!0,A.step("down",N,L,m)},A.up=function(N,L,m){A.pressingUpOrDown=!0,A.step("up",N,L,m)},A.saveInput=function(N){A.input=N};var se=Y.value;se===void 0&&(se=Y.defaultValue),A.state={focused:Y.autoFocus};var F=A.getValidValue(A.toNumber(se));return A.state=oe(oe({},A.state),{},{inputValue:A.toPrecisionAsStep(F),value:F}),A}return Object(Pe.a)(ae,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(A){var se=this.props,F=se.value,N=se.onChange,L=se.max,m=se.min,f=this.state.focused;if(A){if(!Ve(A.value,F)||!Ve(A.max,L)||!Ve(A.min,m)){var w=f?F:this.getValidValue(F),P;this.pressingUpOrDown?P=w:this.inputting?P=this.rawInput:P=this.toPrecisionAsStep(w),this.setState({value:w,inputValue:P})}var J="value"in this.props?F:this.state.value;"max"in this.props&&A.max!==L&&typeof J=="number"&&J>L&&N&&N(L),"min"in this.props&&A.min!==m&&typeof J=="number"&&J<m&&N&&N(m)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===O.a.BACKSPACE?Se=this.cursorStart-1:this.lastKeyCode===O.a.DELETE&&(Se=this.cursorStart):Se=this.input.value.length,this.fixCaret(Se,Se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case O.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case O.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(A){var se=A;return se===""?se="":this.isNotCompleteNumber(parseFloat(se))?se=this.state.value:se=this.getValidValue(se),this.toNumber(se)}},{key:"getValueFromEvent",value:function(A){var se=A.target.value.trim().replace(/。/g,".");return be(this.props.decimalSeparator)&&(se=se.replace(this.props.decimalSeparator,".")),se}},{key:"getValidValue",value:function(A){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,N=parseFloat(A);return isNaN(N)?A:(N<se&&(N=se),N>F&&(N=F),N)}},{key:"setValue",value:function(A,se){var F=this.props.precision,N=this.isNotCompleteNumber(parseFloat(A))?null:parseFloat(A),L=this.state.value,m=L===void 0?null:L,f=this.state.inputValue,w=f===void 0?null:f,P=typeof N=="number"?N.toFixed(F):"".concat(N),J=N!==m||P!=="".concat(w);return"value"in this.props?(w=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:w},se)):this.setState({value:N,inputValue:this.toPrecisionAsStep(A)},se),J&&this.props.onChange(N),N}},{key:"getMaxPrecision",value:function(A){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,N=F.precision,L=F.step;if(be(N))return N;var m=this.getPrecision(se),f=this.getPrecision(L),w=this.getPrecision(A);return A?Math.max(w,m+f):m+f}},{key:"getPrecisionFactor",value:function(A){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(A,se);return Math.pow(10,F)}},{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(A){return this.props.formatter?this.props.formatter(A):A}},{key:"toPrecisionAsStep",value:function(A){if(this.isNotCompleteNumber(A)||A==="")return A;var se=Math.abs(this.getMaxPrecision(A));return isNaN(se)?A.toString():Number(A).toFixed(se)}},{key:"toNumber",value:function(A){var se=this.props.precision,F=this.state.focused,N=A&&A.length>16&&F;return this.isNotCompleteNumber(A)||N?A:be(se)?Math.round(A*Math.pow(10,se))/Math.pow(10,se):Number(A)}},{key:"upStep",value:function(A,se){var F=this.props.step,N=this.getPrecisionFactor(A,se),L=Math.abs(this.getMaxPrecision(A,se)),m=((N*A+N*F*se)/N).toFixed(L);return this.toNumber(m)}},{key:"downStep",value:function(A,se){var F=this.props.step,N=this.getPrecisionFactor(A,se),L=Math.abs(this.getMaxPrecision(A,se)),m=((N*A-N*F*se)/N).toFixed(L);return this.toNumber(m)}},{key:"step",value:function(A,se){var F=this,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=arguments.length>3?arguments[3]:void 0;this.stop(),se&&(se.persist(),se.preventDefault());var m=this.props;if(m.disabled)return;var f=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(f))return;var w=this["".concat(A,"Step")](f,N),P=w>m.max||w<m.min;if(w>m.max?w=m.max:w<m.min&&(w=m.min),this.setValue(w,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),P)return;this.autoStepTimer=setTimeout(function(){F[A](se,N,!0)},L?He:$e)}},{key:"fixCaret",value:function(A,se){if(A===void 0||se===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,N=this.input.selectionEnd;(A!==F||se!==N)&&this.input.setSelectionRange(A,se)}catch(L){}}},{key:"render",value:function(){var A,se=this.props,F=se.prefixCls,N=se.disabled,L=se.readOnly,m=se.useTouch,f=se.autoComplete,w=se.upHandler,P=se.downHandler,J=se.className,Se=se.max,Re=se.min,pe=se.style,ye=se.title,ge=se.onMouseEnter,ce=se.onMouseLeave,$=se.onMouseOver,U=se.onMouseOut,b=se.required,R=se.onClick,k=se.tabIndex,le=se.type,xe=se.placeholder,X=se.id,Ce=se.inputMode,Me=se.pattern,Ge=se.step,je=se.maxLength,Ne=se.autoFocus,Fe=se.name,dt=se.onPaste,Qe=se.onInput,et=Object(K.a)(se,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),tt=this.state,mt=tt.value,ht=tt.focused,st=M()(F,(A={},Object(Te.a)(A,J,!!J),Object(Te.a)(A,"".concat(F,"-disabled"),N),Object(Te.a)(A,"".concat(F,"-focused"),ht),A)),Ee={};Object.keys(et).forEach(function(E){(E.substr(0,5)==="data-"||E.substr(0,5)==="aria-"||E==="role")&&(Ee[E]=et[E])});var pt=!L&&!N,ot=this.getInputDisplayValue(null),Le=(mt||mt===0)&&(isNaN(mt)||Number(mt)>=Se),ze=(mt||mt===0)&&(isNaN(mt)||Number(mt)<=Re),W=Le||N||L,B=ze||N||L,H=M()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(Te.a)({},"".concat(F,"-handler-up-disabled"),W)),y=M()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(Te.a)({},"".concat(F,"-handler-down-disabled"),B)),x=m?{onTouchStart:W?z:this.up,onTouchEnd:this.stop}:{onMouseDown:W?z:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},S=m?{onTouchStart:B?z:this.down,onTouchEnd:this.stop}:{onMouseDown:B?z:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return ie.a.createElement("div",{className:st,style:pe,title:ye,onMouseEnter:ge,onMouseLeave:ce,onMouseOver:$,onMouseOut:U,onFocus:function(){return null},onBlur:function(){return null}},ie.a.createElement("div",{className:"".concat(F,"-handler-wrap")},ie.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Increase Value","aria-disabled":W,className:H}),w||ie.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:me})),ie.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Decrease Value","aria-disabled":B,className:y}),P||ie.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:me}))),ie.a.createElement("div",{className:"".concat(F,"-input-wrap")},ie.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":Se,"aria-valuenow":mt,required:b,type:le,placeholder:xe,onPaste:dt,onClick:R,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:k,autoComplete:f,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:pt?this.onKeyDown:z,onKeyUp:pt?this.onKeyUp:z,autoFocus:Ne,maxLength:je,readOnly:L,disabled:N,max:Se,min:Re,step:Ge,name:Fe,title:ye,id:X,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:Me,inputMode:Ce,onInput:Qe},Ee))))}}]),ae}(ie.a.Component);fe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:we,min:-we,step:1,style:{},onChange:z,onKeyDown:z,onPressEnter:z,onFocus:z,onBlur:z,parser:ue,required:!1,autoComplete:"off"};var ke=fe,Be=rt.a=ke},gkVt:function(wt,rt,T){"use strict";T.r(rt);var K=T("DZo9"),Te=T("8z0m"),de=T("+L6B"),Pe=T("2/Rp"),_e=T("miYZ"),re=T("tsqr"),j=T("9og8"),Q=T("tJVT"),ie=T("WmNS"),V=T.n(ie),M=T("q1tI"),O=T.n(M),ve=T("5NDa"),oe=T("5rEg"),Z=T("Ot1p"),q=T("ErOA");function z(he){var C=he.setIscreate,ae=he.init,Y=he.UpdateItem,A=Object(M.useState)(""),se=Object(Q.a)(A,2),F=se[0],N=se[1],L=Object(M.useState)(""),m=Object(Q.a)(L,2),f=m[0],w=m[1];Object(M.useEffect)(function(){if(!Y)return;N(Y&&Y.name),w(Y&&Y.description)},[Y]);function P(){return J.apply(this,arguments)}function J(){return J=Object(j.a)(V.a.mark(function pe(){var ye;return V.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:if(F){ce.next=3;break}return re.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),ce.abrupt("return");case 3:if(f){ce.next=6;break}return re.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),ce.abrupt("return");case 6:if(!Y){ce.next=9;break}return Se(),ce.abrupt("return");case 9:return ce.next=11,Object(q.a)("/api/hpc_courses.json",{method:"post",body:{name:F,description:f,container_type:window.location.pathname.split("/")[1]}});case 11:ye=ce.sent,ye&&(re.b.info("\u521B\u5EFA\u6210\u529F"),C(!1),ae("add"));case 13:case"end":return ce.stop()}},pe)})),J.apply(this,arguments)}function Se(){return Re.apply(this,arguments)}function Re(){return Re=Object(j.a)(V.a.mark(function pe(){var ye;return V.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(q.a)("/api/hpc_courses/".concat(Y.id,".json"),{method:"put",body:{name:F,description:f,container_type:window.location.pathname.split("/")[1]}});case 2:ye=ce.sent,ye&&(re.b.info("\u7F16\u8F91\u6210\u529F"),C(!1),ae(""));case 4:case"end":return ce.stop()}},pe)})),Re.apply(this,arguments)}return O.a.createElement("div",null,O.a.createElement(oe.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:F,maxLength:60,addonAfter:String(F.length)+"/60",onChange:function(ye){return N(ye.target.value)}}),O.a.createElement(Z.a,{id:"courseContentMD",defaultValue:f,onChange:function(ye){return w(ye)}}),O.a.createElement("div",{className:"clearfix mt30 mb30"},O.a.createElement(Pe.a,{type:"primary",onClick:function(){return P()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),O.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return C(!1)}},"\u53D6\u6D88")))}var me=z,ue=T("9Bee");function He(he){var C=he.CourseItem,ae=he.userId,Y=he.init,A=he.ItemUpdate,se=he.setSee,F=he.UserInfo;function N(){return L.apply(this,arguments)}function L(){return L=Object(j.a)(V.a.mark(function f(){var w;return V.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(q.a)("/api/hpc_courses/".concat(C.id,".json"),{method:"delete"});case 2:w=J.sent,w&&(re.b.info("\u5220\u9664\u6210\u529F"),Y("delete"),se(!1));case 4:case"end":return J.stop()}},f)})),L.apply(this,arguments)}function m(){A(C)}return O.a.createElement("div",null,ae===299635||ae===301458||F!=null&&F.admin||F!=null&&F.business?O.a.createElement("div",{style:{textAlign:"right"}},O.a.createElement(Pe.a,{onClick:function(){return m()}},"\u7F16\u8F91"),O.a.createElement(Pe.a,{onClick:function(){return N()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,O.a.createElement("h1",null,C==null?void 0:C.name),O.a.createElement(ue.a,{value:C==null?void 0:C.description}))}var $e=He,we=T("9ivq"),be=T("m3rI"),Ve=T("Ty5D"),fe=T("9kvl");function ke(he){var C,ae,Y,A,se,F,N,L,m,f=he.user,w=he.dispatch,P=Object(M.useState)(1),J=Object(Q.a)(P,2),Se=J[0],Re=J[1],pe=Object(M.useState)(100),ye=Object(Q.a)(pe,2),ge=ye[0],ce=ye[1],$=Object(M.useState)([]),U=Object(Q.a)($,2),b=U[0],R=U[1],k=Object(M.useState)(!1),le=Object(Q.a)(k,2),xe=le[0],X=le[1],Ce=Object(M.useState)(!1),Me=Object(Q.a)(Ce,2),Ge=Me[0],je=Me[1],Ne=Object(M.useState)(""),Fe=Object(Q.a)(Ne,2),dt=Fe[0],Qe=Fe[1],et=Object(M.useState)(""),tt=Object(Q.a)(et,2),mt=tt[0],ht=tt[1],st=Object(M.useState)(""),Ee=Object(Q.a)(st,2),pt=Ee[0],ot=Ee[1],Le=Object(Ve.i)(),ze=Le.itemname,W=Object(M.useState)(""),B=Object(Q.a)(W,2),H=B[0],y=B[1];Object(M.useEffect)(function(){w({type:"globalSetting/headerToggle",payload:!1}),Se&&x("")},[Se]);function x(Ye){return S.apply(this,arguments)}function S(){return S=Object(j.a)(V.a.mark(function Ye(nt){var Ke,Et,Ct,at,Ht;return V.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(q.a)("/api/hpc_courses.json",{method:"get",params:{page:Se,per_page:ge,container_type:window.location.pathname.split("/")[1]}});case 2:if(Ke=Tt.sent,!Ke){Tt.next=24;break}if(Et=Ke.data.hpc_courses.length,R(Ke.data.hpc_courses),ot(Ke.data.file_url),ht(""),Et){Tt.next=10;break}return Tt.abrupt("return");case 10:if(H){Tt.next=14;break}ze?(Ht=0,Ke==null||((Ct=Ke.data)===null||Ct===void 0||((at=Ct.hpc_courses)===null||at===void 0))||at.map(function(Ot,_t){var bn;(ze==null?void 0:ze.toLocaleLowerCase())===(Ot==null||((bn=Ot.name)===null||bn===void 0)?void 0:bn.toLocaleLowerCase())&&(Ht=_t)}),Qe(Ke.data.hpc_courses[Ht]),je(!0),y(Ke.data.hpc_courses[Ht].id),(ze==null?void 0:ze.toLocaleLowerCase())==="resources"&&(Qe(Ke.data.hpc_courses.filter(function(Ot){return Ot.id===15})[0]),je(!0),y(15))):(Qe(Ke.data.hpc_courses[0]),je(!0),y(Ke.data.hpc_courses[0].id)),Tt.next=24;break;case 14:if(!(nt==="delete")){Tt.next=23;break}if(!(Et===0)){Tt.next=18;break}return je(!1),Tt.abrupt("return");case 18:Qe(Ke.data.hpc_courses[0]),je(!0),y(Ke.data.hpc_courses[0].id),Tt.next=24;break;case 23:nt==="add"?(Qe(Ke.data.hpc_courses[Et-1]),je(!0),y(Ke.data.hpc_courses[Et-1].id)):(Qe(Ke.data.hpc_courses.filter(function(Ot){return Ot.id===H})[0]),je(!0),y(H));case 24:case"end":return Tt.stop()}},Ye)})),S.apply(this,arguments)}function E(Ye){X(!1),je(!0),Qe(Ye),y(Ye.id)}function ne(Ye){ht(Ye),X(!0),je(!1)}function G(){ht(""),X(!0),je(!1)}var Oe={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(nt){var Ke=nt.file.status;Ke!=="uploading",Ke==="done"?(re.b.success("".concat(nt.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),x("")):Ke==="error"&&re.b.error("".concat(nt.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(nt){var Ke=nt.size/1024/1024<150;return Ke||re.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Ke}};return O.a.createElement("div",{style:{marginBottom:"40px"}},O.a.createElement("div",{className:"bannterdiv",style:{background:"url(".concat(be.a.IMG_SERVER+"/".concat(pt),")")}}),O.a.createElement("img",{style:{width:"100%"},src:be.a.IMG_SERVER+"/".concat(pt)}),O.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},O.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},b&&b.map(function(Ye,nt){return O.a.createElement("p",{key:nt,onClick:function(){return E(Ye)},className:H===Ye.id?"menuitemselect":"menuitem task-hide"},Ye.name)}),(f==null||((C=f.userInfo)===null||C===void 0)?void 0:C.user_id)===299635||(f==null||((ae=f.userInfo)===null||ae===void 0)?void 0:ae.user_id)===301458||f!=null&&(Y=f.userInfo)!==null&&Y!==void 0&&Y.admin||f!=null&&(A=f.userInfo)!==null&&A!==void 0&&A.business?O.a.createElement("p",{onClick:function(){return G()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},O.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),O.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},xe?O.a.createElement(me,{UpdateItem:mt,setIscreate:X,init:x}):null,Ge?O.a.createElement($e,{UserInfo:f==null?void 0:f.userInfo,setSee:je,userId:f==null||((se=f.userInfo)===null||se===void 0)?void 0:se.user_id,ItemUpdate:ne,CourseItem:dt,init:x}):null)),(f==null||((F=f.userInfo)===null||F===void 0)?void 0:F.user_id)===299635||(f==null||((N=f.userInfo)===null||N===void 0)?void 0:N.user_id)===301458||f!=null&&(L=f.userInfo)!==null&&L!==void 0&&L.admin||f!=null&&(m=f.userInfo)!==null&&m!==void 0&&m.business?O.a.createElement(Te.a,Oe,O.a.createElement(Pe.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var Be=rt.default=Object(fe.a)(function(he){var C=he.user;return{user:C}})(ke)},h78n:function(wt,rt,T){"use strict";T.d(rt,"a",function(){return A});var K=T("q1tI"),Te=T.n(K),de=T("TSYQ"),Pe=T.n(de),_e={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},re=function(N){var L=N.map(function(){return Object(K.useRef)()}),m=Object(K.useRef)();return Object(K.useEffect)(function(){var f=Date.now(),w=!1;Object.keys(L).forEach(function(P){var J=L[P].current;if(!J)return;w=!0;var Se=J.style;Se.transitionDuration=".3s, .3s, .3s, .06s",m.current&&f-m.current<100&&(Se.transitionDuration="0s, 0s")}),w&&(m.current=Date.now())}),[L]};function j(){return j=Object.assign||function(F){for(var N=1;N<arguments.length;N++){var L=arguments[N];for(var m in L)Object.prototype.hasOwnProperty.call(L,m)&&(F[m]=L[m])}return F},j.apply(this,arguments)}function Q(F,N){return ve(F)||O(F,N)||V(F,N)||ie()}function ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V(F,N){if(!F)return;if(typeof F=="string")return M(F,N);var L=Object.prototype.toString.call(F).slice(8,-1);if(L==="Object"&&F.constructor&&(L=F.constructor.name),L==="Map"||L==="Set")return Array.from(F);if(L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L))return M(F,N)}function M(F,N){(N==null||N>F.length)&&(N=F.length);for(var L=0,m=new Array(N);L<N;L++)m[L]=F[L];return m}function O(F,N){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var L=[],m=!0,f=!1,w=void 0;try{for(var P=F[Symbol.iterator](),J;!(m=(J=P.next()).done)&&!(L.push(J.value),N&&L.length===N);m=!0);}catch(Se){f=!0,w=Se}finally{try{!m&&P.return!=null&&P.return()}finally{if(f)throw w}}return L}function ve(F){if(Array.isArray(F))return F}function oe(F,N){if(F==null)return{};var L=Z(F,N),m,f;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(F);for(f=0;f<w.length;f++){if(m=w[f],N.indexOf(m)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,m))continue;L[m]=F[m]}}return L}function Z(F,N){if(F==null)return{};var L={},m=Object.keys(F),f,w;for(w=0;w<m.length;w++){if(f=m[w],N.indexOf(f)>=0)continue;L[f]=F[f]}return L}var q=function(N){var L=N.className,m=N.percent,f=N.prefixCls,w=N.strokeColor,P=N.strokeLinecap,J=N.strokeWidth,Se=N.style,Re=N.trailColor,pe=N.trailWidth,ye=N.transition,ge=oe(N,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ge.gapPosition;var ce=Array.isArray(m)?m:[m],$=Array.isArray(w)?w:[w],U=re(ce),b=Q(U,1),R=b[0],k=J/2,le=100-J/2,xe="M ".concat(P==="round"?k:0,",").concat(k,`
|
|
L `).concat(P==="round"?le:100,",").concat(k),X="0 0 100 ".concat(J),Ce=0;return Te.a.createElement("svg",j({className:Pe()("".concat(f,"-line"),L),viewBox:X,preserveAspectRatio:"none",style:Se},ge),Te.a.createElement("path",{className:"".concat(f,"-line-trail"),d:xe,strokeLinecap:P,stroke:Re,strokeWidth:pe||J,fillOpacity:"0"}),ce.map(function(Me,Ge){var je={strokeDasharray:"".concat(Me,"px, 100px"),strokeDashoffset:"-".concat(Ce,"px"),transition:ye||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ne=$[Ge]||$[$.length-1];return Ce+=Me,Te.a.createElement("path",{key:Ge,className:"".concat(f,"-line-path"),d:xe,strokeLinecap:P,stroke:Ne,strokeWidth:J,fillOpacity:"0",ref:R[Ge],style:je})}))};q.defaultProps=_e;var z=q;function me(){return me=Object.assign||function(F){for(var N=1;N<arguments.length;N++){var L=arguments[N];for(var m in L)Object.prototype.hasOwnProperty.call(L,m)&&(F[m]=L[m])}return F},me.apply(this,arguments)}function ue(F,N){return Ve(F)||be(F,N)||$e(F,N)||He()}function He(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $e(F,N){if(!F)return;if(typeof F=="string")return we(F,N);var L=Object.prototype.toString.call(F).slice(8,-1);if(L==="Object"&&F.constructor&&(L=F.constructor.name),L==="Map"||L==="Set")return Array.from(F);if(L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L))return we(F,N)}function we(F,N){(N==null||N>F.length)&&(N=F.length);for(var L=0,m=new Array(N);L<N;L++)m[L]=F[L];return m}function be(F,N){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var L=[],m=!0,f=!1,w=void 0;try{for(var P=F[Symbol.iterator](),J;!(m=(J=P.next()).done)&&!(L.push(J.value),N&&L.length===N);m=!0);}catch(Se){f=!0,w=Se}finally{try{!m&&P.return!=null&&P.return()}finally{if(f)throw w}}return L}function Ve(F){if(Array.isArray(F))return F}function fe(F,N){if(F==null)return{};var L=ke(F,N),m,f;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(F);for(f=0;f<w.length;f++){if(m=w[f],N.indexOf(m)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,m))continue;L[m]=F[m]}}return L}function ke(F,N){if(F==null)return{};var L={},m=Object.keys(F),f,w;for(w=0;w<m.length;w++){if(f=m[w],N.indexOf(f)>=0)continue;L[f]=F[f]}return L}var Be=0;function he(F){return+F.replace("%","")}function C(F){return Array.isArray(F)?F:[F]}function ae(F,N,L,m){var f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,w=arguments.length>5?arguments[5]:void 0,P=50-m/2,J=0,Se=-P,Re=0,pe=-2*P;switch(w){case"left":J=-P,Se=0,Re=2*P,pe=0;break;case"right":J=P,Se=0,Re=-2*P,pe=0;break;case"bottom":Se=P,pe=2*P;break;default:}var ye="M 50,50 m ".concat(J,",").concat(Se,`
|
|
a `).concat(P,",").concat(P," 0 1 1 ").concat(Re,",").concat(-pe,`
|
|
a `).concat(P,",").concat(P," 0 1 1 ").concat(-Re,",").concat(pe),ge=Math.PI*2*P,ce={stroke:L,strokeDasharray:"".concat(N/100*(ge-f),"px ").concat(ge,"px"),strokeDashoffset:"-".concat(f/2+F/100*(ge-f),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ye,pathStyle:ce}}var Y=function(N){var L=N.prefixCls,m=N.strokeWidth,f=N.trailWidth,w=N.gapDegree,P=N.gapPosition,J=N.trailColor,Se=N.strokeLinecap,Re=N.style,pe=N.className,ye=N.strokeColor,ge=N.percent,ce=fe(N,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),$=Object(K.useMemo)(function(){return Be+=1,Be},[]),U=ae(0,100,J,m,w,P),b=U.pathString,R=U.pathStyle,k=C(ge),le=C(ye),xe=le.find(function(je){return Object.prototype.toString.call(je)==="[object Object]"}),X=re(k),Ce=ue(X,1),Me=Ce[0],Ge=function(){var Ne=0;return k.map(function(Fe,dt){var Qe=le[dt]||le[le.length-1],et=Object.prototype.toString.call(Qe)==="[object Object]"?"url(#".concat(L,"-gradient-").concat($,")"):"",tt=ae(Ne,Fe,Qe,m,w,P);return Ne+=Fe,Te.a.createElement("path",{key:dt,className:"".concat(L,"-circle-path"),d:tt.pathString,stroke:et,strokeLinecap:Se,strokeWidth:m,opacity:Fe===0?0:1,fillOpacity:"0",style:tt.pathStyle,ref:Me[dt]})})};return Te.a.createElement("svg",me({className:Pe()("".concat(L,"-circle"),pe),viewBox:"0 0 100 100",style:Re},ce),xe&&Te.a.createElement("defs",null,Te.a.createElement("linearGradient",{id:"".concat(L,"-gradient-").concat($),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(xe).sort(function(je,Ne){return he(je)-he(Ne)}).map(function(je,Ne){return Te.a.createElement("stop",{key:Ne,offset:je,stopColor:xe[je]})}))),Te.a.createElement("path",{className:"".concat(L,"-circle-trail"),d:b,stroke:J,strokeLinecap:Se,strokeWidth:f||m,fillOpacity:"0",style:R}),Ge().reverse())};Y.defaultProps=_e;var A=Y,se={Line:z,Circle:A}},kSUc:function(wt,rt,T){},lZu9:function(wt,rt,T){(function(K){K(T("VrN/"),T("1eCo"),T("8EBN"))})(function(K){"use strict";K.defineMode("markdown",function(Te,de){var Pe=K.getMode(Te,"text/html"),_e=Pe.name=="null";function re(m){if(K.findModeByName){var f=K.findModeByName(m);f&&(m=f.mime||f.mimes[0])}var w=K.getMode(Te,m);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 j={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 j)j.hasOwnProperty(Q)&&de.tokenTypeOverrides[Q]&&(j[Q]=de.tokenTypeOverrides[Q]);var ie=/^([*\-_])(?:\s*\1){2,}\s*$/,V=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,M=/^\[(x| )\](?=\s)/i,O=de.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ve=/^ {0,3}(?:\={1,}|-{2,})\s*$/,oe=/^[^#!\[\]*_\\<>` "'(~:]+/,Z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,q=/^\s*\[[^\]]+?\]:.*$/,z=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 ue(m,f,w){return f.f=f.inline=w,w(m,f)}function He(m,f,w){return f.f=f.block=w,w(m,f)}function $e(m){return!m||!/\S/.test(m.string)}function we(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==Ve){var f=_e;if(!f){var w=K.innerMode(Pe,m.htmlState);f=w.mode.name=="xml"&&w.state.tagStart===null&&!w.state.context&&w.state.tokenize.isInText}f&&(m.f=he,m.block=be,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function be(m,f){var w=m.column()===f.indentation,P=$e(f.prevLine.stream),J=f.indentedCode,Se=f.prevLine.hr,Re=f.list!==!1,pe=(f.listStack[f.listStack.length-1]||0)+3;f.indentedCode=!1;var ye=f.indentation;if(f.indentationDiff===null&&(f.indentationDiff=f.indentation,Re)){for(f.list=null;ye<f.listStack[f.listStack.length-1];)f.listStack.pop(),f.listStack.length?f.indentation=f.listStack[f.listStack.length-1]:f.list=!1;f.list!==!1&&(f.indentationDiff=ye-f.listStack[f.listStack.length-1])}var ge=!P&&!Se&&!f.prevLine.header&&(!Re||!J)&&!f.prevLine.fencedCodeEnd,ce=(f.list===!1||Se||P)&&f.indentation<=pe&&m.match(ie),$=null;if(f.indentationDiff>=4&&(J||f.prevLine.fencedCodeEnd||f.prevLine.header||P))return m.skipToEnd(),f.indentedCode=!0,j.code;if(m.eatSpace())return null;if(w&&f.indentation<=pe&&($=m.match(O))&&$[1].length<=6)return f.quote=0,f.header=$[1].length,f.thisLine.header=!0,de.highlightFormatting&&(f.formatting="header"),f.f=f.inline,ke(f);if(f.indentation<=pe&&m.eat(">"))return f.quote=w?1:f.quote+1,de.highlightFormatting&&(f.formatting="quote"),m.eatSpace(),ke(f);if(!ce&&!f.setext&&w&&f.indentation<=pe&&($=m.match(V))){var U=$[1]?"ol":"ul";return f.indentation=ye+m.current().length,f.list=!0,f.quote=0,f.listStack.push(f.indentation),f.em=!1,f.strong=!1,f.code=!1,f.strikethrough=!1,de.taskLists&&m.match(M,!1)&&(f.taskList=!0),f.f=f.inline,de.highlightFormatting&&(f.formatting=["list","list-"+U]),ke(f)}else{if(w&&f.indentation<=pe&&($=m.match(Z,!0)))return f.quote=0,f.fencedEndRE=new RegExp($[1]+"+ *$"),f.localMode=de.fencedCodeBlockHighlighting&&re($[2]||de.fencedCodeBlockDefaultMode),f.localMode&&(f.localState=K.startState(f.localMode)),f.f=f.block=fe,de.highlightFormatting&&(f.formatting="code-block"),f.code=-1,ke(f);if(f.setext||(!ge||!Re)&&!f.quote&&f.list===!1&&!f.code&&!ce&&!q.test(m.string)&&($=m.lookAhead(1))&&($=$.match(ve)))return f.setext?(f.header=f.setext,f.setext=0,m.skipToEnd(),de.highlightFormatting&&(f.formatting="header")):(f.header=$[0].charAt(0)=="="?1:2,f.setext=f.header),f.thisLine.header=!0,f.f=f.inline,ke(f);if(ce)return m.skipToEnd(),f.hr=!0,f.thisLine.hr=!0,j.hr;if(m.peek()==="[")return ue(m,f,se)}return ue(m,f,f.inline)}function Ve(m,f){var w=Pe.token(m,f.htmlState);if(!_e){var P=K.innerMode(Pe,f.htmlState);(P.mode.name=="xml"&&P.state.tagStart===null&&!P.state.context&&P.state.tokenize.isInText||f.md_inside&&m.current().indexOf(">")>-1)&&(f.f=he,f.block=be,f.htmlState=null)}return w}function fe(m,f){var w=f.listStack[f.listStack.length-1]||0,P=f.indentation<w,J=w+3;if(f.fencedEndRE&&f.indentation<=J&&(P||m.match(f.fencedEndRE))){de.highlightFormatting&&(f.formatting="code-block");var Se;return P||(Se=ke(f)),f.localMode=f.localState=null,f.block=be,f.f=he,f.fencedEndRE=null,f.code=0,f.thisLine.fencedCodeEnd=!0,P?He(m,f,f.block):Se}else return f.localMode?f.localMode.token(m,f.localState):(m.skipToEnd(),j.code)}function ke(m){var f=[];if(m.formatting){f.push(j.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var w=0;w<m.formatting.length;w++)f.push(j.formatting+"-"+m.formatting[w]),m.formatting[w]==="header"&&f.push(j.formatting+"-"+m.formatting[w]+"-"+m.header),m.formatting[w]==="quote"&&(!de.maxBlockquoteDepth||de.maxBlockquoteDepth>=m.quote?f.push(j.formatting+"-"+m.formatting[w]+"-"+m.quote):f.push("error"))}if(m.taskOpen)return f.push("meta"),f.length?f.join(" "):null;if(m.taskClosed)return f.push("property"),f.length?f.join(" "):null;if(m.linkHref?f.push(j.linkHref,"url"):(m.strong&&f.push(j.strong),m.em&&f.push(j.em),m.strikethrough&&f.push(j.strikethrough),m.emoji&&f.push(j.emoji),m.linkText&&f.push(j.linkText),m.code&&f.push(j.code),m.image&&f.push(j.image),m.imageAltText&&f.push(j.imageAltText,"link"),m.imageMarker&&f.push(j.imageMarker)),m.header&&f.push(j.header,j.header+"-"+m.header),m.quote&&(f.push(j.quote),!de.maxBlockquoteDepth||de.maxBlockquoteDepth>=m.quote?f.push(j.quote+"-"+m.quote):f.push(j.quote+"-"+de.maxBlockquoteDepth)),m.list!==!1){var P=(m.listStack.length-1)%3;P?P===1?f.push(j.list2):f.push(j.list3):f.push(j.list1)}return m.trailingSpaceNewLine?f.push("trailing-space-new-line"):m.trailingSpace&&f.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),f.length?f.join(" "):null}function Be(m,f){return m.match(oe,!0)?ke(f):void 0}function he(m,f){var w=f.text(m,f);if(typeof w!="undefined")return w;if(f.list)return f.list=null,ke(f);if(f.taskList){var P=m.match(M,!0)[1]===" ";return P?f.taskOpen=!0:f.taskClosed=!0,de.highlightFormatting&&(f.formatting="task"),f.taskList=!1,ke(f)}if(f.taskOpen=!1,f.taskClosed=!1,f.header&&m.match(/^#+$/,!0))return de.highlightFormatting&&(f.formatting="header"),ke(f);var J=m.next();if(f.linkTitle){f.linkTitle=!1;var Se=J;J==="("&&(Se=")"),Se=(Se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+Se+"\\\\]+|\\\\\\\\|\\\\.)"+Se;if(m.match(new RegExp(Re),!0))return j.linkHref}if(J==="`"){var pe=f.formatting;de.highlightFormatting&&(f.formatting="code"),m.eatWhile("`");var ye=m.current().length;if(f.code==0&&(!f.quote||ye==1))return f.code=ye,ke(f);if(ye==f.code){var ge=ke(f);return f.code=0,ge}else return f.formatting=pe,ke(f)}else if(f.code)return ke(f);if(J==="\\"&&(m.next(),de.highlightFormatting)){var ce=ke(f),$=j.formatting+"-escape";return ce?ce+" "+$:$}if(J==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return f.imageMarker=!0,f.image=!0,de.highlightFormatting&&(f.formatting="image"),ke(f);if(J==="["&&f.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return f.imageMarker=!1,f.imageAltText=!0,de.highlightFormatting&&(f.formatting="image"),ke(f);if(J==="]"&&f.imageAltText){de.highlightFormatting&&(f.formatting="image");var ce=ke(f);return f.imageAltText=!1,f.image=!1,f.inline=f.f=ae,ce}if(J==="["&&!f.image)return f.linkText&&m.match(/^.*?\]/)||(f.linkText=!0,de.highlightFormatting&&(f.formatting="link")),ke(f);if(J==="]"&&f.linkText){de.highlightFormatting&&(f.formatting="link");var ce=ke(f);return f.linkText=!1,f.inline=f.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?ae:he,ce}if(J==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){f.f=f.inline=C,de.highlightFormatting&&(f.formatting="link");var ce=ke(f);return ce?ce+=" ":ce="",ce+j.linkInline}if(J==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){f.f=f.inline=C,de.highlightFormatting&&(f.formatting="link");var ce=ke(f);return ce?ce+=" ":ce="",ce+j.linkEmail}if(de.xml&&J==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var U=m.string.indexOf(">",m.pos);if(U!=-1){var b=m.string.substring(m.start,U);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(f.md_inside=!0)}return m.backUp(1),f.htmlState=K.startState(Pe),He(m,f,Ve)}if(de.xml&&J==="<"&&m.match(/^\/\w*?>/))return f.md_inside=!1,"tag";if(J==="*"||J==="_"){for(var R=1,k=m.pos==1?" ":m.string.charAt(m.pos-2);R<3&&m.eat(J);)R++;var le=m.peek()||" ",xe=!/\s/.test(le)&&(!z.test(le)||/\s/.test(k)||z.test(k)),X=!/\s/.test(k)&&(!z.test(k)||/\s/.test(le)||z.test(le)),Ce=null,Me=null;if(R%2&&(!f.em&&xe&&(J==="*"||!X||z.test(k))?Ce=!0:f.em==J&&X&&(J==="*"||!xe||z.test(le))&&(Ce=!1)),R>1&&(!f.strong&&xe&&(J==="*"||!X||z.test(k))?Me=!0:f.strong==J&&X&&(J==="*"||!xe||z.test(le))&&(Me=!1)),Me!=null||Ce!=null){de.highlightFormatting&&(f.formatting=Ce==null?"strong":Me==null?"em":"strong em"),Ce===!0&&(f.em=J),Me===!0&&(f.strong=J);var ge=ke(f);return Ce===!1&&(f.em=!1),Me===!1&&(f.strong=!1),ge}}else if(J===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return ke(f);m.backUp(1)}if(de.strikethrough){if(J==="~"&&m.eatWhile(J)){if(f.strikethrough){de.highlightFormatting&&(f.formatting="strikethrough");var ge=ke(f);return f.strikethrough=!1,ge}else if(m.match(/^[^\s]/,!1))return f.strikethrough=!0,de.highlightFormatting&&(f.formatting="strikethrough"),ke(f)}else if(J===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return ke(f);m.backUp(2)}}if(de.emoji&&J===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){f.emoji=!0,de.highlightFormatting&&(f.formatting="emoji");var Ge=ke(f);return f.emoji=!1,Ge}return J===" "&&(m.match(/^ +$/,!1)?f.trailingSpace++:f.trailingSpace&&(f.trailingSpaceNewLine=!0)),ke(f)}function C(m,f){var w=m.next();if(w===">"){f.f=f.inline=he,de.highlightFormatting&&(f.formatting="link");var P=ke(f);return P?P+=" ":P="",P+j.linkInline}return m.match(/^[^>]+/,!0),j.linkInline}function ae(m,f){if(m.eatSpace())return null;var w=m.next();return w==="("||w==="["?(f.f=f.inline=A(w==="("?")":"]"),de.highlightFormatting&&(f.formatting="link-string"),f.linkHref=!0,ke(f)):"error"}var Y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(m){return function(f,w){var P=f.next();if(P===m){w.f=w.inline=he,de.highlightFormatting&&(w.formatting="link-string");var J=ke(w);return w.linkHref=!1,J}return f.match(Y[m]),w.linkHref=!0,ke(w)}}function se(m,f){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(f.f=F,m.next(),de.highlightFormatting&&(f.formatting="link"),f.linkText=!0,ke(f)):ue(m,f,he)}function F(m,f){if(m.match(/^\]:/,!0)){f.f=f.inline=N,de.highlightFormatting&&(f.formatting="link");var w=ke(f);return f.linkText=!1,w}return m.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function N(m,f){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?f.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),f.f=f.inline=he,j.linkHref+" url")}var L={startState:function(){return{f:be,prevLine:{stream:null},thisLine:{stream:null},block:be,htmlState:null,indentation:0,inline:he,text:Be,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(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&K.copyState(Pe,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?K.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,f){if(f.formatting=!1,m!=f.thisLine.stream){if(f.header=0,f.hr=!1,m.match(/^\s*$/,!0))return we(f),null;if(f.prevLine=f.thisLine,f.thisLine={stream:m},f.taskList=!1,f.trailingSpace=0,f.trailingSpaceNewLine=!1,!f.localState&&(f.f=f.block,f.f!=Ve)){var w=m.match(/^\s*/,!0)[0].replace(/\t/g,me).length;if(f.indentation=w,f.indentationDiff=null,w>0)return null}}return f.f(m,f)},innerMode:function(m){return m.block==Ve?{state:m.htmlState,mode:Pe}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:L}},indent:function(m,f,w){return m.block==Ve&&Pe.indent?Pe.indent(m.htmlState,f,w):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,f,w):K.Pass},blankLine:we,getType:ke,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L},"xml"),K.defineMIME("text/markdown","markdown"),K.defineMIME("text/x-markdown","markdown")})},osHv:function(wt,rt,T){(function(K){K(T("VrN/"))})(function(K){"use strict";var Te=K.Pos;function de(z,me){return z.line-me.line||z.ch-me.ch}var Pe="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",_e=Pe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",re=new RegExp("<(/?)(["+Pe+"]["+_e+"]*)","g");function j(z,me,ue,He){this.line=me,this.ch=ue,this.cm=z,this.text=z.getLine(me),this.min=He?Math.max(He.from,z.firstLine()):z.firstLine(),this.max=He?Math.min(He.to-1,z.lastLine()):z.lastLine()}function Q(z,me){var ue=z.cm.getTokenTypeAt(Te(z.line,me));return ue&&/\btag\b/.test(ue)}function ie(z){return z.line>=z.max?void 0:(z.ch=0,z.text=z.cm.getLine(++z.line),!0)}function V(z){return z.line<=z.min?void 0:(z.text=z.cm.getLine(--z.line),z.ch=z.text.length,!0)}function M(z){for(;;){var me=z.text.indexOf(">",z.ch);if(me==-1){if(ie(z))continue;return}if(!Q(z,me+1)){z.ch=me+1;continue}var ue=z.text.lastIndexOf("/",me),He=ue>-1&&!/\S/.test(z.text.slice(ue+1,me));return z.ch=me+1,He?"selfClose":"regular"}}function O(z){for(;;){var me=z.ch?z.text.lastIndexOf("<",z.ch-1):-1;if(me==-1){if(V(z))continue;return}if(!Q(z,me+1)){z.ch=me;continue}re.lastIndex=me,z.ch=me;var ue=re.exec(z.text);if(ue&&ue.index==me)return ue}}function ve(z){for(;;){re.lastIndex=z.ch;var me=re.exec(z.text);if(!me){if(ie(z))continue;return}if(!Q(z,me.index+1)){z.ch=me.index+1;continue}return z.ch=me.index+me[0].length,me}}function oe(z){for(;;){var me=z.ch?z.text.lastIndexOf(">",z.ch-1):-1;if(me==-1){if(V(z))continue;return}if(!Q(z,me+1)){z.ch=me;continue}var ue=z.text.lastIndexOf("/",me),He=ue>-1&&!/\S/.test(z.text.slice(ue+1,me));return z.ch=me+1,He?"selfClose":"regular"}}function Z(z,me){for(var ue=[];;){var He=ve(z),$e,we=z.line,be=z.ch-(He?He[0].length:0);if(!He||!($e=M(z)))return;if($e=="selfClose")continue;if(He[1]){for(var Ve=ue.length-1;Ve>=0;--Ve)if(ue[Ve]==He[2]){ue.length=Ve;break}if(Ve<0&&(!me||me==He[2]))return{tag:He[2],from:Te(we,be),to:Te(z.line,z.ch)}}else ue.push(He[2])}}function q(z,me){for(var ue=[];;){var He=oe(z);if(!He)return;if(He=="selfClose"){O(z);continue}var $e=z.line,we=z.ch,be=O(z);if(!be)return;if(be[1])ue.push(be[2]);else{for(var Ve=ue.length-1;Ve>=0;--Ve)if(ue[Ve]==be[2]){ue.length=Ve;break}if(Ve<0&&(!me||me==be[2]))return{tag:be[2],from:Te(z.line,z.ch),to:Te($e,we)}}}}K.registerHelper("fold","xml",function(z,me){for(var ue=new j(z,me.line,0);;){var He=ve(ue);if(!He||ue.line!=me.line)return;var $e=M(ue);if(!$e)return;if(!He[1]&&$e!="selfClose"){var we=Te(ue.line,ue.ch),be=Z(ue,He[2]);return be&&de(be.from,we)>0?{from:we,to:be.from}:null}}}),K.findMatchingTag=function(z,me,ue){var He=new j(z,me.line,me.ch,ue);if(He.text.indexOf(">")==-1&&He.text.indexOf("<")==-1)return;var $e=M(He),we=$e&&Te(He.line,He.ch),be=$e&&O(He);if(!$e||!be||de(He,me)>0)return;var Ve={from:Te(He.line,He.ch),to:we,tag:be[2]};return $e=="selfClose"?{open:Ve,close:null,at:"open"}:be[1]?{open:q(He,be[2]),close:Ve,at:"close"}:(He=new j(z,we.line,we.ch,ue),{open:Ve,close:Z(He,be[2]),at:"open"})},K.findEnclosingTag=function(z,me,ue,He){for(var $e=new j(z,me.line,me.ch,ue);;){var we=q($e,He);if(!we)break;var be=new j(z,me.line,me.ch,ue),Ve=Z(be,we.tag);if(Ve)return{open:we,close:Ve}}},K.scanForClosingTag=function(z,me,ue,He){var $e=new j(z,me.line,me.ch,He?{from:0,to:He}:null);return Z($e,ue)}})},p5ED:function(wt,rt,T){"use strict";var K=T("+L6B"),Te=T("2/Rp"),de=T("5Dmo"),Pe=T("3S7+"),_e=T("k1fw"),re=T("9og8"),j=T("tJVT"),Q=T("WmNS"),ie=T.n(Q),V=T("q1tI"),M=T.n(V),O=T("vHTk"),ve=T.n(O),oe=T("yEEn"),Z=T("ZW9T"),q=T("1vsH"),z=T("V0Rq"),me=T("m3rI"),ue=function($e){var we=$e.name,be=$e.data,Ve=$e.theme,fe=$e.type,ke=$e.filename,Be=$e.monacoEditor,he=$e.className,C=$e.style,ae=$e.close,Y=$e.onClose,A=$e.hasMask,se=$e.otherData,F=se===void 0?{}:se,N=Object(V.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=Object(j.a)(N,2),m=L[0],f=L[1],w=Object(V.useState)(""),P=Object(j.a)(w,2),J=P[0],Se=P[1],Re=Object(V.useState)(),pe=Object(j.a)(Re,2),ye=pe[0],ge=pe[1],ce=window.ENV==="build"?"/react/build/office.html":"/office.html",$,U=1024*1024,b=10*U,R=Object(V.useRef)();fe==="office"&&($=Object(q.P)(be).filesize,$>b&&(fe="other")),ke&&(Be.filename=ke),Object(V.useEffect)(function(){var X,Ce,Me=(X=document.cookie)===null||X===void 0||((Ce=X.replace(/\s/g,""))===null||Ce===void 0)?void 0:Ce.split(";");Me==null||Me.map(function(Ge){var je=Ge.split("=");je[0]==="_educoder_session"&&Se(je[1])})},[]),Object(V.useEffect)(function(){fe==="office"&&k()},[fe]);var k=function(){var X=Object(re.a)(ie.a.mark(function Ce(){var Me,Ge,je;return ie.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:return console.log("data:",be),Me=be,be.startsWith("http")||(Me=location.origin+Me),Ge=new URL(Me).pathname.split("/").pop(),Fe.next=6,Object(z.U)({attachment_id:Ge});case 6:je=Fe.sent,ge(je);case 8:case"end":return Fe.stop()}},Ce)}));return function(){return X.apply(this,arguments)}}(),le=function(){if(be.startsWith("http")||be.startsWith("blob:")){xe();return}Object(q.x)(ke||"educoder",be,ke)},xe=function(){Object(q.v)(ke||"educoder",decodeURIComponent(be))};return M.a.createElement("div",{style:Object(_e.a)({},C||{}),className:"".concat(A&&ve.a.bgBlack," ").concat(fe?ve.a.wrp:"hide")},ae&&M.a.createElement("div",{className:ve.a.close,ref:R},M.a.createElement(Pe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return R.current}},M.a.createElement("span",{onClick:xe},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(Pe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return R.current}},M.a.createElement("span",{className:"",onClick:function(){Y(),ge(null)}},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(ve.a[he]," ").concat(he," ").concat(ve.a.monaco," ").concat(fe==="txt"?"show":"hide")},fe==="txt"&&M.a.createElement(Z.b,Be)),fe==="audio"&&M.a.createElement("audio",{src:"".concat((be==null?void 0:be.indexOf("http://"))>-1||(be==null?void 0:be.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(be),autoPlay:!0}),fe==="video"&&M.a.createElement(M.a.Fragment,null,(be==null?void 0:be.indexOf("/api"))>-1?M.a.createElement("video",{controls:!0,src:"".concat(be),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(be),autoPlay:!0})),fe==="office"&&ye&&M.a.createElement("iframe",{src:"".concat(ce,"?key=").concat(ye.key,"&url=").concat(me.a.API_SERVER+ye.url,"&callbackUrl=").concat(me.a.API_SERVER+ye.callbackUrl,"&fileType=").concat(ye.fileType,"&title=").concat(ye.title,"&model=view")}),(fe==="xlsx"||fe==="doc"||fe==="pptx"||fe==="docx")&&M.a.createElement("iframe",{src:"".concat(ce,"?key=").concat(F.key,"&url=").concat(me.a.API_SERVER+F.url,"&callbackUrl=").concat(me.a.API_SERVER+F.callbackUrl,"&fileType=").concat(F.fileType,"&title=").concat(F.title,"&model=").concat(F.model)}),fe==="html"&&M.a.createElement("iframe",{src:be+"&disposition=inline"}),fe==="pdf"&&M.a.createElement("embed",{className:ve.a.embed,src:be,type:"application/pdf"}),fe==="image"&&M.a.createElement("img",{src:"".concat((be==null?void 0:be.indexOf("http://"))>-1||(be==null?void 0:be.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(be)}),fe==="other"&&M.a.createElement("div",null,M.a.createElement(Te.a,{type:"primary",size:"large",onClick:le},M.a.createElement(oe.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),fe==="download"&&M.a.createElement(Te.a,{type:"primary",size:"large",onClick:le},M.a.createElement(oe.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};rt.a=ue},"p77/":function(wt,rt,T){},"rAM+":function(wt,rt,T){"use strict";T.d(rt,"a",function(){return Te});var K=T("Qw5x");function Te(de,Pe){var _e;if(typeof Symbol=="undefined"||de[Symbol.iterator]==null){if(Array.isArray(de)||(_e=Object(K.a)(de))||Pe&&de&&typeof de.length=="number"){_e&&(de=_e);var re=0,j=function(){};return{s:j,n:function(){return re>=de.length?{done:!0}:{done:!1,value:de[re++]}},e:function(O){throw O},f:j}}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,ie=!1,V;return{s:function(){_e=de[Symbol.iterator]()},n:function(){var O=_e.next();return Q=O.done,O},e:function(O){ie=!0,V=O},f:function(){try{!Q&&_e.return!=null&&_e.return()}finally{if(ie)throw V}}}}},rUJ1:function(wt,rt){const T=/[&<>"']/,K=/[&<>"']/g,Te=/[<>"']|&(?!#?\w+;)/,de=/[<>"']|&(?!#?\w+;)/g,Pe={"&":"&","<":"<",">":">",'"':""","'":"'"},_e=fe=>Pe[fe];function re(fe,ke){if(ke){if(T.test(fe))return fe.replace(K,_e)}else if(Te.test(fe))return fe.replace(de,_e);return fe}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Q(fe){return fe.replace(j,(ke,Be)=>(Be=Be.toLowerCase(),Be==="colon"?":":Be.charAt(0)==="#"?Be.charAt(1)==="x"?String.fromCharCode(parseInt(Be.substring(2),16)):String.fromCharCode(+Be.substring(1)):""))}const ie=/(^|[^\[])\^/g;function V(fe,ke){fe=fe.source||fe,ke=ke||"";const Be={replace:(he,C)=>(C=C.source||C,C=C.replace(ie,"$1"),fe=fe.replace(he,C),Be),getRegex:()=>new RegExp(fe,ke)};return Be}const M=/[^\w:]/g,O=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ve(fe,ke,Be){if(fe){let he;try{he=decodeURIComponent(Q(Be)).replace(M,"").toLowerCase()}catch(C){return null}if(he.indexOf("javascript:")===0||he.indexOf("vbscript:")===0||he.indexOf("data:")===0)return null}ke&&!O.test(Be)&&(Be=me(ke,Be));try{Be=encodeURI(Be).replace(/%25/g,"%")}catch(he){return null}return Be}const oe={},Z=/^[^:]+:\/*[^/]*$/,q=/^([^:]+:)[\s\S]*$/,z=/^([^:]+:\/*[^/]*)[\s\S]*$/;function me(fe,ke){oe[" "+fe]||(Z.test(fe)?oe[" "+fe]=fe+"/":oe[" "+fe]=we(fe,"/",!0)),fe=oe[" "+fe];const Be=fe.indexOf(":")===-1;return ke.substring(0,2)==="//"?Be?ke:fe.replace(q,"$1")+ke:ke.charAt(0)==="/"?Be?ke:fe.replace(z,"$1")+ke:fe+ke}const ue={exec:function(){}};function He(fe){let ke=1,Be,he;for(;ke<arguments.length;ke++){Be=arguments[ke];for(he in Be)Object.prototype.hasOwnProperty.call(Be,he)&&(fe[he]=Be[he])}return fe}function $e(fe,ke){const Be=fe.replace(/\|/g,(ae,Y,A)=>{let se=!1,F=Y;for(;--F>=0&&A[F]==="\\";)se=!se;return se?"|":" |"}),he=Be.split(/ \|/);let C=0;if(he.length>ke)he.splice(ke);else for(;he.length<ke;)he.push("");for(;C<he.length;C++)he[C]=he[C].trim().replace(/\\\|/g,"|");return he}function we(fe,ke,Be){const he=fe.length;if(he===0)return"";let C=0;for(;C<he;){const ae=fe.charAt(he-C-1);if(ae===ke&&!Be)C++;else if(ae!==ke&&Be)C++;else break}return fe.substr(0,he-C)}function be(fe,ke){if(fe.indexOf(ke[1])===-1)return-1;const Be=fe.length;let he=0,C=0;for(;C<Be;C++)if(fe[C]==="\\")C++;else if(fe[C]===ke[0])he++;else if(fe[C]===ke[1]&&(he--,he<0))return C;return-1}function Ve(fe){fe&&fe.sanitize&&!fe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}wt.exports={escape:re,unescape:Q,edit:V,cleanUrl:ve,resolveUrl:me,noopTest:ue,merge:He,splitCells:$e,rtrim:we,findClosingBracket:be,checkSanitizeDeprecation:Ve}},vHTk:function(wt,rt,T){wt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|