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.
345 lines
563 KiB
345 lines
563 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[223,7],{"+NIl":function(xt,Xe,b){(function(U){U(b("VrN/"))})(function(U){"use strict";U.defineMode("stex",function(Me,ee){"use strict";function pe(Y,B){Y.cmdState.push(B)}function ue(Y){return Y.cmdState.length>0?Y.cmdState[Y.cmdState.length-1]:null}function he(Y){var B=Y.cmdState.pop();B&&B.closeBracket()}function O(Y){for(var B=Y.cmdState,j=B.length-1;j>=0;j--){var D=B[j];if(D.name=="DEFAULT")continue;return D}return{styleIdentifier:function(){return null}}}function X(Y,B,j){return function(){this.name=Y,this.bracketNo=0,this.style=B,this.styles=j,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var K={};K.importmodule=X("importmodule","tag",["string","builtin"]),K.documentclass=X("documentclass","tag",["","atom"]),K.usepackage=X("usepackage","tag",["atom"]),K.begin=X("begin","tag",["atom"]),K.end=X("end","tag",["atom"]),K.label=X("label","tag",["atom"]),K.ref=X("ref","tag",["atom"]),K.eqref=X("eqref","tag",["atom"]),K.cite=X("cite","tag",["atom"]),K.bibitem=X("bibitem","tag",["atom"]),K.Bibitem=X("Bibitem","tag",["atom"]),K.RBibitem=X("RBibitem","tag",["atom"]),K.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function ae(Y,B){Y.f=B}function T(Y,B){var j;if(Y.match(/^\\[a-zA-Z@]+/)){var D=Y.current().slice(1);return j=K.hasOwnProperty(D)?K[D]:K.DEFAULT,j=new j,pe(B,j),ae(B,ie),j.style}if(Y.match(/^\\[$&%#{}_]/))return"tag";if(Y.match(/^\\[,;!\/\\]/))return"tag";if(Y.match("\\["))return ae(B,function($,Te){return M($,Te,"\\]")}),"keyword";if(Y.match("\\("))return ae(B,function($,Te){return M($,Te,"\\)")}),"keyword";if(Y.match("$$"))return ae(B,function($,Te){return M($,Te,"$$")}),"keyword";if(Y.match("$"))return ae(B,function($,Te){return M($,Te,"$")}),"keyword";var J=Y.next();if(J=="%")return Y.skipToEnd(),"comment";if(J=="}"||J=="]"){if(j=ue(B),j)j.closeBracket(J),ae(B,ie);else return"error";return"bracket"}else return J=="{"||J=="["?(j=K.DEFAULT,j=new j,pe(B,j),"bracket"):/\d/.test(J)?(Y.eatWhile(/[\w.%]/),"atom"):(Y.eatWhile(/[\w\-_]/),j=O(B),j.name=="begin"&&(j.argument=Y.current()),j.styleIdentifier())}function M(Y,B,j){if(Y.eatSpace())return null;if(j&&Y.match(j))return ae(B,T),"keyword";if(Y.match(/^\\[a-zA-Z@]+/))return"tag";if(Y.match(/^[a-zA-Z]+/))return"variable-2";if(Y.match(/^\\[$&%#{}_]/))return"tag";if(Y.match(/^\\[,;!\/]/))return"tag";if(Y.match(/^[\^_&]/))return"tag";if(Y.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Y.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var D=Y.next();return D=="{"||D=="}"||D=="["||D=="]"||D=="("||D==")"?"bracket":D=="%"?(Y.skipToEnd(),"comment"):"error"}function ie(Y,B){var j=Y.peek(),D;return j=="{"||j=="["?(D=ue(B),D.openBracket(j),Y.eat(j),ae(B,T),"bracket"):/[ \t\r]/.test(j)?(Y.eat(j),null):(ae(B,T),he(B),T(Y,B))}return{startState:function(){var Y=ee.inMathMode?function(B,j){return M(B,j)}:T;return{cmdState:[],f:Y}},copyState:function(Y){return{cmdState:Y.cmdState.slice(),f:Y.f}},token:function(Y,B){return B.f(Y,B)},blankLine:function(Y){Y.f=T,Y.cmdState.length=0},lineComment:"%"}}),U.defineMIME("text/x-stex","stex"),U.defineMIME("text/x-latex","stex")})},"19Vz":function(xt,Xe,b){(function(U){U(b("VrN/"))})(function(U){U.defineOption("placeholder","",function(X,K,ae){var T=ae&&ae!=U.Init;if(K&&!T)X.on("blur",ue),X.on("change",he),X.on("swapDoc",he),U.on(X.getInputField(),"compositionupdate",X.state.placeholderCompose=function(){pe(X)}),he(X);else if(!K&&T){X.off("blur",ue),X.off("change",he),X.off("swapDoc",he),U.off(X.getInputField(),"compositionupdate",X.state.placeholderCompose),Me(X);var M=X.getWrapperElement();M.className=M.className.replace(" CodeMirror-empty","")}K&&!X.hasFocus()&&ue(X)});function Me(X){X.state.placeholder&&(X.state.placeholder.parentNode.removeChild(X.state.placeholder),X.state.placeholder=null)}function ee(X){Me(X);var K=X.state.placeholder=document.createElement("pre");K.style.cssText="height: 0; overflow: visible",K.style.direction=X.getOption("direction"),K.className="CodeMirror-placeholder CodeMirror-line-like";var ae=X.getOption("placeholder");typeof ae=="string"&&(ae=document.createTextNode(ae)),K.appendChild(ae),X.display.lineSpace.insertBefore(K,X.display.lineSpace.firstChild)}function pe(X){setTimeout(function(){var K=!1,ae=X.getInputField();ae.nodeName=="TEXTAREA"?K=!ae.value:X.lineCount()==1&&(K=!/[^\u200b]/.test(ae.querySelector(".CodeMirror-line").textContent)),K?ee(X):Me(X)},20)}function ue(X){O(X)&&ee(X)}function he(X){var K=X.getWrapperElement(),ae=O(X);K.className=K.className.replace(" CodeMirror-empty","")+(ae?" CodeMirror-empty":""),ae?ee(X):Me(X)}function O(X){return X.lineCount()===1&&X.getLine(0)===""}})},"1eCo":function(xt,Xe,b){(function(U){U(b("VrN/"))})(function(U){"use strict";var Me={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},ee={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};U.defineMode("xml",function(pe,ue){var he=pe.indentUnit,O={},X=ue.htmlMode?Me:ee;for(var K in X)O[K]=X[K];for(var K in ue)O[K]=ue[K];var ae,T;function M(C,Z){function W(ge){return Z.tokenize=ge,ge(C,Z)}var k=C.next();if(k=="<")return C.eat("!")?C.eat("[")?C.match("CDATA[")?W(B("atom","]]>")):null:C.match("--")?W(B("comment","-->")):C.match("DOCTYPE",!0,!0)?(C.eatWhile(/[\w\._\-]/),W(j(1))):null:C.eat("?")?(C.eatWhile(/[\w\._\-]/),Z.tokenize=B("meta","?>"),"meta"):(ae=C.eat("/")?"closeTag":"openTag",Z.tokenize=ie,"tag bracket");if(k=="&"){var ne;return C.eat("#")?C.eat("x")?ne=C.eatWhile(/[a-fA-F\d]/)&&C.eat(";"):ne=C.eatWhile(/[\d]/)&&C.eat(";"):ne=C.eatWhile(/[\w\.\-:]/)&&C.eat(";"),ne?"atom":"error"}else return C.eatWhile(/[^&<]/),null}M.isInText=!0;function ie(C,Z){var W=C.next();if(W==">"||W=="/"&&C.eat(">"))return Z.tokenize=M,ae=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return ae="equals",null;if(W=="<"){Z.tokenize=M,Z.state=Te,Z.tagName=Z.tagStart=null;var k=Z.tokenize(C,Z);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(W)?(Z.tokenize=Y(W),Z.stringStartCol=C.column(),Z.tokenize(C,Z)):(C.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Y(C){var Z=function(W,k){for(;!W.eol();)if(W.next()==C){k.tokenize=ie;break}return"string"};return Z.isInAttribute=!0,Z}function B(C,Z){return function(W,k){for(;!W.eol();){if(W.match(Z)){k.tokenize=M;break}W.next()}return C}}function j(C){return function(Z,W){for(var k;(k=Z.next())!=null;){if(k=="<")return W.tokenize=j(C+1),W.tokenize(Z,W);if(k==">")if(C==1){W.tokenize=M;break}else return W.tokenize=j(C-1),W.tokenize(Z,W)}return"meta"}}function D(C,Z,W){this.prev=C.context,this.tagName=Z,this.indent=C.indented,this.startOfLine=W,(O.doNotIndent.hasOwnProperty(Z)||C.context&&C.context.noIndent)&&(this.noIndent=!0)}function J(C){C.context&&(C.context=C.context.prev)}function $(C,Z){for(var W;;){if(!C.context)return;if(W=C.context.tagName,!O.contextGrabbers.hasOwnProperty(W)||!O.contextGrabbers[W].hasOwnProperty(Z))return;J(C)}}function Te(C,Z,W){return C=="openTag"?(W.tagStart=Z.column(),Ue):C=="closeTag"?oe:Te}function Ue(C,Z,W){return C=="word"?(W.tagName=Z.current(),T="tag",q):O.allowMissingTagName&&C=="endTag"?(T="tag bracket",q(C,Z,W)):(T="error",Ue)}function oe(C,Z,W){if(C=="word"){var k=Z.current();return W.context&&W.context.tagName!=k&&O.implicitlyClosed.hasOwnProperty(W.context.tagName)&&J(W),W.context&&W.context.tagName==k||O.matchClosing===!1?(T="tag",te):(T="tag error",me)}else return O.allowMissingTagName&&C=="endTag"?(T="tag bracket",te(C,Z,W)):(T="error",me)}function te(C,Z,W){return C!="endTag"?(T="error",te):(J(W),Te)}function me(C,Z,W){return T="error",te(C,Z,W)}function q(C,Z,W){if(C=="word")return T="attribute",se;if(C=="endTag"||C=="selfcloseTag"){var k=W.tagName,ne=W.tagStart;return W.tagName=W.tagStart=null,C=="selfcloseTag"||O.autoSelfClosers.hasOwnProperty(k)?$(W,k):($(W,k),W.context=new D(W,k,ne==W.indented)),Te}return T="error",q}function se(C,Z,W){return C=="equals"?Se:(O.allowMissing||(T="error"),q(C,Z,W))}function Se(C,Z,W){return C=="string"?re:C=="word"&&O.allowUnquoted?(T="string",q):(T="error",q(C,Z,W))}function re(C,Z,W){return C=="string"?re:q(C,Z,W)}return{startState:function(C){var Z={tokenize:M,state:Te,indented:C||0,tagName:null,tagStart:null,context:null};return C!=null&&(Z.baseIndent=C),Z},token:function(C,Z){if(!Z.tagName&&C.sol()&&(Z.indented=C.indentation()),C.eatSpace())return null;ae=null;var W=Z.tokenize(C,Z);return(W||ae)&&W!="comment"&&(T=null,Z.state=Z.state(ae||W,C,Z),T&&(W=T=="error"?W+" error":T)),W},indent:function(C,Z,W){var k=C.context;if(C.tokenize.isInAttribute)return C.tagStart==C.indented?C.stringStartCol+1:C.indented+he;if(k&&k.noIndent)return U.Pass;if(C.tokenize!=ie&&C.tokenize!=M)return W?W.match(/^(\s*)/)[0].length:0;if(C.tagName)return O.multilineTagIndentPastTag!==!1?C.tagStart+C.tagName.length+2:C.tagStart+he*(O.multilineTagIndentFactor||1);if(O.alignCDATA&&/<!\[CDATA\[/.test(Z))return 0;var ne=Z&&/^<(\/)?([\w_:\.-]*)/.exec(Z);if(ne&&ne[1])for(;k;)if(k.tagName==ne[2]){k=k.prev;break}else if(O.implicitlyClosed.hasOwnProperty(k.tagName))k=k.prev;else break;else if(ne)for(;k;){var ge=O.contextGrabbers[k.tagName];if(ge&&ge.hasOwnProperty(ne[2]))k=k.prev;else break}for(;k&&k.prev&&!k.startOfLine;)k=k.prev;return k?k.indent+he:C.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:O.htmlMode?"html":"xml",helperType:O.htmlMode?"html":"xml",skipAttribute:function(C){C.state==Se&&(C.state=q)},xmlCurrentTag:function(C){return C.tagName?{name:C.tagName,close:C.type=="closeTag"}:null},xmlCurrentContext:function(C){for(var Z=[],W=C.context;W;W=W.prev)W.tagName&&Z.push(W.tagName);return Z.reverse()}}}),U.defineMIME("text/xml","xml"),U.defineMIME("application/xml","xml"),U.mimeModes.hasOwnProperty("text/html")||U.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(xt,Xe,b){"use strict";var U=b("Awhp"),Me=b("KrTs"),ee=b("+L6B"),pe=b("2/Rp"),ue=b("5NDa"),he=b("5rEg"),O=b("0Owb"),X=b("oBTY"),K=b("tJVT"),ae=b("PpiC"),T=b("q1tI"),M=b.n(T),ie=function(B){var j=B.InputRight,D=B.value,J=D===void 0?[]:D,$=B.onChange,Te=$===void 0?function(){}:$,Ue=Object(ae.a)(B,["InputRight","value","onChange"]),oe=Object(T.useState)(),te=Object(K.a)(oe,2),me=te[0],q=te[1],se=function(C){var Z=J.filter(function(W,k){return k!==C});Te(Z)},Se=function(C){if(C.preventDefault(),!me)return;Te([].concat(Object(X.a)(J),[me])),q(null)};return M.a.createElement("div",null,M.a.createElement(he.a,Object(O.a)({},Ue,{value:me,onChange:function(C){return q(C.target.value)},onPressEnter:Se,onBlur:Se})),j,M.a.createElement("div",{className:"mt20"},J==null?void 0:J.map(function(re,C){return M.a.createElement(Me.a,{className:"ml10 mr10",count:"x",onClick:function(){return se(C)}},M.a.createElement(pe.a,{type:"primary",ghost:!0},re))})))};Xe.a=ie},"7Cbv":function(xt,Xe,b){"use strict";var U=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Me=new Uint8Array(16);function ee(){if(!U)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return U(Me)}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 ue(ie){return typeof ie=="string"&&pe.test(ie)}for(var he=ue,O=[],X=0;X<256;++X)O.push((X+256).toString(16).substr(1));function K(ie){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=(O[ie[Y+0]]+O[ie[Y+1]]+O[ie[Y+2]]+O[ie[Y+3]]+"-"+O[ie[Y+4]]+O[ie[Y+5]]+"-"+O[ie[Y+6]]+O[ie[Y+7]]+"-"+O[ie[Y+8]]+O[ie[Y+9]]+"-"+O[ie[Y+10]]+O[ie[Y+11]]+O[ie[Y+12]]+O[ie[Y+13]]+O[ie[Y+14]]+O[ie[Y+15]]).toLowerCase();if(!he(B))throw TypeError("Stringified UUID is invalid");return B}var ae=K;function T(ie,Y,B){ie=ie||{};var j=ie.random||(ie.rng||ee)();if(j[6]=j[6]&15|64,j[8]=j[8]&63|128,Y){B=B||0;for(var D=0;D<16;++D)Y[B+D]=j[D];return Y}return ae(j)}var M=Xe.a=T},"7ahc":function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return Ue});var U=b("k1fw"),Me=b("0Owb"),ee=b("+L6B"),pe=b("2/Rp"),ue=b("y8nQ"),he=b("Vl3Y"),O=b("tJVT"),X=b("OaEy"),K=b("2fM7"),ae=b("q1tI"),T=b.n(ae),M=b("VrN/"),ie=b.n(M),Y=b("p77/"),B=b.n(Y),j=b("c5Ni"),D=b.n(j),J=K.a.Option,$={labelCol:{span:4},wrapperCol:{span:20}},Te={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"]};Xe.b=function(oe){var te=oe.callback,me=oe.onCancel,q=Object(ae.useState)("python"),se=Object(O.a)(q,2),Se=se[0],re=se[1];function C(W){re(Te[W][1])}function Z(W){te(W)}return T.a.createElement(he.a,Object(Me.a)({},$,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Z}),T.a.createElement(he.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},T.a.createElement(K.a,{onChange:C},Object.keys(Te).map(function(W){return T.a.createElement(J,{key:W,value:W},Te[W][0])}))),T.a.createElement(he.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},T.a.createElement(Ue,{mode:Se})),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(pe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(pe.a,{type:"ghost",onClick:me},"\u53D6\u6D88")))};function Ue(oe){var te=oe.value,me=oe.onChange,q=oe.mode,se=oe.options,Se=se===void 0?{}:se,re=Object(ae.useRef)(),C=Object(ae.useState)(),Z=Object(O.a)(C,2),W=Z[0],k=Z[1];return Object(ae.useEffect)(function(){if(W){function ne(ge){var Q=ge.getValue();me&&me(Q)}return W.on("change",ne),function(){W.off("change",ne)}}},[W,me]),Object(ae.useEffect)(function(){W&&W.setOption("mode",q)},[W,q]),Object(ae.useEffect)(function(){W&&((te!==W.getValue()||te==="")&&setTimeout(function(){W.setValue(te||" ")},300))},[W,te]),Object(ae.useEffect)(function(){if(re.current&&!W){var ne=ie.a.fromTextArea(re.current,Object(U.a)({mode:q,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Se));k(ne)}},[re.current,W]),T.a.createElement("div",{className:"my-codemirror-container"},T.a.createElement("textarea",{ref:re}))}},"7ixt":function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return ee});var U={adjustX:1,adjustY:1},Me=[0,0],ee={left:{points:["cr","cl"],overflow:U,offset:[-4,0],targetOffset:Me},right:{points:["cl","cr"],overflow:U,offset:[4,0],targetOffset:Me},top:{points:["bc","tc"],overflow:U,offset:[0,-4],targetOffset:Me},bottom:{points:["tc","bc"],overflow:U,offset:[0,4],targetOffset:Me},topLeft:{points:["bl","tl"],overflow:U,offset:[0,-4],targetOffset:Me},leftTop:{points:["tr","tl"],overflow:U,offset:[-4,0],targetOffset:Me},topRight:{points:["br","tr"],overflow:U,offset:[0,-4],targetOffset:Me},rightTop:{points:["tl","tr"],overflow:U,offset:[4,0],targetOffset:Me},bottomRight:{points:["tr","br"],overflow:U,offset:[0,4],targetOffset:Me},rightBottom:{points:["bl","br"],overflow:U,offset:[4,0],targetOffset:Me},bottomLeft:{points:["tl","bl"],overflow:U,offset:[0,4],targetOffset:Me},leftBottom:{points:["br","bl"],overflow:U,offset:[-4,0],targetOffset:Me}},pe=ee},"8EBN":function(xt,Xe,b){(function(U){U(b("VrN/"))})(function(U){"use strict";U.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 Me=0;Me<U.modeInfo.length;Me++){var ee=U.modeInfo[Me];ee.mimes&&(ee.mime=ee.mimes[0])}U.findModeByMIME=function(pe){pe=pe.toLowerCase();for(var ue=0;ue<U.modeInfo.length;ue++){var he=U.modeInfo[ue];if(he.mime==pe)return he;if(he.mimes){for(var O=0;O<he.mimes.length;O++)if(he.mimes[O]==pe)return he}}if(/\+xml$/.test(pe))return U.findModeByMIME("application/xml");if(/\+json$/.test(pe))return U.findModeByMIME("application/json")},U.findModeByExtension=function(pe){pe=pe.toLowerCase();for(var ue=0;ue<U.modeInfo.length;ue++){var he=U.modeInfo[ue];if(he.ext){for(var O=0;O<he.ext.length;O++)if(he.ext[O]==pe)return he}}},U.findModeByFileName=function(pe){for(var ue=0;ue<U.modeInfo.length;ue++){var he=U.modeInfo[ue];if(he.file&&he.file.test(pe))return he}var O=pe.lastIndexOf("."),X=O>-1&&pe.substring(O+1,pe.length);if(X)return U.findModeByExtension(X)},U.findModeByName=function(pe){pe=pe.toLowerCase();for(var ue=0;ue<U.modeInfo.length;ue++){var he=U.modeInfo[ue];if(he.name.toLowerCase()==pe)return he;if(he.alias){for(var O=0;O<he.alias.length;O++)if(he.alias[O].toLowerCase()==pe)return he}}}})},"8hTe":function(xt,Xe,b){xt.exports={button:"button___1wy9m"}},"93VE":function(xt,Xe,b){},"9Bee":function(xt,Xe,b){"use strict";var U=b("DYRE"),Me=b("zeV3"),ee=b("+L6B"),pe=b("2/Rp"),ue=b("k1fw"),he=b("9og8"),O=b("tJVT"),X=b("WmNS"),K=b.n(X),ae=b("q1tI"),T=b.n(ae),M=b("vg9a"),ie=b("DlQD"),Y=b.n(ie),B=b("rUJ1");function j(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 L=Object(O.a)(h,1),xe=L[0];return xe.length>=u.length?d.slice(u.length):d}).join(`
|
|
`)}var D=[],J=["<ul>"],$=new Y.a.Renderer,Te=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ue(){D.length=0,J=["<ul>"]}var oe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function te(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=te(c,o,d.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(L){u.push(L)}),u.push("</ul>")),u.push("</li>"),o=te(c,o,a,u),o}function me(){return te(D,0,0,J),J.push("</ul>"),J.join("")}var q={heading:function(o){var a=Te.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=j(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var L=re(),xe=d;d=L,C[L]={type:"block",expression:xe}}return{type:"code",raw:u,lang:h,text:d}}}},se=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Se=0,re=function(){return"__special_katext_id_".concat(Se++,"__")},C={};function Z(){return C}function W(){Se=0,C={}}function k(c){return c=c.replace(se,function(o,a){var u=re();return C[u]={type:"inline",expression:a},u}),c}var ne=$.listitem;$.listitem=function(c){return ne(k(c))};var ge=$.paragraph;$.paragraph=function(c){return ge(k(c))};var Q=$.tablecell;$.tablecell=function(c,o){return Q(k(c),o)},$.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(B.escape)(c,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(B.escape)(c,!0))+"</code></pre>"},$.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return D.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},Y.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Y.a.use({tokenizer:q,renderer:$});var Pe=Y.a,w=b("SJMd"),g=b("ulZh"),H=b.n(g),be=b("m3rI"),Ce=b("Oy/b"),Ke=b("p5ED"),Ye=b("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 Le=function(c,o){return(Le=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 ke(c,o){function a(){this.constructor=c}Le(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ve(c,o,a,u){return new(a||(a=Promise))(function(d,h){function L(ot){try{Fe(u.next(ot))}catch(we){h(we)}}function xe(ot){try{Fe(u.throw(ot))}catch(we){h(we)}}function Fe(ot){var we;ot.done?d(ot.value):(we=ot.value,we instanceof a?we:new a(function(Et){Et(we)})).then(L,xe)}Fe((u=u.apply(c,o||[])).next())})}function Ee(c,o){var a,u,d,h,L={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:xe(0),throw:xe(1),return:xe(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function xe(Fe){return function(ot){return function(we){if(a)throw new TypeError("Generator is already executing.");for(;L;)try{if(a=1,u&&(d=2&we[0]?u.return:we[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,we[1])).done)return d;switch(u=0,d&&(we=[2&we[0],d.value]),we[0]){case 0:case 1:d=we;break;case 4:return L.label++,{value:we[1],done:!1};case 5:L.label++,u=we[1],we=[0];continue;case 7:we=L.ops.pop(),L.trys.pop();continue;default:if(!(d=L.trys,(d=d.length>0&&d[d.length-1])||we[0]!==6&&we[0]!==2)){L=0;continue}if(we[0]===3&&(!d||we[1]>d[0]&&we[1]<d[3])){L.label=we[1];break}if(we[0]===6&&L.label<d[1]){L.label=d[1],d=we;break}if(d&&L.label<d[2]){L.label=d[2],L.ops.push(we);break}d[2]&&L.ops.pop(),L.trys.pop();continue}we=o.call(c,L)}catch(Et){we=[6,Et],u=0}finally{a=d=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([Fe,ot])}}}function z(){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],L=0,xe=h.length;L<xe;L++,d++)u[d]=h[L];return u}var R=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],L=h[0],xe=h[1];o.setAttribute(L,xe)}},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 L=document.createElementNS("http://www.w3.org/2000/svg","line");return L.setAttribute("x1",o.toString()),L.setAttribute("y1",a.toString()),L.setAttribute("x2",u.toString()),L.setAttribute("y2",d.toString()),h&&c.setAttributes(L,h),L},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,L,xe){var Fe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Fe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",L.toString()]]),Fe.appendChild(xe),Fe},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}(),Be=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}(),$e=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 L=u!==void 0?u:document.createElement("canvas");o===null&&(d.markersOnly=!0,d.naturalSize=!1);var xe=document.createElementNS("http://www.w3.org/2000/svg","svg");xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),xe.setAttribute("width",a.width.baseVal.valueAsString),xe.setAttribute("height",a.height.baseVal.valueAsString),xe.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),xe.innerHTML=a.innerHTML,d.naturalSize===!0?(xe.width.baseVal.value=o.naturalWidth,xe.height.baseVal.value=o.naturalHeight):d.width!==void 0&&d.height!==void 0&&(xe.width.baseVal.value=d.width,xe.height.baseVal.value=d.height),L.width=xe.width.baseVal.value,L.height=xe.height.baseVal.value;var Fe=xe.outerHTML,ot=L.getContext("2d");d.markersOnly!==!0&&ot.drawImage(o,0,0,L.width,L.height);var we=window.URL,Et=new Image(L.width,L.height);Et.setAttribute("crossOrigin","anonymous");var Dt=new Blob([Fe],{type:"image/svg+xml"}),Kt=we.createObjectURL(Dt);Et.onload=function(){ot.drawImage(Et,0,0),we.revokeObjectURL(Kt);var ji=L.toDataURL(d.imageType,d.imageQuality);h(ji)},Et.src=Kt})},c}(),ft=function(){},rt=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 Ge("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ge("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ge("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new de("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new de("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}(),Ge=function(c,o){this.selector=c,this.style=o},de=function(c,o){this.localName=c,this.style=o},Re=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 L=document.createElement("div");L.className=""+a.toolbarButtonStyleClass.name,L.setAttribute("data-type-name",h.typeName),L.innerHTML=h.icon,L.addEventListener("click",function(){a.markerToolbarButtonClicked(L,h)}),a.buttons.push(L),a.markerButtons.push(L)}),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 de("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 de("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new de("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new de("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 de("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new de("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 de("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new de("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ge("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ge("."+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}(),je=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 de("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 de("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new de("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new de("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new de("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 de("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new de("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 de("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new de("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ge("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ge("."+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 L;h.uiStyleSettings=d.uiStyleSettings;var xe=document.createElement("div");xe.className=d.toolboxButtonStyleClass.name+" "+((L=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&L!==void 0?L:d.toolboxButtonStyleColorsClass.name),xe.innerHTML=h.icon,xe.title=h.title,xe.addEventListener("click",function(){d.panelButtonClick(h)}),d.panelButtons.push(xe),d.buttonRow.appendChild(xe)}),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,L){var xe,Fe;h.className=a.toolboxButtonStyleClass.name+" "+(L===u?""+((xe=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&xe!==void 0?xe:a.toolboxActiveButtonStyleColorsClass.name):""+((Fe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:a.toolboxButtonStyleColorsClass.name))})},c}(),Je=function(c,o){this.title=c,this.icon=o},We=function(c){function o(a,u,d,h){var L=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 L.colors=[],L.addTransparent=!1,L.colorBoxes=[],L.colors=u,L.currentColor=d,L.setCurrentColor=L.setCurrentColor.bind(L),L.getColorBox=L.getColorBox.bind(L),L}return ke(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,L=document.createElement("div");L.style.display="inline-block",L.style.boxSizing="content-box",L.style.width=h-2+"px",L.style.height=h-2+"px",L.style.padding="1px",L.style.marginRight="2px",L.style.marginBottom="2px",L.style.borderWidth="2px",L.style.borderStyle="solid",L.style.borderRadius=(h+2)/2+"px",L.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",L.addEventListener("click",function(){u.setCurrentColor(a,L)});var xe=document.createElement("div");return xe.style.display="inline-block",xe.style.width=h-2+"px",xe.style.height=h-2+"px",xe.style.backgroundColor=a,xe.style.borderRadius=h/2+"px",a==="transparent"&&(xe.style.fill=this.uiStyleSettings.toolboxAccentColor,xe.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>`),L.appendChild(xe),L},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}(Je),Oe=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}(),Ie=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}(),pt=function(){function c(){this.GRIP_SIZE=10,this.visual=R.createGroup(),this.visual.appendChild(R.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(R.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}(),Qe=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(R.createTransform()),h.setupControlBox(),h}return ke(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=R.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 L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,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,L=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,L=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:L=this.manipulationStartHeight+a.y-this.manipulationStartY}d>=0?(this.left=u,this.width=d):(this.left=u+d,this.width=-d),L>=0?(this.top=h,this.height=L):(this.top=h+L,this.height=-L),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=R.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=R.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=R.createGroup();var a=R.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=R.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=R.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 Ie,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 pt;return a.visual.transform.baseVal.appendItem(R.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,L=(this.height+this.CB_DISTANCE)/2-a/2,xe=this.height+this.CB_DISTANCE-a/2,Fe=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,Fe,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,L),this.positionGrip(this.controlGrips.centerRight.visual,Fe,L),this.positionGrip(this.controlGrips.bottomLeft.visual,u,xe),this.positionGrip(this.controlGrips.bottomCenter.visual,h,xe),this.positionGrip(this.controlGrips.bottomRight.visual,Fe,xe),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}(Oe),et=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 ke(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=R.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),R.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&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&R.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}(Qe),yt=function(c){function o(a,u,d,h){var L=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return L.widths=[],L.widthBoxes=[],L.widths=u,L.currentWidth=d,L.setCurrentWidth=L.setCurrentWidth.bind(L),L}return ke(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 L=document.createElement("div");L.innerText=d.toString(),L.style.marginRight="5px",h.appendChild(L);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.display="flex",xe.style.alignItems="center";var Fe=document.createElement("hr");Fe.style.minWidth="20px",Fe.style.border="0px",Fe.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,Fe.style.flexGrow="2",xe.appendChild(Fe),h.appendChild(xe),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}(Je),lt=function(c){function o(a,u,d,h){var L=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 L.styles=[],L.styleBoxes=[],L.styles=u,L.currentStyle=d,L.setCurrentStyle=L.setCurrentStyle.bind(L),L}return ke(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 L=document.createElement("div");L.style.minHeight="20px",L.style.flexGrow="2",L.style.overflow="hidden";var xe=`<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>`;L.innerHTML=xe,h.appendChild(L),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}(Je),tt=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 We("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new yt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ke(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}(et),le=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},gt=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 ke(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=R.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 pt;return a.visual.transform.baseVal.appendItem(R.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}(Oe),it=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 We("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new yt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ke(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=R.createGroup(),this.selectorLine=R.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=R.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()),R.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),R.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}(gt),fe=function(c){function o(a,u,d,h){var L=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 L.fonts=[],L.fontBoxes=[],L.fonts=u,L.currentFont=d,L.setCurrentFont=L.setCurrentFont.bind(L),L}return ke(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 L=document.createElement("div");L.style.display="flex",L.style.minHeight="20px",L.style.flexGrow="2",L.style.fontFamily=d,L.style.overflow="hidden";var xe=document.createElement("div");xe.style.whiteSpace="nowrap",xe.style.overflow="hidden",xe.style.textOverflow="ellipsis",xe.innerHTML="The quick brown fox jumps over the lazy dog",L.appendChild(xe),h.appendChild(L),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}(Je),De=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 We("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new fe("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return ke(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=R.createGroup(),this.bgRectangle=R.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=R.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.textElement.transform.baseVal.appendItem(R.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(R.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&&(R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.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&&R.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&&R.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}(Qe),N=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 We("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new yt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return ke(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=R.createGroup(),this.drawingImage=R.createImage(),this.visual.appendChild(this.drawingImage);var a=R.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),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.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],L=u[2],xe=u[3],Fe=!1,ot=0;ot<this.canvasElement.height;ot++)for(var we=0;we<this.canvasElement.width;we++)a.data[ot*this.canvasElement.width*4+4*we+3]>0&&(Fe=!0,ot<h&&(h=ot),we<d&&(d=we),ot>xe&&(xe=ot),we>L&&(L=we));if(Fe){this.left=d/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(L-d)/this.pixelRatio,this.height=(xe-h)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=L-d,Et.height=xe-h,Et.getContext("2d").putImageData(this.canvasContext.getImageData(d,h,L-d,xe-h),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),R.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}(Qe),A=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 ke(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(xe){var Fe="both";switch(xe){case 0:Fe="both";break;case 1:Fe="start";break;case 2:Fe="end";break;case 3:Fe="none"}var ot=document.createElement("div");if(ot.style.display="flex",ot.style.flexGrow="2",ot.style.alignItems="center",ot.style.justifyContent="space-between",ot.style.padding="5px",ot.style.borderWidth="2px",ot.style.borderStyle="solid",ot.style.borderColor=Fe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ot.addEventListener("click",function(){a.setCurrentType(Fe,ot)}),u.appendChild(ot),Fe==="both"||Fe==="start"){var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.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>`,we.style.marginLeft="5px",ot.appendChild(we)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var Dt=document.createElement("hr");if(Dt.style.minWidth="20px",Dt.style.border="0px",Dt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Dt.style.flexGrow="2",Et.appendChild(Dt),ot.appendChild(Et),Fe==="both"||Fe==="end"){var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.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>`,Kt.style.marginRight="5px",ot.appendChild(Kt)}h.typeBoxes.push(ot)},h=this,L=0;L<4;L++)d(L);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}(Je),P=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 A("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return ke(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=R.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=R.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(R.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",R.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),R.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}(it),v=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 We("Color",d.defaultColorSet,d.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return ke(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}(et),y=function(c){function o(a,u,d,h){var L=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 L.opacities=[],L.opacityBoxes=[],L.opacities=u,L.currentOpacity=d,L.setCurrentOpacity=L.setCurrentOpacity.bind(L),L}return ke(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 L=document.createElement("div");L.innerText=100*d+"%",h.appendChild(L),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}(Je),x=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 We("Color",d.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new y("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ke(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&R.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}(v),S='<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>',V=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 We("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 We("Fill color",d.defaultColorSet,h.bgColor,S),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new fe("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new pt,h.tipGrip.visual.transform.baseVal.appendItem(R.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return ke(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(){R.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=R.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&&(R.setAttributes(this.bgRectangle,[["fill",a]]),R.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(){R.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}(De),I=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 We("Line color",z(d.defaultColorSet,["transparent"]),d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new We("Fill color",z(d.defaultColorSet,["transparent"]),h.fillColor,S),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new yt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new y("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ke(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=R.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),R.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&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&R.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}(Qe),ye=function(c){function o(a,u,d){return c.call(this,a,u,d)||this}return ke(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=R.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(R.createTransform()),this.visual.appendChild(this.tip1),this.tip2=R.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(R.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&&(R.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()]]),R.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}(it),Ve=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 ke(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}(I),ut=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}(),nt=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 We("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new yt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ke(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=R.createGroup(),this.selectorCurve=R.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=R.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()),R.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=R.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=R.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}(gt),Mt=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}(),_t=function(c){function o(a,u,d){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=d,h}return ke(o,c),o}(Mt),st=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 ke(o,c),o}(Mt),Xt=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}(),Lt=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 le,this._isOpen=!1,this.undoRedoManager=new ut,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 Xt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new rt(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[tt,N,P,De,Ve,I,x,V,ye,v,it,nt]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[tt,N,P,De,I,x,V]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[tt,N,P,De,x]},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(),Be.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&ft.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ft.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Mt(o))})},c.prototype.render=function(){return ve(this,void 0,void 0,function(){var o;return Ee(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new $e).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 Mt(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 Mt(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 De?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=R.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 Re(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 je(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 st(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 st(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(L){var xe=new st(o,void 0,!0);L(xe),xe.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(L){var xe=d.markers[L];d.setCurrentMarker(d.markers[L]),d._currentMarker.dispose(),d.markerImage.removeChild(d._currentMarker.container),d.markers.splice(d.markers.indexOf(d._currentMarker),1),d.eventListeners.markerdelete.forEach(function(Fe){return Fe(new st(o,xe))})},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 Mt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new Mt(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 Mt(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 Mt(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 ve(this,void 0,void 0,function(){var o,a,u=this;return Ee(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 _t(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(L){return L.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 Mt(a))})},c.prototype.addNewMarker=function(o){var a=R.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 st(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 N&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(N):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new st(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 st(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 st(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 st(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){Be.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 Mt(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 Mt(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 Ct=function(c,o){return(Ct=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 St(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}Ct(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ht(c,o,a,u){return new(a||(a=Promise))(function(d,h){function L(ot){try{Fe(u.next(ot))}catch(we){h(we)}}function xe(ot){try{Fe(u.throw(ot))}catch(we){h(we)}}function Fe(ot){var we;ot.done?d(ot.value):(we=ot.value,we instanceof a?we:new a(function(Et){Et(we)})).then(L,xe)}Fe((u=u.apply(c,o||[])).next())})}function pi(c,o){var a,u,d,h,L={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:xe(0),throw:xe(1),return:xe(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function xe(Fe){return function(ot){return function(we){if(a)throw new TypeError("Generator is already executing.");for(;L;)try{if(a=1,u&&(d=2&we[0]?u.return:we[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,we[1])).done)return d;switch(u=0,d&&(we=[2&we[0],d.value]),we[0]){case 0:case 1:d=we;break;case 4:return L.label++,{value:we[1],done:!1};case 5:L.label++,u=we[1],we=[0];continue;case 7:we=L.ops.pop(),L.trys.pop();continue;default:if(!(d=L.trys,(d=d.length>0&&d[d.length-1])||we[0]!==6&&we[0]!==2)){L=0;continue}if(we[0]===3&&(!d||we[1]>d[0]&&we[1]<d[3])){L.label=we[1];break}if(we[0]===6&&L.label<d[1]){L.label=d[1],d=we;break}if(d&&L.label<d[2]){L.label=d[2],L.ops.push(we);break}d[2]&&L.ops.pop(),L.trys.pop();continue}we=o.call(c,L)}catch(Et){we=[6,Et],u=0}finally{a=d=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([Fe,ot])}}}var qt=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}(),mt=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],L=h[0],xe=h[1];o.setAttribute(L,xe)}},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 L=document.createElementNS("http://www.w3.org/2000/svg","line");return L.setAttribute("x1",o.toString()),L.setAttribute("y1",a.toString()),L.setAttribute("x2",u.toString()),L.setAttribute("y2",d.toString()),h&&c.setAttributes(L,h),L},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,L,xe){var Fe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Fe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",L.toString()]]),Fe.appendChild(xe),Fe},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,L,xe,Fe){return"M"+o+","+a+"V"+(a+d)+"H"+(o+u)+"V"+a+"H"+h+"V"+L+"H"+(h+xe)+"V"+(L+Fe)+"H"+h+"V"+a+"Z"},c}(),wi=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 ii("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ii("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ii("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Gt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Gt("_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}(),ii=function(c,o){this.selector=c,this.style=o},Gt=function(c,o){this.localName=c,this.style=o},Gi=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}(),sn=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}(),ln=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return St(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}(sn),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 St(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}(sn),Ii=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}(),un=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Ii(o,a),d=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(L);var xe=mt.createDefs();L.appendChild(xe);var Fe=mt.createElement("clipPath",[["id","text-bg-clip"]]);xe.appendChild(Fe);var ot=mt.createPath(mt.getHollowRectanglePath((24-d)/2,(24-h)/2,d,h,(24-d)/2+2,(24-h)/2+2,d-4,h-4));L.appendChild(ot);var we=mt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);we.appendChild(mt.createTSpan(o+":"+a)),L.appendChild(we);var Et=we.getBBox();mt.setAttributes(we,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var Dt=mt.createPath(mt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return Fe.appendChild(Dt),mt.setAttributes(ot,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(L),L.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}(),Si=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 St(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),Ot=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=mt.createGroup(),this.visual.appendChild(mt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(mt.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 mt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Bi=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&&mt.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=mt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=mt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(mt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(mt.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=mt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(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),mt.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,L){var xe=a.y+u*(L+1);mt.setAttributes(h,[["x1",""+a.x],["y1",""+xe],["x2",""+(a.x+a.width)],["y2",""+xe]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,L){var xe=a.x+d*(L+1);mt.setAttributes(h,[["x1",""+xe],["y1",""+a.y],["x2",""+xe],["y2",""+(a.y+a.height)]])}),mt.setAttributes(this.cropShadeElement,[["d",mt.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,L){var xe=u/o,Fe=d/a;return{x:(h.x-L)*xe+L,y:(h.y-L)*Fe+L,width:h.width*xe,height:h.height*Fe}},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}(),Yi=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();mt.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=mt.createPath(a);var h=mt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=mt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=mt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var L=mt.createTSpan("");return L.innerHTML="°",this.angleLabelElement.appendChild(L),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),hn=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,d,h,L,xe){var Fe=this;return new Promise(function(ot){var we=document.createElement("canvas");we.width=o.width.baseVal.value-2*d,we.height=o.height.baseVal.value-2*d;var Et=1,Dt=1;Fe.naturalSize===!0?(Et=a.naturalWidth/(o.width.baseVal.value-2*d)/L,Dt=a.naturalHeight/(o.height.baseVal.value-2*d)/xe,we.width=a.naturalWidth/L,we.height=a.naturalHeight/xe):Fe.width!==void 0&&Fe.height!==void 0&&(Et=Fe.width/u.width,Dt=Fe.height/u.height,we.width*=Et,we.height*=Dt);var Kt=we.getContext("2d");Kt.translate(we.width/2,we.height/2),Kt.rotate(h*Math.PI/180),Kt.scale(L,xe),Kt.translate(-we.width/2,-we.height/2),Kt.drawImage(a,0,0,we.width,we.height);var ji=document.createElement("canvas");ji.width=u.width*Et,ji.height=u.height*Dt,ji.getContext("2d").putImageData(Kt.getImageData((u.x-d)*Et,(u.y-d)*Dt,u.width*Et,u.height*Dt),0,0),ot(ji.toDataURL(Fe.imageType,Fe.imageQuality))})},c}(),Ae=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 wi(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",mt.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();mt.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=mt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=mt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=mt.createGroup(),this.editingTargetRotationScaleContainer=mt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=mt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=mt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=mt.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=mt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Bi(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 Gi,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 ln;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Dt){var Kt=new It(un.getIcon(Dt.horizontal,Dt.vertical),Dt.horizontal===0&&Dt.vertical===0?"FREE":Dt.horizontal+":"+Dt.vertical);Kt.onClick=function(){return o.ratioButtonClicked(Dt)},u.push(Kt)}),this.aspectRatioButton=new Si(un.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),!qt.isLicensed){var L=new ct;this.topToolbar.addElementBlock(L);var xe=document.createElement("div");xe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Fe=document.createElement("a");Fe.style.color="currentColor",Fe.href="https://markerjs.com/products/cropro",Fe.target="_blank",Fe.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>',xe.appendChild(Fe),L.addElement(xe)}var ot=new ln;ot.minWidth=3*this.toolbarHeight+"px",ot.contentAlign="end",this.topToolbar.addButtonBlock(ot);var we=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");we.onClick=this.startRenderAndClose,ot.addButton(we),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(we.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=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");Et.onClick=this.close,ot.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Gi,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 ln;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 Yi("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(ot){o.rotateBy(ot),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var L=new ln;L.minWidth=2*this.toolbarHeight+"px",L.contentAlign="end",this.bottomToolbar.addButtonBlock(L);var xe=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");xe.onClick=this.flipHorizontallyButtonClicked,L.addButton(xe);var Fe=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");Fe.onClick=this.flipVerticallyButtonClicked,L.addButton(Fe)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=un.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 Ii(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 ht(this,void 0,void 0,function(){var o,a;return pi(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 ht(this,void 0,void 0,function(){var o;return pi(this,function(a){switch(a.label){case 0:return(o=new hn).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),mt.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 Gt("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 Gt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Gt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new ii("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ii("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gt("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 Gt("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 Gt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},c.instanceCounter=0,c}(),kt=b("8hTe"),cn=b.n(kt),Ln=/<pre[^>]*>/g;function dn(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Mn=Xe.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,d=u===void 0?!1:u,h=c.className,L=c.showTextOnly,xe=c.showLines,Fe=c.replaces,ot=c.zoomImg,we=c.hasMask,Et=c.style,Dt=Et===void 0?{}:Et,Kt=c.stylesPrev,ji=Kt===void 0?{}:Kt,Ui=String(a),si=Object(ae.useRef)(),Vi=Object(ae.useRef)(),zn=Object(ae.useState)(""),Ei=Object(O.a)(zn,2),Fi=Ei[0],Ri=Ei[1],vn=Object(ae.useState)("office"),$i=Object(O.a)(vn,2),fn=$i[0],tn=$i[1],cr=function(){var jt=new Ae(Vi.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var mi=Object(he.a)(K.a.mark(function Bt(ni){var Wt;return K.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return si.current.style.display="none",ei.next=3,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ni}});case 3:Wt=ei.sent,Wt!=null&&Wt.id&&Fe(Vi.current.getAttribute("src").replace(be.a.API_SERVER,""),"/api/attachments/".concat(Wt==null?void 0:Wt.id,"?type=").concat(Wt.content_type));case 5:case"end":return ei.stop()}},Bt)}));return function(Bt){return mi.apply(this,arguments)}}()),jt.show()},Gn=function(){var jt=new Lt(Vi.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var mi=Object(he.a)(K.a.mark(function Bt(ni){var Wt;return K.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:if(si.current.style.display="none",!Vi.current){ei.next=6;break}return ei.next=4,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ni.dataUrl}});case 4:Wt=ei.sent,Wt!=null&&Wt.id&&Fe(Vi.current.getAttribute("src").replace(be.a.API_SERVER,""),"/api/attachments/".concat(Wt==null?void 0:Wt.id,"?type=").concat(Wt.content_type));case 6:case"end":return ei.stop()}},Bt)}));return function(Bt){return mi.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},Ji=Object(ae.useMemo)(function(){try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,mi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ui=Ui.replace(Zt,"("+be.a.API_SERVER+"/api/attachments/").replace(jt,'"'+be.a.API_SERVER+"/api/attachments/").replace(mi,'"'+be.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,`
|
|
`),Ui=Ui.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(nn){}var Bt=Pe(Ui),ni=Z();if(Ui.match(/\[TOC\]/)&&(Bt=Bt.replace("<p>[TOC]</p>",me()),Ue()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(nn,ei){var ki=ni[ei],Vn=ki.type,Xn=ki.expression;return Object(Ce.renderToString)(dn(Xn)||"",{displayMode:Vn==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),W(),L){var Wt=document.createElement("div");return Wt.innerHTML=Bt,Wt.innerText}return setTimeout(function(){return On()},500),Bt},[Ui]),Wi=Object(ae.useRef)();oe.WebkitLineClamp=xe,xe&&(Dt=Object(ue.a)(Object(ue.a)({},Dt),oe));function An(Zt){var jt=Zt.target;if(jt.tagName.toUpperCase()==="IMG"){if(ot){var mi=jt.getAttribute("src");Ri(mi),tn("image")}}else if(jt.tagName.toUpperCase()==="A"){var Bt=jt.getAttribute("href");if(Bt.indexOf("office")>-1)Zt.preventDefault(),Ri(Bt),tn("office");else if(Bt.indexOf("application/pdf")>-1)Zt.preventDefault(),Ri(Bt),tn("pdf");else if(Bt.indexOf("type=text")>-1)Zt.preventDefault(),Ri(Bt),tn("html");else if(Bt.startsWith("#")){Zt.preventDefault();var ni=document.getElementById(Bt.replace("#",""));ni&&ni.scrollIntoView(!0)}}}var On=function(){var jt,mi=(jt=Wi.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");mi==null||mi.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ni=new H.a;ni.loadSource(Bt.src),ni.attachMedia(Bt)}}})};Object(ae.useEffect)(function(){if(Wi.current&&Ji&&(Ji.match(Ln)&&window.PR.prettyPrint()),Wi.current)return Wi.current.addEventListener("click",An),function(){Wi.current.removeEventListener("click",An),W(),Ue()}},[Ji,Wi.current,An]);var dr=function(jt){if(!d)return;jt.target.nodeName==="IMG"?(si.current.style.display="flex",si.current.style.width=jt.target.clientWidth+"px",si.current.style.height=jt.target.clientHeight+"px",si.current.style.top=jt.target.offsetTop+"px",si.current.style.left=jt.target.offsetLeft+"px",Vi.current.src=jt.target.getAttribute("src")):si.current.style.display="none"};return T.a.createElement("div",{style:{position:"relative"}},T.a.createElement("div",{ref:Wi,style:Object(ue.a)({},Dt),className:"".concat(h||""," markdown-body ").concat(cn.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:Ji}}),T.a.createElement("div",{ref:si,className:cn.a.button},T.a.createElement(Me.a,null,T.a.createElement(pe.a,{onClick:function(){return cr()}},"\u88C1\u526A"),T.a.createElement(pe.a,{onClick:function(){return Gn()}},"\u7F16\u8F91"))),T.a.createElement("img",{ref:Vi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),T.a.createElement(Ke.a,{close:!0,data:Fi,hasMask:we,type:Fi!=null&&Fi.length?fn:"",style:Object(ue.a)({},ji),onClose:function(){return Ri("")}}))}},"9VGf":function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return ee});var U=b("q1tI"),Me=b.n(U);function ee(pe,ue){var he=Object(U.useRef)();Object(U.useEffect)(function(){he.current=pe}),Object(U.useEffect)(function(){function O(){he.current()}if(ue!==null){var X=setInterval(O,ue);return function(){return clearInterval(X)}}},[ue])}},"9ZNV":function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return ae});var U=b("0Owb"),Me=b("+L6B"),ee=b("2/Rp"),pe=b("q1tI"),ue=b.n(pe),he=b("UUDw"),O=b.n(he),X=b("TSYQ"),K=b.n(X),ae=function(M){var ie=M.cancelText,Y=ie===void 0?"\u53D6\u6D88":ie,B=M.okText,j=B===void 0?"\u786E\u5B9A":B,D=M.loading,J=D===void 0?!1:D,$=M.hasOkBtn,Te=$===void 0?!0:$,Ue=M.okButtonProps,oe=Ue===void 0?{}:Ue,te=M.onCancel,me=te===void 0?function(){}:te,q=M.onOk,se=q===void 0?function(){}:q,Se=M.className,re=Se===void 0?"":Se;return ue.a.createElement("div",{className:K()(O.a.buttonFixed,re)},ue.a.createElement("div",{className:O.a.buttonWrap},ue.a.createElement(ee.a,{size:"large",className:"".concat(O.a.button," mr20"),onClick:me},Y),Te&&ue.a.createElement(ee.a,Object(U.a)({size:"large",type:"primary",className:"".concat(O.a.button," mr20"),loading:J,onClick:se},oe),j)))}},Bd2K:function(xt,Xe,b){(function(U){U(b("VrN/"),b("osHv"))})(function(U){U.defineOption("autoCloseTags",!1,function(K,ae,T){if(T!=U.Init&&T&&K.removeKeyMap("autoCloseTags"),!ae)return;var M={name:"autoCloseTags"};(typeof ae!="object"||ae.whenClosing!==!1)&&(M["'/'"]=function(ie){return he(ie)}),(typeof ae!="object"||ae.whenOpening!==!1)&&(M["'>'"]=function(ie){return pe(ie)}),K.addKeyMap(M)});var Me=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ee=["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(K){if(K.getOption("disableInput"))return U.Pass;for(var ae=K.listSelections(),T=[],M=K.getOption("autoCloseTags"),ie=0;ie<ae.length;ie++){if(!ae[ie].empty())return U.Pass;var Y=ae[ie].head,B=K.getTokenAt(Y),j=U.innerMode(K.getMode(),B.state),D=j.state,J=j.mode.xmlCurrentTag&&j.mode.xmlCurrentTag(D),$=J&&J.name;if(!$)return U.Pass;var Te=j.mode.configuration=="html",Ue=typeof M=="object"&&M.dontCloseTags||Te&&Me,oe=typeof M=="object"&&M.indentTags||Te&ⅇB.end>Y.ch&&($=$.slice(0,$.length-B.end+Y.ch));var te=$.toLowerCase();if(!$||B.type=="string"&&(B.end!=Y.ch||!/[\"\']/.test(B.string.charAt(B.string.length-1))||B.string.length==1)||B.type=="tag"&&J.close||B.string.indexOf("/")==Y.ch-B.start-1||Ue&&O(Ue,te)>-1||X(K,j.mode.xmlCurrentContext&&j.mode.xmlCurrentContext(D)||[],$,Y,!0))return U.Pass;var me=typeof M=="object"&&M.emptyTags;if(me&&O(me,$)>-1){T[ie]={text:"/>",newPos:U.Pos(Y.line,Y.ch+2)};continue}var q=oe&&O(oe,te)>-1;T[ie]={indent:q,text:">"+(q?`
|
|
|
|
`:"")+"</"+$+">",newPos:q?U.Pos(Y.line+1,0):U.Pos(Y.line,Y.ch+1)}}for(var se=typeof M=="object"&&M.dontIndentOnAutoClose,ie=ae.length-1;ie>=0;ie--){var Se=T[ie];K.replaceRange(Se.text,ae[ie].head,ae[ie].anchor,"+insert");var re=K.listSelections().slice(0);re[ie]={head:Se.newPos,anchor:Se.newPos},K.setSelections(re),!se&&Se.indent&&(K.indentLine(Se.newPos.line,null,!0),K.indentLine(Se.newPos.line+1,null,!0))}}function ue(K,ae){for(var T=K.listSelections(),M=[],ie=ae?"/":"</",Y=K.getOption("autoCloseTags"),B=typeof Y=="object"&&Y.dontIndentOnSlash,j=0;j<T.length;j++){if(!T[j].empty())return U.Pass;var D=T[j].head,J=K.getTokenAt(D),$=U.innerMode(K.getMode(),J.state),Te=$.state;if(ae&&(J.type=="string"||J.string.charAt(0)!="<"||J.start!=D.ch-1))return U.Pass;var Ue,oe=$.mode.name!="xml"&&K.getMode().name=="htmlmixed";if(oe&&$.mode.name=="javascript")Ue=ie+"script";else if(oe&&$.mode.name=="css")Ue=ie+"style";else{var te=$.mode.xmlCurrentContext&&$.mode.xmlCurrentContext(Te);if(!te||te.length&&X(K,te,te[te.length-1],D))return U.Pass;Ue=ie+te[te.length-1]}K.getLine(D.line).charAt(J.end)!=">"&&(Ue+=">"),M[j]=Ue}if(K.replaceSelections(M),T=K.listSelections(),!B)for(var j=0;j<T.length;j++)(j==T.length-1||T[j].head.line<T[j+1].head.line)&&K.indentLine(T[j].head.line)}function he(K){return K.getOption("disableInput")?U.Pass:ue(K,!0)}U.commands.closeTag=function(K){return ue(K)};function O(K,ae){if(K.indexOf)return K.indexOf(ae);for(var T=0,M=K.length;T<M;++T)if(K[T]==ae)return T;return-1}function X(K,ae,T,M,ie){if(!U.scanForClosingTag)return!1;var Y=Math.min(K.lastLine()+1,M.line+500),B=U.scanForClosingTag(K,M,null,Y);if(!B||B.tag!=T)return!1;for(var j=ie?1:0,D=ae.length-1;D>=0&&ae[D]==T;D--)++j;M=B.to;for(var D=1;D<j;D++){var J=U.scanForClosingTag(K,M,null,Y);if(!J||J.tag!=T)return!1;M=J.to}return!0}})},BjJ7:function(xt,Xe,b){"use strict";b.d(Xe,"d",function(){return Me}),b.d(Xe,"c",function(){return ee}),b.d(Xe,"e",function(){return pe}),b.d(Xe,"b",function(){return ue}),b.d(Xe,"a",function(){return O});var U=b("m3rI");function Me(X){var K=!0;if(X.length>0){for(var ae=0;ae<X.length;ae++)if(X[ae].compile_success==0||!X[ae].compile_success){K=!1;break}}else K=!1;return K}function ee(X){for(var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",ae=[],T=0;T<X.length;T++){var M=X[T],ie=K?"".concat(K,"/").concat(M.name):"".concat(M.name);ae.push({title:M.name,isLeaf:!(M.type==="tree"),key:ie})}return ae}function pe(X,K,ae){for(var T=0;T<X.length;T++){var M=X[T];if(M.key===K){M.children=ae;break}M.children&&pe(M.children,K,ae)}return X}function ue(X,K,ae){var T;return function(){var M=this,ie=arguments,Y=function(){T=null,ae||X.apply(M,ie)},B=ae&&!T;clearTimeout(T),T=setTimeout(Y,K),B&&X.apply(M,ie)}}var he=!0,O=U.a.API_SERVER},"C+DQ":function(xt,Xe,b){},DlQD:function(xt,Xe,b){(function(U,Me){xt.exports=Me()})(this,function(){"use strict";function U(N,A){for(var P=0;P<A.length;P++){var v=A[P];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(N,v.key,v)}}function Me(N,A,P){return A&&U(N.prototype,A),P&&U(N,P),N}function ee(N,A){if(!N)return;if(typeof N=="string")return pe(N,A);var P=Object.prototype.toString.call(N).slice(8,-1);if(P==="Object"&&N.constructor&&(P=N.constructor.name),P==="Map"||P==="Set")return Array.from(N);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return pe(N,A)}function pe(N,A){(A==null||A>N.length)&&(A=N.length);for(var P=0,v=new Array(A);P<A;P++)v[P]=N[P];return v}function ue(N,A){var P;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(P=ee(N))||A&&N&&typeof N.length=="number"){P&&(N=P);var v=0;return function(){return v>=N.length?{done:!0}:{done:!1,value:N[v++]}}}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 P=N[Symbol.iterator](),P.next.bind(P)}function he(N,A){return A={exports:{}},N(A,A.exports),A.exports}var O=he(function(N){function A(){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 P(v){N.exports.defaults=v}N.exports={defaults:A(),getDefaults:A,changeDefaults:P}}),X=O.defaults,K=O.getDefaults,ae=O.changeDefaults,T=/[&<>"']/,M=/[&<>"']/g,ie=/[<>"']|&(?!#?\w+;)/,Y=/[<>"']|&(?!#?\w+;)/g,B={"&":"&","<":"<",">":">",'"':""","'":"'"},j=function(A){return B[A]};function D(N,A){if(A){if(T.test(N))return N.replace(M,j)}else if(ie.test(N))return N.replace(Y,j);return N}var J=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function $(N){return N.replace(J,function(A,P){return P=P.toLowerCase(),P==="colon"?":":P.charAt(0)==="#"?P.charAt(1)==="x"?String.fromCharCode(parseInt(P.substring(2),16)):String.fromCharCode(+P.substring(1)):""})}var Te=/(^|[^\[])\^/g;function Ue(N,A){N=N.source||N,A=A||"";var P={replace:function(y,x){return x=x.source||x,x=x.replace(Te,"$1"),N=N.replace(y,x),P},getRegex:function(){return new RegExp(N,A)}};return P}var oe=/[^\w:]/g,te=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function me(N,A,P){if(N){var v;try{v=decodeURIComponent($(P)).replace(oe,"").toLowerCase()}catch(y){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}A&&!te.test(P)&&(P=C(A,P));try{P=encodeURI(P).replace(/%25/g,"%")}catch(y){return null}return P}var q={},se=/^[^:]+:\/*[^/]*$/,Se=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C(N,A){q[" "+N]||(se.test(N)?q[" "+N]=N+"/":q[" "+N]=ne(N,"/",!0)),N=q[" "+N];var P=N.indexOf(":")===-1;return A.substring(0,2)==="//"?P?A:N.replace(Se,"$1")+A:A.charAt(0)==="/"?P?A:N.replace(re,"$1")+A:N+A}var Z={exec:function(){}};function W(N){for(var A=1,P,v;A<arguments.length;A++){P=arguments[A];for(v in P)Object.prototype.hasOwnProperty.call(P,v)&&(N[v]=P[v])}return N}function k(N,A){var P=N.replace(/\|/g,function(x,S,V){for(var I=!1,ye=S;--ye>=0&&V[ye]==="\\";)I=!I;return I?"|":" |"}),v=P.split(/ \|/),y=0;if(v.length>A)v.splice(A);else for(;v.length<A;)v.push("");for(;y<v.length;y++)v[y]=v[y].trim().replace(/\\\|/g,"|");return v}function ne(N,A,P){var v=N.length;if(v===0)return"";for(var y=0;y<v;){var x=N.charAt(v-y-1);if(x===A&&!P)y++;else if(x!==A&&P)y++;else break}return N.substr(0,v-y)}function ge(N,A){if(N.indexOf(A[1])===-1)return-1;for(var P=N.length,v=0,y=0;y<P;y++)if(N[y]==="\\")y++;else if(N[y]===A[0])v++;else if(N[y]===A[1]&&(v--,v<0))return y;return-1}function Q(N){N&&N.sanitize&&!N.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 Pe={escape:D,unescape:$,edit:Ue,cleanUrl:me,resolveUrl:C,noopTest:Z,merge:W,splitCells:k,rtrim:ne,findClosingBracket:ge,checkSanitizeDeprecation:Q},w=O.defaults,g=Pe.rtrim,H=Pe.splitCells,be=Pe.escape,Ce=Pe.findClosingBracket;function Ke(N,A,P){var v=A.href,y=A.title?be(A.title):null,x=N[1].replace(/\\([\[\]])/g,"$1");return N[0].charAt(0)!=="!"?{type:"link",raw:P,href:v,title:y,text:x}:{type:"image",raw:P,href:v,title:y,text:be(x)}}function Ye(N,A){var P=N.match(/^(\s+)(?:```)/);if(P===null)return A;var v=P[1];return A.split(`
|
|
`).map(function(y){var x=y.match(/^\s+/);if(x===null)return y;var S=x[0];return S.length>=v.length?y.slice(v.length):y}).join(`
|
|
`)}var Le=function(){function N(P){this.options=P||w}var A=N.prototype;return A.space=function(v){var y=this.rules.block.newline.exec(v);if(y)return y[0].length>1?{type:"space",raw:y[0]}:{raw:`
|
|
`}},A.code=function(v,y){var x=this.rules.block.code.exec(v);if(x){var S=y[y.length-1];if(S&&S.type==="paragraph")return{raw:x[0],text:x[0].trimRight()};var V=x[0].replace(/^ {4}/gm,"");return{type:"code",raw:x[0],codeBlockStyle:"indented",text:this.options.pedantic?V:g(V,`
|
|
`)}}},A.fences=function(v){var y=this.rules.block.fences.exec(v);if(y){var x=y[0],S=Ye(x,y[3]||"");return{type:"code",raw:x,lang:y[2]?y[2].trim():y[2],text:S}}},A.heading=function(v){var y=this.rules.block.heading.exec(v);if(y)return{type:"heading",raw:y[0],depth:y[1].length,text:y[2]}},A.nptable=function(v){var y=this.rules.block.nptable.exec(v);if(y){var x={type:"table",header:H(y[1].replace(/^ *| *\| *$/g,"")),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:y[3]?y[3].replace(/\n$/,"").split(`
|
|
`):[],raw:y[0]};if(x.header.length===x.align.length){var S=x.align.length,V;for(V=0;V<S;V++)/^ *-+: *$/.test(x.align[V])?x.align[V]="right":/^ *:-+: *$/.test(x.align[V])?x.align[V]="center":/^ *:-+ *$/.test(x.align[V])?x.align[V]="left":x.align[V]=null;for(S=x.cells.length,V=0;V<S;V++)x.cells[V]=H(x.cells[V],x.header.length);return x}}},A.hr=function(v){var y=this.rules.block.hr.exec(v);if(y)return{type:"hr",raw:y[0]}},A.blockquote=function(v){var y=this.rules.block.blockquote.exec(v);if(y){var x=y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:y[0],text:x}}},A.list=function(v){var y=this.rules.block.list.exec(v);if(y){for(var x=y[0],S=y[2],V=S.length>1,I=S[S.length-1]===")",ye={type:"list",raw:x,ordered:V,start:V?+S.slice(0,-1):"",loose:!1,items:[]},Ve=y[0].match(this.rules.block.item),ut=!1,nt,Mt,_t,st,Xt,Lt,Ct,St=Ve.length,ht=0;ht<St;ht++)nt=Ve[ht],x=nt,Mt=nt.length,nt=nt.replace(/^ *([*+-]|\d+[.)]) */,""),~nt.indexOf(`
|
|
`)&&(Mt-=nt.length,nt=this.options.pedantic?nt.replace(/^ {1,4}/gm,""):nt.replace(new RegExp("^ {1,"+Mt+"}","gm"),"")),ht!==St-1&&(_t=this.rules.block.bullet.exec(Ve[ht+1])[0],(V?_t.length===1||!I&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==S)&&(st=Ve.slice(ht+1).join(`
|
|
`),ye.raw=ye.raw.substring(0,ye.raw.length-st.length),ht=St-1)),Xt=ut||/\n\n(?!\s*$)/.test(nt),ht!==St-1&&(ut=nt.charAt(nt.length-1)===`
|
|
`,Xt||(Xt=ut)),Xt&&(ye.loose=!0),Lt=/^\[[ xX]\] /.test(nt),Ct=void 0,Lt&&(Ct=nt[1]!==" ",nt=nt.replace(/^\[[ xX]\] +/,"")),ye.items.push({type:"list_item",raw:x,task:Lt,checked:Ct,loose:Xt,text:nt});return ye}},A.html=function(v){var y=this.rules.block.html.exec(v);if(y)return{type:this.options.sanitize?"paragraph":"html",raw:y[0],pre:!this.options.sanitizer&&(y[1]==="pre"||y[1]==="script"||y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(y[0]):be(y[0]):y[0]}},A.def=function(v){var y=this.rules.block.def.exec(v);if(y){y[3]&&(y[3]=y[3].substring(1,y[3].length-1));var x=y[1].toLowerCase().replace(/\s+/g," ");return{tag:x,raw:y[0],href:y[2],title:y[3]}}},A.table=function(v){var y=this.rules.block.table.exec(v);if(y){var x={type:"table",header:H(y[1].replace(/^ *| *\| *$/g,"")),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:y[3]?y[3].replace(/\n$/,"").split(`
|
|
`):[]};if(x.header.length===x.align.length){x.raw=y[0];var S=x.align.length,V;for(V=0;V<S;V++)/^ *-+: *$/.test(x.align[V])?x.align[V]="right":/^ *:-+: *$/.test(x.align[V])?x.align[V]="center":/^ *:-+ *$/.test(x.align[V])?x.align[V]="left":x.align[V]=null;for(S=x.cells.length,V=0;V<S;V++)x.cells[V]=H(x.cells[V].replace(/^ *\| *| *\| *$/g,""),x.header.length);return x}}},A.lheading=function(v){var y=this.rules.block.lheading.exec(v);if(y)return{type:"heading",raw:y[0],depth:y[2].charAt(0)==="="?1:2,text:y[1]}},A.paragraph=function(v){var y=this.rules.block.paragraph.exec(v);if(y)return{type:"paragraph",raw:y[0],text:y[1].charAt(y[1].length-1)===`
|
|
`?y[1].slice(0,-1):y[1]}},A.text=function(v,y){var x=this.rules.block.text.exec(v);if(x){var S=y[y.length-1];return S&&S.type==="text"?{raw:x[0],text:x[0]}:{type:"text",raw:x[0],text:x[0]}}},A.escape=function(v){var y=this.rules.inline.escape.exec(v);if(y)return{type:"escape",raw:y[0],text:be(y[1])}},A.tag=function(v,y,x){var S=this.rules.inline.tag.exec(v);if(S)return!y&&/^<a /i.test(S[0])?y=!0:y&&/^<\/a>/i.test(S[0])&&(y=!1),!x&&/^<(pre|code|kbd|script)(\s|>)/i.test(S[0])?x=!0:x&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(S[0])&&(x=!1),{type:this.options.sanitize?"text":"html",raw:S[0],inLink:y,inRawBlock:x,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):be(S[0]):S[0]}},A.link=function(v){var y=this.rules.inline.link.exec(v);if(y){var x=Ce(y[2],"()");if(x>-1){var S=y[0].indexOf("!")===0?5:4,V=S+y[1].length+x;y[2]=y[2].substring(0,x),y[0]=y[0].substring(0,V).trim(),y[3]=""}var I=y[2],ye="";if(this.options.pedantic){var Ve=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(I);Ve?(I=Ve[1],ye=Ve[3]):ye=""}else ye=y[3]?y[3].slice(1,-1):"";I=I.trim().replace(/^<([\s\S]*)>$/,"$1");var ut=Ke(y,{href:I&&I.replace(this.rules.inline._escapes,"$1"),title:ye&&ye.replace(this.rules.inline._escapes,"$1")},y[0]);return ut}},A.reflink=function(v,y){var x;if((x=this.rules.inline.reflink.exec(v))||(x=this.rules.inline.nolink.exec(v))){var S=(x[2]||x[1]).replace(/\s+/g," ");if(S=y[S.toLowerCase()],!S||!S.href){var V=x[0].charAt(0);return{type:"text",raw:V,text:V}}var I=Ke(x,S,x[0]);return I}},A.strong=function(v,y,x){x===void 0&&(x="");var S=this.rules.inline.strong.start.exec(v);if(S&&(!S[1]||S[1]&&(x===""||this.rules.inline.punctuation.exec(x)))){y=y.slice(-1*v.length);var V=S[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;V.lastIndex=0;for(var I;(S=V.exec(y))!=null;)if(I=this.rules.inline.strong.middle.exec(y.slice(0,S.index+3)),I)return{type:"strong",raw:v.slice(0,I[0].length),text:v.slice(2,I[0].length-2)}}},A.em=function(v,y,x){x===void 0&&(x="");var S=this.rules.inline.em.start.exec(v);if(S&&(!S[1]||S[1]&&(x===""||this.rules.inline.punctuation.exec(x)))){y=y.slice(-1*v.length);var V=S[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;V.lastIndex=0;for(var I;(S=V.exec(y))!=null;)if(I=this.rules.inline.em.middle.exec(y.slice(0,S.index+2)),I)return{type:"em",raw:v.slice(0,I[0].length),text:v.slice(1,I[0].length-1)}}},A.codespan=function(v){var y=this.rules.inline.code.exec(v);if(y){var x=y[2].replace(/\n/g," "),S=/[^ ]/.test(x),V=x.startsWith(" ")&&x.endsWith(" ");return S&&V&&(x=x.substring(1,x.length-1)),x=be(x,!0),{type:"codespan",raw:y[0],text:x}}},A.br=function(v){var y=this.rules.inline.br.exec(v);if(y)return{type:"br",raw:y[0]}},A.del=function(v){var y=this.rules.inline.del.exec(v);if(y)return{type:"del",raw:y[0],text:y[1]}},A.autolink=function(v,y){var x=this.rules.inline.autolink.exec(v);if(x){var S,V;return x[2]==="@"?(S=be(this.options.mangle?y(x[1]):x[1]),V="mailto:"+S):(S=be(x[1]),V=S),{type:"link",raw:x[0],text:S,href:V,tokens:[{type:"text",raw:S,text:S}]}}},A.url=function(v,y){var x;if(x=this.rules.inline.url.exec(v)){var S,V;if(x[2]==="@")S=be(this.options.mangle?y(x[0]):x[0]),V="mailto:"+S;else{var I;do I=x[0],x[0]=this.rules.inline._backpedal.exec(x[0])[0];while(I!==x[0]);S=be(x[0]),x[1]==="www."?V="http://"+S:V=S}return{type:"link",raw:x[0],text:S,href:V,tokens:[{type:"text",raw:S,text:S}]}}},A.inlineText=function(v,y,x){var S=this.rules.inline.text.exec(v);if(S){var V;return y?V=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):be(S[0]):S[0]:V=be(this.options.smartypants?x(S[0]):S[0]),{type:"text",raw:S[0],text:V}}},N}(),ke=Pe.noopTest,ve=Pe.edit,Ee=Pe.merge,z={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\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:ke,table:ke,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};z._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,z._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,z.def=ve(z.def).replace("label",z._label).replace("title",z._title).getRegex(),z.bullet=/(?:[*+-]|\d{1,9}[.)])/,z.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,z.item=ve(z.item,"gm").replace(/bull/g,z.bullet).getRegex(),z.list=ve(z.list).replace(/bull/g,z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+z.def.source+")").getRegex(),z._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",z._comment=/<!--(?!-?>)[\s\S]*?-->/,z.html=ve(z.html,"i").replace("comment",z._comment).replace("tag",z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),z.paragraph=ve(z._paragraph).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.blockquote=ve(z.blockquote).replace("paragraph",z.paragraph).getRegex(),z.normal=Ee({},z),z.gfm=Ee({},z.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),z.gfm.nptable=ve(z.gfm.nptable).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.gfm.table=ve(z.gfm.table).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.pedantic=Ee({},z.normal,{html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",z._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ke,paragraph:ve(z.normal._paragraph).replace("hr",z.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var R={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ke,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:ke,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};R._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",R.punctuation=ve(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",R._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",R.em.start=ve(R.em.start).replace(/punctuation/g,R._punctuation).getRegex(),R.em.middle=ve(R.em.middle).replace(/punctuation/g,R._punctuation).replace(/overlapSkip/g,R._overlapSkip).getRegex(),R.em.endAst=ve(R.em.endAst,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.em.endUnd=ve(R.em.endUnd,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.strong.start=ve(R.strong.start).replace(/punctuation/g,R._punctuation).getRegex(),R.strong.middle=ve(R.strong.middle).replace(/punctuation/g,R._punctuation).replace(/blockSkip/g,R._blockSkip).getRegex(),R.strong.endAst=ve(R.strong.endAst,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.strong.endUnd=ve(R.strong.endUnd,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=ve(R._blockSkip,"g").getRegex(),R.overlapSkip=ve(R._overlapSkip,"g").getRegex(),R._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,R._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,R._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])?)+(?![-_])/,R.autolink=ve(R.autolink).replace("scheme",R._scheme).replace("email",R._email).getRegex(),R._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,R.tag=ve(R.tag).replace("comment",z._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=ve(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=ve(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=ve(R.reflinkSearch,"g").replace("reflink",R.reflink).replace("nolink",R.nolink).getRegex(),R.normal=Ee({},R),R.pedantic=Ee({},R.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:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=Ee({},R.normal,{escape:ve(R.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),R.gfm.url=ve(R.gfm.url,"i").replace("email",R.gfm._extended_email).getRegex(),R.breaks=Ee({},R.gfm,{br:ve(R.br).replace("{2,}","*").getRegex(),text:ve(R.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Be={block:z,inline:R},$e=O.defaults,ft=Be.block,rt=Be.inline;function Ge(N){return N.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 de(N){var A="",P,v,y=N.length;for(P=0;P<y;P++)v=N.charCodeAt(P),Math.random()>.5&&(v="x"+v.toString(16)),A+="&#"+v+";";return A}var Re=function(){function N(P){this.tokens=[],this.tokens.links=Object.create(null),this.options=P||$e,this.options.tokenizer=this.options.tokenizer||new Le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var v={block:ft.normal,inline:rt.normal};this.options.pedantic?(v.block=ft.pedantic,v.inline=rt.pedantic):this.options.gfm&&(v.block=ft.gfm,this.options.breaks?v.inline=rt.breaks:v.inline=rt.gfm),this.tokenizer.rules=v}N.lex=function(v,y){var x=new N(y);return x.lex(v)};var A=N.prototype;return A.lex=function(v){return v=v.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(v,this.tokens,!0),this.inline(this.tokens),this.tokens},A.blockTokens=function(v,y,x){y===void 0&&(y=[]),x===void 0&&(x=!0),v=v.replace(/^ +$/gm,"");for(var S,V,I,ye;v;){if(S=this.tokenizer.space(v)){v=v.substring(S.raw.length),S.type&&y.push(S);continue}if(S=this.tokenizer.code(v,y)){v=v.substring(S.raw.length),S.type?y.push(S):(ye=y[y.length-1],ye.raw+=`
|
|
`+S.raw,ye.text+=`
|
|
`+S.text);continue}if(S=this.tokenizer.fences(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.heading(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.nptable(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.hr(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.blockquote(v)){v=v.substring(S.raw.length),S.tokens=this.blockTokens(S.text,[],x),y.push(S);continue}if(S=this.tokenizer.list(v)){for(v=v.substring(S.raw.length),I=S.items.length,V=0;V<I;V++)S.items[V].tokens=this.blockTokens(S.items[V].text,[],!1);y.push(S);continue}if(S=this.tokenizer.html(v)){v=v.substring(S.raw.length),y.push(S);continue}if(x&&(S=this.tokenizer.def(v))){v=v.substring(S.raw.length),this.tokens.links[S.tag]||(this.tokens.links[S.tag]={href:S.href,title:S.title});continue}if(S=this.tokenizer.table(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.lheading(v)){v=v.substring(S.raw.length),y.push(S);continue}if(x&&(S=this.tokenizer.paragraph(v))){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.text(v,y)){v=v.substring(S.raw.length),S.type?y.push(S):(ye=y[y.length-1],ye.raw+=`
|
|
`+S.raw,ye.text+=`
|
|
`+S.text);continue}if(v){var Ve="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(Ve);break}else throw new Error(Ve)}}return y},A.inline=function(v){var y,x,S,V,I,ye,Ve=v.length;for(y=0;y<Ve;y++){ye=v[y];switch(ye.type){case"paragraph":case"text":case"heading":{ye.tokens=[],this.inlineTokens(ye.text,ye.tokens);break}case"table":{for(ye.tokens={header:[],cells:[]},V=ye.header.length,x=0;x<V;x++)ye.tokens.header[x]=[],this.inlineTokens(ye.header[x],ye.tokens.header[x]);for(V=ye.cells.length,x=0;x<V;x++)for(I=ye.cells[x],ye.tokens.cells[x]=[],S=0;S<I.length;S++)ye.tokens.cells[x][S]=[],this.inlineTokens(I[S],ye.tokens.cells[x][S]);break}case"blockquote":{this.inline(ye.tokens);break}case"list":{for(V=ye.items.length,x=0;x<V;x++)this.inline(ye.items[x].tokens);break}}}return v},A.inlineTokens=function(v,y,x,S,V){y===void 0&&(y=[]),x===void 0&&(x=!1),S===void 0&&(S=!1),V===void 0&&(V="");var I,ye=v,Ve;if(this.tokens.links){var ut=Object.keys(this.tokens.links);if(ut.length>0)for(;(Ve=this.tokenizer.rules.inline.reflinkSearch.exec(ye))!=null;)ut.includes(Ve[0].slice(Ve[0].lastIndexOf("[")+1,-1))&&(ye=ye.slice(0,Ve.index)+"["+"a".repeat(Ve[0].length-2)+"]"+ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ve=this.tokenizer.rules.inline.blockSkip.exec(ye))!=null;)ye=ye.slice(0,Ve.index)+"["+"a".repeat(Ve[0].length-2)+"]"+ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;v;){if(I=this.tokenizer.escape(v)){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.tag(v,x,S)){v=v.substring(I.raw.length),x=I.inLink,S=I.inRawBlock,y.push(I);continue}if(I=this.tokenizer.link(v)){v=v.substring(I.raw.length),I.type==="link"&&(I.tokens=this.inlineTokens(I.text,[],!0,S)),y.push(I);continue}if(I=this.tokenizer.reflink(v,this.tokens.links)){v=v.substring(I.raw.length),I.type==="link"&&(I.tokens=this.inlineTokens(I.text,[],!0,S)),y.push(I);continue}if(I=this.tokenizer.strong(v,ye,V)){v=v.substring(I.raw.length),I.tokens=this.inlineTokens(I.text,[],x,S),y.push(I);continue}if(I=this.tokenizer.em(v,ye,V)){v=v.substring(I.raw.length),I.tokens=this.inlineTokens(I.text,[],x,S),y.push(I);continue}if(I=this.tokenizer.codespan(v)){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.br(v)){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.del(v)){v=v.substring(I.raw.length),I.tokens=this.inlineTokens(I.text,[],x,S),y.push(I);continue}if(I=this.tokenizer.autolink(v,de)){v=v.substring(I.raw.length),y.push(I);continue}if(!x&&(I=this.tokenizer.url(v,de))){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.inlineText(v,S,Ge)){v=v.substring(I.raw.length),V=I.raw.slice(-1),y.push(I);continue}if(v){var nt="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return y},Me(N,null,[{key:"rules",get:function(){return{block:ft,inline:rt}}}]),N}(),je=O.defaults,Je=Pe.cleanUrl,We=Pe.escape,Oe=function(){function N(P){this.options=P||je}var A=N.prototype;return A.code=function(v,y,x){var S=(y||"").match(/\S*/)[0];if(this.options.highlight){var V=this.options.highlight(v,S);V!=null&&V!==v&&(x=!0,v=V)}return S?'<pre><code class="'+this.options.langPrefix+We(S,!0)+'">'+(x?v:We(v,!0))+`</code></pre>
|
|
`:"<pre><code>"+(x?v:We(v,!0))+`</code></pre>
|
|
`},A.blockquote=function(v){return`<blockquote>
|
|
`+v+`</blockquote>
|
|
`},A.html=function(v){return v},A.heading=function(v,y,x,S){return this.options.headerIds?"<h"+y+' id="'+this.options.headerPrefix+S.slug(x)+'">'+v+"</h"+y+`>
|
|
`:"<h"+y+">"+v+"</h"+y+`>
|
|
`},A.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},A.list=function(v,y,x){var S=y?"ol":"ul",V=y&&x!==1?' start="'+x+'"':"";return"<"+S+V+`>
|
|
`+v+"</"+S+`>
|
|
`},A.listitem=function(v){return"<li>"+v+`</li>
|
|
`},A.checkbox=function(v){return"<input "+(v?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},A.paragraph=function(v){return"<p>"+v+`</p>
|
|
`},A.table=function(v,y){return y&&(y="<tbody>"+y+"</tbody>"),`<table>
|
|
<thead>
|
|
`+v+`</thead>
|
|
`+y+`</table>
|
|
`},A.tablerow=function(v){return`<tr>
|
|
`+v+`</tr>
|
|
`},A.tablecell=function(v,y){var x=y.header?"th":"td",S=y.align?"<"+x+' align="'+y.align+'">':"<"+x+">";return S+v+"</"+x+`>
|
|
`},A.strong=function(v){return"<strong>"+v+"</strong>"},A.em=function(v){return"<em>"+v+"</em>"},A.codespan=function(v){return"<code>"+v+"</code>"},A.br=function(){return this.options.xhtml?"<br/>":"<br>"},A.del=function(v){return"<del>"+v+"</del>"},A.link=function(v,y,x){if(v=Je(this.options.sanitize,this.options.baseUrl,v),v===null)return x;var S='<a href="'+We(v)+'"';return y&&(S+=' title="'+y+'"'),S+=">"+x+"</a>",S},A.image=function(v,y,x){if(v=Je(this.options.sanitize,this.options.baseUrl,v),v===null)return x;var S='<img src="'+v+'" alt="'+x+'"';return y&&(S+=' title="'+y+'"'),S+=this.options.xhtml?"/>":">",S},A.text=function(v){return v},N}(),Ie=function(){function N(){}var A=N.prototype;return A.strong=function(v){return v},A.em=function(v){return v},A.codespan=function(v){return v},A.del=function(v){return v},A.html=function(v){return v},A.text=function(v){return v},A.link=function(v,y,x){return""+x},A.image=function(v,y,x){return""+x},A.br=function(){return""},N}(),pt=function(){function N(){this.seen={}}var A=N.prototype;return A.slug=function(v){var y=v.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(y)){var x=y;do this.seen[x]++,y=x+"-"+this.seen[x];while(this.seen.hasOwnProperty(y))}return this.seen[y]=0,y},N}(),qe=O.defaults,Qe=Pe.unescape,et=function(){function N(P){this.options=P||qe,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new pt}N.parse=function(v,y){var x=new N(y);return x.parse(v)};var A=N.prototype;return A.parse=function(v,y){y===void 0&&(y=!0);var x="",S,V,I,ye,Ve,ut,nt,Mt,_t,st,Xt,Lt,Ct,St,ht,pi,qt,mt,wi=v.length;for(S=0;S<wi;S++){st=v[S];switch(st.type){case"space":continue;case"hr":{x+=this.renderer.hr();continue}case"heading":{x+=this.renderer.heading(this.parseInline(st.tokens),st.depth,Qe(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{x+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(Mt="",nt="",ye=st.header.length,V=0;V<ye;V++)nt+=this.renderer.tablecell(this.parseInline(st.tokens.header[V]),{header:!0,align:st.align[V]});for(Mt+=this.renderer.tablerow(nt),_t="",ye=st.cells.length,V=0;V<ye;V++){for(ut=st.tokens.cells[V],nt="",Ve=ut.length,I=0;I<Ve;I++)nt+=this.renderer.tablecell(this.parseInline(ut[I]),{header:!1,align:st.align[I]});_t+=this.renderer.tablerow(nt)}x+=this.renderer.table(Mt,_t);continue}case"blockquote":{_t=this.parse(st.tokens),x+=this.renderer.blockquote(_t);continue}case"list":{for(Xt=st.ordered,Lt=st.start,Ct=st.loose,ye=st.items.length,_t="",V=0;V<ye;V++)ht=st.items[V],pi=ht.checked,qt=ht.task,St="",ht.task&&(mt=this.renderer.checkbox(pi),Ct?ht.tokens.length>0&&ht.tokens[0].type==="text"?(ht.tokens[0].text=mt+" "+ht.tokens[0].text,ht.tokens[0].tokens&&ht.tokens[0].tokens.length>0&&ht.tokens[0].tokens[0].type==="text"&&(ht.tokens[0].tokens[0].text=mt+" "+ht.tokens[0].tokens[0].text)):ht.tokens.unshift({type:"text",text:mt}):St+=mt),St+=this.parse(ht.tokens,Ct),_t+=this.renderer.listitem(St,qt,pi);x+=this.renderer.list(_t,Xt,Lt);continue}case"html":{x+=this.renderer.html(st.text);continue}case"paragraph":{x+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(_t=st.tokens?this.parseInline(st.tokens):st.text;S+1<wi&&v[S+1].type==="text";)st=v[++S],_t+=`
|
|
`+(st.tokens?this.parseInline(st.tokens):st.text);x+=y?this.renderer.paragraph(_t):_t;continue}default:{var ii='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(ii);return}else throw new Error(ii)}}}return x},A.parseInline=function(v,y){y=y||this.renderer;var x="",S,V,I=v.length;for(S=0;S<I;S++){V=v[S];switch(V.type){case"escape":{x+=y.text(V.text);break}case"html":{x+=y.html(V.text);break}case"link":{x+=y.link(V.href,V.title,this.parseInline(V.tokens,y));break}case"image":{x+=y.image(V.href,V.title,V.text);break}case"strong":{x+=y.strong(this.parseInline(V.tokens,y));break}case"em":{x+=y.em(this.parseInline(V.tokens,y));break}case"codespan":{x+=y.codespan(V.text);break}case"br":{x+=y.br();break}case"del":{x+=y.del(this.parseInline(V.tokens,y));break}case"text":{x+=y.text(V.text);break}default:{var ye='Token with "'+V.type+'" type was not found.';if(this.options.silent){console.error(ye);return}else throw new Error(ye)}}}return x},N}(),yt=Pe.merge,lt=Pe.checkSanitizeDeprecation,tt=Pe.escape,le=O.getDefaults,gt=O.changeDefaults,it=O.defaults;function fe(N,A,P){if(typeof N=="undefined"||N===null)throw new Error("marked(): input parameter is undefined or null");if(typeof N!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(N)+", string expected");if(typeof A=="function"&&(P=A,A=null),A=yt({},fe.defaults,A||{}),lt(A),P){var v=A.highlight,y;try{y=Re.lex(N,A)}catch(I){return P(I)}var x=function(ye){var Ve;if(!ye)try{Ve=et.parse(y,A)}catch(ut){ye=ut}return A.highlight=v,ye?P(ye):P(null,Ve)};if(!v||v.length<3)return x();if(delete A.highlight,!y.length)return x();var S=0;fe.walkTokens(y,function(I){I.type==="code"&&(S++,setTimeout(function(){v(I.text,I.lang,function(ye,Ve){if(ye)return x(ye);Ve!=null&&Ve!==I.text&&(I.text=Ve,I.escaped=!0),S--,S===0&&x()})},0))}),S===0&&x();return}try{var V=Re.lex(N,A);return A.walkTokens&&fe.walkTokens(V,A.walkTokens),et.parse(V,A)}catch(I){if(I.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,A.silent)return"<p>An error occurred:</p><pre>"+tt(I.message+"",!0)+"</pre>";throw I}}fe.options=fe.setOptions=function(N){return yt(fe.defaults,N),gt(fe.defaults),fe},fe.getDefaults=le,fe.defaults=it,fe.use=function(N){var A=yt({},N);if(N.renderer&&function(){var v=fe.defaults.renderer||new Oe,y=function(V){var I=v[V];v[V]=function(){for(var ye=arguments.length,Ve=new Array(ye),ut=0;ut<ye;ut++)Ve[ut]=arguments[ut];var nt=N.renderer[V].apply(v,Ve);return nt===!1&&(nt=I.apply(v,Ve)),nt}};for(var x in N.renderer)y(x);A.renderer=v}(),N.tokenizer&&function(){var v=fe.defaults.tokenizer||new Le,y=function(V){var I=v[V];v[V]=function(){for(var ye=arguments.length,Ve=new Array(ye),ut=0;ut<ye;ut++)Ve[ut]=arguments[ut];var nt=N.tokenizer[V].apply(v,Ve);return nt===!1&&(nt=I.apply(v,Ve)),nt}};for(var x in N.tokenizer)y(x);A.tokenizer=v}(),N.walkTokens){var P=fe.defaults.walkTokens;A.walkTokens=function(v){N.walkTokens(v),P&&P(v)}}fe.setOptions(A)},fe.walkTokens=function(N,A){for(var P=ue(N),v;!(v=P()).done;){var y=v.value;A(y);switch(y.type){case"table":{for(var x=ue(y.tokens.header),S;!(S=x()).done;){var V=S.value;fe.walkTokens(V,A)}for(var I=ue(y.tokens.cells),ye;!(ye=I()).done;)for(var Ve=ye.value,ut=ue(Ve),nt;!(nt=ut()).done;){var Mt=nt.value;fe.walkTokens(Mt,A)}break}case"list":{fe.walkTokens(y.items,A);break}default:y.tokens&&fe.walkTokens(y.tokens,A)}}},fe.Parser=et,fe.parser=et.parse,fe.Renderer=Oe,fe.TextRenderer=Ie,fe.Lexer=Re,fe.lexer=Re.lex,fe.Tokenizer=Le,fe.Slugger=pt,fe.parse=fe;var De=fe;return De})},ELLl:function(xt,Xe,b){(function(U){U(b("VrN/"))})(function(U){var Me={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ee=U.Pos;U.defineOption("autoCloseBrackets",!1,function(B,j,D){D&&D!=U.Init&&(B.removeKeyMap(ue),B.state.closeBrackets=null),j&&(he(pe(j,"pairs")),B.state.closeBrackets=j,B.addKeyMap(ue))});function pe(B,j){return j=="pairs"&&typeof B=="string"?B:typeof B=="object"&&B[j]!=null?B[j]:Me[j]}var ue={Backspace:K,Enter:ae};function he(B){for(var j=0;j<B.length;j++){var D=B.charAt(j),J="'"+D+"'";ue[J]||(ue[J]=O(D))}}he(Me.pairs+"`");function O(B){return function(j){return M(j,B)}}function X(B){var j=B.state.closeBrackets;if(!j||j.override)return j;var D=B.getModeAt(B.getCursor());return D.closeBrackets||j}function K(B){var j=X(B);if(!j||B.getOption("disableInput"))return U.Pass;for(var D=pe(j,"pairs"),J=B.listSelections(),$=0;$<J.length;$++){if(!J[$].empty())return U.Pass;var Te=ie(B,J[$].head);if(!Te||D.indexOf(Te)%2!=0)return U.Pass}for(var $=J.length-1;$>=0;$--){var Ue=J[$].head;B.replaceRange("",ee(Ue.line,Ue.ch-1),ee(Ue.line,Ue.ch+1),"+delete")}}function ae(B){var j=X(B),D=j&&pe(j,"explode");if(!D||B.getOption("disableInput"))return U.Pass;for(var J=B.listSelections(),$=0;$<J.length;$++){if(!J[$].empty())return U.Pass;var Te=ie(B,J[$].head);if(!Te||D.indexOf(Te)%2!=0)return U.Pass}B.operation(function(){var Ue=B.lineSeparator()||`
|
|
`;B.replaceSelection(Ue+Ue,null),B.execCommand("goCharLeft"),J=B.listSelections();for(var oe=0;oe<J.length;oe++){var te=J[oe].head.line;B.indentLine(te,null,!0),B.indentLine(te+1,null,!0)}})}function T(B){var j=U.cmpPos(B.anchor,B.head)>0;return{anchor:new ee(B.anchor.line,B.anchor.ch+(j?-1:1)),head:new ee(B.head.line,B.head.ch+(j?1:-1))}}function M(B,j){var D=X(B);if(!D||B.getOption("disableInput"))return U.Pass;var J=pe(D,"pairs"),$=J.indexOf(j);if($==-1)return U.Pass;for(var Te=pe(D,"closeBefore"),Ue=pe(D,"triples"),oe=J.charAt($+1)==j,te=B.listSelections(),me=$%2==0,q,se=0;se<te.length;se++){var Se=te[se],re=Se.head,C,Z=B.getRange(re,ee(re.line,re.ch+1));if(me&&!Se.empty())C="surround";else if((oe||!me)&&Z==j)oe&&Y(B,re)?C="both":Ue.indexOf(j)>=0&&B.getRange(re,ee(re.line,re.ch+3))==j+j+j?C="skipThree":C="skip";else if(oe&&re.ch>1&&Ue.indexOf(j)>=0&&B.getRange(ee(re.line,re.ch-2),re)==j+j){if(re.ch>2&&/\bstring/.test(B.getTokenTypeAt(ee(re.line,re.ch-2))))return U.Pass;C="addFour"}else if(oe){var W=re.ch==0?" ":B.getRange(ee(re.line,re.ch-1),re);if(!U.isWordChar(Z)&&W!=j&&!U.isWordChar(W))C="both";else return U.Pass}else if(me&&(Z.length===0||/\s/.test(Z)||Te.indexOf(Z)>-1))C="both";else return U.Pass;if(!q)q=C;else if(q!=C)return U.Pass}var k=$%2?J.charAt($-1):j,ne=$%2?j:J.charAt($+1);B.operation(function(){if(q=="skip")B.execCommand("goCharRight");else if(q=="skipThree")for(var ge=0;ge<3;ge++)B.execCommand("goCharRight");else if(q=="surround"){for(var Q=B.getSelections(),ge=0;ge<Q.length;ge++)Q[ge]=k+Q[ge]+ne;B.replaceSelections(Q,"around"),Q=B.listSelections().slice();for(var ge=0;ge<Q.length;ge++)Q[ge]=T(Q[ge]);B.setSelections(Q)}else q=="both"?(B.replaceSelection(k+ne,null),B.triggerElectric(k+ne),B.execCommand("goCharLeft")):q=="addFour"&&(B.replaceSelection(k+k+k+k,"before"),B.execCommand("goCharRight"))})}function ie(B,j){var D=B.getRange(ee(j.line,j.ch-1),ee(j.line,j.ch+1));return D.length==2?D:null}function Y(B,j){var D=B.getTokenAt(ee(j.line,j.ch+1));return/\bstring/.test(D.type)&&D.start==j.ch&&(j.ch==0||!/\bstring/.test(B.getTokenTypeAt(j)))}})},F8wB:function(xt,Xe,b){xt.exports={loading:"loading___1SIOG"}},Gytx:function(xt,Xe){xt.exports=function(U,Me,ee,pe){var ue=ee?ee.call(pe,U,Me):void 0;if(ue!==void 0)return!!ue;if(U===Me)return!0;if(typeof U!="object"||!U||typeof Me!="object"||!Me)return!1;var he=Object.keys(U),O=Object.keys(Me);if(he.length!==O.length)return!1;for(var X=Object.prototype.hasOwnProperty.bind(Me),K=0;K<he.length;K++){var ae=he[K];if(!X(ae))return!1;var T=U[ae],M=Me[ae];if(ue=ee?ee.call(pe,T,M,ae):void 0,ue===!1||ue===void 0&&T!==M)return!1}return!0}},HV1I:function(xt,Xe,b){xt.exports={flex_box_center:"flex_box_center___1nEOe",flex_space_between:"flex_space_between___21gJ7",flex_box_vertical_center:"flex_box_vertical_center___2iHIq",flex_box_center_end:"flex_box_center_end___19LSZ",flex_box_column:"flex_box_column___2zG50",bg:"bg___u_uqy",formWrap:"formWrap___3rl8w"}},HmJG:function(xt,Xe,b){},LdHM:function(xt,Xe,b){"use strict";b.d(Xe,"b",function(){return Te}),b.d(Xe,"a",function(){return oe});var U=b("1OyB"),Me=b("vuIU"),ee=b("Ji7U"),pe=b("LK+K"),ue=b("q1tI"),he=b("rePB"),O=b("Ff2n"),X=b("ODXe"),K=b("4IlW"),ae=b("bX4T"),T=b("YrtM"),M=b("TSYQ"),ie=b.n(M),Y=b("+nKL"),B=b("8OUc"),j=function(H,be){var Ce=H.prefixCls,Ke=H.id,Ye=H.flattenOptions,Le=H.childrenAsData,ke=H.values,ve=H.searchValue,Ee=H.multiple,z=H.defaultActiveFirstOption,R=H.height,Be=H.itemHeight,$e=H.notFoundContent,ft=H.open,rt=H.menuItemSelectedIcon,Ge=H.virtual,de=H.onSelect,Re=H.onToggleOpen,je=H.onActiveValue,Je=H.onScroll,We=H.onMouseEnter,Oe="".concat(Ce,"-item"),Ie=Object(T.a)(function(){return Ye},[ft,Ye],function(De,N){return N[0]&&De[1]!==N[1]}),pt=ue.useRef(null),qe=function(N){N.preventDefault()},Qe=function(N){pt.current&&pt.current.scrollTo({index:N})},et=function(N){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=Ie.length,v=0;v<P;v+=1){var y=(N+v*A+P)%P,x=Ie[y],S=x.group,V=x.data;if(!S&&!V.disabled)return y}return-1},yt=ue.useState(function(){return et(0)}),lt=Object(X.a)(yt,2),tt=lt[0],le=lt[1],gt=function(N){le(N);var A=Ie[N];if(!A){je(null,-1);return}je(A.data.value,N)};ue.useEffect(function(){gt(z!==!1?et(0):-1)},[Ie.length,ve]),ue.useEffect(function(){var De=setTimeout(function(){if(!Ee&&ft&&ke.size===1){var N=Array.from(ke)[0],A=Ie.findIndex(function(P){var v=P.data;return v.value===N});gt(A),Qe(A)}});return function(){return clearTimeout(De)}},[ft]);var it=function(N){N!==void 0&&de(N,{selected:!ke.has(N)}),Ee||Re(!1)};if(ue.useImperativeHandle(be,function(){return{onKeyDown:function(N){var A=N.which;switch(A){case K.a.UP:case K.a.DOWN:{var P=0;if(A===K.a.UP?P=-1:A===K.a.DOWN&&(P=1),P!==0){var v=et(tt+P,P);Qe(v),gt(v)}break}case K.a.ENTER:{var y=Ie[tt];y&&!y.data.disabled?it(y.data.value):it(void 0),ft&&N.preventDefault();break}case K.a.ESC:Re(!1)}},onKeyUp:function(){},scrollTo:function(N){Qe(N)}}}),Ie.length===0)return ue.createElement("div",{role:"listbox",id:"".concat(Ke,"_list"),className:"".concat(Oe,"-empty"),onMouseDown:qe},$e);function fe(De){var N=Ie[De];if(!N)return null;var A=N.data||{},P=A.value,v=A.label,y=A.children,x=Object(ae.a)(A,!0),S=Le?y:v;return N?ue.createElement("div",Object.assign({"aria-label":typeof S=="string"?S:null},x,{key:De,role:"option",id:"".concat(Ke,"_list_").concat(De),"aria-selected":ke.has(P)}),P):null}return ue.createElement(ue.Fragment,null,ue.createElement("div",{role:"listbox",id:"".concat(Ke,"_list"),style:{height:0,width:0,overflow:"hidden"}},fe(tt-1),fe(tt),fe(tt+1)),ue.createElement(Y.a,{itemKey:"key",ref:pt,data:Ie,height:R,itemHeight:Be,fullHeight:!1,onMouseDown:qe,onScroll:Je,virtual:Ge,onMouseEnter:We},function(De,N){var A,P=De.group,v=De.groupOption,y=De.data,x=y.label,S=y.key;if(P)return ue.createElement("div",{className:ie()(Oe,"".concat(Oe,"-group"))},x!==void 0?x:S);var V=y.disabled,I=y.value,ye=y.title,Ve=y.children,ut=y.style,nt=y.className,Mt=Object(O.a)(y,["disabled","value","title","children","style","className"]),_t=ke.has(I),st="".concat(Oe,"-option"),Xt=ie()(Oe,st,nt,(A={},Object(he.a)(A,"".concat(st,"-grouped"),v),Object(he.a)(A,"".concat(st,"-active"),tt===N&&!V),Object(he.a)(A,"".concat(st,"-disabled"),V),Object(he.a)(A,"".concat(st,"-selected"),_t),A)),Lt=Le?Ve:x,Ct=!rt||typeof rt=="function"||_t;return ue.createElement("div",Object.assign({},Mt,{"aria-selected":_t,className:Xt,title:ye,onMouseMove:function(){if(tt===N||V)return;gt(N)},onClick:function(){V||it(I)},style:ut}),ue.createElement("div",{className:"".concat(st,"-content")},Lt||I),ue.isValidElement(rt)||_t,Ct&&ue.createElement(B.a,{className:"".concat(Oe,"-option-state"),customizeIcon:rt,customizeIconProps:{isSelected:_t}},_t?"\u2713":null))}))},D=ue.forwardRef(j);D.displayName="OptionList";var J=D,$=function(){return null};$.isSelectOption=!0;var Te=$,Ue=function(){return null};Ue.isSelectOptGroup=!0;var oe=Ue,te=b("VTBJ"),me=b("Zm9Q");function q(g){var H=g.key,be=g.props,Ce=be.children,Ke=be.value,Ye=Object(O.a)(be,["children","value"]);return Object(te.a)({key:H,value:Ke!==void 0?Ke:H,children:Ce},Ye)}function se(g){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(me.a)(g).map(function(be,Ce){if(!ue.isValidElement(be)||!be.type)return null;var Ke=be.type.isSelectOptGroup,Ye=be.key,Le=be.props,ke=Le.children,ve=Object(O.a)(Le,["children"]);return H||!Ke?q(be):Object(te.a)(Object(te.a)({key:"__RC_SELECT_GRP__".concat(Ye===null?Ce:Ye,"__"),label:Ye},ve),{},{options:se(ke)})}).filter(function(be){return be})}var Se=b("2Qr1"),re=b("qNPg"),C=b("U8pU"),Z=b("Kwbf"),W=b("WKfj");function k(g){var H=g.mode,be=g.options,Ce=g.children,Ke=g.backfill,Ye=g.allowClear,Le=g.placeholder,ke=g.getInputElement,ve=g.showSearch,Ee=g.onSearch,z=g.defaultOpen,R=g.autoFocus,Be=g.labelInValue,$e=g.value,ft=g.inputValue,rt=g.optionLabelProp,Ge=H==="multiple"||H==="tags",de=ve!==void 0?ve:Ge||H==="combobox",Re=be||se(Ce);if(Object(Z.a)(H!=="tags"||Re.every(function(Oe){return!Oe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var je=Re.some(function(Oe){return Oe.options?Oe.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Oe?Oe.value:Oe.key)=="number"});Object(Z.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(Z.a)(H!=="combobox"||!rt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(Z.a)(H==="combobox"||!Ke,"`backfill` only works with `combobox` mode."),Object(Z.a)(H==="combobox"||!ke,"`getInputElement` only work with `combobox` mode."),Object(Z.b)(H!=="combobox"||!ke||!Ye||!Le,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ee&&!de&&H!=="combobox"&&H!=="tags"&&Object(Z.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(Z.b)(!z||R,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),$e!=null){var Je=Object(W.d)($e);Object(Z.a)(!Be||Je.every(function(Oe){return Object(C.a)(Oe)==="object"&&("key"in Oe||"value"in Oe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(Z.a)(!Ge||Array.isArray($e),"`value` should be array when `mode` is `multiple` or `tags`")}if(Ce){var We=null;Object(me.a)(Ce).some(function(Oe){if(!ue.isValidElement(Oe)||!Oe.type)return!1;var Ie=Oe.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var pt=Object(me.a)(Oe.props.children).every(function(qe){return!ue.isValidElement(qe)||!Oe.type||qe.type.isSelectOption?!0:(We=qe.type,!1)});return!pt}return We=Ie,!0}),We&&Object(Z.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(We.displayName||We.name||We,"`.")),Object(Z.a)(ft===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var ne=k,ge=Object(re.a)({prefixCls:"rc-select",components:{optionList:J},convertChildrenToData:se,flattenOptions:Se.d,getLabeledValue:Se.e,filterOptions:Se.b,isValueDisabled:Se.g,findValueOption:Se.c,warningProps:ne,fillOptionsWithMissingValue:Se.a}),Q=function(g){Object(ee.a)(be,g);var H=Object(pe.a)(be);function be(){var Ce;return Object(U.a)(this,be),Ce=H.apply(this,arguments),Ce.selectRef=ue.createRef(),Ce.focus=function(){Ce.selectRef.current.focus()},Ce.blur=function(){Ce.selectRef.current.blur()},Ce}return Object(Me.a)(be,[{key:"render",value:function(){return ue.createElement(ge,Object.assign({ref:this.selectRef},this.props))}}]),be}(ue.Component);Q.Option=Te,Q.OptGroup=oe;var Pe=Q,w=Xe.c=Pe},Ly88:function(xt,Xe,b){"use strict";b.r(Xe);var U=b("14J3"),Me=b("BMrR"),ee=b("jCWc"),pe=b("kPKH"),ue=b("OaEy"),he=b("2fM7"),O=b("7Kak"),X=b("9yH6"),K=b("5NDa"),ae=b("5rEg"),T=b("2qtc"),M=b("kLXV"),ie=b("miYZ"),Y=b("tsqr"),B=b("9og8"),j=b("k1fw"),D=b("y8nQ"),J=b("Vl3Y"),$=b("tJVT"),Te=b("PpiC"),Ue=b("WmNS"),oe=b.n(Ue),te=b("q1tI"),me=b.n(te),q=b("9kvl"),se=b("Ot1p"),Se=b("HBuW"),re=b("HV1I"),C=b.n(re),Z=b("LvDl"),W=b.n(Z),k=b("9ZNV"),ne=b("nuEh"),ge=b("fnXi"),Q=b("UqFu"),Pe=b("2RCv"),w={1:[100,200],2:[300,400,500,600],3:[700,800,900,1e3]},g=function(be){var Ce,Ke,Ye,Le=be.shixunsDetail,ke=be.dispatch,ve=be.match,Ee=be.practiceSetting,z=Object(Te.a)(be,["shixunsDetail","dispatch","match","practiceSetting"]),R=J.a.useForm(),Be=Object($.a)(R,1),$e=Be[0],ft=Object(te.useState)({}),rt=Object($.a)(ft,2),Ge=rt[0],de=rt[1],Re=Object(te.useState)([100,200]),je=Object($.a)(Re,2),Je=je[0],We=je[1],Oe=Le.challengesNew,Ie=Object(te.useState)(),pt=Object($.a)(Ie,2),qe=pt[0],Qe=pt[1],et=Object(te.useState)(),yt=Object($.a)(et,2),lt=yt[0],tt=yt[1],le=Object(te.useState)(!0),gt=Object($.a)(le,2),it=gt[0],fe=gt[1],De=Object(te.useState)(1),N=Object($.a)(De,2),A=N[0],P=N[1],v=Object(te.useRef)({subject:"",difficulty:1,score:100,task_pass:Object(Q.a)(Oe.task_pass_default)}),y=Object(te.useRef)(null),x=Ee.selectQuestionParams,S=Ee.id,V=Ee.newQuestion;Object(te.useEffect)(function(){ve.params.challengesId?(tt(!0),I()):(fe(!0),tt(!1),ke({type:"shixunsDetail/getChallengesNew",payload:Object(j.a)({},ve.params)}),fe(!1)),setTimeout(function(){document.getElementById("practice-scroll").scrollTo(0,0)},300)},[ve.params]),Object(te.useEffect)(function(){return _t(),function(){clearTimeout(y.current)}},[Ge]);var I=function(){var Lt=Object(B.a)(oe.a.mark(function Ct(){var St,ht;return oe.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return fe(!0),qt.next=3,Object(Se.G)({id:ve.params.id,challengeId:ve.params.challengesId,tab:0});case 3:St=qt.sent,St&&(ht=Object(j.a)(Object(j.a)({},St),{},{task_pass:Object(Q.a)(St.task_pass)}),Qe(ht),ye(ht),fe(!1),v.current={subject:ht.subject,difficulty:ht.difficulty,score:ht.score,task_pass:ht.task_pass});case 5:case"end":return qt.stop()}},Ct)}));return function(){return Lt.apply(this,arguments)}}(),ye=function(Ct){var St={subject:Ct.name,difficulty:Ct.difficulty,score:Ct.score,challenge_tag:Ct.tags,task_pass:Ct.task_pass},ht=w[Ct.difficulty];We(ht),$e.setFieldsValue(Object(j.a)({},St)),de(Object(j.a)({},St))},Ve=function(Ct){var St=w[Ct],ht=St==null?void 0:St[0];We(St),$e.setFieldsValue({score:ht}),de(Object(j.a)(Object(j.a)({},$e.getFieldsValue()),{score:ht}))},ut=function(Ct,St){de(Object(j.a)({},$e.getFieldsValue())),"difficulty"in Ct&&Ve(Ct.difficulty)},nt=function(){var Lt=Object(B.a)(oe.a.mark(function Ct(){var St,ht,pi,qt,mt,wi=arguments;return oe.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:if(ht=wi.length>0&&wi[0]!==void 0?wi[0]:{},!(!lt&&((St=Le.detail)===null||St===void 0?void 0:St.shixun_status)===2)){Gt.next=4;break}return Y.b.info("\u8BE5\u5B9E\u8BAD\u5DF2\u7ECF\u53D1\u5E03\u4E0D\u80FD\u65B0\u5EFA"),Gt.abrupt("return");case 4:if(!lt){Gt.next=10;break}return Gt.next=7,Object(Se.Lb)(Object(j.a)(Object(j.a)({},ve.params),{},{tab:0,challenge:Object(j.a)({},ht),challenge_tag:ht.challenge_tag}));case 7:return pi=Gt.sent,pi&&(ke({type:"practiceSetting/setUpdateIndex"}),q.d.replace("/shixuns/".concat(ve.params.id,"/edit/").concat(ve.params.challengesId,"/tab=2"))),Gt.abrupt("return");case 10:return qt=Object(j.a)({},Ge),qt.identifier=ve.params.id,qt.st=0,Gt.next=15,Object(Se.b)(Object(j.a)({},qt));case 15:mt=Gt.sent,mt.status===1&&(q.d.replace("/shixuns/".concat(ve.params.id,"/edit/").concat(mt.challenge_id,"/tab=2")),setTimeout(function(){ke({type:"practiceSetting/setParams",payload:{newQuestion:null}}),ke({type:"practiceSetting/setUpdateIndex"})},200));case 17:case"end":return Gt.stop()}},Ct)}));return function(){return Lt.apply(this,arguments)}}(),Mt=function(){Xt()},_t=function(){clearTimeout(y.current),y.current=setTimeout(st,500)},st=function(){"subject"in Ge&&V&&ke({type:"practiceSetting/setParams",payload:{newQuestion:{st:0,name:Ge==null?void 0:Ge.subject}}});var Ct=["subject","difficulty","score","task_pass"],St=Ct.some(function(ht){var pi=Object(Z.isNumber)(Ge[ht])?String(Ge[ht]):Ge[ht],qt=Object(Z.isNumber)(v.current[ht])?String(v.current[ht]):v.current[ht];return!Object(Z.isEqual)(pi,qt)});ke(St?{type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}:{type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},Xt=function(){var Ct,St=function(){q.d.push("/shixuns/".concat(S,"/challenges")),ke({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Ee!=null&&(Ct=Ee.sideBar)!==null&&Ct!==void 0&&Ct.confirmLeave?M.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){St()}}):St()};return me.a.createElement(me.a.Fragment,null,me.a.createElement("section",{key:1,className:C.a.bg,id:"practice-scroll"},me.a.createElement(J.a,{key:A,form:$e,className:C.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:ut,onFinish:nt},me.a.createElement(ge.a,{activeIndex:0,isEdit:lt}),me.a.createElement(J.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},me.a.createElement(ae.a,{bordered:!1,maxLength:60,suffix:"".concat(((Ce=Ge.subject)===null||Ce===void 0?void 0:Ce.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"})),me.a.createElement(J.a.Item,{name:"task_pass",label:"\u4EFB\u52A1\u8981\u6C42:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u8FC7\u5173\u4EFB\u52A1\u7B80\u4ECB\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},me.a.createElement(se.a,{key:ve.params.challengesId||"3",watch:!0,defaultValue:lt?qe==null?void 0:qe.task_pass:Oe.task_pass_default})),me.a.createElement(J.a.Item,{initialValue:1,name:"difficulty",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},me.a.createElement(X.a.Group,{disabled:((Ke=Le.detail)===null||Ke===void 0?void 0:Ke.shixun_status)===2},me.a.createElement(X.a,{value:1},"\u7B80\u5355"),me.a.createElement(X.a,{style:{marginLeft:70},value:2},"\u4E2D\u7B49"),me.a.createElement(X.a,{style:{marginLeft:70},value:3},"\u56F0\u96BE"))),me.a.createElement(J.a.Item,{name:"challenge_tag",label:me.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E ",me.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6280\u80FD\u6807\u7B7E"}]},me.a.createElement(Pe.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E",style:{width:"260px"},InputRight:me.a.createElement("span",{className:"ml5"},"(\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E)")})),me.a.createElement(Me.a,{className:"customItemSelect"},me.a.createElement(pe.a,null,me.a.createElement(J.a.Item,{name:"score",initialValue:100,label:"\u5956\u52B1\u91D1\u5E01:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},me.a.createElement(he.a,{disabled:((Ye=Le.detail)===null||Ye===void 0?void 0:Ye.shixun_status)===2,bordered:!1,style:{width:260}},Je==null?void 0:Je.map(function(Lt,Ct){return me.a.createElement(he.a.Option,{key:Ct,value:Lt},Lt)})))),me.a.createElement(pe.a,{flex:1},me.a.createElement("div",{style:{marginTop:88},className:"font12 c-light-black ml10"}," \u5B66\u5458\u6B63\u786E\u7B54\u9898\u65F6\u83B7\u5F97\u91D1\u5E01\uFF0C\u5E76\u4E14\u83B7\u5F97\u7B49\u91CF\u7684\u7ECF\u9A8C\u503C\u3002\u5982\uFF1A+100\u91D1\u5E01\u3001+100\u7ECF\u9A8C\u503C"))))),me.a.createElement(k.a,{key:2,onOk:function(){return $e.submit()},className:"customFixedButton",onCancel:Mt}),me.a.createElement(ne.a,{loading:it}))};Xe.default=Object(q.a)(function(H){var be=H.shixunsDetail,Ce=H.newCourse,Ke=H.globalSetting,Ye=H.practiceSetting;return{shixunsDetail:be,newCourse:Ce,globalSetting:Ke,practiceSetting:Ye}})(g)},M8RZ:function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return K});var U=b("fWQN"),Me=b("mtLc"),ee=b("yKVA"),pe=b("879j"),ue=b("q1tI"),he=b.n(ue),O=b("i8i4"),X=b.n(O),K=function(ae){Object(ee.a)(M,ae);var T=Object(pe.a)(M);function M(ie){var Y;Object(U.a)(this,M),Y=T.call(this,ie);var B=window.document;return Y.node=B.createElement("div"),B.body.appendChild(Y.node),Y}return Object(Me.a)(M,[{key:"render",value:function(){var Y=this.props.children;return Object(O.createPortal)(Y,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),M}(he.a.Component)},OLES:function(xt,Xe,b){"use strict";var U=b("U8pU"),Me=b("VTBJ"),ee=b("Ff2n"),pe=b("q1tI"),ue=b("uciX"),he=b("7ixt"),O=function(ie){var Y=ie.overlay,B=ie.prefixCls,j=ie.id,D=ie.overlayInnerStyle;return pe.createElement("div",{className:"".concat(B,"-inner"),id:j,role:"tooltip",style:D},typeof Y=="function"?Y():Y)},X=O,K=function(ie,Y){var B=ie.overlayClassName,j=ie.trigger,D=j===void 0?["hover"]:j,J=ie.mouseEnterDelay,$=J===void 0?0:J,Te=ie.mouseLeaveDelay,Ue=Te===void 0?.1:Te,oe=ie.overlayStyle,te=ie.prefixCls,me=te===void 0?"rc-tooltip":te,q=ie.children,se=ie.onVisibleChange,Se=ie.afterVisibleChange,re=ie.transitionName,C=ie.animation,Z=ie.placement,W=Z===void 0?"right":Z,k=ie.align,ne=k===void 0?{}:k,ge=ie.destroyTooltipOnHide,Q=ge===void 0?!1:ge,Pe=ie.defaultVisible,w=ie.getTooltipContainer,g=ie.overlayInnerStyle,H=Object(ee.a)(ie,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),be=Object(pe.useRef)(null);Object(pe.useImperativeHandle)(Y,function(){return be.current});var Ce=Object(Me.a)({},H);"visible"in ie&&(Ce.popupVisible=ie.visible);var Ke=function(){var Ee=ie.arrowContent,z=Ee===void 0?null:Ee,R=ie.overlay,Be=ie.id;return[pe.createElement("div",{className:"".concat(me,"-arrow"),key:"arrow"},z),pe.createElement(X,{key:"content",prefixCls:me,id:Be,overlay:R,overlayInnerStyle:g})]},Ye=!1,Le=!1;if(typeof Q=="boolean")Ye=Q;else if(Q&&Object(U.a)(Q)==="object"){var ke=Q.keepParent;Ye=ke===!0,Le=ke===!1}return pe.createElement(ue.a,Object.assign({popupClassName:B,prefixCls:me,popup:Ke,action:D,builtinPlacements:he.a,popupPlacement:W,ref:be,popupAlign:ne,getPopupContainer:w,onPopupVisibleChange:se,afterPopupVisibleChange:Se,popupTransitionName:re,popupAnimation:C,defaultPopupVisible:Pe,destroyPopupOnHide:Ye,autoDestroy:Le,mouseLeaveDelay:Ue,popupStyle:oe,mouseEnterDelay:$},Ce),q)},ae=Object(pe.forwardRef)(K),T=Xe.a=ae},Ot1p:function(xt,Xe,b){"use strict";var U=b("2qtc"),Me=b("kLXV"),ee=b("rAM+"),pe=b("miYZ"),ue=b("tsqr"),he=b("9og8"),O=b("tJVT"),X=b("jrin"),K=b("WmNS"),ae=b.n(K),T=b("q1tI"),M=b.n(T),ie=b("VrN/"),Y=b.n(ie),B=b("bdgK"),j=b("p77/"),D=b("Bd2K"),J=b("ELLl"),$=b("19Vz"),Te=b("lZu9"),Ue=b("+NIl"),oe=b("kSUc"),te=b("9Bee"),me=function(I){var ye=I.value,Ve=ye===void 0?"":ye,ut=I.className,nt=I.showTextOnly,Mt=I.showLines,_t=I.style,st=_t===void 0?{}:_t,Xt=Object(T.useMemo)(function(){return""},[Ve]);return M.a.createElement(M.a.Fragment,null,M.a.createElement("div",{dangerouslySetInnerHTML:{__html:Xt}}))},q=b("0Owb"),se=b("dejd"),Se=b("C+DQ"),re=b("1vsH"),C=b("m3rI"),Z=[{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 W(I){var ye=I.onActionCallback,Ve=I.title,ut=I.icon,nt=I.actionName,Mt=I.className,_t=Mt===void 0?"":Mt,st=I.children;function Xt(){ye(nt)}return M.a.createElement("a",{title:Ve,className:_t,onClick:Xt},M.a.createElement("i",{className:"md-iconfont ".concat(ut)}),st)}var k=function(I){var ye=I.watch,Ve=I.showNullButton,ut=I.onActionCallback,nt=I.fullScreen,Mt=I.insertTemp,_t=I.hidetoolBar,st=I.uuid,Xt=I.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(re.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(re.D)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(C.a.PROXY_SERVER)));var Lt=[].concat(Z,[{title:"".concat(ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ye?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return M.a.createElement("ul",{className:"markdown-toolbar-container"},!_t&&Lt.map(function(Ct,St){return M.a.createElement("li",{key:St},Ct.actionName?M.a.createElement(W,Object(q.a)({},Ct,{onActionCallback:ut})):M.a.createElement("span",{className:"v-line"}))}),Ve?M.a.createElement("li",null,M.a.createElement(W,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ut},M.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Mt&&M.a.createElement("li",null,M.a.createElement(W,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Mt),onActionCallback:ut},M.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),M.a.createElement("li",{className:"btn-full-screen"},M.a.createElement(W,{icon:"".concat(nt?"icon-shrink":"icon-enlarge"),title:nt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ut})))},ne=b("M8RZ"),ge=b("+L6B"),Q=b("2/Rp"),Pe=b("y8nQ"),w=b("Vl3Y"),g=b("5NDa"),H=b("5rEg"),be={labelCol:{span:4},wrapperCol:{span:20}},Ce=function(I){var ye=I.callback,Ve=I.onCancel;function ut(nt){ye(nt)}return M.a.createElement(w.a,Object(q.a)({},be,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut}),M.a.createElement(w.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},M.a.createElement(H.a,null)),M.a.createElement(w.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},M.a.createElement(H.a,null)),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(Q.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))},Ke=b("7ahc"),Ye=b("k1fw"),Le=b("HmJG"),ke=b("BjJ7"),ve=w.a.useForm,Ee={width:280,marginRight:10},z={labelCol:{span:5},wrapperCol:{span:19}},R=function(I){var ye=I.callback,Ve=I.onCancel,ut=ve(),nt=Object(O.a)(ut,1),Mt=nt[0],_t=Object(T.useRef)();function st(Ct){ye(Object(Ye.a)(Object(Ye.a)({},Ct),{},{name:_t.current}))}function Xt(Ct,St){Mt.setFieldsValue({src:"/api/attachments/".concat(Ct.id,"?type=").concat(Ct.content_type),type:St.type})}function Lt(Ct){var St=Ct.target.files[0];_t.current=St.name,$e(St,Xt)}return M.a.createElement(w.a,Object(q.a)({form:Mt},z,{className:"upload-image-panel",onFinish:st}),M.a.createElement(w.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},M.a.createElement("div",{className:"flex-container"},M.a.createElement(w.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},M.a.createElement(H.a,{style:Ee})),M.a.createElement(Be,{onFileChange:Lt}))),M.a.createElement(w.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},M.a.createElement(H.a,{style:{width:264}})),M.a.createElement(w.a.Item,{style:{textAlign:"right"}},M.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(Q.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function Be(I){var ye=I.onFileChange;return M.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",M.a.createElement("input",{type:"file",onChange:ye}))}function $e(I,ye){if(!I)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ve=new FormData;Ve.append("editormd-image-file",I),Ve.append("file_param_name","editormd-image-file"),Ve.append("byxhr","true");var ut=new window.XMLHttpRequest;ut.withCredentials=!0,ut.addEventListener("load",function(nt){ye(JSON.parse(nt.target.responseText),I)},!1),ut.addEventListener("error",function(nt){console.error(nt)},!1),ut.open("POST","".concat(ke.a,"/api/attachments.json")),ut.send(Ve)}var ft=b("giR+"),rt=b("fyUT"),Ge=b("7Kak"),de=b("9yH6"),Re=de.a.Group,je={margin:"0 8px"},Je=function(I){var ye=I.callback,Ve=I.onCancel;function ut(nt){ye(nt)}return M.a.createElement(w.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},M.a.createElement("div",{className:"flex-container"},M.a.createElement("span",{style:je},"\u5355\u5143\u683C\u6570\uFF1A"),M.a.createElement("span",{style:je},"\u884C\u6570"),M.a.createElement(w.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},M.a.createElement(rt.a,null)),M.a.createElement("span",{style:je},"\u5217\u6570"),M.a.createElement(w.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},M.a.createElement(rt.a,null))),M.a.createElement("div",{className:"flex-container",style:{marginTop:12}},M.a.createElement("span",{style:je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),M.a.createElement(w.a.Item,{name:"align"},M.a.createElement(Re,null,M.a.createElement(de.a,{value:"default"},M.a.createElement("i",{className:"fa fa-align-justify"})),M.a.createElement(de.a,{value:"left"},M.a.createElement("i",{className:"fa fa-align-left"})),M.a.createElement(de.a,{value:"center"},M.a.createElement("i",{className:"fa fa-align-center"})),M.a.createElement(de.a,{value:"right"},M.a.createElement("i",{className:"fa fa-align-right"}))))),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(Q.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))},We=b("ErOA"),Oe=b("7Cbv"),Ie="link",pt="upload-image",qe="code-block",Qe="add-table",et="------------",yt={default:et,left:":".concat(et),center:":".concat(et,":"),right:"".concat(et,":")},lt=b("9VGf"),tt,le;function gt(){}var it=0,fe=1e4,De="\u2581",N=`
|
|
**\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 A(I){return/^\d+$/.test(I)?"".concat(I,"px"):I}var P=navigator.platform.toUpperCase().indexOf("MAC")>=0,v=P?"Cmd":"Ctrl",y=["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"],x=(tt={},Object(X.a)(tt,v+"-B","bold"),Object(X.a)(tt,v+"-I","italic"),tt),S=(le={},Object(X.a)(le,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(X.a)(le,qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(X.a)(le,pt,"\u6DFB\u52A0\u6587\u4EF6"),Object(X.a)(le,Qe,"\u6DFB\u52A0\u8868\u683C"),le),V=Xe.a=function(I){var ye=I.defaultValue,Ve=ye===void 0?"":ye,ut=I.onChange,nt=I.width,Mt=nt===void 0?"100%":nt,_t=I.height,st=_t===void 0?400:_t,Xt=I.miniToolbar,Lt=Xt===void 0?!1:Xt,Ct=I.isFocus,St=Ct===void 0?!1:Ct,ht=I.watch,pi=I.insertTemp,qt=I.mode,mt=qt===void 0?"markdown":qt,wi=I.id,ii=wi===void 0?"markdown-editor-id":wi,Gt=I.showResizeBar,Gi=Gt===void 0?!1:Gt,sn=I.noStorage,ln=sn===void 0?!1:sn,It=I.showNullButton,ct=It===void 0?!1:It,Ii=I.hidetoolBar,un=Ii===void 0?!1:Ii,Si=I.fullScreen,Ot=Si===void 0?!1:Si,Bi=I.onBlur,Yi=I.onCMBeforeChange,hn=I.onFullScreen,Ae=I.className,kt=Ae===void 0?"":Ae,cn=I.disablePaste,Ln=cn===void 0?!1:cn,dn=I.placeholder,Mn=dn===void 0?"":dn,c=I.values,o=c===void 0?"":c,a=Object(T.useState)(null),u=Object(O.a)(a,2),d=u[0],h=u[1],L=Object(T.useState)(Ve),xe=Object(O.a)(L,2),Fe=xe[0],ot=xe[1],we=Object(T.useState)(ht),Et=Object(O.a)(we,2),Dt=Et[0],Kt=Et[1],ji=Object(T.useState)(Ot),Ui=Object(O.a)(ji,2),si=Ui[0],Vi=Ui[1],zn=Object(T.useState)(""),Ei=Object(O.a)(zn,2),Fi=Ei[0],Ri=Ei[1],vn=Object(T.useState)(0),$i=Object(O.a)(vn,2),fn=$i[0],tn=$i[1],cr=Object(T.useState)(st),Gn=Object(O.a)(cr,2),Ji=Gn[0],Wi=Gn[1],An=Object(T.useState)(!1),On=Object(O.a)(An,2),dr=On[0],Zt=On[1],jt=Object(T.useRef)(Object(Oe.a)()),mi=Object(T.useRef)(!1),Bt=Object(T.useRef)(),ni=Object(T.useRef)(),Wt=Object(T.useRef)(),nn=Object(T.useRef)(),ei=Object(T.useRef)(),ki=function(){var dt=Object(he.a)(ae.a.mark(function Tt(){var bt,Rt;return ae.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(We.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:jt.current}});case 2:Rt=zt.sent,Rt!=null&&(bt=Rt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",d,ni),Rt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?d.replaceSelection(".concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?d.replaceSelection('<video width="100%" controls src="'.concat(C.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?d.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):d.replaceSelection("[".concat(Nt.name,"](").concat(C.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return zt.stop()}},Tt)}));return function(){return dt.apply(this,arguments)}}();Object(T.useEffect)(function(){ot(o),d==null||d.setValue(o)},[o]),Object(T.useEffect)(function(){hn==null||hn(si)},[si]),Object(T.useEffect)(function(){if(ni.current){var dt=Y.a.fromTextArea(ni.current,{mode:mt,lineNumbers:!Lt,lineWrapping:!0,value:Ve,autoCloseTags:!0,autoCloseBrackets:!0});St&&dt.focus();function Tt(bt,Rt){if(Ln){Rt.preventDefault();return}var Ut=Rt.clipboardData;if(Ut){var zt=Ut.types.toString(),Nt=Ut.items;if(zt==="Files"||Ut.types.indexOf("Files")>-1){if(Rt.preventDefault(),mt=="stex")return;try{var ri,_i=Nt[1];((ri=Nt[0])===null||ri===void 0?void 0:ri.kind)==="file"&&(_i=Nt[0]);var Pt=_i.getAsFile(),bn=Pt.name.split(".").pop();$e(Pt,function(Ft){if(Ft.id){var ui,Xi,Ki;(Pt==null||((ui=Pt.type)===null||ui===void 0)?void 0:ui.indexOf("image"))>-1?dt.replaceSelection(".concat(Ft.content_type,")")):(Pt==null||((Xi=Pt.type)===null||Xi===void 0)?void 0:Xi.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(Pt==null||((Ki=Pt.type)===null||Ki===void 0)?void 0:Ki.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Pt.type,'&disposition=inline" target="_blank">').concat(Pt.name,"</a>")):y.includes(bn)?dt.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(Pt.name,"</a>")):dt.replaceSelection("[".concat(Pt.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){ue.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dt.on("paste",Tt),dt.on("dragleave",function(bt,Rt){Wt.current.classList.remove("mouse-hover-md")}),dt.on("dragover",function(bt,Rt){Wt.current.classList.add("mouse-hover-md")}),dt.on("drop",function(bt,Rt){Wt.current.classList.add("mouse-hover-md");var Ut;if(Ut=Rt.dataTransfer.files,Ut.length>0){Rt.preventDefault(),Rt.stopPropagation();for(var zt=function(_i){var Pt=Ut[_i],bn=Pt.name.split(".").pop();$e(Pt,function(Ft){if(Ft.id){var ui,Xi,Ki;(Pt==null||((ui=Pt.type)===null||ui===void 0)?void 0:ui.indexOf("image"))>-1?dt.replaceSelection(".concat(Ft.content_type,")")):(Pt==null||((Xi=Pt.type)===null||Xi===void 0)?void 0:Xi.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(Pt==null||((Ki=Pt.type)===null||Ki===void 0)?void 0:Ki.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Pt.type,'&disposition=inline" target="_blank">').concat(Pt.name,"</a>")):y.includes(bn)?dt.replaceSelection('<a href="'.concat(C.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(Pt.name,"</a>")):dt.replaceSelection("[".concat(Pt.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")})},Nt=0;Nt<Ut.length;Nt++)zt(Nt)}}),h(dt),function(){dt.off("paste",Tt)}}},[]);var Vn=Object(T.useCallback)(function(){if(Wt.current)try{}catch(dt){console.log(dt,"---- to set md editor body height")}},[Ji,Wt,si]);Object(T.useEffect)(function(){function dt(){var bt=new B.default(function(Rt){var Ut=Object(ee.a)(Rt),zt;try{for(Ut.s();!(zt=Ut.n()).done;){var Nt=zt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Vn(),d.setSize("100%","100%"),d.refresh())}}catch(ri){Ut.e(ri)}finally{Ut.f()}});return bt.observe(ni.current.parentElement),bt}if(d){var Tt=dt();return function(){Tt.unobserve(ni.current.parentElement)}}},[d,Vn]),Object(T.useEffect)(function(){if(d){for(var dt=[],Tt=function(){var Nt=Rt[bt];Ut=Object(O.a)(Nt,2);var ri=Ut[0],_i=Ut[1],Pt=Object(X.a)({},ri,function(){Xn(_i)});dt.push(Pt),d.addKeyMap(Pt)},bt=0,Rt=Object.entries(x);bt<Rt.length;bt++){var Ut;Tt()}return Bt.current=setInterval(function(){mi.current&&ki()},4e3),function(){clearInterval(Bt.current);var zt=Object(ee.a)(dt),Nt;try{for(zt.s();!(Nt=zt.n()).done;){var ri=Nt.value;d.removeKeyMap(ri)}}catch(_i){zt.e(_i)}finally{zt.f()}}}},[d]),Object(T.useEffect)(function(){Ot!==si&&Vi(Ot)},[Ot]),Object(lt.a)(function(){if(!ln&&fn>0){var dt=new Date().getTime(),Tt=window.sessionStorage.getItem(ii);dt>=fn+fe&&(!Tt||Tt!==Fe)&&(window.sessionStorage.setItem(ii,Fe),Zt(!0))}},fe),Object(T.useEffect)(function(){Kt(ht)},[d,ht]),Object(T.useEffect)(function(){d&&(St&&d.focus())},[d,St]),Object(T.useEffect)(function(){if(Dt&&d){var dt=d.getScrollerElement();function Tt(bt){var Rt=bt.target;if(ei.current){var Ut=Rt.scrollTop/Rt.scrollHeight;ei.current.scrollTop=ei.current.scrollHeight*Ut}}return dt.addEventListener("scroll",Tt),function(){dt.removeEventListener("scroll",Tt)}}},[d,Dt]),Object(T.useEffect)(function(){if(d&&Yi){function dt(Tt,bt){Yi(Tt,bt)}return d.on("beforeChange",dt),function(){d.off("beforeChange",dt)}}},[d,Yi]),Object(T.useEffect)(function(){if(d&&Bi){function dt(){Bi(d.getValue())}return d.on("blur",dt),function(){d.off("blur",dt)}}},[d,Bi]),Object(T.useEffect)(function(){if(d){function dt(Tt){var bt=Tt.getValue();ot(bt),tn(new Date().getTime()),Tt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ut&&ut(bt)}return d.on("change",dt),function(){d.off("change",dt)}}},[d,ut]),Object(T.useEffect)(function(){d&&(Ve==null?(d.setValue(""),ot("")):Ve!==d.getValue()&&(d.setValue(Ve),ot(Ve),d.setCursor(d.lineCount(),0)))},[d,Ve]);var Xn=Object(T.useCallback)(function(dt){var Tt=d.getCursor(),bt=d.getSelection(),Rt=bt.split(`
|
|
`);switch(dt){case"bold":return d.replaceSelection("**"+bt+"**"),bt===""&&d.setCursor(Tt.line,Tt.ch+2),d.focus();case"italic":return d.replaceSelection("*"+bt+"*"),bt===""&&d.setCursor(Tt.line,Tt.ch+1),d.focus();case"code":return d.replaceSelection("`"+bt+"`"),bt===""&&d.setCursor(Tt.line,Tt.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+bt+"$$`"),bt===""&&d.setCursor(Tt.line,Tt.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+bt+"\n```"),d.setCursor(Tt.line+1,bt.length+1),d.focus();case"line-break":return d.replaceSelection(`<br/>
|
|
`),d.focus();case"list-ul":return bt===""?d.replaceSelection("- "+bt):d.replaceSelection(Rt.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(`
|
|
`)),d.focus();case"list-ol":return bt===""?d.replaceSelection("1. "+bt):d.replaceSelection(Rt.map(function(Ut,zt){return Ut===""?"":"".concat(zt+1,". ").concat(Ut)}).join(`
|
|
`)),d.focus();case"add-null-ch":return bt===""&&d.setCursor(Tt.line,Tt.ch+1),d.replaceSelection(De),d.focus();case"inster-template-1":return bt===""&&d.setCursor(Tt.line,Tt.ch),d.replaceSelection(N),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return Kt(!Dt),d.focus();case"trigger-full-screen":return Vi(!si),d.focus();case Ie:Ri(Ie);return;case qe:Ri(qe);return;case pt:Ri(pt);return;case Qe:Ri(Qe);return;default:throw new Error}},[d,Dt,si]),yn=Object(T.useCallback)(function(dt){Ri("");switch(Fi){case Ie:var Tt=dt.title,bt=dt.link;return d.replaceSelection("[".concat(Tt,"](").concat(bt,")")),d.focus();case qe:var Rt=dt.language,Ut=dt.content;return d.replaceSelection(["```"+Rt,Ut,"```"].join(`
|
|
`)),d.focus();case pt:var zt=dt.src,Nt=dt.alt,ri=dt.name;return zt.indexOf("type=image")>-1?d.replaceSelection(".concat(zt,' "').concat(Nt||"",'" )')):zt.indexOf("type=application/pdf")>-1?d.replaceSelection('<a href="'.concat(zt,'&disposition=inline" target="_blank">').concat(ri,"</a>")):d.replaceSelection('<a href="'.concat(zt,'" target="_blank">').concat(ri,"</a>")),d.focus();case Qe:for(var _i=dt.row,Pt=dt.col,bn=dt.align,Ft=`
|
|
`,ui=0;ui<_i;ui++){for(var Xi=[],Ki=[],Wr=0;Wr<Pt;Wr++)ui===1&&Ki.push(yt[bn]),Xi.push(" ");ui===1&&(Ft+="| ".concat(Ki.join(" | "),` |
|
|
`)),Ft+="| ".concat(Xi.join(Pt===1?"":" | "),` |
|
|
`)}return d.replaceSelection(Ft+`
|
|
`),d.focus();default:throw new Error}},[d,Fi]),Ur=Object(T.useMemo)(function(){switch(Fi){case Ie:return M.a.createElement(Ce,{callback:yn,onCancel:Di});case qe:return M.a.createElement(Ke.b,{callback:yn,onCancel:Di});case pt:return M.a.createElement(R,{callback:yn,onCancel:Di});case Qe:return M.a.createElement(Je,{callback:yn,onCancel:Di});default:return null}},[Fi]);function Di(){Ri("")}Object(T.useEffect)(function(){if(nn.current){var dt=nn.current,Tt=!1,bt=0;function Rt(Nt){Tt=!0,bt=Nt.pageY}function Ut(){Tt=!1}function zt(Nt){if(Tt){var ri=Nt.pageY-bt;ri<0&&(ri=0),ri>300&&(ri=300);var _i=st+ri+"px";Wi(_i)}}return dt.addEventListener("mousedown",Rt),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",Ut),function(){dt.removeEventListener("mousedown",Rt),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",Ut)}}},[d,nn]),Object(T.useEffect)(function(){Wi(st)},[st]);var fr=A(Mt),Zi=A(Ji),Kn={width:fr,height:Zi},Fr=Object(T.useMemo)(function(){if(fn){var dt=new Date(fn),Tt=dt.getHours(),bt=dt.getMinutes(),Rt=dt.getSeconds();return Tt=Tt<10?"0"+Tt:Tt,bt=bt<10?"0"+bt:bt,Rt=Rt<10?"0"+Rt:Rt,"".concat(Tt,":").concat(bt,":").concat(Rt)}return 0},[fn]);function Rn(){window.sessionStorage.removeItem(ii),Zt(!1),tn(0)}function Jo(){Zt(!1),tn(0),d.setValue(window.sessionStorage.getItem(ii))}function ho(dt,Tt){var bt=d.getValue();bt=bt.replace(dt,Tt),ot(bt),d==null||d.setValue(bt)}return M.a.createElement(T.Fragment,null,M.a.createElement("div",{className:"markdown-editor-wrapper",ref:Wt},M.a.createElement("div",{className:"markdown-editor-container ".concat(kt," ").concat(Dt?"on-preview":""," ").concat(Lt?"mini":""," ").concat(si?"full-screen":""),style:Kn},M.a.createElement(k,{insertTemp:pi,watch:Dt,fullScreen:si,showNullButton:ct,onActionCallback:Xn,hidetoolBar:un,uuid:jt.current,setOpenPhones:function(){mi.current=!0}}),M.a.createElement("div",{className:"markdown-editor-body"},M.a.createElement("div",{className:"codemirror-container"},M.a.createElement("textarea",{ref:ni,placeholder:Mn})),Dt?M.a.createElement("div",{ref:ei,className:"preview-container"},mt==="stex"&&M.a.createElement(me,{value:Fe}),mt!=="stex"&&M.a.createElement(te.a,{edit:!0,value:Fe,replaces:ho})):null))),Gi?M.a.createElement("a",{ref:nn,className:"editor-resize"}):null,M.a.createElement(ne.a,null,S[Fi]?M.a.createElement(Me.a,{centered:!0,title:S[Fi],visible:!0,onCancel:Di,footer:null},Ur):null))}},SJMd:function(xt,Xe){/**
|
|
* @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 b,U,Me,ee=!1,pe,ue;window.PR_SHOULD_USE_CONTINUATION=!0;var he,O;(function(){var X=window,K=["break,continue,do,else,for,if,return,while"],ae=[K,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],T=[ae,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[T,"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"],ie=[T,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Y=[T,"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"],B="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",j=[T,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],D="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",J=[K,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],$=[K,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Te=[K,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ue=[M,Y,ie,j,D,J,$,Te],oe=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,te="str",me="kwd",q="com",se="typ",Se="lit",re="pun",C="pln",Z="tag",W="dec",k="src",ne="atn",ge="atv",Q="nocode",Pe="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function w(de){for(var Re=0,je=!1,Je=!1,We=0,Oe=de.length;We<Oe;++We){var Ie=de[We];if(Ie.ignoreCase)Je=!0;else if(/[a-z]/i.test(Ie.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){je=!0,Je=!1;break}}var pt={b:8,t:9,n:10,v:11,f:12,r:13};function qe(tt){var le=tt.charCodeAt(0);if(le!==92)return le;var gt=tt.charAt(1);return le=pt[gt],le||("0"<=gt&><="7"?parseInt(tt.substring(1),8):gt==="u"||gt==="x"?parseInt(tt.substring(2),16):tt.charCodeAt(1))}function Qe(tt){if(tt<32)return(tt<16?"\\x0":"\\x")+tt.toString(16);var le=String.fromCharCode(tt);return le==="\\"||le==="-"||le==="]"||le==="^"?"\\"+le:le}function et(tt){var le=tt.substring(1,tt.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")),gt=[],it=le[0]==="^",fe=["["];it&&fe.push("^");for(var De=it?1:0,N=le.length;De<N;++De){var A=le[De];if(/\\[bdsw]/i.test(A))fe.push(A);else{var P=qe(A),v;De+2<N&&le[De+1]==="-"?(v=qe(le[De+2]),De+=2):v=P,gt.push([P,v]),v<65||P>122||(v<65||P>90||gt.push([Math.max(65,P)|32,Math.min(v,90)|32]),v<97||P>122||gt.push([Math.max(97,P)&~32,Math.min(v,122)&~32]))}}gt.sort(function(V,I){return V[0]-I[0]||I[1]-V[1]});for(var y=[],x=[],De=0;De<gt.length;++De){var S=gt[De];S[0]<=x[1]+1?x[1]=Math.max(x[1],S[1]):y.push(x=S)}for(var De=0;De<y.length;++De){var S=y[De];fe.push(Qe(S[0])),S[1]>S[0]&&(S[1]+1>S[0]&&fe.push("-"),fe.push(Qe(S[1])))}return fe.push("]"),fe.join("")}function yt(tt){for(var le=tt.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")),gt=le.length,it=[],fe=0,De=0;fe<gt;++fe){var N=le[fe];if(N==="(")++De;else if(N.charAt(0)==="\\"){var A=+N.substring(1);A&&(A<=De?it[A]=-1:le[fe]=Qe(A))}}for(var fe=1;fe<it.length;++fe)it[fe]===-1&&(it[fe]=++Re);for(var fe=0,De=0;fe<gt;++fe){var N=le[fe];if(N==="(")++De,it[De]||(le[fe]="(?:");else if(N.charAt(0)==="\\"){var A=+N.substring(1);A&&A<=De&&(le[fe]="\\"+it[A])}}for(var fe=0;fe<gt;++fe)le[fe]==="^"&&le[fe+1]!=="^"&&(le[fe]="");if(tt.ignoreCase&&je)for(var fe=0;fe<gt;++fe){var N=le[fe],P=N.charAt(0);N.length>=2&&P==="["?le[fe]=et(N):P!=="\\"&&(le[fe]=N.replace(/[a-zA-Z]/g,function(x){var S=x.charCodeAt(0);return"["+String.fromCharCode(S&~32,S|32)+"]"}))}return le.join("")}for(var lt=[],We=0,Oe=de.length;We<Oe;++We){var Ie=de[We];if(Ie.global||Ie.multiline)throw new Error(""+Ie);lt.push("(?:"+yt(Ie)+")")}return new RegExp(lt.join("|"),Je?"gi":"g")}function g(de,Re){var je=/(?:^|\s)nocode(?:\s|$)/,Je=[],We=0,Oe=[],Ie=0;function pt(qe){var Qe=qe.nodeType;if(Qe==1){if(je.test(qe.className))return;for(var et=qe.firstChild;et;et=et.nextSibling)pt(et);var yt=qe.nodeName.toLowerCase();(yt==="br"||yt==="li")&&(Je[Ie]=`
|
|
`,Oe[Ie<<1]=We++,Oe[Ie++<<1|1]=qe)}else if(Qe==3||Qe==4){var lt=qe.nodeValue;lt.length&&(Re?lt=lt.replace(/\r\n?/g,`
|
|
`):lt=lt.replace(/[ \t\r\n]+/g," "),Je[Ie]=lt,Oe[Ie<<1]=We,We+=lt.length,Oe[Ie++<<1|1]=qe)}}return pt(de),{sourceCode:Je.join("").replace(/\n$/,""),spans:Oe}}function H(de,Re,je,Je,We){if(!je)return;var Oe={sourceNode:de,pre:1,langExtension:null,numberLines:null,sourceCode:je,spans:null,basePos:Re,decorations:null};Je(Oe),We.push.apply(We,Oe.decorations)}var be=/\S/;function Ce(de){for(var Re=void 0,je=de.firstChild;je;je=je.nextSibling){var Je=je.nodeType;Re=Je===1?Re?de:je:Je===3&&be.test(je.nodeValue)?de:Re}return Re===de?void 0:Re}function Ke(de,Re){var je={},Je;(function(){for(var Ie=de.concat(Re),pt=[],qe={},Qe=0,et=Ie.length;Qe<et;++Qe){var yt=Ie[Qe],lt=yt[3];if(lt)for(var tt=lt.length;--tt>=0;)je[lt.charAt(tt)]=yt;var le=yt[1],gt=""+le;qe.hasOwnProperty(gt)||(pt.push(le),qe[gt]=null)}pt.push(/[\0-\uffff]/),Je=w(pt)})();var We=Re.length,Oe=function(Ie){for(var pt=Ie.sourceCode,qe=Ie.basePos,Qe=Ie.sourceNode,et=[qe,C],yt=0,lt=pt.match(Je)||[],tt={},le=0,gt=lt.length;le<gt;++le){var it=lt[le],fe=tt[it],De=void 0,N;if(typeof fe=="string")N=!1;else{var A=je[it.charAt(0)];if(A)De=it.match(A[1]),fe=A[0];else{for(var P=0;P<We;++P)if(A=Re[P],De=it.match(A[1]),De){fe=A[0];break}De||(fe=C)}N=fe.length>=5&&fe.substring(0,5)==="lang-",N&&!(De&&typeof De[1]=="string")&&(N=!1,fe=k),N||(tt[it]=fe)}var v=yt;if(yt+=it.length,!N)et.push(qe+v,fe);else{var y=De[1],x=it.indexOf(y),S=x+y.length;De[2]&&(S=it.length-De[2].length,x=S-y.length);var V=fe.substring(5);H(Qe,qe+v,it.substring(0,x),Oe,et),H(Qe,qe+v+x,y,R(V,y),et),H(Qe,qe+v+S,it.substring(S),Oe,et)}}Ie.decorations=et};return Oe}function Ye(de){var Re=[],je=[];de.tripleQuotedStrings?Re.push([te,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):de.multiLineStrings?Re.push([te,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([te,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),de.verbatimStrings&&je.push([te,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Je=de.hashComments;Je&&(de.cStyleComments?(Je>1?Re.push([q,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([q,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([te,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([q,/^#[^\r\n]*/,null,"#"])),de.cStyleComments&&(je.push([q,/^\/\/[^\r\n]*/,null]),je.push([q,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var We=de.regexLiterals;if(We){var Oe=We>1?"":`
|
|
\r`,Ie=Oe?".":"[\\S\\s]",pt="/(?=[^/*"+Oe+"])(?:[^/\\x5B\\x5C"+Oe+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Oe+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+Pe+"("+pt+")")])}var qe=de.types;qe&&je.push([se,qe]);var Qe=(""+de.keywords).replace(/^ | $/g,"");Qe.length&&je.push([me,new RegExp("^(?:"+Qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([C,/^\s+/,null,` \r
|
|
\xA0`]);var et="^.[^\\s\\w.$@'\"`/\\\\]*";return de.regexLiterals&&(et+="(?!s*/)"),je.push([Se,/^@[a-z_$][a-z_$@0-9]*/i,null],[se,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[C,/^[a-z_$][a-z_$@0-9]*/i,null],[Se,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[C,/^\\[\s\S]?/,null],[re,new RegExp(et),null]),Ke(Re,je)}var Le=Ye({keywords:Ue,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ke(de,Re,je){for(var Je=/(?:^|\s)nocode(?:\s|$)/,We=/\r\n?|\n/,Oe=de.ownerDocument,Ie=Oe.createElement("li");de.firstChild;)Ie.appendChild(de.firstChild);var pt=[Ie];function qe(le){var gt=le.nodeType;if(gt==1&&!Je.test(le.className))if(le.nodeName==="br")Qe(le),le.parentNode&&le.parentNode.removeChild(le);else for(var it=le.firstChild;it;it=it.nextSibling)qe(it);else if((gt==3||gt==4)&&je){var fe=le.nodeValue,De=fe.match(We);if(De){var N=fe.substring(0,De.index);le.nodeValue=N;var A=fe.substring(De.index+De[0].length);if(A){var P=le.parentNode;P.insertBefore(Oe.createTextNode(A),le.nextSibling)}Qe(le),N||le.parentNode.removeChild(le)}}}function Qe(le){for(;!le.nextSibling;)if(le=le.parentNode,!le)return;function gt(De,N){var A=N?De.cloneNode(!1):De,P=De.parentNode;if(P){var v=gt(P,1),y=De.nextSibling;v.appendChild(A);for(var x=y;x;x=y)y=x.nextSibling,v.appendChild(x)}return A}for(var it=gt(le.nextSibling,0),fe;(fe=it.parentNode)&&fe.nodeType===1;)it=fe;pt.push(it)}for(var et=0;et<pt.length;++et)qe(pt[et]);Re===(Re|0)&&pt[0].setAttribute("value",Re);var yt=Oe.createElement("ol");yt.className="linenums";for(var lt=Math.max(0,Re-1|0)||0,et=0,tt=pt.length;et<tt;++et)Ie=pt[et],Ie.className="L"+(et+lt)%10,Ie.firstChild||Ie.appendChild(Oe.createTextNode("\xA0")),yt.appendChild(Ie);de.appendChild(yt)}function ve(de){var Re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Re=Re&&+Re[1]<=8;var je=/\n/g,Je=de.sourceCode,We=Je.length,Oe=0,Ie=de.spans,pt=Ie.length,qe=0,Qe=de.decorations,et=Qe.length,yt=0;Qe[et]=We;var lt,tt;for(tt=lt=0;tt<et;)Qe[tt]!==Qe[tt+2]?(Qe[lt++]=Qe[tt++],Qe[lt++]=Qe[tt++]):tt+=2;for(et=lt,tt=lt=0;tt<et;){for(var le=Qe[tt],gt=Qe[tt+1],it=tt+2;it+2<=et&&Qe[it+1]===gt;)it+=2;Qe[lt++]=le,Qe[lt++]=gt,tt=it}et=Qe.length=lt;var fe=de.sourceNode,De="";fe&&(De=fe.style.display,fe.style.display="none");try{for(var N=null;qe<pt;){var A=Ie[qe],P=Ie[qe+2]||We,v=Qe[yt+2]||We,it=Math.min(P,v),y=Ie[qe+1],x;if(y.nodeType!==1&&(x=Je.substring(Oe,it))){Re&&(x=x.replace(je,"\r")),y.nodeValue=x;var S=y.ownerDocument,V=S.createElement("span");V.className=Qe[yt+1];var I=y.parentNode;I.replaceChild(V,y),V.appendChild(y),Oe<P&&(Ie[qe+1]=y=S.createTextNode(Je.substring(it,P)),I.insertBefore(y,V.nextSibling))}Oe=it,Oe>=P&&(qe+=2),Oe>=v&&(yt+=2)}}finally{fe&&(fe.style.display=De)}}var Ee={};function z(de,Re){for(var je=Re.length;--je>=0;){var Je=Re[je];Ee.hasOwnProperty(Je)?X.console&&console.warn("cannot override language handler %s",Je):Ee[Je]=de}}function R(de,Re){return de&&Ee.hasOwnProperty(de)||(de=/^\s*</.test(Re)?"default-markup":"default-code"),Ee[de]}z(Le,["default-code"]),z(Ke([],[[C,/^[^<?]+/],[W,/^<!\w[^>]*(?:>|$)/],[q,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[re,/^(?:<[%?]|[%?]>)/],["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"]),z(Ke([[C,/^[\s]+/,null,` \r
|
|
`],[ge,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Z,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ne,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[re,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),z(Ke([],[[ge,/^[\s\S]+/]]),["uq.val"]),z(Ye({keywords:M,hashComments:!0,cStyleComments:!0,types:oe}),["c","cc","cpp","cxx","cyc","m"]),z(Ye({keywords:"null,true,false"}),["json"]),z(Ye({keywords:Y,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:oe}),["cs"]),z(Ye({keywords:ie,cStyleComments:!0}),["java"]),z(Ye({keywords:Te,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),z(Ye({keywords:J,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),z(Ye({keywords:D,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),z(Ye({keywords:$,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),z(Ye({keywords:j,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),z(Ye({keywords:B,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),z(Ke([],[[te,/^[\s\S]+/]]),["regex"]);function Be(de){var Re=de.langExtension;try{var je=g(de.sourceNode,de.pre),Je=je.sourceCode;de.sourceCode=Je,de.spans=je.spans,de.basePos=0,R(Re,Je)(de),ve(de)}catch(We){X.console&&console.log(We&&We.stack||We)}}function $e(de,Re,je){var Je=je||!1,We=Re||null,Oe=document.createElement("div");Oe.innerHTML="<pre>"+de+"</pre>",Oe=Oe.firstChild,Je&&ke(Oe,Je,!0);var Ie={langExtension:We,numberLines:Je,sourceNode:Oe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Be(Ie),Oe.innerHTML}function ft(de,Re){var je=Re||document.body,Je=je.ownerDocument||document;function We(A){return je.getElementsByTagName(A)}for(var Oe=[We("pre"),We("code"),We("xmp")],Ie=[],pt=0;pt<Oe.length;++pt)for(var qe=0,Qe=Oe[pt].length;qe<Qe;++qe)Ie.push(Oe[pt][qe]);Oe=null;var et=Date;et.now||(et={now:function(){return+new Date}});var yt=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,tt=/\bprettyprint\b/,le=/\bprettyprinted\b/,gt=/pre|xmp/i,it=/^code$/i,fe=/^(?:pre|code|xmp)$/i,De={};function N(){for(var A=X.PR_SHOULD_USE_CONTINUATION?et.now()+250:Infinity;yt<Ie.length&&et.now()<A;yt++){for(var P=Ie[yt],v=De,y=P;y=y.previousSibling;){var x=y.nodeType,S=(x===7||x===8)&&y.nodeValue;if(S?!/^\??prettify\b/.test(S):x!==3||/\S/.test(y.nodeValue))break;if(S){v={},S.replace(/\b(\w+)=([\w:.%+-]+)/g,function(St,ht,pi){v[ht]=pi});break}}var V=P.className;if((v!==De||tt.test(V))&&!le.test(V)){for(var I=!1,ye=P.parentNode;ye;ye=ye.parentNode){var Ve=ye.tagName;if(fe.test(Ve)&&ye.className&&tt.test(ye.className)){I=!0;break}}if(!I){P.className+=" prettyprinted";var ut=v.lang;if(!ut){ut=V.match(lt);var nt;!ut&&(nt=Ce(P))&&it.test(nt.tagName)&&(ut=nt.className.match(lt)),ut&&(ut=ut[1])}var Mt;if(gt.test(P.tagName))Mt=1;else{var _t=P.currentStyle,st=Je.defaultView,Xt=_t?_t.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(P,null).getPropertyValue("white-space"):0;Mt=Xt&&Xt.substring(0,3)==="pre"}var Lt=v.linenums;(Lt=Lt==="true"||+Lt)||(Lt=V.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&ke(P,Lt,Mt);var Ct={langExtension:ut,sourceNode:P,numberLines:Lt,pre:Mt,sourceCode:null,basePos:null,spans:null,decorations:null};Be(Ct)}}}yt<Ie.length?X.setTimeout(N,250):typeof de=="function"&&de()}N()}var rt=X.PR={createSimpleLexer:Ke,registerLangHandler:z,sourceDecorator:Ye,PR_ATTRIB_NAME:ne,PR_ATTRIB_VALUE:ge,PR_COMMENT:q,PR_DECLARATION:W,PR_KEYWORD:me,PR_LITERAL:Se,PR_NOCODE:Q,PR_PLAIN:C,PR_PUNCTUATION:re,PR_SOURCE:k,PR_STRING:te,PR_TAG:Z,PR_TYPE:se,prettyPrintOne:ee?X.prettyPrintOne=$e:he=$e,prettyPrint:O=ee?X.prettyPrint=ft:O=ft},Ge=X.define;typeof Ge=="function"&&Ge.amd&&Ge("google-code-prettify",[],function(){return rt})})()},UUDw:function(xt,Xe,b){xt.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return U});var U=function(ee){var pe=document.createElement("textarea");return pe.value=ee,pe.value}},"VrN/":function(xt,Xe,b){(function(U,Me){xt.exports=Me()})(this,function(){"use strict";var U=navigator.userAgent,Me=navigator.platform,ee=/gecko\/\d/i.test(U),pe=/MSIE \d/.test(U),ue=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(U),he=/Edge\/(\d+)/.exec(U),O=pe||ue||he,X=O&&(pe?document.documentMode||6:+(he||ue)[1]),K=!he&&/WebKit\//.test(U),ae=K&&/Qt\/\d+\.\d+/.test(U),T=!he&&/Chrome\//.test(U),M=/Opera\//.test(U),ie=/Apple Computer/.test(navigator.vendor),Y=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(U),B=/PhantomJS/.test(U),j=!he&&/AppleWebKit/.test(U)&&/Mobile\/\w+/.test(U),D=/Android/.test(U),J=j||D||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(U),$=j||/Mac/.test(Me),Te=/\bCrOS\b/.test(U),Ue=/win/i.test(Me),oe=M&&U.match(/Version\/(\d*\.\d*)/);oe&&(oe=Number(oe[1])),oe&&oe>=15&&(M=!1,K=!0);var te=$&&(ae||M&&(oe==null||oe<12.11)),me=ee||O&&X>=9;function q(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var se=function(e,t){var n=e.className,i=q(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function Se(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function re(e,t){return Se(e).appendChild(t)}function C(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),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 Z(e,t,n,i){var r=C(e,t,n,i);return r.setAttribute("role","presentation"),r}var W;document.createRange?W=function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:W=function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};function k(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 ne(){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 ge(e,t){var n=e.className;q(t).test(n)||(e.className+=(n?" ":"")+t)}function Q(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!q(n[i]).test(t)&&(t+=" "+n[i]);return t}var Pe=function(e){e.select()};j?Pe=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:O&&(Pe=function(e){try{e.select()}catch(t){}});function w(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,n){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(n!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function H(e,t,n,i,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=i||0,l=r||0;;){var f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=n-l%n,s=f+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=w(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Ce(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ke=50,Ye={toString:function(){return"CodeMirror.Pass"}},Le={scroll:!1},ke={origin:"*mouse"},ve={origin:"+move"};function Ee(e,t,n){for(var i=0,r=0;;){var s=e.indexOf(" ",i);s==-1&&(s=e.length);var l=s-i;if(s==e.length||r+l>=t)return i+Math.min(l,t-r);if(r+=s-i,r+=n-r%n,i=s+1,r>=t)return i}}var z=[""];function R(e){for(;z.length<=e;)z.push(Be(z)+" ");return z[e]}function Be(e){return e[e.length-1]}function $e(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function ft(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)}function rt(){}function Ge(e,t){var n;return Object.create?n=Object.create(e):(rt.prototype=e,n=new rt),t&&g(t,n),n}var de=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Re(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||de.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function Je(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var We=/[\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 Oe(e){return e.charCodeAt(0)>=768&&We.test(e)}function Ie(e,t,n){for(;(n<0?t>0:t<e.length)&&Oe(e.charAt(t));)t+=n;return t}function pt(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,s=i<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:n;e(s)?n=s:t=s+i}}function qe(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<n&&l.to>t||t==n&&l.to==t)&&(i(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",s),r=!0)}r||i(t,n,"ltr")}var Qe=null;function et(e,t,n){var i;Qe=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&&n=="before"?i=r:Qe=r),s.from==t&&(s.from!=s.to&&n!="before"?i=r:Qe=r)}return i!=null?i:Qe}var yt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function p(m,E,_){this.level=m,this.from=E,this.to=_}return function(m,E){var _=E=="ltr"?"L":"R";if(m.length==0||E=="ltr"&&!i.test(m))return!1;for(var G=m.length,F=[],ce=0;ce<G;++ce)F.push(n(m.charCodeAt(ce)));for(var _e=0,Ne=_;_e<G;++_e){var He=F[_e];He=="m"?F[_e]=Ne:Ne=He}for(var Ze=0,ze=_;Ze<G;++Ze){var at=F[Ze];at=="1"&&ze=="r"?F[Ze]="n":s.test(at)&&(ze=at,at=="r"&&(F[Ze]="R"))}for(var wt=1,vt=F[0];wt<G-1;++wt){var At=F[wt];At=="+"&&vt=="1"&&F[wt+1]=="1"?F[wt]="1":At==","&&vt==F[wt+1]&&(vt=="1"||vt=="n")&&(F[wt]=vt),vt=At}for(var Yt=0;Yt<G;++Yt){var di=F[Yt];if(di==",")F[Yt]="N";else if(di=="%"){var Jt=void 0;for(Jt=Yt+1;Jt<G&&F[Jt]=="%";++Jt);for(var Ni=Yt&&F[Yt-1]=="!"||Jt<G&&F[Jt]=="1"?"1":"N",Mi=Yt;Mi<Jt;++Mi)F[Mi]=Ni;Yt=Jt-1}}for(var oi=0,Ai=_;oi<G;++oi){var vi=F[oi];Ai=="L"&&vi=="1"?F[oi]="L":s.test(vi)&&(Ai=vi)}for(var li=0;li<G;++li)if(r.test(F[li])){var ai=void 0;for(ai=li+1;ai<G&&r.test(F[ai]);++ai);for(var Qt=(li?F[li-1]:_)=="L",Oi=(ai<G?F[ai]:_)=="L",ur=Qt==Oi?Qt?"L":"R":_,Tn=li;Tn<ai;++Tn)F[Tn]=ur;li=ai-1}for(var bi=[],an,fi=0;fi<G;)if(l.test(F[fi])){var Yo=fi;for(++fi;fi<G&&l.test(F[fi]);++fi);bi.push(new p(0,Yo,fi))}else{var gn=fi,Wn=bi.length,Hn=E=="rtl"?1:0;for(++fi;fi<G&&F[fi]!="L";++fi);for(var Ci=gn;Ci<fi;)if(f.test(F[Ci])){gn<Ci&&(bi.splice(Wn,0,new p(1,gn,Ci)),Wn+=Hn);var hr=Ci;for(++Ci;Ci<fi&&f.test(F[Ci]);++Ci);bi.splice(Wn,0,new p(2,hr,Ci)),Wn+=Hn,gn=Ci}else++Ci;gn<fi&&bi.splice(Wn,0,new p(1,gn,fi))}return E=="ltr"&&(bi[0].level==1&&(an=m.match(/^\s+/))&&(bi[0].from=an[0].length,bi.unshift(new p(0,0,an[0].length))),Be(bi).level==1&&(an=m.match(/\s+$/))&&(Be(bi).to-=an[0].length,bi.push(new p(0,G-an[0].length,G)))),E=="rtl"?bi.reverse():bi}}();function lt(e,t){var n=e.order;return n==null&&(n=e.order=yt(e.text,t)),n}var tt=[],le=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||tt).concat(n)}};function gt(e,t){return e._handlers&&e._handlers[t]||tt}function it(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var s=Ce(r,n);s>-1&&(i[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function fe(e,t){var n=gt(e,t);if(!n.length)return;for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function De(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,n||t.type,e,t),x(t)||t.codemirrorIgnore}function N(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)Ce(n,t[i])==-1&&n.push(t[i])}function A(e,t){return gt(e,t).length>0}function P(e){e.prototype.on=function(t,n){le(this,t,n)},e.prototype.off=function(t,n){it(this,t,n)}}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function x(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function S(e){v(e),y(e)}function V(e){return e.target||e.srcElement}function I(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),$&&e.ctrlKey&&t==1&&(t=3),t}var ye=function(){if(O&&X<9)return!1;var e=C("div");return"draggable"in e||"dragDrop"in e}(),Ve;function ut(e){if(Ve==null){var t=C("span","\u200B");re(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ve=t.offsetWidth<=1&&t.offsetHeight>2&&!(O&&X<8))}var n=Ve?C("span","\u200B"):C("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var nt;function Mt(e){if(nt!=null)return nt;var t=re(e,document.createTextNode("A\u062EA")),n=W(t,0,1).getBoundingClientRect(),i=W(t,1,2).getBoundingClientRect();return Se(e),!n||n.left==n.right?!1:nt=i.right-n.right<3}var _t=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],i=e.length;t<=i;){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?(n.push(s.slice(0,l)),t+=l+1):(n.push(s),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},st=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(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Xt=function(){var e=C("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function Ct(e){if(Lt!=null)return Lt;var t=re(e,C("span","x")),n=t.getBoundingClientRect(),i=W(t,0,1).getBoundingClientRect();return Lt=Math.abs(n.left-i.left)>1}var St={},ht={};function pi(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=t}function qt(e,t){ht[e]=t}function mt(e){if(typeof e=="string"&&ht.hasOwnProperty(e))e=ht[e];else if(e&&typeof e.name=="string"&&ht.hasOwnProperty(e.name)){var t=ht[e.name];typeof t=="string"&&(t={name:t}),e=Ge(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return mt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return mt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wi(e,t){t=mt(t);var n=St[t.name];if(!n)return wi(e,"text/plain");var i=n(e,t);if(ii.hasOwnProperty(t.name)){var r=ii[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=r[s]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)i[l]=t.modeProps[l];return i}var ii={};function Gt(e,t){var n=ii.hasOwnProperty(e)?ii[e]:ii[e]={};g(t,n)}function Gi(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function sn(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function ln(e,t,n){return e.startState?e.startState(t,n):!0}var It=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};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),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)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=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},It.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},It.prototype.match=function(e,t,n){if(typeof e=="string"){var i=function(l){return n?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(i(r)==i(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 n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],s=r.chunkSize();if(t<s){n=r;break}t-=s}return n.lines[t]}function Ii(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,function(s){var l=s.text;r==n.line&&(l=l.slice(0,n.ch)),r==t.line&&(l=l.slice(t.ch)),i.push(l),++r}),i}function un(e,t,n){var i=[];return e.iter(t,n,function(r){i.push(r.text)}),i}function Si(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,n=Ce(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;!(i.children[r]==t);++r)n+=i.children[r].chunkSize();return n+t.first}function Bi(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],s=r.height;if(t<s){e=r;continue e}t-=s,n+=r.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var f=e.lines[l],p=f.height;if(t<p)break;t-=p}return n+l}function Yi(e,t){return t>=e.first&&t<e.first+e.size}function hn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ae(e,t,n){if(n===void 0&&(n=null),!(this instanceof Ae))return new Ae(e,t,n);this.line=e,this.ch=t,this.sticky=n}function kt(e,t){return e.line-t.line||e.ch-t.ch}function cn(e,t){return e.sticky==t.sticky&&kt(e,t)==0}function Ln(e){return Ae(e.line,e.ch)}function dn(e,t){return kt(e,t)<0?t:e}function Mn(e,t){return kt(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 Ae(e.first,0);var n=e.first+e.size-1;return t.line>n?Ae(n,ct(e,n).text.length):a(t,ct(e,t.line).text.length)}function a(e,t){var n=e.ch;return n==null||n>t?Ae(e.line,t):n<0?Ae(e.line,0):e}function u(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=o(e,t[i]);return n}var d=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||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,n){return t instanceof d?new h(e,Gi(e.mode,t.state),n,t.lookAhead):new h(e,Gi(e.mode,t),n)},h.prototype.save=function(e){var t=e!==!1?Gi(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new d(t,this.maxLookAhead):t};function L(e,t,n,i){var r=[e.state.modeGen],s={};Ui(e,t.text,e.doc.mode,n,function(m,E){return r.push(m,E)},s,i);for(var l=n.state,f=function(m){n.baseTokens=r;var E=e.state.overlays[m],_=1,G=0;n.state=!0,Ui(e,t.text,E.mode,n,function(F,ce){for(var _e=_;G<F;){var Ne=r[_];Ne>F&&r.splice(_,1,F,r[_+1],Ne),_+=2,G=Math.min(F,Ne)}if(!ce)return;if(E.opaque)r.splice(_e,_-_e,F,"overlay "+ce),_=_e+2;else for(;_e<_;_e+=2){var He=r[_e+1];r[_e+1]=(He?He+" ":"")+"overlay "+ce}},s),n.state=l,n.baseTokens=null,n.baseTokenPos=1},p=0;p<e.state.overlays.length;++p)f(p);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function xe(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=Fe(e,Ot(t)),r=t.text.length>e.options.maxHighlightLength&&Gi(e.doc.mode,i.state),s=L(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Fe(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new h(i,!0,t);var s=si(e,t,n),l=s>i.first&&ct(i,s-1).stateAfter,f=l?h.fromSaved(i,l,s):new h(i,ln(i.mode),s);return i.iter(s,t,function(p){ot(e,p.text,f);var m=f.line;p.stateAfter=m==t-1||m%5==0||m>=r.viewFrom&&m<r.viewTo?f.save():null,f.nextLine()}),n&&(i.modeFrontier=f.line),f}function ot(e,t,n,i){var r=e.doc.mode,s=new It(t,e.options.tabSize,n);for(s.start=s.pos=i||0,t==""&&we(r,n.state);!s.eol();)Et(r,s,n.state),s.start=s.pos}function we(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=sn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Et(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=sn(e,n).mode);var s=e.token(t,n);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Dt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Kt(e,t,n,i){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ct(r,t.line),p=Fe(e,t.line,n),m=new It(f.text,e.options.tabSize,p),E;for(i&&(E=[]);(i||m.pos<t.ch)&&!m.eol();)m.start=m.pos,l=Et(s,m,p.state),i&&E.push(new Dt(m,l,Gi(r.mode,p.state)));return i?E:new Dt(m,l,p.state)}function ji(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";t[i]==null?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function Ui(e,t,n,i,r,s,l){var f=n.flattenSpans;f==null&&(f=e.options.flattenSpans);var p=0,m=null,E=new It(t,e.options.tabSize,i),_,G=e.options.addModeClass&&[null];for(t==""&&ji(we(n,i.state),s);!E.eol();){if(E.pos>e.options.maxHighlightLength?(f=!1,l&&ot(e,t,i,E.pos),E.pos=t.length,_=null):_=ji(Et(n,E,i.state,G),s),G){var F=G[0].name;F&&(_="m-"+(_?F+" "+_:F))}if(!f||m!=_){for(;p<E.start;)p=Math.min(E.start,p+5e3),r(p,m);m=_}E.start=E.pos}for(;p<E.pos;){var ce=Math.min(E.pos,p+5e3);r(ce,m),p=ce}}function si(e,t,n){for(var i,r,s=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var p=ct(s,f-1),m=p.stateAfter;if(m&&(!n||f+(m instanceof d?m.lookAhead:0)<=s.modeFrontier))return f;var E=H(p.text,null,e.options.tabSize);(r==null||i>E)&&(r=f-1,i=E)}return r}function Vi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,i=t-1;i>n;i--){var r=ct(e,i).stateAfter;if(r&&(!(r instanceof d)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var zn=!1,Ei=!1;function Fi(){zn=!0}function Ri(){Ei=!0}function vn(e,t,n){this.marker=e,this.from=t,this.to=n}function $i(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function fn(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!n||!s.marker.insertLeft)){var p=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push(new vn(l,s.from,p?null:s.to))}}return i}function Gn(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!n||s.marker.insertLeft)){var p=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(i||(i=[])).push(new vn(l,p?null:s.from-t,s.to==null?null:s.to-t))}}return i}function Ji(e,t){if(t.full)return null;var n=Yi(e,t.from.line)&&ct(e,t.from.line).markedSpans,i=Yi(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,s=t.to.ch,l=kt(t.from,t.to)==0,f=cr(n,r,l),p=Gn(i,s,l),m=t.text.length==1,E=Be(t.text).length+(m?r:0);if(f)for(var _=0;_<f.length;++_){var G=f[_];if(G.to==null){var F=$i(p,G.marker);F?m&&(G.to=F.to==null?null:F.to+E):G.to=r}}if(p)for(var ce=0;ce<p.length;++ce){var _e=p[ce];if(_e.to!=null&&(_e.to+=E),_e.from==null){var Ne=$i(f,_e.marker);Ne||(_e.from=E,m&&(f||(f=[])).push(_e))}else _e.from+=E,m&&(f||(f=[])).push(_e)}f&&(f=Wi(f)),p&&p!=f&&(p=Wi(p));var He=[f];if(!m){var Ze=t.text.length-2,ze;if(Ze>0&&f)for(var at=0;at<f.length;++at)f[at].to==null&&(ze||(ze=[])).push(new vn(f[at].marker,null,null));for(var wt=0;wt<Ze;++wt)He.push(ze);He.push(p)}return He}function Wi(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function An(e,t,n){var i=null;if(e.iter(t.line,n.line+1,function(F){if(F.markedSpans)for(var ce=0;ce<F.markedSpans.length;++ce){var _e=F.markedSpans[ce].marker;_e.readOnly&&(!i||Ce(i,_e)==-1)&&(i||(i=[])).push(_e)}}),!i)return null;for(var r=[{from:t,to:n}],s=0;s<i.length;++s)for(var l=i[s],f=l.find(0),p=0;p<r.length;++p){var m=r[p];if(kt(m.to,f.from)<0||kt(m.from,f.to)>0)continue;var E=[p,1],_=kt(m.from,f.from),G=kt(m.to,f.to);(_<0||!l.inclusiveLeft&&!_)&&E.push({from:m.from,to:f.from}),(G>0||!l.inclusiveRight&&!G)&&E.push({from:f.to,to:m.to}),r.splice.apply(r,E),p+=E.length-3}return r}function On(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function dr(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Zt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function mi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var i=e.find(),r=t.find(),s=kt(i.from,r.from)||Zt(e)-Zt(t);if(s)return-s;var l=kt(i.to,r.to)||jt(e)-jt(t);return l||t.id-e.id}function Bt(e,t){var n=Ei&&e.markedSpans,i;if(n)for(var r=void 0,s=0;s<n.length;++s)r=n[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!i||mi(i,r.marker)<0)&&(i=r.marker);return i}function ni(e){return Bt(e,!0)}function Wt(e){return Bt(e,!1)}function nn(e,t){var n=Ei&&e.markedSpans,i;if(n)for(var r=0;r<n.length;++r){var s=n[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!i||mi(i,s.marker)<0)&&(i=s.marker)}return i}function ei(e,t,n,i,r){var s=ct(e,t),l=Ei&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var p=l[f];if(!p.marker.collapsed)continue;var m=p.marker.find(0),E=kt(m.from,n)||Zt(p.marker)-Zt(r),_=kt(m.to,i)||jt(p.marker)-jt(r);if(E>=0&&_<=0||E<=0&&_>=0)continue;if(E<=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?kt(m.to,n)>=0:kt(m.to,n)>0)||E>=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?kt(m.from,i)<=0:kt(m.from,i)<0))return!0}}function ki(e){for(var t;t=ni(e);)e=t.find(-1,!0).line;return e}function Vn(e){for(var t;t=Wt(e);)e=t.find(1,!0).line;return e}function Xn(e){for(var t,n;t=Wt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function yn(e,t){var n=ct(e,t),i=ki(n);return n==i?t:Ot(i)}function Ur(e,t){if(t>e.lastLine())return t;var n=ct(e,t),i;if(!Di(e,n))return t;for(;i=Wt(n);)n=i.find(1,!0).line;return Ot(n)+1}function Di(e,t){var n=Ei&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r){if(i=n[r],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&fr(e,t,i))return!0}}function fr(e,t,n){if(n.to==null){var i=n.marker.find(1,!0);return fr(e,i.line,$i(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.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==n.to&&(r.to==null||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&fr(e,t,r))return!0}function Zi(e){e=ki(e);for(var t=0,n=e.parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var s=n.parent;s;n=s,s=n.parent)for(var l=0;l<s.children.length;++l){var f=s.children[l];if(f==n)break;t+=f.height}return t}function Kn(e){if(e.height==0)return 0;for(var t=e.text.length,n,i=e;n=ni(i);){var r=n.find(0,!0);i=r.from.line,t+=r.from.ch-r.to.ch}for(i=e;n=Wt(i);){var s=n.find(0,!0);t-=i.text.length-s.from.ch,i=s.to.line,t+=i.text.length-s.to.ch}return t}function Fr(e){var t=e.display,n=e.doc;t.maxLine=ct(n,n.first),t.maxLineLength=Kn(t.maxLine),t.maxLineChanged=!0,n.iter(function(i){var r=Kn(i);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=i)})}var Rn=function(e,t,n){this.text=e,dr(this,t),this.height=n?n(this):1};Rn.prototype.lineNo=function(){return Ot(this)},P(Rn);function Jo(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),On(e),dr(e,n);var r=i?i(e):1;r!=e.height&&Si(e,r)}function ho(e){e.parent=null,On(e)}var dt={},Tt={};function bt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Tt:dt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Rt(e,t){var n=Z("span",null,null,K?"padding-right: .1px":null),i={pre:Z("pre",[n],"CodeMirror-line"),content:n,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;i.pos=0,i.addToken=zt,Mt(e.display.measure)&&(l=lt(s,e.doc.direction))&&(i.addToken=ri(i.addToken,l)),i.map=[];var f=t!=e.display.externalMeasured&&Ot(s);Pt(s,i,xe(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=Q(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=Q(s.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(ut(e.display.measure))),r==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(K){var p=i.content.lastChild;(/\bcm-tab\b/.test(p.className)||p.querySelector&&p.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=Q(i.pre.className,i.textClass||"")),i}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 zt(e,t,n,i,r,s,l){if(!t)return;var f=e.splitSpaces?Nt(t,e.trailingSpace):t,p=e.cm.state.specialChars,m=!1,E;if(!p.test(t))e.col+=t.length,E=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,E),O&&X<9&&(m=!0),e.pos+=t.length;else{E=document.createDocumentFragment();for(var _=0;;){p.lastIndex=_;var G=p.exec(t),F=G?G.index-_:t.length-_;if(F){var ce=document.createTextNode(f.slice(_,_+F));O&&X<9?E.appendChild(C("span",[ce])):E.appendChild(ce),e.map.push(e.pos,e.pos+F,ce),e.col+=F,e.pos+=F}if(!G)break;_+=F+1;var _e=void 0;if(G[0]==" "){var Ne=e.cm.options.tabSize,He=Ne-e.col%Ne;_e=E.appendChild(C("span",R(He),"cm-tab")),_e.setAttribute("role","presentation"),_e.setAttribute("cm-text"," "),e.col+=He}else G[0]=="\r"||G[0]==`
|
|
`?(_e=E.appendChild(C("span",G[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_e.setAttribute("cm-text",G[0]),e.col+=1):(_e=e.cm.options.specialCharPlaceholder(G[0]),_e.setAttribute("cm-text",G[0]),O&&X<9?E.appendChild(C("span",[_e])):E.appendChild(_e),e.col+=1);e.map.push(e.pos,e.pos+1,_e),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,n||i||r||m||s||l){var Ze=n||"";i&&(Ze+=i),r&&(Ze+=r);var ze=C("span",[E],Ze,s);if(l)for(var at in l)l.hasOwnProperty(at)&&at!="style"&&at!="class"&&ze.setAttribute(at,l[at]);return e.content.appendChild(ze)}e.content.appendChild(E)}function Nt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&n&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),i+=s,n=s==" "}return i}function ri(e,t){return function(n,i,r,s,l,f,p){r=r?r+" cm-force-border":"cm-force-border";for(var m=n.pos,E=m+i.length;;){for(var _=void 0,G=0;G<t.length&&!(_=t[G],_.to>m&&_.from<=m);G++);if(_.to>=E)return e(n,i,r,s,l,f,p);e(n,i.slice(0,_.to-m),r,s,null,f,p),s=null,i=i.slice(_.to-m),m=_.to}}}function _i(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Pt(e,t,n){var i=e.markedSpans,r=e.text,s=0;if(!i){for(var l=1;l<n.length;l+=2)t.addToken(t,r.slice(s,s=n[l]),bt(n[l+1],t.cm.options));return}for(var f=r.length,p=0,m=1,E="",_,G,F=0,ce,_e,Ne,He,Ze;;){if(F==p){ce=_e=Ne=G="",Ze=null,He=null,F=Infinity;for(var ze=[],at=void 0,wt=0;wt<i.length;++wt){var vt=i[wt],At=vt.marker;if(At.type=="bookmark"&&vt.from==p&&At.widgetNode)ze.push(At);else if(vt.from<=p&&(vt.to==null||vt.to>p||At.collapsed&&vt.to==p&&vt.from==p)){if(vt.to!=null&&vt.to!=p&&F>vt.to&&(F=vt.to,_e=""),At.className&&(ce+=" "+At.className),At.css&&(G=(G?G+";":"")+At.css),At.startStyle&&vt.from==p&&(Ne+=" "+At.startStyle),At.endStyle&&vt.to==F&&(at||(at=[])).push(At.endStyle,vt.to),At.title&&((Ze||(Ze={})).title=At.title),At.attributes)for(var Yt in At.attributes)(Ze||(Ze={}))[Yt]=At.attributes[Yt];At.collapsed&&(!He||mi(He.marker,At)<0)&&(He=vt)}else vt.from>p&&F>vt.from&&(F=vt.from)}if(at)for(var di=0;di<at.length;di+=2)at[di+1]==F&&(_e+=" "+at[di]);if(!He||He.from==p)for(var Jt=0;Jt<ze.length;++Jt)_i(t,0,ze[Jt]);if(He&&(He.from||0)==p){if(_i(t,(He.to==null?f+1:He.to)-p,He.marker,He.from==null),He.to==null)return;He.to==p&&(He=!1)}}if(p>=f)break;for(var Ni=Math.min(f,F);;){if(E){var Mi=p+E.length;if(!He){var oi=Mi>Ni?E.slice(0,Ni-p):E;t.addToken(t,oi,_?_+ce:ce,Ne,p+oi.length==F?_e:"",G,Ze)}if(Mi>=Ni){E=E.slice(Ni-p),p=Ni;break}p=Mi,Ne=""}E=r.slice(s,s=n[m++]),_=bt(n[m++],t.cm.options)}}}function bn(e,t,n){this.line=t,this.rest=Xn(t),this.size=this.rest?Ot(Be(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Di(e,t)}function Ft(e,t,n){for(var i=[],r,s=t;s<n;s=r){var l=new bn(e.doc,ct(e.doc,s),s);r=s+l.size,i.push(l)}return i}var ui=null;function Xi(e){ui?ui.ops.push(e):e.ownsGroup=ui={ops:[e],delayedCallbacks:[]}}function Ki(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}function Wr(e,t){var n=e.ownsGroup;if(!n)return;try{Ki(n)}finally{ui=null,t(n)}}var pr=null;function gi(e,t){var n=gt(e,t);if(!n.length)return;var i=Array.prototype.slice.call(arguments,2),r;ui?r=ui.delayedCallbacks:pr?r=pr:(r=pr=[],setTimeout(Rs,0));for(var s=function(f){r.push(function(){return n[f].apply(null,i)})},l=0;l<n.length;++l)s(l)}function Rs(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function Zo(e,t,n,i){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?qo(e,t,n,i):s=="class"?co(e,t):s=="widget"&&Ns(e,t,i)}t.changes=null}function mr(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),O&&X<8&&(e.node.style.zIndex=2)),e.node}function Ds(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=mr(t);t.background=i.insertBefore(C("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function Qo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Rt(e,t)}function Ps(e,t){var n=t.text.className,i=Qo(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,co(e,t)):n&&(t.text.className=n)}function co(e,t){Ds(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function qo(e,t,n,i){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=mr(t);t.gutterBackground=C("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.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=mr(t),f=t.gutter=C("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(C("div",hn(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var p=0;p<e.display.gutterSpecs.length;++p){var m=e.display.gutterSpecs[p].className,E=s.hasOwnProperty(m)&&s[m];E&&f.appendChild(C("div",[E],"CodeMirror-gutter-elt","left: "+i.gutterLeft[m]+"px; width: "+i.gutterWidth[m]+"px"))}}}function Ns(e,t,n){t.alignable&&(t.alignable=null);for(var i=q("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);ea(e,t,n)}function Is(e,t,n,i){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,n,i),ea(e,t,i),t.node}function ea(e,t,n){if(ta(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)ta(e,t.rest[i],t,n,!1)}function ta(e,t,n,i,r){if(!t.widgets)return;for(var s=mr(n),l=0,f=t.widgets;l<f.length;++l){var p=f[l],m=C("div",[p.node],"CodeMirror-linewidget"+(p.className?" "+p.className:""));p.handleMouseEvents||m.setAttribute("cm-ignore-events","true"),Bs(p,m,n,i),e.display.input.setUneditable(m),r&&p.above?s.insertBefore(m,n.gutter||n.text):s.appendChild(m),gi(p,"redraw")}}function Bs(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!k(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),re(t.display.measure,C("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function pn(e,t){for(var n=V(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function fo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=re(e.measure,C("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function rn(e){return Ke-e.display.nativeBarWidth}function Dn(e){return e.display.scroller.clientWidth-rn(e)-e.display.barWidth}function po(e){return e.display.scroller.clientHeight-rn(e)-e.display.barHeight}function js(e,t,n){var i=e.options.lineWrapping,r=i&&Dn(e);if(!t.measure.heights||i&&t.measure.width!=r){var s=t.measure.heights=[];if(i){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),f=0;f<l.length-1;f++){var p=l[f],m=l[f+1];Math.abs(p.bottom-m.bottom)>2&&s.push((p.bottom+m.top)/2-n.top)}}s.push(n.bottom-n.top)}}function na(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var r=0;r<e.rest.length;r++)if(Ot(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=ki(t);var n=Ot(t),i=e.display.externalMeasured=new bn(e.doc,t,n);i.lineN=n;var r=i.built=Rt(e,i);return i.text=r.pre,re(e.display.lineMeasure,r.pre),i}function ra(e,t,n,i){return on(e,Yn(e,t),n,i)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[In(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Yn(e,t){var n=Ot(t),i=mo(e,n);i&&!i.text?i=null:i&&i.changes&&(Zo(e,i,n,Co(e)),e.curOp.forceUpdate=!0),i||(i=Us(e,t));var r=na(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function on(e,t,n,i,r){t.before&&(n=-1);var s=n+(i||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(js(e,t.view,t.rect),t.hasHeights=!0),l=Ws(e,t,n,i),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,n){for(var i,r,s,l,f,p,m=0;m<e.length;m+=3)if(f=e[m],p=e[m+1],t<f?(r=0,s=1,l="left"):t<p?(r=t-f,s=r+1):(m==e.length-3||t==p&&e[m+3]>t)&&(s=p-f,r=s-1,t>=p&&(l="right")),r!=null){if(i=e[m+2],f==p&&n==(i.insertLeft?"left":"right")&&(l=n),n=="left"&&r==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)i=e[(m-=3)+2],l="left";if(n=="right"&&r==p-f)for(;m<e.length-3&&e[m+3]==e[m+4]&&!e[m+5].insertLeft;)i=e[(m+=3)+2],l="right";break}return{node:i,start:r,end:s,collapse:l,coverStart:f,coverEnd:p}}function Fs(e,t){var n=oa;if(t=="left")for(var i=0;i<e.length&&!((n=e[i]).left!=n.right);i++);else for(var r=e.length-1;r>=0&&!((n=e[r]).left!=n.right);r--);return n}function Ws(e,t,n,i){var r=aa(t.map,n,i),s=r.node,l=r.start,f=r.end,p=r.collapse,m;if(s.nodeType==3){for(var E=0;E<4;E++){for(;l&&Oe(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Oe(t.line.text.charAt(r.coverStart+f));)++f;if(O&&X<9&&l==0&&f==r.coverEnd-r.coverStart?m=s.parentNode.getBoundingClientRect():m=Fs(W(s,l,f).getClientRects(),i),m.left||m.right||l==0)break;f=l,l=l-1,p="right"}O&&X<11&&(m=Hs(e.display.measure,m))}else{l>0&&(p=i="right");var _;e.options.lineWrapping&&(_=s.getClientRects()).length>1?m=_[i=="right"?_.length-1:0]:m=s.getBoundingClientRect()}if(O&&X<9&&!l&&(!m||!m.left&&!m.right)){var G=s.parentNode.getClientRects()[0];G?m={left:G.left,right:G.left+Jn(e.display),top:G.top,bottom:G.bottom}:m=oa}for(var F=m.top-t.rect.top,ce=m.bottom-t.rect.top,_e=(F+ce)/2,Ne=t.view.measure.heights,He=0;He<Ne.length-1&&!(_e<Ne[He]);He++);var Ze=He?Ne[He-1]:0,ze=Ne[He],at={left:(p=="right"?m.right:m.left)-t.rect.left,right:(p=="left"?m.left:m.right)-t.rect.left,top:Ze,bottom:ze};return!m.left&&!m.right&&(at.bogus=!0),e.options.singleCursorHeightPerLine||(at.rtop=F,at.rbottom=ce),at}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ct(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}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,Se(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 T&&D?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return T&&D?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function go(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=gr(e.widgets[n]));return t}function zr(e,t,n,i,r){if(!r){var s=go(t);n.top+=s,n.bottom+=s}if(i=="line")return n;i||(i="local");var l=Zi(t);if(i=="local"?l+=Hr(e.display):l-=e.display.viewOffset,i=="page"||i=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(i=="window"?0:ha());var p=f.left+(i=="window"?0:ua());n.left+=p,n.right+=p}return n.top+=l,n.bottom+=l,n}function ca(e,t,n){if(n=="div")return t;var i=t.left,r=t.top;if(n=="page")i-=ua(),r-=ha();else if(n=="local"||!n){var s=e.display.sizer.getBoundingClientRect();i+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:i-l.left,top:r-l.top}}function vo(e,t,n,i,r){return i||(i=ct(e.doc,t.line)),zr(e,i,ra(e,i,t.ch,r),n)}function Qi(e,t,n,i,r,s){i=i||ct(e.doc,t.line),r||(r=Yn(e,i));function l(ce,_e){var Ne=on(e,r,ce,_e?"right":"left",s);return _e?Ne.left=Ne.right:Ne.right=Ne.left,zr(e,i,Ne,n)}var f=lt(i,e.doc.direction),p=t.ch,m=t.sticky;if(p>=i.text.length?(p=i.text.length,m="before"):p<=0&&(p=0,m="after"),!f)return l(m=="before"?p-1:p,m=="before");function E(ce,_e,Ne){var He=f[_e],Ze=He.level==1;return l(Ne?ce-1:ce,Ze!=Ne)}var _=et(f,p,m),G=Qe,F=E(p,_,m=="before");return G!=null&&(F.other=E(p,G,m!="before")),F}function da(e,t){var n=0;t=o(e.doc,t),e.options.lineWrapping||(n=Jn(e.display)*t.ch);var i=ct(e.doc,t.line),r=Zi(i)+Hr(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function yo(e,t,n,i,r){var s=Ae(e,t,n);return s.xRel=r,i&&(s.outside=i),s}function bo(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,n<0)return yo(i.first,0,null,-1,-1);var r=Bi(i,n),s=i.first+i.size-1;if(r>s)return yo(i.first+i.size-1,ct(i,s).text.length,null,1,1);t<0&&(t=0);for(var l=ct(i,r);;){var f=zs(e,l,r,t,n),p=nn(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!p)return f;var m=p.find(1);if(m.line==r)return m;l=ct(i,r=m.line)}}function fa(e,t,n,i){i-=go(t);var r=t.text.length,s=pt(function(l){return on(e,n,l-1).bottom<=i},r,0);return r=pt(function(l){return on(e,n,l).top>i},s,r),{begin:s,end:r}}function pa(e,t,n,i){n||(n=Yn(e,t));var r=zr(e,t,on(e,n,i),"line").top;return fa(e,t,n,r)}function xo(e,t,n,i){return e.bottom<=n?!1:e.top>n?!0:(i?e.left:e.right)>t}function zs(e,t,n,i,r){r-=Zi(t);var s=Yn(e,t),l=go(t),f=0,p=t.text.length,m=!0,E=lt(t,e.doc.direction);if(E){var _=(e.options.lineWrapping?Vs:Gs)(e,t,n,s,E,i,r);m=_.level!=1,f=m?_.from:_.to-1,p=m?_.to:_.from-1}var G=null,F=null,ce=pt(function(wt){var vt=on(e,s,wt);return vt.top+=l,vt.bottom+=l,xo(vt,i,r,!1)?(vt.top<=r&&vt.left<=i&&(G=wt,F=vt),!0):!1},f,p),_e,Ne,He=!1;if(F){var Ze=i-F.left<F.right-i,ze=Ze==m;ce=G+(ze?0:1),Ne=ze?"after":"before",_e=Ze?F.left:F.right}else{!m&&(ce==p||ce==f)&&ce++,Ne=ce==0?"after":ce==t.text.length?"before":on(e,s,ce-(m?1:0)).bottom+l<=r==m?"after":"before";var at=Qi(e,Ae(n,ce,Ne),"line",t,s);_e=at.left,He=r<at.top?-1:r>=at.bottom?1:0}return ce=Ie(t.text,ce,1),yo(n,ce,Ne,He,i-_e)}function Gs(e,t,n,i,r,s,l){var f=pt(function(_){var G=r[_],F=G.level!=1;return xo(Qi(e,Ae(n,F?G.to:G.from,F?"before":"after"),"line",t,i),s,l,!0)},0,r.length-1),p=r[f];if(f>0){var m=p.level!=1,E=Qi(e,Ae(n,m?p.from:p.to,m?"after":"before"),"line",t,i);xo(E,s,l,!0)&&E.top>l&&(p=r[f-1])}return p}function Vs(e,t,n,i,r,s,l){var f=fa(e,t,i,l),p=f.begin,m=f.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var E=null,_=null,G=0;G<r.length;G++){var F=r[G];if(F.from>=m||F.to<=p)continue;var ce=F.level!=1,_e=on(e,i,ce?Math.min(m,F.to)-1:Math.max(p,F.from)).right,Ne=_e<s?s-_e+1e9:_e-s;(!E||_>Ne)&&(E=F,_=Ne)}return E||(E=r[r.length-1]),E.from<p&&(E={from:p,to:E.to,level:E.level}),E.to>m&&(E={from:E.from,to:m,level:E.level}),E}var Pn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pn==null){Pn=C("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(C("br"));Pn.appendChild(document.createTextNode("x"))}re(e.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Se(e.measure),n||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=C("span","xxxxxxxxxx"),n=C("pre",[t],"CodeMirror-line-like");re(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;n[f]=s.offsetLeft+s.clientLeft+r,i[f]=s.clientWidth}return{fixedPos:wo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function wo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=$n(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(r){if(Di(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 n?s+(Math.ceil(r.text.length/i)||1)*t:s+t}}function So(e){var t=e.doc,n=ma(e);t.iter(function(i){var r=n(i);r!=i.height&&Si(i,r)})}function Nn(e,t,n,i){var r=e.display;if(!n&&V(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=r.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(_){return null}var p=bo(e,s,l),m;if(i&&p.xRel>0&&(m=ct(e.doc,p.line).text).length==p.ch){var E=H(m,m.length,e.options.tabSize)-m.length;p=Ae(p.line,Math.max(0,Math.round((s-ia(e.display).left)/Jn(e.display))-E))}return p}function In(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if(t-=n[i].size,t<0)return i}function Ti(e,t,n,i){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Ei&&yn(e.doc,t)<r.viewTo&&Cn(e);else if(n<=r.viewFrom)Ei&&Ur(e.doc,n+i)>r.viewFrom?Cn(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)Cn(e);else if(t<=r.viewFrom){var s=Gr(e,n,n+i,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=i):Cn(e)}else if(n>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Cn(e)}else{var f=Gr(e,t,t,-1),p=Gr(e,n,n+i,1);f&&p?(r.view=r.view.slice(0,f.index).concat(Ft(e,f.lineN,p.lineN)).concat(r.view.slice(p.index)),r.viewTo+=i):Cn(e)}var m=r.externalMeasured;m&&(n<m.lineN?m.lineN+=i:t<m.lineN+m.size&&(r.externalMeasured=null))}function xn(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var s=i.view[In(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Ce(l,n)==-1&&l.push(n)}function Cn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,n,i){var r=In(e,t),s,l=e.display.view;if(!Ei||n==e.doc.first+e.doc.size)return{index:r,lineN:n};for(var f=e.display.viewFrom,p=0;p<r;p++)f+=l[p].size;if(f!=t){if(i>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,n+=s}for(;yn(e.doc,n)!=n;){if(r==(i<0?0:l.length-1))return null;n+=i*l[r-(i<0?1:0)].size,r+=i}return{index:r,lineN:n}}function Xs(e,t,n){var i=e.display,r=i.view;r.length==0||t>=i.viewTo||n<=i.viewFrom?(i.view=Ft(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=Ft(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(In(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(Ft(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,In(e,n)))),i.viewTo=n}function ga(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];!r.hidden&&(!r.node||r.changes)&&++n}return n}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function va(e,t){t===void 0&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),s=i.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++){if(!t&&l==n.sel.primIndex)continue;var f=n.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var p=f.empty();(p||e.options.showCursorWhenSelecting)&&ya(e,f.head,r),p||Ks(e,f,s)}return i}function ya(e,t,n){var i=Qi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(C("div","\xA0","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var s=n.appendChild(C("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=i.other.left+"px",s.style.top=i.other.top+"px",s.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,n){var i=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),f=l.left,p=Math.max(i.sizerWidth,Dn(e)-i.sizer.offsetLeft)-l.right,m=r.direction=="ltr";function E(ze,at,wt,vt){at<0&&(at=0),at=Math.round(at),vt=Math.round(vt),s.appendChild(C("div",null,"CodeMirror-selected","position: absolute; left: "+ze+`px;
|
|
top: `+at+"px; width: "+(wt==null?p-ze:wt)+`px;
|
|
height: `+(vt-at)+"px"))}function _(ze,at,wt){var vt=ct(r,ze),At=vt.text.length,Yt,di;function Jt(oi,Ai){return vo(e,Ae(ze,oi),"div",vt,Ai)}function Ni(oi,Ai,vi){var li=pa(e,vt,null,oi),ai=Ai=="ltr"==(vi=="after")?"left":"right",Qt=vi=="after"?li.begin:li.end-(/\s/.test(vt.text.charAt(li.end-1))?2:1);return Jt(Qt,ai)[ai]}var Mi=lt(vt,r.direction);return qe(Mi,at||0,wt==null?At:wt,function(oi,Ai,vi,li){var ai=vi=="ltr",Qt=Jt(oi,ai?"left":"right"),Oi=Jt(Ai-1,ai?"right":"left"),ur=at==null&&oi==0,Tn=wt==null&&Ai==At,bi=li==0,an=!Mi||li==Mi.length-1;if(Oi.top-Qt.top<=3){var fi=(m?ur:Tn)&&bi,Yo=(m?Tn:ur)&&an,gn=fi?f:(ai?Qt:Oi).left,Wn=Yo?p:(ai?Oi:Qt).right;E(gn,Qt.top,Wn-gn,Qt.bottom)}else{var Hn,Ci,hr,$o;ai?(Hn=m&&ur&&bi?f:Qt.left,Ci=m?p:Ni(oi,vi,"before"),hr=m?f:Ni(Ai,vi,"after"),$o=m&&Tn&&an?p:Oi.right):(Hn=m?Ni(oi,vi,"before"):f,Ci=!m&&ur&&bi?p:Qt.right,hr=!m&&Tn&&an?f:Oi.left,$o=m?Ni(Ai,vi,"after"):p),E(Hn,Qt.top,Ci-Hn,Qt.bottom),Qt.bottom<Oi.top&&E(f,Qt.bottom,null,Oi.top),E(hr,Oi.top,$o-hr,Oi.bottom)}(!Yt||Vr(Qt,Yt)<0)&&(Yt=Qt),Vr(Oi,Yt)<0&&(Yt=Oi),(!di||Vr(Qt,di)<0)&&(di=Qt),Vr(Oi,di)<0&&(di=Oi)}),{start:Yt,end:di}}var G=t.from(),F=t.to();if(G.line==F.line)_(G.line,G.ch,F.ch);else{var ce=ct(r,G.line),_e=ct(r,F.line),Ne=ki(ce)==ki(_e),He=_(G.line,G.ch,Ne?ce.text.length+1:null).end,Ze=_(F.line,Ne?0:null,F.ch).start;Ne&&(He.top<Ze.top-2?(E(He.right,He.top,null,He.bottom),E(f,Ze.top,Ze.left,Ze.bottom)):E(He.right,He.top,Ze.left-He.right,He.bottom)),He.bottom<Ze.top&&E(f,He.bottom,null,Ze.top)}n.appendChild(s)}function Eo(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Zn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zn(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,ge(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),K&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Eo(e)}function Zn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,se(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,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],s=e.options.lineWrapping,l=void 0,f=0;if(r.hidden)continue;if(O&&X<8){var p=r.node.offsetTop+r.node.offsetHeight;l=p-n,n=p}else{var m=r.node.getBoundingClientRect();l=m.bottom-m.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-m.left-1)}var E=r.line.height-l;if((E>.005||E<-.005)&&(Si(r.line,l),Ca(r.line),r.rest))for(var _=0;_<r.rest.length;_++)Ca(r.rest[_]);if(f>e.display.sizerWidth){var G=Math.ceil(f/Jn(e.display));G>e.display.maxLineLength&&(e.display.maxLineLength=G,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Kr(e,t,n){var i=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Hr(e));var r=n&&n.bottom!=null?n.bottom:i+e.wrapper.clientHeight,s=Bi(t,i),l=Bi(t,r);if(n&&n.ensure){var f=n.ensure.from.line,p=n.ensure.to.line;f<s?(s=f,l=Bi(t,Zi(ct(t,f))+e.wrapper.clientHeight)):Math.min(p,t.lastLine())>=l&&(s=Bi(t,Zi(ct(t,p))-e.wrapper.clientHeight),l=p)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(De(e,"scrollCursorIntoView"))return;var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!B){var s=C("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+rn(e)+n.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,n,i){i==null&&(i=0);var r;!e.options.lineWrapping&&t==n&&(t=t.ch?Ae(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Ae(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qi(e,t),p=!n||n==t?f:Qi(e,n);r={left:Math.min(f.left,p.left),top:Math.min(f.top,p.top)-i,right:Math.max(f.left,p.left),bottom:Math.max(f.bottom,p.bottom)+i};var m=_o(e,r),E=e.doc.scrollTop,_=e.doc.scrollLeft;if(m.scrollTop!=null&&(xr(e,m.scrollTop),Math.abs(e.doc.scrollTop-E)>1&&(l=!0)),m.scrollLeft!=null&&(Bn(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-_)>1&&(l=!0)),!l)break}return r}function Js(e,t){var n=_o(e,t);n.scrollTop!=null&&xr(e,n.scrollTop),n.scrollLeft!=null&&Bn(e,n.scrollLeft)}function _o(e,t){var n=e.display,i=$n(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+fo(n),p=t.top<i,m=t.bottom>f-i;if(t.top<r)l.scrollTop=p?0:t.top;else if(t.bottom>r+s){var E=Math.min(t.top,(m?f:t.bottom)-s);E!=r&&(l.scrollTop=E)}var _=e.options.fixedGutter?0:n.gutters.offsetWidth,G=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-_,F=Dn(e)-n.gutters.offsetWidth,ce=t.right-t.left>F;return ce&&(t.right=t.left+F),t.left<10?l.scrollLeft=0:t.left<G?l.scrollLeft=Math.max(0,t.left+_-(ce?0:10)):t.right>F+G-3&&(l.scrollLeft=t.right+(ce?0:10)-F),l}function To(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,n){(t!=null||n!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=da(e,t.from),i=da(e,t.to);wa(e,n,i,t.margin)}}function wa(e,t,n,i){var r=_o(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ee||Mo(e,{top:t}),Sa(e,t,!0),ee&&Mo(e),Sr(e,100)}function Sa(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,n,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,La(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,n=t.gutters.offsetWidth,i=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?n:0,docHeight:i,scrollHeight:i+rn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var jn=function(e,t,n){this.cm=n;var i=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");i.tabIndex=r.tabIndex=-1,e(i),e(r),le(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),le(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,O&&X<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i: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=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(n?i: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&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=$&&!Y?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new be,this.disableVert=new be},jn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function i(){var r=e.getBoundingClientRect(),s=n=="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,i)}t.set(1e3,i)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function qn(e,t){t||(t=Cr(e));var n=e.display.barWidth,i=e.display.barHeight;Ea(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Xr(e),Ea(e,Cr(e)),n=e.display.barWidth,i=e.display.barHeight}function Ea(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var ka={native:jn,null:wr};function _a(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&se(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),le(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Bn(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&ge(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Un(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},Xi(e.curOp)}function Fn(e){var t=e.curOp;t&&Wr(t,function(n){for(var i=0;i<n.ops.length;i++)n.ops[i].cm.curOp=null;qs(n)})}function qs(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var i=0;i<t.length;i++)tl(t[i]);for(var r=0;r<t.length;r++)il(t[r]);for(var s=0;s<t.length;s++)nl(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,n=t.display;al(t),e.updateMaxLine&&Fr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.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&&Lo(e.cm,e.update)}function il(e){var t=e.cm,n=t.display;e.updatedDisplay&&Xr(t),e.barMeasure=Cr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+rn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Dn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ne();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Oo(t,e.barMeasure),e.selectionChanged&&Eo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&ba(e.cm)}function rl(e){var t=e.cm,n=t.display,i=t.doc;if(e.updatedDisplay&&Ta(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(i,e.scrollToPos.from),o(i,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||fe(s[f],"hide");if(l)for(var p=0;p<l.length;++p)l[p].lines.length&&fe(l[p],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Pi(e,t){if(e.curOp)return t();Un(e);try{return t()}finally{Fn(e)}}function hi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Un(e);try{return t.apply(e,arguments)}finally{Fn(e)}}}function xi(e){return function(){if(this.curOp)return e.apply(this,arguments);Un(this);try{return e.apply(this,arguments)}finally{Fn(this)}}}function ci(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Un(t);try{return e.apply(this,arguments)}finally{Fn(t)}}}function Sr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,w(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,i=Fe(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(i.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?Gi(t.mode,i.state):null,p=L(e,s,i,!0);f&&(i.state=f),s.styles=p.styles;var m=s.styleClasses,E=p.classes;E?s.styleClasses=E:m&&(s.styleClasses=null);for(var _=!l||l.length!=s.styles.length||m!=E&&(!m||!E||m.bgClass!=E.bgClass||m.textClass!=E.textClass),G=0;!_&&G<l.length;++G)_=l[G]!=s.styles[G];_&&r.push(i.line),s.stateAfter=i.save(),i.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ot(e,s.text,i),s.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return Sr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Pi(e,function(){for(var s=0;s<r.length;s++)xn(e,r[s],"text")})}var $r=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Kr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Dn(e),this.force=n,this.dims=Co(e),this.events=[]};$r.prototype.signal=function(e,t){A(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)fe.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=rn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=rn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=ne();if(!t||!k(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&k(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==ne())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&k(document.body,e.anchorNode)&&k(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Lo(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return Cn(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ga(e)==0)return!1;Ma(e)&&(Cn(e),t.dims=Co(e));var r=i.first+i.size,s=Math.max(t.visible.from-e.options.viewportMargin,i.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(i.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(r,n.viewTo)),Ei&&(s=yn(e.doc,s),l=Ur(e.doc,l));var f=s!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),n.viewOffset=Zi(ct(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var p=ga(e);if(!f&&p==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var m=sl(e);return p>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),p>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(m),Se(n.cursorDiv),Se(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,f&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Sr(e,400)),n.updateLineNumbers=null,!0}function Ta(e,t){for(var n=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Dn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+fo(e.display)-po(e),n.top)}),t.visible=Kr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Kr(e.display,e.doc,n));if(!Lo(e,t))break;Xr(e);var r=Cr(e);yr(e),qn(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 Mo(e,t){var n=new $r(e,t);if(Lo(e,n)){Xr(e),Ta(e,n);var i=Cr(e);yr(e),qn(e,i),Oo(e,i),n.finish()}}function ul(e,t,n){var i=e.display,r=e.options.lineNumbers,s=i.lineDiv,l=s.firstChild;function f(ce){var _e=ce.nextSibling;return K&&$&&e.display.currentWheelTarget==ce?ce.style.display="none":ce.parentNode.removeChild(ce),_e}for(var p=i.view,m=i.viewFrom,E=0;E<p.length;E++){var _=p[E];if(!_.hidden)if(!_.node||_.node.parentNode!=s){var G=Is(e,_,m,n);s.insertBefore(G,l)}else{for(;l!=_.node;)l=f(l);var F=r&&t!=null&&t<=m&&_.lineNumber;_.changes&&(Ce(_.changes,"gutter")>-1&&(F=!1),Zo(e,_,m,n)),F&&(Se(_.lineNumber),_.lineNumber.appendChild(document.createTextNode(hn(e.options,m)))),l=_.node.nextSibling}m+=_.size}for(;l;)l=f(l)}function Ao(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+rn(e)+"px"}function La(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=wo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=i+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=s),n[l].gutterBackground&&(n[l].gutterBackground.style.left=s));var f=n[l].alignable;if(f)for(var p=0;p<f.length;p++)f[p].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}function Ma(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=hn(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(C("div",[C("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(s,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ao(e.display),!0}return!1}function Ro(e,t){for(var n=[],i=!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)i=!0;else continue;n.push({className:s,style:l})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Aa(e){var t=e.gutters,n=e.gutterSpecs;Se(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],s=r.className,l=r.style,f=t.appendChild(C("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ao(e)}function Er(e){Aa(e.display),Ti(e),La(e)}function hl(e,t,n,i){var r=this;this.input=n,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=Z("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=Z("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=Z("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: "+Ke+"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"),O&&X<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!K&&!(ee&&J)&&(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(i.gutters,i.lineNumbers),Aa(r),n.init(r)}var Jr=0,Hi=null;O?Hi=-.53:ee?Hi=15:T?Hi=-.7:ie&&(Hi=-1/3);function Oa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Oa(e);return t.x*=Hi,t.y*=Hi,t}function Ra(e,t){var n=Oa(t),i=n.x,r=n.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,p=l.scrollHeight>l.clientHeight;if(!(i&&f||r&&p))return;if(r&&$&&K){e:for(var m=t.target,E=s.view;m!=l;m=m.parentNode)for(var _=0;_<E.length;_++)if(E[_].node==m){e.display.currentWheelTarget=m;break e}}if(i&&!ee&&!M&&Hi!=null){r&&p&&xr(e,Math.max(0,l.scrollTop+r*Hi)),Bn(e,Math.max(0,l.scrollLeft+i*Hi)),(!r||r&&p)&&v(t),s.wheelStartX=null;return}if(r&&Hi!=null){var G=r*Hi,F=e.doc.scrollTop,ce=F+s.wrapper.clientHeight;G<0?F=Math.max(0,F+G-50):ce=Math.min(e.doc.height,ce+G+50),Mo(e,{top:F,bottom:ce})}Jr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var _e=l.scrollLeft-s.wheelStartX,Ne=l.scrollTop-s.wheelStartY,He=Ne&&s.wheelDY&&Ne/s.wheelDY||_e&&s.wheelDX&&_e/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!He)return;Hi=(Hi*Jr+He)/(Jr+1),++Jr},200)):(s.wheelDX+=i,s.wheelDY+=r))}var zi=function(e,t){this.ranges=e,this.primIndex=t};zi.prototype.primary=function(){return this.ranges[this.primIndex]},zi.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 n=this.ranges[t],i=e.ranges[t];if(!cn(n.anchor,i.anchor)||!cn(n.head,i.head))return!1}return!0},zi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ht(Ln(this.ranges[t].anchor),Ln(this.ranges[t].head));return new zi(e,this.primIndex)},zi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},zi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(kt(t,i.from())>=0&&kt(e,i.to())<=0)return n}return-1};var Ht=function(e,t){this.anchor=e,this.head=t};Ht.prototype.from=function(){return Mn(this.anchor,this.head)},Ht.prototype.to=function(){return dn(this.anchor,this.head)},Ht.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qi(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort(function(G,F){return kt(G.from(),F.from())}),n=Ce(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],p=kt(f.to(),l.from());if(i&&!l.empty()?p>0:p>=0){var m=Mn(f.from(),l.from()),E=dn(f.to(),l.to()),_=f.empty()?l.from()==l.head:f.from()==f.head;s<=n&&--n,t.splice(--s,2,new Ht(_?E:m,_?m:E))}}return new zi(t,n)}function wn(e,t){return new zi([new Ht(e,t||e)],0)}function Sn(e){return e.text?Ae(e.from.line+e.text.length-1,Be(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(kt(e,t.from)<0)return e;if(kt(e,t.to)<=0)return Sn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Sn(t).ch-t.to.ch),Ae(n,i)}function Do(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new Ht(Da(r.anchor,t),Da(r.head,t)))}return qi(e.cm,n,e.sel.primIndex)}function Pa(e,t,n){return e.line==t.line?Ae(n.line,e.ch-t.ch+n.ch):Ae(n.line+(e.line-t.line),e.ch)}function dl(e,t,n){for(var i=[],r=Ae(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],p=Pa(f.from,r,s),m=Pa(Sn(f),r,s);if(r=f.to,s=m,n=="around"){var E=e.sel.ranges[l],_=kt(E.head,E.anchor)<0;i[l]=new Ht(_?m:p,_?p:m)}else i[l]=new Ht(p,p)}return new zi(i,e.sel.primIndex)}function Po(e){e.doc.mode=wi(e.options,e.doc.modeOption),kr(e)}function kr(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&&Ti(e)}function Na(e,t){return t.from.ch==0&&t.to.ch==0&&Be(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function No(e,t,n,i){function r(Ze){return n?n[Ze]:null}function s(Ze,ze,at){Jo(Ze,ze,at,i),gi(Ze,"change",Ze,t)}function l(Ze,ze){for(var at=[],wt=Ze;wt<ze;++wt)at.push(new Rn(m[wt],r(wt),i));return at}var f=t.from,p=t.to,m=t.text,E=ct(e,f.line),_=ct(e,p.line),G=Be(m),F=r(m.length-1),ce=p.line-f.line;if(t.full)e.insert(0,l(0,m.length)),e.remove(m.length,e.size-m.length);else if(Na(e,t)){var _e=l(0,m.length-1);s(_,_.text,F),ce&&e.remove(f.line,ce),_e.length&&e.insert(f.line,_e)}else if(E==_)if(m.length==1)s(E,E.text.slice(0,f.ch)+G+E.text.slice(p.ch),F);else{var Ne=l(1,m.length-1);Ne.push(new Rn(G+E.text.slice(p.ch),F,i)),s(E,E.text.slice(0,f.ch)+m[0],r(0)),e.insert(f.line+1,Ne)}else if(m.length==1)s(E,E.text.slice(0,f.ch)+m[0]+_.text.slice(p.ch),r(0)),e.remove(f.line+1,ce);else{s(E,E.text.slice(0,f.ch)+m[0],r(0)),s(_,G+_.text.slice(p.ch),F);var He=l(1,m.length-1);ce>1&&e.remove(f.line+1,ce-1),e.insert(f.line+1,He)}gi(e,"change",e,t)}function En(e,t,n){function i(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var p=r.linked[f];if(p.doc==s)continue;var m=l&&p.sharedHist;if(n&&!m)continue;t(p.doc,m),i(p.doc,r,m)}}i(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),Ba(e),e.options.lineWrapping||Fr(e),e.options.mode=t.modeOption,Ti(e)}function Ba(e){(e.doc.direction=="rtl"?ge:se)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Pi(e,function(){Ba(e),Ti(e)})}function Zr(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 n={from:Ln(t.from),to:Sn(t),text:Ii(e,t.from,t.to)};return Fa(e,n,t.from.line,t.to.line+1),En(e,function(i){return Fa(i,n,t.from.line,t.to.line+1)},!0),n}function ja(e){for(;e.length;){var t=Be(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ja(e.done),Be(e.done);if(e.done.length&&!Be(e.done).ranges)return Be(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Be(e.done)}function Ua(e,t,n,i){var r=e.history;r.undone.length=0;var s=+new Date,l,f;if((r.lastOp==i||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==i)))f=Be(l.changes),kt(t.from,t.to)==0&&kt(t.from,f.to)==0?f.to=Sn(t):l.changes.push(Io(e,t));else{var p=Be(r.done);for((!p||!p.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(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,f||fe(e,"historyAdded")}function ml(e,t,n,i){var r=t.charAt(0);return r=="*"||r=="+"&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,i){var r=e.history,s=i&&i.origin;n==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,Be(r.done),t))?r.done[r.done.length-1]=t:Qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=n,i&&i.clearRedo!==!1&&ja(r.undone)}function Qr(e,t){var n=Be(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fa(e,t,n,i){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(vl(n[r]));return i}function Wa(e,t){var n=yl(e,t),i=Ji(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var s=n[r],l=i[r];if(s&&l){e:for(var f=0;f<l.length;++f){for(var p=l[f],m=0;m<s.length;++m)if(s[m].marker==p.marker)continue e;s.push(p)}}else l&&(n[r]=l)}return n}function er(e,t,n){for(var i=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){i.push(n?zi.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];i.push({changes:f});for(var p=0;p<l.length;++p){var m=l[p],E=void 0;if(f.push({from:m.from,to:m.to,text:m.text}),t)for(var _ in m)(E=_.match(/^spans_(\d+)$/))&&(Ce(t,Number(E[1]))>-1&&(Be(f)[_]=m[_],delete m[_]))}}return i}function Bo(e,t,n,i){if(i){var r=e.anchor;if(n){var s=kt(t,r)<0;s!=kt(n,r)<0?(r=t,t=n):s!=kt(t,n)<0&&(t=n)}return new Ht(r,t)}else return new Ht(n||t,t)}function qr(e,t,n,i,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),yi(e,new zi([Bo(e.sel.primary(),t,n,r)],0),i)}function Ha(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)i[s]=Bo(e.sel.ranges[s],t[s],null,r);var l=qi(e.cm,i,e.sel.primIndex);yi(e,l,n)}function jo(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,yi(e,qi(e.cm,r,e.sel.primIndex),i)}function za(e,t,n,i){yi(e,wn(t,n),i)}function bl(e,t,n){var i={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Ht(o(e,r[s].anchor),o(e,r[s].head))},origin:n&&n.origin};return fe(e,"beforeSelectionChange",e,i),e.cm&&fe(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?qi(e.cm,i.ranges,i.ranges.length-1):t}function Ga(e,t,n){var i=e.history.done,r=Be(i);r&&r.ranges?(i[i.length-1]=t,eo(e,t,n)):yi(e,t,n)}function yi(e,t,n){eo(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(A(e,"beforeSelectionChange")||e.cm&&A(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var i=n&&n.bias||(kt(t.primary().head,e.sel.primary().head)<0?-1:1);Va(e,Ka(e,t,i,!0)),!(n&&n.scroll===!1)&&e.cm&&Qn(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,N(e.cm)),gi(e,"cursorActivity",e)}function Xa(e){Va(e,Ka(e,e.sel,null,!1))}function Ka(e,t,n,i){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],p=to(e,l.anchor,f&&f.anchor,n,i),m=to(e,l.head,f&&f.head,n,i);(r||p!=l.anchor||m!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ht(p,m))}return r?qi(e.cm,r,t.primIndex):t}function tr(e,t,n,i,r){var s=ct(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],p=f.marker,m="selectLeft"in p?!p.selectLeft:p.inclusiveLeft,E="selectRight"in p?!p.selectRight:p.inclusiveRight;if((f.from==null||(m?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(E?f.to>=t.ch:f.to>t.ch))){if(r&&(fe(p,"beforeCursorEnter"),p.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!p.atomic)continue;if(n){var _=p.find(i<0?1:-1),G=void 0;if((i<0?E:m)&&(_=Ya(e,_,-i,_&&_.line==t.line?s:null)),_&&_.line==t.line&&(G=kt(_,n))&&(i<0?G<0:G>0))return tr(e,_,t,i,r)}var F=p.find(i<0?-1:1);return(i<0?m:E)&&(F=Ya(e,F,i,F.line==t.line?s:null)),F?tr(e,F,t,i,r):null}}return t}function to(e,t,n,i,r){var s=i||1,l=tr(e,t,n,s,r)||!r&&tr(e,t,n,s,!0)||tr(e,t,n,-s,r)||!r&&tr(e,t,n,-s,!0);return l||(e.cantEdit=!0,Ae(e.first,0))}function Ya(e,t,n,i){return n<0&&t.ch==0?t.line>e.first?o(e,Ae(t.line-1)):null:n>0&&t.ch==(i||ct(e,t.line)).text.length?t.line<e.first+e.size-1?Ae(t.line+1,0):null:new Ae(t.line,t.ch+n)}function $a(e){e.setSelection(Ae(e.firstLine(),0),Ae(e.lastLine()),Le)}function Ja(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(r,s,l,f){r&&(i.from=o(e,r)),s&&(i.to=o(e,s)),l&&(i.text=l),f!==void 0&&(i.origin=f)}),fe(e,"beforeChange",e,i),e.cm&&fe(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ir(e,t,n){if(e.cm){if(!e.cm.curOp)return hi(e.cm,ir)(e,t,n);if(e.cm.state.suppressEdits)return}if((A(e,"beforeChange")||e.cm&&A(e.cm,"beforeChange"))&&(t=Ja(e,t,!0),!t))return;var i=zn&&!n&&An(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)Za(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else Za(e,t)}function Za(e,t){if(t.text.length==1&&t.text[0]==""&&kt(t.from,t.to)==0)return;var n=Do(e,t);Ua(e,t,n,e.cm?e.cm.curOp.id:NaN),_r(e,t,n,Ji(e,t));var i=[];En(e,function(r,s){!s&&Ce(i,r.history)==-1&&(ts(r.history,t),i.push(r.history)),_r(r,t,null,Ji(r,t))})}function io(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!n)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,p=t=="undo"?r.undone:r.done,m=0;m<f.length&&!(s=f[m],n?s.ranges&&!s.equals(e.sel):!s.ranges);m++);if(m==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Qr(s,p),n&&!s.equals(e.sel)){yi(e,s,{clearRedo:!1});return}l=s}else if(i){f.push(s);return}else break;var E=[];Qr(l,p),p.push({changes:E,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var _=A(e,"beforeChange")||e.cm&&A(e.cm,"beforeChange"),G=function(_e){var Ne=s.changes[_e];if(Ne.origin=t,_&&!Ja(e,Ne,!1))return f.length=0,{};E.push(Io(e,Ne));var He=_e?Do(e,Ne):Be(f);_r(e,Ne,He,Wa(e,Ne)),!_e&&e.cm&&e.cm.scrollIntoView({from:Ne.from,to:Sn(Ne)});var Ze=[];En(e,function(ze,at){!at&&Ce(Ze,ze.history)==-1&&(ts(ze.history,Ne),Ze.push(ze.history)),_r(ze,Ne,null,Wa(ze,Ne))})},F=s.changes.length-1;F>=0;--F){var ce=G(F);if(ce)return ce.v}}function Qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new zi($e(e.sel.ranges,function(r){return new Ht(Ae(r.anchor.line+t,r.anchor.ch),Ae(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Ti(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)xn(e.cm,i,"gutter")}}function _r(e,t,n,i){if(e.cm&&!e.cm.curOp)return hi(e.cm,_r)(e,t,n,i);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:Ae(e.first,0),to:Ae(t.to.line+r,t.to.ch),text:[Be(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Ae(s,ct(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ii(e,t.from,t.to),n||(n=Do(e,t)),e.cm?xl(e.cm,t,i):No(e,t,i),eo(e,n,Le),e.cantEdit&&to(e,Ae(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,n){var i=e.doc,r=e.display,s=t.from,l=t.to,f=!1,p=s.line;e.options.lineWrapping||(p=Ot(ki(ct(i,s.line))),i.iter(p,l.line+1,function(F){if(F==r.maxLine)return f=!0,!0})),i.sel.contains(t.from,t.to)>-1&&N(e),No(i,t,n,ma(e)),e.options.lineWrapping||(i.iter(p,s.line+t.text.length,function(F){var ce=Kn(F);ce>r.maxLineLength&&(r.maxLine=F,r.maxLineLength=ce,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Vi(i,s.line),Sr(e,400);var m=t.text.length-(l.line-s.line)-1;t.full?Ti(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?xn(e,s.line,"text"):Ti(e,s.line,l.line+1,m);var E=A(e,"changes"),_=A(e,"change");if(_||E){var G={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};_&&gi(e,"change",e,G),E&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(G)}e.display.selForContextMenu=null}function nr(e,t,n,i,r){var s;i||(i=n),kt(i,n)<0&&(s=[i,n],n=s[0],i=s[1]),typeof t=="string"&&(t=e.splitLines(t)),ir(e,{from:n,to:i,text:t,origin:r})}function qa(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function es(e,t,n,i){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 f=0;f<s.ranges.length;f++)qa(s.ranges[f].anchor,t,n,i),qa(s.ranges[f].head,t,n,i);continue}for(var p=0;p<s.changes.length;++p){var m=s.changes[p];if(n<m.from.line)m.from=Ae(m.from.line+i,m.from.ch),m.to=Ae(m.to.line+i,m.to.ch);else if(t<=m.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ts(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;es(e.done,n,i,r),es(e.undone,n,i,r)}function Tr(e,t,n,i){var r=t,s=t;return typeof t=="number"?s=ct(e,c(e,t)):r=Ot(t),r==null?null:(i(s,r)&&e.cm&&xn(e.cm,r,n),s)}function Lr(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Lr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,ho(r),gi(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}};function Mr(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}Mr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var s=Math.min(t,r-e),l=i.height;if(i.removeInner(e,s),this.height-=l-i.height,r==s&&(this.children.splice(n--,1),i.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Lr))){var f=[];this.collapse(f),this.children=[new Lr(f)],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,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,f=l;f<r.lines.length;){var p=new Lr(r.lines.slice(f,f+=25));r.height-=p.height,this.children.splice(++i,0,p),p.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),n=new Mr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ce(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Mr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,n))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Ar=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};Ar.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=Ot(n);if(i==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var s=gr(this);Si(n,Math.max(0,n.height-s)),e&&(Pi(e,function(){is(e,n,-s),xn(e,i,"widget")}),gi(e,"lineWidgetCleared",e,this,i))},Ar.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=gr(this)-t;if(!r)return;Di(this.doc,i)||Si(i,i.height+r),n&&Pi(n,function(){n.curOp.forceUpdate=!0,is(n,i,r),gi(n,"lineWidgetChanged",n,e,Ot(i))})},P(Ar);function is(e,t,n){Zi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&To(e,n)}function Cl(e,t,n,i){var r=new Ar(e,n,i),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Tr(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(r.insertAt==null?f.push(r):f.splice(Math.min(f.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Di(e,l)){var p=Zi(l)<e.scrollTop;Si(l,l.height+gr(r)),p&&To(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&gi(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Ot(t)),r}var ns=0,kn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ns};kn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Un(e),A(this,"clear")){var n=this.find();n&&gi(this,"clear",n.from,n.to)}for(var i=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=$i(l.markedSpans,this);e&&!this.collapsed?xn(e,Ot(l),"text"):e&&(f.to!=null&&(r=Ot(l)),f.from!=null&&(i=Ot(l))),l.markedSpans=fn(l.markedSpans,f),f.from==null&&this.collapsed&&!Di(this.doc,l)&&e&&Si(l,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var p=0;p<this.lines.length;++p){var m=ki(this.lines[p]),E=Kn(m);E>e.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=E,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Ti(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&gi(e,"markerCleared",e,this,i,r),t&&Fn(e),this.parent&&this.parent.clear()},kn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,i,r=0;r<this.lines.length;++r){var s=this.lines[r],l=$i(s.markedSpans,this);if(l.from!=null&&(n=Ae(t?s:Ot(s),l.from),e==-1))return n;if(l.to!=null&&(i=Ae(t?s:Ot(s),l.to),e==1))return i}return n&&{from:n,to:i}},kn.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;if(!t||!i)return;Pi(i,function(){var r=t.line,s=Ot(t.line),l=mo(i,s);if(l&&(sa(l),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Di(n.doc,r)&&n.height!=null){var f=n.height;n.height=null;var p=gr(n)-f;p&&Si(r,r.height+p)}gi(i,"markerChanged",i,e)})},kn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},kn.prototype.detachLine=function(e){if(this.lines.splice(Ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},P(kn);function rr(e,t,n,i,r){if(i&&i.shared)return wl(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return hi(e.cm,rr)(e,t,n,i,r);var s=new kn(e,r),l=kt(t,n);if(i&&g(i,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=Z("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ei(e,t.line,t,n,s)||t.line!=n.line&&ei(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ri()}s.addToHistory&&Ua(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var f=t.line,p=e.cm,m;if(e.iter(f,n.line+1,function(_){p&&s.collapsed&&!p.options.lineWrapping&&ki(_)==p.display.maxLine&&(m=!0),s.collapsed&&f!=t.line&&Si(_,0),tn(_,new vn(s,f==t.line?t.ch:null,f==n.line?n.ch:null)),++f}),s.collapsed&&e.iter(t.line,n.line+1,function(_){Di(e,_)&&Si(_,0)}),s.clearOnEnter&&le(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Fi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++ns,s.atomic=!0),p){if(m&&(p.curOp.updateMaxLine=!0),s.collapsed)Ti(p,t.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var E=t.line;E<=n.line;E++)xn(p,E,"text");s.atomic&&Xa(p.doc),gi(p,"markerAdded",p,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].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();gi(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},P(Or);function wl(e,t,n,i,r){i=g(i),i.shared=!1;var s=[rr(e,t,n,i,r)],l=s[0],f=i.widgetNode;return En(e,function(p){f&&(i.widgetNode=f.cloneNode(!0)),s.push(rr(p,o(p,t),o(p,n),i,r));for(var m=0;m<p.linked.length;++m)if(p.linked[m].isParent)return;l=Be(s)}),new Or(s,l)}function rs(e){return e.findMarks(Ae(e.first,0),e.clipPos(Ae(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(kt(s,l)){var f=rr(e,s,l,i.primary,i.primary.type);i.markers.push(f),f.parent=i}}}function El(e){for(var t=function(i){var r=e[i],s=[r.primary.doc];En(r.primary.doc,function(p){return s.push(p)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];Ce(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},n=0;n<e.length;n++)t(n)}var kl=0,Li=function(e,t,n,i,r){if(!(this instanceof Li))return new Li(e,t,n,i,r);n==null&&(n=0),Mr.call(this,[new Lr([new Rn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var s=Ae(n,0);this.sel=wn(s),this.history=new Zr(null),this.id=++kl,this.modeOption=t,this.lineSep=i,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),No(this,{from:s,to:s,text:e}),yi(this,wn(s),Le)};Li.prototype=Ge(Mr.prototype,{constructor:Li,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=un(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ci(function(e){var t=Ae(this.first,0),n=this.first+this.size-1;ir(this,{from:t,to:Ae(n,ct(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),yi(this,wn(t),Le)}),replaceRange:function(e,t,n,i){t=o(this,t),n=n?o(this,n):t,nr(this,e,t,n,i)},getRange:function(e,t,n){var i=Ii(this,o(this,e),o(this,t));return n===!1?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Yi(this,e))return ct(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),ki(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(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ci(function(e,t,n){za(this,o(this,typeof e=="number"?Ae(e,t||0):e),null,n)}),setSelection:ci(function(e,t,n){za(this,o(this,e),o(this,t||e),n)}),extendSelection:ci(function(e,t,n){qr(this,o(this,e),t&&o(this,t),n)}),extendSelections:ci(function(e,t){Ha(this,u(this,e),t)}),extendSelectionsBy:ci(function(e,t){var n=$e(this.sel.ranges,e);Ha(this,u(this,n),t)}),setSelections:ci(function(e,t,n){if(!e.length)return;for(var i=[],r=0;r<e.length;r++)i[r]=new Ht(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),yi(this,qi(this.cm,i,t),n)}),addSelection:ci(function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new Ht(o(this,e),o(this,t||e))),yi(this,qi(this.cm,i,i.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,i=0;i<t.length;i++){var r=Ii(this,t[i].from(),t[i].to());n=n?n.concat(r):r}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Ii(this,n[i].from(),n[i].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:ci(function(e,t,n){for(var i=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];i[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:n}}for(var f=t&&t!="end"&&dl(this,i,t),p=i.length-1;p>=0;p--)ir(this,i[p]);f?Ga(this,f):this.cm&&Qn(this.cm)}),undo:ci(function(){io(this,"undo")}),redo:ci(function(){io(this,"redo")}),undoSelection:ci(function(){io(this,"undo",!0)}),redoSelection:ci(function(){io(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Zr(this.history.maxGeneration),En(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 Zr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:ci(function(e,t,n){return Tr(this,e,"gutter",function(i){var r=i.gutterMarkers||(i.gutterMarkers={});return r[t]=n,!n&&Je(r)&&(i.gutterMarkers=null),!0})}),clearGutter:ci(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Tr(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Je(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Yi(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Ot(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:ci(function(e,t,n){return Tr(this,e,t=="gutter"?"gutter":"class",function(i){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[r])i[r]=n;else{if(q(n).test(i[r]))return!1;i[r]+=" "+n}return!0})}),removeLineClass:ci(function(e,t,n){return Tr(this,e,t=="gutter"?"gutter":"class",function(i){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=i[r];if(s)if(n==null)i[r]=null;else{var l=s.match(q(n));if(!l)return!1;var f=l.index+l[0].length;i[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:ci(function(e,t,n){return Cl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return rr(this,o(this,e),o(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={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,n,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],n=ct(this,e.line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(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,n){e=o(this,e),t=o(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f<l.length;f++){var p=l[f];!(p.to!=null&&r==e.line&&e.ch>=p.to||p.from==null&&r!=e.line||p.from!=null&&r==t.line&&p.from>=t.ch)&&(!n||n(p.marker))&&i.push(p.marker.parent||p.marker)}++r}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)n[i].from!=null&&e.push(n[i].marker)}),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+i;if(s>e)return t=e,!0;e-=s,++n}),o(this,Ae(n,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+n}),t},copy:function(e){var t=new Li(un(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,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var i=new Li(un(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(i,rs(this)),i},unlinkDoc:function(e){if(e instanceof $t&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),El(rs(this));break}if(e.history==this.history){var i=[e.id];En(e,function(r){return i.push(r.id)},!0),e.history=new Zr(null),e.history.done=er(this.history.done,i),e.history.undone=er(this.history.undone,i)}},iterLinkedDocs:function(e){En(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_t(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:ci(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)})}),Li.prototype.eachLine=Li.prototype.iter;var os=0;function _l(e){var t=this;if(as(t),De(t,e)||pn(t.display,e))return;v(e),O&&(os=+new Date);var n=Nn(t,e,!0),i=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,s=Array(r),l=0,f=function(){++l==r&&hi(t,function(){n=o(t.doc,n);var F={from:n,to:n,text:t.doc.splitLines(s.filter(function(ce){return ce!=null}).join(t.doc.lineSeparator())),origin:"paste"};ir(t.doc,F),Ga(t.doc,wn(o(t.doc,n),o(t.doc,Sn(F))))})()},p=function(F,ce){if(t.options.allowDropFileTypes&&Ce(t.options.allowDropFileTypes,F.type)==-1){f();return}var _e=new FileReader;_e.onerror=function(){return f()},_e.onload=function(){var Ne=_e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ne)){f();return}s[ce]=Ne,f()},_e.readAsText(F)},m=0;m<i.length;m++)p(i[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var E=e.dataTransfer.getData("Text");if(E){var _;if(t.state.draggingText&&!t.state.draggingText.copy&&(_=t.listSelections()),eo(t.doc,wn(n,n)),_)for(var G=0;G<_.length;++G)nr(t.doc,"",_[G].anchor,_[G].head,"drag");t.replaceSelection(E,"around","paste"),t.display.input.focus()}}catch(F){}}}function Tl(e,t){if(O&&(!e.state.draggingText||+new Date-os<100)){S(t);return}if(De(e,t)||pn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ie){var n=C("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",M&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),M&&n.parentNode.removeChild(n)}}function Ll(e,t){var n=Nn(e,t);if(!n)return;var i=document.createDocumentFragment();ya(e,n,i),e.display.dragCursor||(e.display.dragCursor=C("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),re(e.display.dragCursor,i)}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"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation(function(){for(var s=0;s<n.length;s++)e(n[s])})}var ls=!1;function Ml(){if(ls)return;Al(),ls=!0}function Al(){var e;le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ol)},100))}),le(window,"blur",function(){return ss(Zn)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var _n={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++)_n[Rr+48]=_n[Rr+96]=String(Rr);for(var no=65;no<=90;no++)_n[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)_n[Dr+111]=_n[Dr+63235]="F"+Dr;var mn={};mn.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"},mn.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"},mn.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"},mn.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"]},mn.default=$?mn.macDefault:mn.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,i,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))n=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}return n&&(e="Alt-"+e),i&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(i=="..."){delete e[n];continue}for(var r=$e(n.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=i):(f=r.slice(0,s+1).join(" "),l="...");var p=t[f];if(!p)t[f]=l;else if(p!=l)throw new Error("Inconsistent bindings for "+f)}delete e[n]}for(var m in t)e[m]=t[m];return e}function or(e,t,n,i){t=ro(t);var r=t.call?t.call(e,i):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&n(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return or(e,t.fallthrough,n,i);for(var s=0;s<t.fallthrough.length;s++){var l=or(e,t.fallthrough[s],n,i);if(l)return l}}}function us(e){var t=typeof e=="string"?e:_n[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,n){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(te?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(te?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(M&&e.keyCode==34&&e.char)return!1;var n=_n[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),hs(n,e,t))}function ro(e){return typeof e=="string"?mn[e]:e}function ar(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var s=t(n[r]);i.length&&kt(s.from,Be(i).to)<=0;){var l=i.pop();if(kt(l.from,s.from)<0){s.from=l.from;break}}i.push(s)}Pi(e,function(){for(var f=i.length-1;f>=0;f--)nr(e.doc,"",i[f].from,i[f].to,"+delete");Qn(e)})}function Uo(e,t,n){var i=Ie(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Fo(e,t,n){var i=Uo(e,t.ch,n);return i==null?null:new Ae(t.line,i,n<0?"after":"before")}function Wo(e,t,n,i,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=lt(n,t.doc.direction);if(s){var l=r<0?Be(s):s[0],f=r<0==(l.level==1),p=f?"after":"before",m;if(l.level>0||t.doc.direction=="rtl"){var E=Yn(t,n);m=r<0?n.text.length-1:0;var _=on(t,E,m).top;m=pt(function(G){return on(t,E,G).top==_},r<0==(l.level==1)?l.from:l.to-1,m),p=="before"&&(m=Uo(n,m,1))}else m=r<0?l.to:l.from;return new Ae(i,m,p)}}return new Ae(i,r<0?n.text.length:0,r<0?"before":"after")}function Pl(e,t,n,i){var r=lt(t,e.doc.direction);if(!r)return Fo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var s=et(r,n.ch,n.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(i>0?l.to>n.ch:l.from<n.ch))return Fo(t,n,i);var f=function(He,Ze){return Uo(t,He instanceof Ae?He.ch:He,Ze)},p,m=function(He){return e.options.lineWrapping?(p=p||Yn(e,t),pa(e,t,p,He)):{begin:0,end:t.text.length}},E=m(n.sticky=="before"?f(n,-1):n.ch);if(e.doc.direction=="rtl"||l.level==1){var _=l.level==1==i<0,G=f(n,_?1:-1);if(G!=null&&(_?G<=l.to&&G<=E.end:G>=l.from&&G>=E.begin)){var F=_?"before":"after";return new Ae(n.line,G,F)}}var ce=function(He,Ze,ze){for(var at=function(Yt,di){return di?new Ae(n.line,f(Yt,1),"before"):new Ae(n.line,Yt,"after")};He>=0&&He<r.length;He+=Ze){var wt=r[He],vt=Ze>0==(wt.level!=1),At=vt?ze.begin:f(ze.end,-1);if(wt.from<=At&&At<wt.to)return at(At,vt);if(At=vt?wt.from:f(wt.to,-1),ze.begin<=At&&At<ze.end)return at(At,vt)}},_e=ce(s+i,i,E);if(_e)return _e;var Ne=i>0?E.end:f(E.begin,-1);return Ne!=null&&!(i>0&&Ne==t.text.length)&&(_e=ce(i>0?0:r.length-1,i,m(Ne)),_e)?_e:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Le)},killLine:function(e){return ar(e,function(t){if(t.empty()){var n=ct(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Ae(t.head.line+1,0)}:{from:t.head,to:Ae(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ar(e,function(t){return{from:Ae(t.from().line,0),to:o(e.doc,Ae(t.to().line+1,0))}})},delLineLeft:function(e){return ar(e,function(t){return{from:Ae(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ar(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return ar(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}})},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(Ae(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ae(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 n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},ve)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},ve)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?fs(e,t.head):i},ve)},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=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var s=n[r].from(),l=H(e.getLine(s.line),s.ch,i);t.push(R(i-l%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pi(e,function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var r=t[i].head,s=ct(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Ae(r.line,r.ch-1)),r.ch>0)r=new Ae(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Ae(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 Ae(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ae(r.line-1,l.length-1),r,"+transpose"))}}n.push(new Ht(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){return Pi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Qn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var n=ct(e.doc,t),i=ki(n);return i!=n&&(t=Ot(i)),Wo(!0,e,i,t,1)}function Nl(e,t){var n=ct(e.doc,t),i=Vn(n);return i!=n&&(t=Ot(i)),Wo(!0,e,n,t,-1)}function fs(e,t){var n=ds(e,t.line),i=ct(e.doc,n.line),r=lt(i,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(n.ch,i.text.search(/\S/)),l=t.line==n.line&&t.ch<=s&&t.ch;return Ae(n.line,l?0:s,n.sticky)}return n}function oo(e,t,n){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=Ye}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function Il(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=or(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&or(t,e.options.extraKeys,n,e)||or(t,e.options.keyMap,n,e)}var Bl=new be;function Nr(e,t,n,i){var r=e.state.keySeq;if(r){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ps(e,r+" "+t,n,i))return!0}return ps(e,t,n,i)}function ps(e,t,n,i){var r=Il(e,t,i);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&gi(e,"keyHandled",e,t,n),(r=="handled"||r=="multi")&&(v(n),Eo(e)),!!r}function ms(e,t){var n=cs(t,!0);return n?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+n,t,function(i){return oo(e,i,!0)})||Nr(e,n,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return oo(e,i)}):Nr(e,n,t,function(i){return oo(e,i)}):!1}function jl(e,t,n){return Nr(e,"'"+n+"'",t,function(i){return oo(e,i,!0)})}var Ho=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=ne(),De(t,e))return;O&&X<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var i=ms(t,e);M&&(Ho=i?n:null,!i&&n==88&&!Xt&&($?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ee&&!$&&!i&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;ge(t,"CodeMirror-crosshair");function n(i){(i.keyCode==18||!i.altKey)&&(se(t,"CodeMirror-crosshair"),it(document,"keyup",n),it(document,"mouseover",n))}le(document,"keyup",n),le(document,"mouseover",n)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),De(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pn(t.display,e)||De(t,e)||e.ctrlKey&&!e.altKey||$&&e.metaKey)return;var n=e.keyCode,i=e.charCode;if(M&&n==Ho){Ho=null,v(e);return}if(M&&(!e.which||e.which<10)&&ms(t,e))return;var r=String.fromCharCode(i==null?n:i);if(r=="\b")return;if(jl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,zo=function(e,t,n){this.time=e,this.pos=t,this.button=n};zo.prototype.compare=function(e,t,n){return this.time+Fl>e&&kt(t,this.pos)==0&&n==this.button};var Ir,Br;function Wl(e,t){var n=+new Date;return Br&&Br.compare(n,e,t)?(Ir=Br=null,"triple"):Ir&&Ir.compare(n,e,t)?(Br=new zo(n,e,t),Ir=null,"double"):(Ir=new zo(n,e,t),Br=null,"single")}function bs(e){var t=this,n=t.display;if(De(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,pn(n,e)){K||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Go(t,e))return;var i=Nn(t,e),r=I(e),s=i?Wl(i,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),i&&Hl(t,r,i,s,e))return;r==1?i?Gl(t,i,s,e):V(e)==n.scroller&&v(e):r==2?(i&&qr(t.doc,i),setTimeout(function(){return n.input.focus()},20)):r==3&&(me?t.display.input.onContextMenu(e):xa(t))}function Hl(e,t,n,i,r){var s="Click";return i=="double"?s="Double"+s:i=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,n)!=Ye}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(r.unit==null){var s=Te?n.shiftKey&&n.metaKey:n.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),r.addNew==null&&(r.addNew=$?n.metaKey:n.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!($?n.altKey:n.ctrlKey)),r}function Gl(e,t,n,i){O?setTimeout(w(ba,e),0):e.curOp.focus=ne();var r=zl(e,n,i),s=e.doc.sel,l;e.options.dragDrop&&ye&&!e.isReadOnly()&&n=="single"&&(l=s.contains(t))>-1&&(kt((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(kt(l.to(),t)>0||t.xRel<0)?Vl(e,i,t,r):Xl(e,i,t,r)}function Vl(e,t,n,i){var r=e.display,s=!1,l=hi(e,function(m){K&&(r.scroller.draggable=!1),e.state.draggingText=!1,it(r.wrapper.ownerDocument,"mouseup",l),it(r.wrapper.ownerDocument,"mousemove",f),it(r.scroller,"dragstart",p),it(r.scroller,"drop",l),s||(v(m),i.addNew||qr(e.doc,n,null,null,i.extend),K&&!ie||O&&X==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(m){s=s||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},p=function(){return s=!0};K&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),le(r.wrapper.ownerDocument,"mouseup",l),le(r.wrapper.ownerDocument,"mousemove",f),le(r.scroller,"dragstart",p),le(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,n){if(n=="char")return new Ht(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ht(Ae(t.line,0),o(e.doc,Ae(t.line+1,0)));var i=n(e,t);return new Ht(i.from,i.to)}function Xl(e,t,n,i){var r=e.display,s=e.doc;v(t);var l,f,p=s.sel,m=p.ranges;if(i.addNew&&!i.extend?(f=s.sel.contains(n),f>-1?l=m[f]:l=new Ht(n,n)):(l=s.sel.primary(),f=s.sel.primIndex),i.unit=="rectangle")i.addNew||(l=new Ht(n,n)),n=Nn(e,t,!0,!0),f=-1;else{var E=xs(e,n,i.unit);i.extend?l=Bo(l,E.anchor,E.head,i.extend):l=E}i.addNew?f==-1?(f=m.length,yi(s,qi(e,m.concat([l]),f),{scroll:!1,origin:"*mouse"})):m.length>1&&m[f].empty()&&i.unit=="char"&&!i.extend?(yi(s,qi(e,m.slice(0,f).concat(m.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=s.sel):jo(s,f,l,ke):(f=0,yi(s,new zi([l],0),ke),p=s.sel);var _=n;function G(ze){if(kt(_,ze)==0)return;if(_=ze,i.unit=="rectangle"){for(var at=[],wt=e.options.tabSize,vt=H(ct(s,n.line).text,n.ch,wt),At=H(ct(s,ze.line).text,ze.ch,wt),Yt=Math.min(vt,At),di=Math.max(vt,At),Jt=Math.min(n.line,ze.line),Ni=Math.min(e.lastLine(),Math.max(n.line,ze.line));Jt<=Ni;Jt++){var Mi=ct(s,Jt).text,oi=Ee(Mi,Yt,wt);Yt==di?at.push(new Ht(Ae(Jt,oi),Ae(Jt,oi))):Mi.length>oi&&at.push(new Ht(Ae(Jt,oi),Ae(Jt,Ee(Mi,di,wt))))}at.length||at.push(new Ht(n,n)),yi(s,qi(e,p.ranges.slice(0,f).concat(at),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ze)}else{var Ai=l,vi=xs(e,ze,i.unit),li=Ai.anchor,ai;kt(vi.anchor,li)>0?(ai=vi.head,li=Mn(Ai.from(),vi.anchor)):(ai=vi.anchor,li=dn(Ai.to(),vi.head));var Qt=p.ranges.slice(0);Qt[f]=Kl(e,new Ht(o(s,li),ai)),yi(s,qi(e,Qt,f),ke)}}var F=r.wrapper.getBoundingClientRect(),ce=0;function _e(ze){var at=++ce,wt=Nn(e,ze,!0,i.unit=="rectangle");if(!wt)return;if(kt(wt,_)!=0){e.curOp.focus=ne(),G(wt);var vt=Kr(r,s);(wt.line>=vt.to||wt.line<vt.from)&&setTimeout(hi(e,function(){ce==at&&_e(ze)}),150)}else{var At=ze.clientY<F.top?-20:ze.clientY>F.bottom?20:0;At&&setTimeout(hi(e,function(){if(ce!=at)return;r.scroller.scrollTop+=At,_e(ze)}),50)}}function Ne(ze){e.state.selectingText=!1,ce=Infinity,ze&&(v(ze),r.input.focus()),it(r.wrapper.ownerDocument,"mousemove",He),it(r.wrapper.ownerDocument,"mouseup",Ze),s.history.lastSelOrigin=null}var He=hi(e,function(ze){ze.buttons===0||!I(ze)?Ne(ze):_e(ze)}),Ze=hi(e,Ne);e.state.selectingText=Ze,le(r.wrapper.ownerDocument,"mousemove",He),le(r.wrapper.ownerDocument,"mouseup",Ze)}function Kl(e,t){var n=t.anchor,i=t.head,r=ct(e.doc,n.line);if(kt(n,i)==0&&n.sticky==i.sticky)return t;var s=lt(r);if(!s)return t;var l=et(s,n.ch,n.sticky),f=s[l];if(f.from!=n.ch&&f.to!=n.ch)return t;var p=l+(f.from==n.ch==(f.level!=1)?0:1);if(p==0||p==s.length)return t;var m;if(i.line!=n.line)m=(i.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var E=et(s,i.ch,i.sticky),_=E-l||(i.ch-n.ch)*(f.level==1?-1:1);E==p-1||E==p?m=_<0:m=_>0}var G=s[p+(m?-1:0)],F=m==(G.level==1),ce=F?G.from:G.to,_e=F?"after":"before";return n.ch==ce&&n.sticky==_e?t:new Ht(new Ae(n.line,ce,_e),i)}function Cs(e,t,n,i){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(G){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&v(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!A(e,n))return x(t);s-=f.top-l.viewOffset;for(var p=0;p<e.display.gutterSpecs.length;++p){var m=l.gutters.childNodes[p];if(m&&m.getBoundingClientRect().right>=r){var E=Bi(e.doc,s),_=e.display.gutterSpecs[p];return fe(e,n,e,E,_.className,t),x(t)}}}function Go(e,t){return Cs(e,t,"gutterClick",!0)}function ws(e,t){if(pn(e.display,t)||Yl(e,t))return;if(De(e,t,"contextmenu"))return;me||e.display.input.onContextMenu(t)}function Yl(e,t){return A(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var sr={toString:function(){return"CodeMirror.Init"}},Es={},ao={};function $l(e){var t=e.optionHandlers;function n(i,r,s,l){e.defaults[i]=r,s&&(t[i]=l?function(f,p,m){m!=sr&&s(f,p,m)}:s)}e.defineOption=n,e.Init=sr,n("value","",function(i,r){return i.setValue(r)},!0),n("mode",null,function(i,r){i.doc.modeOption=r,Po(i)},!0),n("indentUnit",2,Po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(i){kr(i),vr(i),Ti(i)},!0),n("lineSeparator",null,function(i,r){if(i.doc.lineSep=r,!r)return;var s=[],l=i.doc.first;i.doc.iter(function(p){for(var m=0;;){var E=p.text.indexOf(r,m);if(E==-1)break;m=E+r.length,s.push(Ae(l,E))}l++});for(var f=s.length-1;f>=0;f--)nr(i.doc,r,s[f],Ae(s[f].line,s[f].ch+r.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,r,s){i.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=sr&&i.refresh()}),n("specialCharPlaceholder",Ut,function(i){return i.refresh()},!0),n("electricChars",!0),n("inputStyle",J?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(i,r){return i.getInputField().spellcheck=r},!0),n("autocorrect",!1,function(i,r){return i.getInputField().autocorrect=r},!0),n("autocapitalize",!1,function(i,r){return i.getInputField().autocapitalize=r},!0),n("rtlMoveVisually",!Ue),n("wholeLineUpdateBefore",!0),n("theme","default",function(i){Ss(i),Er(i)},!0),n("keyMap","default",function(i,r,s){var l=ro(r),f=s!=sr&&ro(s);f&&f.detach&&f.detach(i,l),l.attach&&l.attach(i,f||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(i,r){i.display.gutterSpecs=Ro(r,i.options.lineNumbers),Er(i)},!0),n("fixedGutter",!0,function(i,r){i.display.gutters.style.left=r?wo(i.display)+"px":"0",i.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(i){return qn(i)},!0),n("scrollbarStyle","native",function(i){_a(i),qn(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),n("lineNumbers",!1,function(i,r){i.display.gutterSpecs=Ro(i.options.gutters,r),Er(i)},!0),n("firstLineNumber",1,Er,!0),n("lineNumberFormatter",function(i){return i},Er,!0),n("showCursorWhenSelecting",!1,yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(i,r){r=="nocursor"&&(Zn(i),i.display.input.blur()),i.display.input.readOnlyChanged(r)}),n("screenReaderLabel",null,function(i,r){r=r===""?null:r,i.display.input.screenReaderLabelChanged(r)}),n("disableInput",!1,function(i,r){r||i.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,yr,!0),n("singleCursorHeightPerLine",!0,yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,kr,!0),n("addModeClass",!1,kr,!0),n("pollInterval",100),n("undoDepth",200,function(i,r){return i.doc.history.undoDepth=r}),n("historyEventDelay",1250),n("viewportMargin",10,function(i){return i.refresh()},!0),n("maxHighlightLength",1e4,kr,!0),n("moveInputWithCursor",!0,function(i,r){r||i.display.input.resetPosition()}),n("tabindex",null,function(i,r){return i.display.input.getField().tabIndex=r||""}),n("autofocus",null),n("direction","ltr",function(i,r){return i.doc.setDirection(r)},!0),n("phrases",null)}function Jl(e,t,n){var i=n&&n!=sr;if(!t!=!i){var r=e.display.dragFunctions,s=t?le:it;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 Zl(e){e.options.lineWrapping?(ge(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(se(e.display.wrapper,"CodeMirror-wrap"),Fr(e)),So(e),Ti(e),vr(e),setTimeout(function(){return qn(e)},100)}function $t(e,t){var n=this;if(!(this instanceof $t))return new $t(e,t);this.options=t=t?g(t):{},g(Es,t,!1);var i=t.value;typeof i=="string"?i=new Li(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new $t.inputStyles[t.inputStyle](this),s=this.display=new hl(e,i,r,t);s.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),_a(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 be,keySeq:null,specialChars:null},t.autofocus&&!J&&s.input.focus(),O&&X<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ql(this),Ml(),Un(this),this.curOp.forceUpdate=!0,Ia(this,i),t.autofocus&&!J||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ko(n)},20):Zn(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);Ma(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Vo.length;++f)Vo[f](this);Fn(this),K&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}$t.defaults=Es,$t.optionHandlers=ao;function Ql(e){var t=e.display;le(t.scroller,"mousedown",hi(e,bs)),O&&X<11?le(t.scroller,"dblclick",hi(e,function(p){if(De(e,p))return;var m=Nn(e,p);if(!m||Go(e,p)||pn(e.display,p))return;v(p);var E=e.findWordAt(m);qr(e.doc,E.anchor,E.head)})):le(t.scroller,"dblclick",function(p){return De(e,p)||v(p)}),le(t.scroller,"contextmenu",function(p){return ws(e,p)}),le(t.input.getField(),"contextmenu",function(p){t.scroller.contains(p.target)||ws(e,p)});var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function s(p){if(p.touches.length!=1)return!1;var m=p.touches[0];return m.radiusX<=1&&m.radiusY<=1}function l(p,m){if(m.left==null)return!0;var E=m.left-p.left,_=m.top-p.top;return E*E+_*_>20*20}le(t.scroller,"touchstart",function(p){if(!De(e,p)&&!s(p)&&!Go(e,p)){t.input.ensurePolled(),clearTimeout(n);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-i.end<=300?i:null},p.touches.length==1&&(t.activeTouch.left=p.touches[0].pageX,t.activeTouch.top=p.touches[0].pageY)}}),le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),le(t.scroller,"touchend",function(p){var m=t.activeTouch;if(m&&!pn(t,p)&&m.left!=null&&!m.moved&&new Date-m.start<300){var E=e.coordsChar(t.activeTouch,"page"),_;!m.prev||l(m,m.prev)?_=new Ht(E,E):!m.prev.prev||l(m,m.prev.prev)?_=e.findWordAt(E):_=new Ht(Ae(E.line,0),o(e.doc,Ae(E.line+1,0))),e.setSelection(_.anchor,_.head),e.focus(),v(p)}r()}),le(t.scroller,"touchcancel",r),le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))}),le(t.scroller,"mousewheel",function(p){return Ra(e,p)}),le(t.scroller,"DOMMouseScroll",function(p){return Ra(e,p)}),le(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(p){De(e,p)||S(p)},over:function(p){De(e,p)||(Ll(e,p),S(p))},start:function(p){return Tl(e,p)},drop:hi(e,_l),leave:function(p){De(e,p)||as(e)}};var f=t.input.getField();le(f,"keyup",function(p){return vs.call(e,p)}),le(f,"keydown",hi(e,gs)),le(f,"keypress",hi(e,ys)),le(f,"focus",function(p){return ko(e,p)}),le(f,"blur",function(p){return Zn(e,p)})}var Vo=[];$t.defineInitHook=function(e){return Vo.push(e)};function jr(e,t,n,i){var r=e.doc,s;n==null&&(n="add"),n=="smart"&&(r.mode.indent?s=Fe(e,t).state:n="prev");var l=e.options.tabSize,f=ct(r,t),p=H(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var m=f.text.match(/^\s*/)[0],E;if(!i&&!/\S/.test(f.text))E=0,n="not";else if(n=="smart"&&(E=r.mode.indent(s,f.text.slice(m.length),f.text),E==Ye||E>150)){if(!i)return;n="prev"}n=="prev"?t>r.first?E=H(ct(r,t-1).text,null,l):E=0:n=="add"?E=p+e.options.indentUnit:n=="subtract"?E=p-e.options.indentUnit:typeof n=="number"&&(E=p+n),E=Math.max(0,E);var _="",G=0;if(e.options.indentWithTabs)for(var F=Math.floor(E/l);F;--F)G+=l,_+=" ";if(G<E&&(_+=R(E-G)),_!=m)return nr(r,_,Ae(t,0),Ae(t,m.length),"+input"),f.stateAfter=null,!0;for(var ce=0;ce<r.sel.ranges.length;ce++){var _e=r.sel.ranges[ce];if(_e.head.line==t&&_e.head.ch<m.length){var Ne=Ae(t,m.length);jo(r,ce,new Ht(Ne,Ne));break}}}var en=null;function so(e){en=e}function Xo(e,t,n,i,r){var s=e.doc;e.display.shift=!1,i||(i=s.sel);var l=+new Date-200,f=r=="paste"||e.state.pasteIncoming>l,p=_t(t),m=null;if(f&&i.ranges.length>1)if(en&&en.text.join(`
|
|
`)==t){if(i.ranges.length%en.text.length==0){m=[];for(var E=0;E<en.text.length;E++)m.push(s.splitLines(en.text[E]))}}else p.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(m=$e(p,function(He){return[He]}));for(var _=e.curOp.updateInput,G=i.ranges.length-1;G>=0;G--){var F=i.ranges[G],ce=F.from(),_e=F.to();F.empty()&&(n&&n>0?ce=Ae(ce.line,ce.ch-n):e.state.overwrite&&!f?_e=Ae(_e.line,Math.min(ct(s,_e.line).text.length,_e.ch+Be(p).length)):f&&en&&en.lineWise&&en.text.join(`
|
|
`)==p.join(`
|
|
`)&&(ce=_e=Ae(ce.line,0)));var Ne={from:ce,to:_e,text:m?m[G%m.length]:p,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};ir(e.doc,Ne),gi(e,"inputRead",e,Ne)}t&&!f&&_s(e,t),Qn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=_),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Pi(t,function(){return Xo(t,n,0,null,"paste")}),!0}function _s(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=jr(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=jr(e,r.head.line,"smart")));l&&gi(e,"electricInput",e,r.head.line)}}function Ts(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,s={anchor:Ae(r,0),head:Ae(r+1,0)};n.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:n}}function Ls(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){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 K?e.style.width="1000px":e.setAttribute("wrap","off"),j&&(e.style.border="1px solid black"),Ls(e),t}function ql(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,r){var s=this.options,l=s[i];if(s[i]==r&&i!="mode")return;s[i]=r,t.hasOwnProperty(i)&&hi(this,t[i])(this,r,l),fe(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,r){this.state.keyMaps[r?"push":"unshift"](ro(i))},removeKeyMap:function(i){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==i||r[s].name==i)return r.splice(s,1),!0},addOverlay:xi(function(i,r){var s=i.token?i:e.getMode(this.options,i);if(s.startState)throw new Error("Overlays may not be stateful.");ft(this.state.overlays,{mode:s,modeSpec:i,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Ti(this)}),removeOverlay:xi(function(i){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==i||typeof i=="string"&&l.name==i){r.splice(s,1),this.state.modeGen++,Ti(this);return}}}),indentLine:xi(function(i,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Yi(this.doc,i)&&jr(this,i,r,s)}),indentSelection:xi(function(i){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var f=r[l];if(f.empty())f.head.line>s&&(jr(this,f.head.line,i,!0),s=f.head.line,l==this.doc.sel.primIndex&&Qn(this));else{var p=f.from(),m=f.to(),E=Math.max(s,p.line);s=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var _=E;_<s;++_)jr(this,_,i);var G=this.doc.sel.ranges;p.ch==0&&r.length==G.length&&G[l].from().ch>0&&jo(this.doc,l,new Ht(p,G[l].to()),Le)}}}),getTokenAt:function(i,r){return Kt(this,i,r)},getLineTokens:function(i,r){return Kt(this,Ae(i),r,!0)},getTokenTypeAt:function(i){i=o(this.doc,i);var r=xe(this,ct(this.doc,i.line)),s=0,l=(r.length-1)/2,f=i.ch,p;if(f==0)p=r[2];else for(;;){var m=s+l>>1;if((m?r[m*2-1]:0)>=f)l=m;else if(r[m*2+1]<f)s=m+1;else{p=r[m*2+2];break}}var E=p?p.indexOf("overlay "):-1;return E<0?p:E==0?null:p.slice(0,E-1)},getModeAt:function(i){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(i).state).mode:r},getHelper:function(i,r){return this.getHelpers(i,r)[0]},getHelpers:function(i,r){var s=[];if(!n.hasOwnProperty(r))return s;var l=n[r],f=this.getModeAt(i);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var p=0;p<f[r].length;p++){var m=l[f[r][p]];m&&s.push(m)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var E=0;E<l._global.length;E++){var _=l._global[E];_.pred(f,this)&&Ce(s,_.val)==-1&&s.push(_.val)}return s},getStateAfter:function(i,r){var s=this.doc;return i=c(s,i==null?s.first+s.size-1:i),Fe(this,i+1,r).state},cursorCoords:function(i,r){var s,l=this.doc.sel.primary();return i==null?s=l.head:typeof i=="object"?s=o(this.doc,i):s=i?l.from():l.to(),Qi(this,s,r||"page")},charCoords:function(i,r){return vo(this,o(this.doc,i),r||"page")},coordsChar:function(i,r){return i=ca(this,i,r||"page"),bo(this,i.left,i.top)},lineAtHeight:function(i,r){return i=ca(this,{top:i,left:0},r||"page").top,Bi(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,r,s){var l=!1,f;if(typeof i=="number"){var p=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>p&&(i=p,l=!0),f=ct(this.doc,i)}else f=i;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Zi(f):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,r,s,l,f){var p=this.display;i=Qi(this,o(this.doc,i));var m=i.bottom,E=i.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),p.sizer.appendChild(r),l=="over")m=i.top;else if(l=="above"||l=="near"){var _=Math.max(p.wrapper.clientHeight,this.doc.height),G=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);(l=="above"||i.bottom+r.offsetHeight>_)&&i.top>r.offsetHeight?m=i.top-r.offsetHeight:i.bottom+r.offsetHeight<=_&&(m=i.bottom),E+r.offsetWidth>G&&(E=G-r.offsetWidth)}r.style.top=m+"px",r.style.left=r.style.right="",f=="right"?(E=p.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?E=0:f=="middle"&&(E=(p.sizer.clientWidth-r.offsetWidth)/2),r.style.left=E+"px"),s&&Js(this,{left:E,top:m,right:E+r.offsetWidth,bottom:m+r.offsetHeight})},triggerOnKeyDown:xi(gs),triggerOnKeyPress:xi(ys),triggerOnKeyUp:vs,triggerOnMouseDown:xi(bs),execCommand:function(i){if(Pr.hasOwnProperty(i))return Pr[i].call(null,this)},triggerElectric:xi(function(i){_s(this,i)}),findPosH:function(i,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var p=o(this.doc,i),m=0;m<r&&!(p=Ko(this.doc,p,f,s,l),p.hitSide);++m);return p},moveH:xi(function(i,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Ko(s.doc,l.head,i,r,s.options.rtlMoveVisually):i<0?l.from():l.to()},ve)}),deleteH:xi(function(i,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ar(this,function(f){var p=Ko(l,f.head,i,r,!1);return i<0?{from:p,to:f.head}:{from:f.head,to:p}})}),findPosV:function(i,r,s,l){var f=1,p=l;r<0&&(f=-1,r=-r);for(var m=o(this.doc,i),E=0;E<r;++E){var _=Qi(this,m,"div");if(p==null?p=_.left:_.left=p,m=As(this,_,f,s),m.hitSide)break}return m},moveV:xi(function(i,r){var s=this,l=this.doc,f=[],p=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(E){if(p)return i<0?E.from():E.to();var _=Qi(s,E.head,"div");E.goalColumn!=null&&(_.left=E.goalColumn),f.push(_.left);var G=As(s,_,i,r);return r=="page"&&E==l.sel.primary()&&To(s,vo(s,G,"div").top-_.top),G},ve),f.length)for(var m=0;m<l.sel.ranges.length;m++)l.sel.ranges[m].goalColumn=f[m]}),findWordAt:function(i){var r=this.doc,s=ct(r,i.line).text,l=i.ch,f=i.ch;if(s){var p=this.getHelper(i,"wordChars");(i.sticky=="before"||f==s.length)&&l?--l:++f;for(var m=s.charAt(l),E=je(m,p)?function(_){return je(_,p)}:/\s/.test(m)?function(_){return/\s/.test(_)}:function(_){return!/\s/.test(_)&&!je(_)};l>0&&E(s.charAt(l-1));)--l;for(;f<s.length&&E(s.charAt(f));)++f}return new Ht(Ae(i.line,l),Ae(i.line,f))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?ge(this.display.cursorDiv,"CodeMirror-overwrite"):se(this.display.cursorDiv,"CodeMirror-overwrite"),fe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ne()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:xi(function(i,r){br(this,i,r)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-rn(this)-this.display.barHeight,width:i.scrollWidth-rn(this)-this.display.barWidth,clientHeight:po(this),clientWidth:Dn(this)}},scrollIntoView:xi(function(i,r){i==null?(i={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof i=="number"?i={from:Ae(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=r||0,i.from.line!=null?Zs(this,i):wa(this,i.from,i.to,i.margin)}),setSize:xi(function(i,r){var s=this,l=function(p){return typeof p=="number"||/^\d+$/.test(String(p))?p+"px":p};i!=null&&(this.display.wrapper.style.width=l(i)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&la(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(p){if(p.widgets){for(var m=0;m<p.widgets.length;m++)if(p.widgets[m].noHScroll){xn(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,fe(this,"refresh",this)}),operation:function(i){return Pi(this,i)},startOperation:function(){return Un(this)},endOperation:function(){return Fn(this)},refresh:xi(function(){var i=this.display.cachedTextHeight;Ti(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Ao(this.display),(i==null||Math.abs(i-$n(this.display))>.5||this.options.lineWrapping)&&So(this),fe(this,"refresh",this)}),swapDoc:xi(function(i){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,i),vr(this),this.display.input.reset(),br(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,gi(this,"swapDoc",this,r),r}),phrase:function(i){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,i)?r[i]:i},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}},P(e),e.registerHelper=function(i,r,s){n.hasOwnProperty(i)||(n[i]=e[i]={_global:[]}),n[i][r]=s},e.registerGlobalHelper=function(i,r,s,l){e.registerHelper(i,r,l),n[i]._global.push({pred:s,val:l})}}function Ko(e,t,n,i,r){var s=t,l=n,f=ct(e,t.line),p=r&&e.direction=="rtl"?-n:n;function m(){var Ze=t.line+p;return Ze<e.first||Ze>=e.first+e.size?!1:(t=new Ae(Ze,t.ch,t.sticky),f=ct(e,Ze))}function E(Ze){var ze;if(i=="codepoint"){var at=f.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(at)?ze=null:ze=new Ae(t.line,Math.max(0,Math.min(f.text.length,t.ch+n*(at>=55296&&at<56320?2:1))),-n)}else r?ze=Pl(e.cm,f,t,n):ze=Fo(f,t,n);if(ze==null)if(!Ze&&m())t=Wo(r,e.cm,f,t.line,p);else return!1;else t=ze;return!0}if(i=="char"||i=="codepoint")E();else if(i=="column")E(!0);else if(i=="word"||i=="group")for(var _=null,G=i=="group",F=e.cm&&e.cm.getHelper(t,"wordChars"),ce=!0;!(n<0&&!E(!ce));ce=!1){var _e=f.text.charAt(t.ch)||`
|
|
`,Ne=je(_e,F)?"w":G&&_e==`
|
|
`?"n":!G||/\s/.test(_e)?null:"p";if(G&&!ce&&!Ne&&(Ne="s"),_&&_!=Ne){n<0&&(n=1,E(),t.sticky="after");break}if(Ne&&(_=Ne),n>0&&!E(!ce))break}var He=to(e,t,s,l,!0);return cn(s,He)&&(He.hitSide=!0),He}function As(e,t,n,i){var r=e.doc,s=t.left,l;if(i=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),p=Math.max(f-.5*$n(e.display),3);l=(n>0?t.bottom:t.top)+n*p}else i=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var m;!(m=bo(e,s,l),!m.outside);){if(n<0?l<=0:l>=r.height){m.hitSide=!0;break}l+=n*5}return m}var Vt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Vt.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;Ls(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function s(f){for(var p=f.target;p;p=p.parentNode){if(p==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(p.className))break}return!1}le(r,"paste",function(f){if(!s(f)||De(i,f)||ks(f,i))return;X<=11&&setTimeout(hi(i,function(){return t.updateFromDOM()}),20)}),le(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),le(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),le(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),le(r,"touchstart",function(){return n.forceCompositionEnd()}),le(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||De(i,f))return;if(i.somethingSelected())so({lineWise:!1,text:i.getSelections()}),f.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var p=Ts(i);so({lineWise:!0,text:p.text}),f.type=="cut"&&i.operation(function(){i.setSelections(p.ranges,0,Le),i.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var m=en.text.join(`
|
|
`);if(f.clipboardData.setData("Text",m),f.clipboardData.getData("Text")==m){f.preventDefault();return}}var E=Ms(),_=E.firstChild;i.display.lineSpace.insertBefore(E,i.display.lineSpace.firstChild),_.value=en.text.join(`
|
|
`);var G=document.activeElement;Pe(_),setTimeout(function(){i.display.lineSpace.removeChild(E),G.focus(),G==r&&n.showPrimarySelection()},50)}le(r,"copy",l),le(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,n=t.doc.sel.primary(),i=n.from(),r=n.to();if(t.display.viewTo==t.display.viewFrom||i.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&&kt(Mn(s,l),i)==0&&kt(dn(s,l),r)==0)return;var f=t.display.view,p=i.line>=t.display.viewFrom&&Os(t,i)||{node:f[0].measure.map[2],offset:0},m=r.line<t.display.viewTo&&Os(t,r);if(!m){var E=f[f.length-1].measure,_=E.maps?E.maps[E.maps.length-1]:E.map;m={node:_[_.length-1],offset:_[_.length-2]-_[_.length-3]}}if(!p||!m){e.removeAllRanges();return}var G=e.rangeCount&&e.getRangeAt(0),F;try{F=W(p.node,p.offset,m.offset,m.node)}catch(ce){}F&&(!ee&&t.state.focused?(e.collapse(p.node,p.offset),F.collapsed||(e.removeAllRanges(),e.addRange(F))):(e.removeAllRanges(),e.addRange(F)),G&&e.anchorNode==null?e.addRange(G):ee&&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){re(this.cm.display.cursorDiv,e.cursors),re(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 k(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():Pi(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(D&&T&&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 n=lo(t,e.anchorNode,e.anchorOffset),i=lo(t,e.focusNode,e.focusOffset);n&&i&&Pi(t,function(){yi(t.doc,wn(n,i),Le),(n.bad||i.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,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(i.ch==0&&i.line>e.firstLine()&&(i=Ae(i.line-1,ct(e.doc,i.line-1).length)),r.ch==ct(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Ae(r.line+1,0)),i.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;i.line==t.viewFrom||(s=In(e,i.line))==0?(l=Ot(t.view[0].line),f=t.view[0].node):(l=Ot(t.view[s].line),f=t.view[s-1].node.nextSibling);var p=In(e,r.line),m,E;if(p==t.view.length-1?(m=t.viewTo-1,E=t.lineDiv.lastChild):(m=Ot(t.view[p+1].line)-1,E=t.view[p+1].node.previousSibling),!f)return!1;for(var _=e.doc.splitLines(tu(e,f,E,l,m)),G=Ii(e.doc,Ae(l,0),Ae(m,ct(e.doc,m).text.length));_.length>1&&G.length>1;)if(Be(_)==Be(G))_.pop(),G.pop(),m--;else if(_[0]==G[0])_.shift(),G.shift(),l++;else break;for(var F=0,ce=0,_e=_[0],Ne=G[0],He=Math.min(_e.length,Ne.length);F<He&&_e.charCodeAt(F)==Ne.charCodeAt(F);)++F;for(var Ze=Be(_),ze=Be(G),at=Math.min(Ze.length-(_.length==1?F:0),ze.length-(G.length==1?F:0));ce<at&&Ze.charCodeAt(Ze.length-ce-1)==ze.charCodeAt(ze.length-ce-1);)++ce;if(_.length==1&&G.length==1&&l==i.line)for(;F&&F>i.ch&&Ze.charCodeAt(Ze.length-ce-1)==ze.charCodeAt(ze.length-ce-1);)F--,ce++;_[_.length-1]=Ze.slice(0,Ze.length-ce).replace(/^\u200b+/,""),_[0]=_[0].slice(F).replace(/\u200b+$/,"");var wt=Ae(l,F),vt=Ae(m,G.length?Be(G).length-ce:0);if(_.length>1||_[0]||kt(wt,vt))return nr(e.doc,_,wt,vt,"+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())&&Pi(this.cm,function(){return Ti(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()||hi(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 n=mo(e,t.line);if(!n||n.hidden)return null;var i=ct(e.doc,t.line),r=na(n,i,t.line),s=lt(i,e.doc.direction),l="left";if(s){var f=et(s,t.ch);l=f%2?"right":"left"}var p=aa(r.map,t.ch,l);return p.offset=p.collapse=="right"?p.end:p.start,p}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,n,i,r){var s="",l=!1,f=e.doc.lineSeparator(),p=!1;function m(F){return function(ce){return ce.id==F}}function E(){l&&(s+=f,p&&(s+=f),l=p=!1)}function _(F){F&&(E(),s+=F)}function G(F){if(F.nodeType==1){var ce=F.getAttribute("cm-text");if(ce){_(ce);return}var _e=F.getAttribute("cm-marker"),Ne;if(_e){var He=e.findMarks(Ae(i,0),Ae(r+1,0),m(+_e));He.length&&(Ne=He[0].find(0))&&_(Ii(e.doc,Ne.from,Ne.to).join(f));return}if(F.getAttribute("contenteditable")=="false")return;var Ze=/^(pre|div|p|li|table|br)$/i.test(F.nodeName);if(!/^br$/i.test(F.nodeName)&&F.textContent.length==0)return;Ze&&E();for(var ze=0;ze<F.childNodes.length;ze++)G(F.childNodes[ze]);/^(pre|p)$/i.test(F.nodeName)&&(p=!0),Ze&&(l=!0)}else F.nodeType==3&&_(F.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(G(t),t==n);)t=t.nextSibling,p=!1;return s}function lo(e,t,n){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[n],!i)return lr(e.clipPos(Ae(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==i)return iu(s,t,n)}}function iu(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!k(i,t))return lr(Ae(Ot(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var s=e.rest?Be(e.rest):e.line;return lr(Ae(Ot(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,n&&(n=l.nodeValue.length));f.parentNode!=i;)f=f.parentNode;var p=e.measure,m=p.maps;function E(Ne,He,Ze){for(var ze=-1;ze<(m?m.length:0);ze++)for(var at=ze<0?p.map:m[ze],wt=0;wt<at.length;wt+=3){var vt=at[wt+2];if(vt==Ne||vt==He){var At=Ot(ze<0?e.line:e.rest[ze]),Yt=at[wt]+Ze;return(Ze<0||vt!=Ne)&&(Yt=at[wt+(Ze?1:0)]),Ae(At,Yt)}}}var _=E(l,f,n);if(_)return lr(_,r);for(var G=f.nextSibling,F=l?l.nodeValue.length-n:0;G;G=G.nextSibling){if(_=E(G,G.firstChild,0),_)return lr(Ae(_.line,_.ch-F),r);F+=G.textContent.length}for(var ce=f.previousSibling,_e=n;ce;ce=ce.previousSibling){if(_=E(ce,ce.firstChild,-1),_)return lr(Ae(_.line,_.ch+_e),r);_e+=ce.textContent.length}}var ti=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new be,this.hasSelection=!1,this.composing=null};ti.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),j&&(r.style.width="0px"),le(r,"input",function(){O&&X>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),le(r,"paste",function(l){if(De(i,l)||ks(l,i))return;i.state.pasteIncoming=+new Date,n.fastPoll()});function s(l){if(De(i,l))return;if(i.somethingSelected())so({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var f=Ts(i);so({lineWise:!0,text:f.text}),l.type=="cut"?i.setSelections(f.ranges,null,Le):(n.prevInput="",r.value=f.text.join(`
|
|
`),Pe(r))}else return;l.type=="cut"&&(i.state.cutIncoming=+new Date)}le(r,"cut",s),le(r,"copy",s),le(e.scroller,"paste",function(l){if(pn(e,l)||De(i,l))return;if(!r.dispatchEvent){i.state.pasteIncoming=+new Date,n.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),le(e.lineSpace,"selectstart",function(l){pn(e,l)||v(l)}),le(r,"compositionstart",function(){var l=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:i.markText(l,i.getCursor("to"),{className:"CodeMirror-composing"})}}),le(r,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ti.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},ti.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ti.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=va(e);if(e.options.moveInputWithCursor){var r=Qi(e,n.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return i},ti.prototype.showSelection=function(e){var t=this.cm,n=t.display;re(n.cursorDiv,e.cursors),re(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ti.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Pe(this.textarea),O&&X>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",O&&X>=9&&(this.hasSelection=null))},ti.prototype.getField=function(){return this.textarea},ti.prototype.supportsTouch=function(){return!1},ti.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!J||ne()!=this.textarea))try{this.textarea.focus()}catch(e){}},ti.prototype.blur=function(){this.textarea.blur()},ti.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ti.prototype.receivedFocus=function(){this.slowPoll()},ti.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()})},ti.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},ti.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(O&&X>=9&&this.hasSelection===r||$&&/[\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&&!i&&(i="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,f=Math.min(i.length,r.length);l<f&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Pi(t,function(){Xo(t,r.slice(l),i.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
|
|
`)>-1?n.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},ti.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ti.prototype.onKeyPress=function(){O&&X>=9&&(this.hasSelection=null),this.fastPoll()},ti.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Nn(n,e),l=i.scroller.scrollTop;if(!s||M)return;var f=n.options.resetSelectionOnContextMenu;f&&n.doc.sel.contains(s)==-1&&hi(n,yi)(n.doc,wn(s),Le);var p=r.style.cssText,m=t.wrapper.style.cssText,E=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-E.top-5)+"px; left: "+(e.clientX-E.left-5)+`px;
|
|
z-index: 1000; background: `+(O?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var _;K&&(_=window.scrollY),i.input.focus(),K&&window.scrollTo(null,_),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=F,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll);function G(){if(r.selectionStart!=null){var _e=n.somethingSelected(),Ne="\u200B"+(_e?r.value:"");r.value="\u21DA",r.value=Ne,t.prevInput=_e?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ne.length,i.selForContextMenu=n.doc.sel}}function F(){if(t.contextMenuPending!=F)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=m,r.style.cssText=p,O&&X<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=l),r.selectionStart!=null){(!O||O&&X<9)&&G();var _e=0,Ne=function(){i.selForContextMenu==n.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?hi(n,$a)(n):_e++<10?i.detectingSelectAll=setTimeout(Ne,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Ne,200)}}if(O&&X>=9&&G(),me){S(e);var ce=function(){it(window,"mouseup",ce),setTimeout(F,20)};le(window,"mouseup",ce)}else setTimeout(F,50)},ti.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ti.prototype.setUneditable=function(){},ti.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?g(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 n=ne();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function i(){e.value=f.getValue()}var r;if(e.form&&(le(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){i(),s.submit=r,s.submit(),s.submit=l}}catch(p){}}t.finishInit=function(p){p.save=i,p.getTextArea=function(){return e},p.toTextArea=function(){p.toTextArea=isNaN,i(),e.parentNode.removeChild(p.getWrapperElement()),e.style.display="",e.form&&(it(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=$t(function(p){return e.parentNode.insertBefore(p,e.nextSibling)},t);return f}function ru(e){e.off=it,e.on=le,e.wheelEventPixels=cl,e.Doc=Li,e.splitLines=_t,e.countColumn=H,e.findColumn=Ee,e.isWordChar=Re,e.Pass=Ye,e.signal=fe,e.Line=Rn,e.changeEnd=Sn,e.scrollbarModel=ka,e.Pos=Ae,e.cmpPos=kt,e.modes=St,e.mimeModes=ht,e.resolveMode=mt,e.getMode=wi,e.modeExtensions=ii,e.extendMode=Gt,e.copyState=Gi,e.startState=ln,e.innerMode=sn,e.commands=Pr,e.keyMap=mn,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=Dl,e.StringStream=It,e.SharedTextMarker=Or,e.TextMarker=kn,e.LineWidget=Ar,e.e_preventDefault=v,e.e_stopPropagation=y,e.e_stop=S,e.addClass=ge,e.contains=k,e.rmClass=se,e.keyNames=_n}$l($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in Li.prototype)Li.prototype.hasOwnProperty(uo)&&Ce(ou,uo)<0&&($t.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[uo]));return P(Li),$t.inputStyles={textarea:ti,contenteditable:Vt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),pi.apply(this,arguments)},$t.defineMIME=qt,$t.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),$t.defineMIME("text/plain","null"),$t.defineExtension=function(e,t){$t.prototype[e]=t},$t.defineDocExtension=function(e,t){Li.prototype[e]=t},$t.fromTextArea=nu,ru($t),$t.version="5.58.2",$t})},Y1PL:function(xt,Xe,b){"use strict";b.r(Xe),b.d(Xe,"ResizableTextArea",function(){return Ce});var U=b("wx14"),Me=b("1OyB"),ee=b("vuIU"),pe=b("Ji7U"),ue=b("LK+K"),he=b("q1tI"),O=b("VTBJ"),X=b("rePB"),K=b("Zm9Q"),ae=b("Kwbf"),T=b("c+Xe"),M=b("m+aA"),ie=b("bdgK"),Y=new Map;function B(Le){Le.forEach(function(ke){var ve,Ee=ke.target;(ve=Y.get(Ee))===null||ve===void 0||ve.forEach(function(z){return z(Ee)})})}var j=new ie.default(B),D=null,J=null;function $(Le,ke){Y.has(Le)||(Y.set(Le,new Set),j.observe(Le)),Y.get(Le).add(ke)}function Te(Le,ke){Y.has(Le)&&(Y.get(Le).delete(ke),Y.get(Le).size||(j.unobserve(Le),Y.delete(Le)))}var Ue=function(Le){Object(pe.a)(ve,Le);var ke=Object(ue.a)(ve);function ve(){return Object(Me.a)(this,ve),ke.apply(this,arguments)}return Object(ee.a)(ve,[{key:"render",value:function(){return this.props.children}}]),ve}(he.Component),oe=he.createContext(null);function te(Le){var ke=Le.children,ve=Le.onBatchResize,Ee=he.useRef(0),z=he.useRef([]),R=he.useContext(oe),Be=he.useCallback(function($e,ft,rt){Ee.current+=1;var Ge=Ee.current;z.current.push({size:$e,element:ft,data:rt}),Promise.resolve().then(function(){Ge===Ee.current&&(ve==null||ve(z.current),z.current=[])}),R==null||R($e,ft,rt)},[ve,R]);return he.createElement(oe.Provider,{value:Be},ke)}function me(Le){var ke=Le.children,ve=Le.disabled,Ee=he.useRef(null),z=he.useRef(null),R=he.useContext(oe),Be=he.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),$e=he.isValidElement(ke)&&Object(T.c)(ke),ft=$e?ke.ref:null,rt=he.useMemo(function(){return Object(T.a)(ft,Ee)},[ft,Ee]),Ge=he.useRef(Le);Ge.current=Le;var de=he.useCallback(function(Re){var je=Ge.current,Je=je.onResize,We=je.data,Oe=Re.getBoundingClientRect(),Ie=Oe.width,pt=Oe.height,qe=Re.offsetWidth,Qe=Re.offsetHeight,et=Math.floor(Ie),yt=Math.floor(pt);if(Be.current.width!==et||Be.current.height!==yt||Be.current.offsetWidth!==qe||Be.current.offsetHeight!==Qe){var lt={width:et,height:yt,offsetWidth:qe,offsetHeight:Qe};Be.current=lt;var tt=qe===Math.round(Ie)?Ie:qe,le=Qe===Math.round(pt)?pt:Qe,gt=Object(O.a)(Object(O.a)({},lt),{},{offsetWidth:tt,offsetHeight:le});R==null||R(gt,Re,We),Je&&Promise.resolve().then(function(){Je(gt,Re)})}},[]);return he.useEffect(function(){var Re=Object(M.a)(Ee.current)||Object(M.a)(z.current);return Re&&!ve&&$(Re,de),function(){return Te(Re,de)}},[Ee.current,ve]),he.createElement(Ue,{ref:z},$e?he.cloneElement(ke,{ref:rt}):ke)}var q="rc-observer-key";function se(Le){var ke=Le.children,ve=Object(K.a)(ke);return ve.map(function(Ee,z){var R=(Ee==null?void 0:Ee.key)||"".concat(q,"-").concat(z);return he.createElement(me,Object(U.a)({},Le,{key:R}),Ee)})}se.Collection=te;var Se=se,re=b("bT9E"),C=b("TSYQ"),Z=b.n(C),W=`
|
|
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
|
|
`,k=["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"],ne={},ge;function Q(Le){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=Le.getAttribute("id")||Le.getAttribute("data-reactid")||Le.getAttribute("name");if(ke&&ne[ve])return ne[ve];var Ee=window.getComputedStyle(Le),z=Ee.getPropertyValue("box-sizing")||Ee.getPropertyValue("-moz-box-sizing")||Ee.getPropertyValue("-webkit-box-sizing"),R=parseFloat(Ee.getPropertyValue("padding-bottom"))+parseFloat(Ee.getPropertyValue("padding-top")),Be=parseFloat(Ee.getPropertyValue("border-bottom-width"))+parseFloat(Ee.getPropertyValue("border-top-width")),$e=k.map(function(rt){return"".concat(rt,":").concat(Ee.getPropertyValue(rt))}).join(";"),ft={sizingStyle:$e,paddingSize:R,borderSize:Be,boxSizing:z};return ke&&ve&&(ne[ve]=ft),ft}function Pe(Le){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ge||(ge=document.createElement("textarea"),ge.setAttribute("tab-index","-1"),ge.setAttribute("aria-hidden","true"),document.body.appendChild(ge)),Le.getAttribute("wrap")?ge.setAttribute("wrap",Le.getAttribute("wrap")):ge.removeAttribute("wrap");var z=Q(Le,ke),R=z.paddingSize,Be=z.borderSize,$e=z.boxSizing,ft=z.sizingStyle;ge.setAttribute("style","".concat(ft,";").concat(W)),ge.value=Le.value||Le.placeholder||"";var rt=Number.MIN_SAFE_INTEGER,Ge=Number.MAX_SAFE_INTEGER,de=ge.scrollHeight,Re;if($e==="border-box"?de+=Be:$e==="content-box"&&(de-=R),ve!==null||Ee!==null){ge.value=" ";var je=ge.scrollHeight-R;ve!==null&&(rt=je*ve,$e==="border-box"&&(rt=rt+R+Be),de=Math.max(rt,de)),Ee!==null&&(Ge=je*Ee,$e==="border-box"&&(Ge=Ge+R+Be),Re=de>Ge?"":"hidden",de=Math.min(Ge,de))}return{height:de,minHeight:rt,maxHeight:Ge,overflowY:Re,resize:"none"}}var w=b("Gytx"),g=b.n(w),H;(function(Le){Le[Le.NONE=0]="NONE",Le[Le.RESIZING=1]="RESIZING",Le[Le.RESIZED=2]="RESIZED"})(H||(H={}));var be=function(Le){Object(pe.a)(ve,Le);var ke=Object(ue.a)(ve);function ve(Ee){var z;return Object(Me.a)(this,ve),z=ke.call(this,Ee),z.nextFrameActionId=void 0,z.resizeFrameId=void 0,z.textArea=void 0,z.saveTextArea=function(R){z.textArea=R},z.handleResize=function(R){var Be=z.state.resizeStatus,$e=z.props,ft=$e.autoSize,rt=$e.onResize;if(Be!==H.NONE)return;typeof rt=="function"&&rt(R),ft&&z.resizeOnNextFrame()},z.resizeOnNextFrame=function(){cancelAnimationFrame(z.nextFrameActionId),z.nextFrameActionId=requestAnimationFrame(z.resizeTextarea)},z.resizeTextarea=function(){var R=z.props.autoSize;if(!R||!z.textArea)return;var Be=R.minRows,$e=R.maxRows,ft=Pe(z.textArea,!1,Be,$e);z.setState({textareaStyles:ft,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(z.resizeFrameId),z.resizeFrameId=requestAnimationFrame(function(){z.setState({resizeStatus:H.RESIZED},function(){z.resizeFrameId=requestAnimationFrame(function(){z.setState({resizeStatus:H.NONE}),z.fixFirefoxAutoScroll()})})})})},z.renderTextArea=function(){var R=z.props,Be=R.prefixCls,$e=Be===void 0?"rc-textarea":Be,ft=R.autoSize,rt=R.onResize,Ge=R.className,de=R.disabled,Re=z.state,je=Re.textareaStyles,Je=Re.resizeStatus,We=Object(re.a)(z.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Oe=Z()($e,Ge,Object(X.a)({},"".concat($e,"-disabled"),de));"value"in We&&(We.value=We.value||"");var Ie=Object(O.a)(Object(O.a)(Object(O.a)({},z.props.style),je),Je===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return he.createElement(Se,{onResize:z.handleResize,disabled:!(ft||rt)},he.createElement("textarea",Object(U.a)({},We,{className:Oe,style:Ie,ref:z.saveTextArea})))},z.state={textareaStyles:{},resizeStatus:H.NONE},z}return Object(ee.a)(ve,[{key:"componentDidUpdate",value:function(z){(z.value!==this.props.value||!g()(z.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var z=this.textArea.selectionStart,R=this.textArea.selectionEnd;this.textArea.setSelectionRange(z,R)}}catch(Be){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ve}(he.Component),Ce=be,Ke=function(Le){Object(pe.a)(ve,Le);var ke=Object(ue.a)(ve);function ve(Ee){var z;Object(Me.a)(this,ve),z=ke.call(this,Ee),z.resizableTextArea=void 0,z.focus=function(){z.resizableTextArea.textArea.focus()},z.saveTextArea=function(Be){z.resizableTextArea=Be},z.handleChange=function(Be){var $e=z.props.onChange;z.setValue(Be.target.value,function(){z.resizableTextArea.resizeTextarea()}),$e&&$e(Be)},z.handleKeyDown=function(Be){var $e=z.props,ft=$e.onPressEnter,rt=$e.onKeyDown;Be.keyCode===13&&ft&&ft(Be),rt&&rt(Be)};var R=typeof Ee.value=="undefined"||Ee.value===null?Ee.defaultValue:Ee.value;return z.state={value:R},z}return Object(ee.a)(ve,[{key:"setValue",value:function(z,R){"value"in this.props||this.setState({value:z},R)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return he.createElement(Ce,Object(U.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(z){return"value"in z?{value:z.value}:null}}]),ve}(he.Component),Ye=Xe.default=Ke},ZW9T:function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return Ue});var U=b("k1fw"),Me=b("miYZ"),ee=b("tsqr"),pe=b("rAM+"),ue=b("tJVT"),he=b("PpiC"),O=b("q1tI"),X=b.n(O),K=b("bdgK");function ae(oe,te,me,q,se){var Se=te.getWordUntilPosition(me),re={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},C=q.map(function(Z){return{label:Z,kind:oe.languages.CompletionItemKind.Keyword,insertText:Z,insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:re}});return se.map(function(Z){C.push(Object(U.a)(Object(U.a)({},Z),{},{range:re}))}),C}var T=function(oe){var te={label:"ifelse",kind:oe.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet},me=["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"];oe.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(re,C){var Z=ae(oe,re,C,me,[te]);return{suggestions:Z}}});var q=["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"];oe.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(re,C){var Z=[{label:"print",kind:oe.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],W=ae(oe,re,C,q,Z);return{suggestions:W}}});var se=["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"];oe.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(re,C){var Z=[te,{label:"main",kind:oe.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:oe.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],W=ae(oe,re,C,se,Z);return{suggestions:W}}})},M="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ie=b("LvDl");function Y(oe){return/^\d+$/.test(oe)?"".concat(oe,"px"):oe}function B(){}var j=!1,D={"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 J(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],te=oe;if(Array.isArray(oe)){for(var me=0;me<oe.length;me++){var q=D[oe[me]];if(q)return q}return te[0]}return D[te]||te}var $=null,Te=Xe.b=function(oe){var te=oe.width,me=te===void 0?"100%":te,q=oe.height,se=q===void 0?"100%":q,Se=oe.value,re=oe.language,C=re===void 0?"javascript":re,Z=oe.style,W=Z===void 0?{}:Z,k=oe.options,ne=k===void 0?{}:k,ge=oe.overrideServices,Q=ge===void 0?{}:ge,Pe=oe.theme,w=Pe===void 0?"vs-dark":Pe,g=oe.onEditBlur,H=oe.onSave,be=oe.autoHeight,Ce=be===void 0?!1:be,Ke=oe.forbidCopy,Ye=Ke===void 0?!1:Ke,Le=oe.onChange,ke=Le===void 0?B:Le,ve=oe.editorDidMount,Ee=ve===void 0?B:ve,z=oe.onFocus,R=z===void 0?B:z,Be=oe.filename,$e=Be===void 0?"educoder.txt":Be,ft=Object(he.a)(oe,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),rt=Object(O.useRef)(),Ge=Object(O.useRef)({}),de=Object(O.useRef)(),Re=Object(O.useRef)(!1),je=Object(O.useRef)(),Je=Object(O.useState)(!1),We=Object(ue.a)(Je,2),Oe=We[0],Ie=We[1];function pt(){var x;return rt.current&&(x=new K.default(function(S){var V=Object(pe.a)(S),I;try{for(V.s();!(I=V.n()).done;){var ye=I.value;(ye.target.offsetHeight>0||ye.target.offsetWidth>0)&&Ge.current.instance.layout()}}catch(Ve){V.e(Ve)}finally{V.f()}}),x.observe(rt.current)),x}function qe(){ee.b.warn(decodeURIComponent(M))}var Qe=function(){var S=Ge.current.instance;if(Se!=null&&S&&Oe){var V=S.getModel();V&&Se!==V.getValue()&&(j=!0,V.setValue(Se),S.layout(),j=!1)}};Object(O.useEffect)(function(){de.current&&clearTimeout(de.current),de.current=setTimeout(function(){Qe()},500)},[Se,Oe,Ge.current]);function et(){var x=Ge.current.instance;if(x){var S=x.getSelection(),V=Ge.current.pastePos||{},I=new $.Range(V.startLineNumber||S.endLineNumber,V.startColumn||S.endColumn,V.endLineNumber||S.endLineNumber,V.endColumn||S.endColumn);setTimeout(function(){x.executeEdits("",[{range:I,text:""}])},300)}}function yt(x){(window.navigator.platform.match("Mac")?x.metaKey:x.ctrlKey)&&x.keyCode==83&&(x.preventDefault(),H())}var lt=function(){if(Ce&&Ge.current.instance){var S=Ge.current.instance.getContentHeight();v(S<se?se:S)}else v(se)};function tt(x){var S=document.createEvent("MouseEvents");S.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),x.dispatchEvent(S)}function le(x,S){var V=window.URL||window.webkitURL||window,I=new Blob([S]),ye=document.createElementNS("http://www.w3.org/1999/xhtml","a");ye.href=V.createObjectURL(I),ye.download=x,tt(ye)}Object(O.useEffect)(function(){lt()},[lt]),Object(O.useEffect)(function(){rt.current&&!Oe&&b.e(27).then(b.t.bind(null,"M/lh",7)).then(function(x){try{$=x,Ge.current.instance=$.editor.create(rt.current,{value:Se,language:J(C),theme:w,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Q);var S=Ge.current.instance;if(Ee(S,$),setTimeout(function(){lt(),Ge.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){le($e||"educoder.txt",S.getValue())}})},500),Ge.current.subscription=S.onDidChangeModelContent(function(I){Re.current?clearTimeout(je.current):(lt(),ke(S.getValue(),I)),je.current=setTimeout(function(){Re.current=!1},500)}),window.Monaco||T($),Ye&&(S.addCommand($.KeyMod.CtrlCmd|$.KeyMod.Shift|$.KeyCode.KEY_V,function(){return qe(),null}),S.addCommand($.KeyMod.CtrlCmd|$.KeyCode.KEY_C,function(){return qe(),null})),window.Monaco=$,g&&S.onDidBlurEditorWidget(function(){g(S.getValue())}),R&&S.onDidFocusEditorText(function(){R(S.getValue())}),Ye){S.addCommand($.KeyMod.CtrlCmd|$.KeyCode.KEY_V,function(){return qe(),null}),S.onDidPaste(function(I){Ge.current.pastePos=I});try{window.addEventListener("paste",et)}catch(I){}}var V=pt();return Ie(!0),function(){var I=Ge.current.instance;I.dispose();var ye=I.getModel();ye&&ye.dispose(),Ge.current.subscription&&Ge.current.subscription.dispose(),Ye&&window.removeEventListener("paste",et),V.unobserve(rt.current)}}catch(I){}})},[]),Object(O.useEffect)(function(){var x=Ge.current.instance;if(x&&Oe)return document.addEventListener("keydown",yt,!1),function(){document.removeEventListener("keydown",yt)}},[H,Oe]),Object(O.useEffect)(function(){var x=Ge.current.instance;if(x&&Oe){var S=J(C);$.editor.setModelLanguage(x.getModel(),S),console.log("language:",C,x.getModel(),S)}},[C,Oe]),Object(O.useEffect)(function(){var x=Ge.current.instance;x&&Oe&&$.editor.setTheme(w)},[w,Oe]),Object(O.useEffect)(function(){var x=Ge.current.instance;x&&Oe&&(x.updateOptions(Object(U.a)({},ne)),setTimeout(function(){x.getModel().updateOptions(Object(U.a)({},ne))},200))},[JSON.stringify(ne),Oe]),Object(O.useEffect)(function(){var x=Ge.current.instance;x&&Oe&&x.layout()},[me,se,Oe]);var gt=Object(O.useState)(Y(me)),it=Object(ue.a)(gt,2),fe=it[0],De=it[1],N=Object(O.useState)(Y(se)),A=Object(ue.a)(N,2),P=A[0],v=A[1],y=Object(U.a)(Object(U.a)({},W),{},{width:fe,height:P});return X.a.createElement("div",{className:"my-monaco-editor",ref:rt,style:y})};function Ue(oe){var te=oe.width,me=te===void 0?"100%":te,q=oe.height,se=q===void 0?"100%":q,Se=oe.original,re=oe.modified,C=oe.language,Z=oe.options,W=Z===void 0?{}:Z,k=Object(O.useRef)(),ne=Object(O.useState)(null),ge=Object(ue.a)(ne,2),Q=ge[0],Pe=ge[1];function w(Ce){var Ke;return k.current&&(Ke=new K.default(function(Ye){var Le=Object(pe.a)(Ye),ke;try{for(Le.s();!(ke=Le.n()).done;){var ve=ke.value;(ve.target.offsetHeight>0||ve.target.offsetWidth>0)&&Ce.layout()}}catch(Ee){Le.e(Ee)}finally{Le.f()}}),Ke.observe(k.current)),Ke}Object(O.useEffect)(function(){k.current&&b.e(27).then(b.t.bind(null,"M/lh",7)).then(function(Ce){$=Ce;var Ke=$.editor.createDiffEditor(k.current,Object(U.a)(Object(U.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},W),{},{wordWrap:!0}));Pe(Ke);var Ye=w(Ke);return function(){Ke.dispose();var Le=Ke.getModel();Le&&Le.dispose(),Ye.unobserve(k.current)}})},[]),Object(O.useEffect)(function(){Q&&Q.setModel({original:$.editor.createModel(Se,C),modified:$.editor.createModel(re,C)})},[Se,re,C,Q]);var g=Y(me),H=Y(se),be={width:g,height:H};return X.a.createElement("div",{className:"my-diff-editor",ref:k,style:be})}},ZpRC:function(xt,Xe,b){"use strict";function U(T){return typeof T=="object"&&T!=null&&T.nodeType===1}function Me(T,M){return(!M||T!=="hidden")&&T!=="visible"&&T!=="clip"}function ee(T,M){if(T.clientHeight<T.scrollHeight||T.clientWidth<T.scrollWidth){var ie=getComputedStyle(T,null);return Me(ie.overflowY,M)||Me(ie.overflowX,M)||function(Y){var B=function(j){if(!j.ownerDocument||!j.ownerDocument.defaultView)return null;try{return j.ownerDocument.defaultView.frameElement}catch(D){return null}}(Y);return!!B&&(B.clientHeight<Y.scrollHeight||B.clientWidth<Y.scrollWidth)}(T)}return!1}function pe(T,M,ie,Y,B,j,D,J){return j<T&&D>M||j>T&&D<M?0:j<=T&&J<=ie||D>=M&&J>=ie?j-T-Y:D>M&&J<ie||j<T&&J>ie?D-M+B:0}var ue=function(T,M){var ie=window,Y=M.scrollMode,B=M.block,j=M.inline,D=M.boundary,J=M.skipOverflowHiddenElements,$=typeof D=="function"?D:function(je){return je!==D};if(!U(T))throw new TypeError("Invalid target");for(var Te=document.scrollingElement||document.documentElement,Ue=[],oe=T;U(oe)&&$(oe);){if((oe=oe.parentElement)===Te){Ue.push(oe);break}oe!=null&&oe===document.body&&ee(oe)&&!ee(document.documentElement)||oe!=null&&ee(oe,J)&&Ue.push(oe)}for(var te=ie.visualViewport?ie.visualViewport.width:innerWidth,me=ie.visualViewport?ie.visualViewport.height:innerHeight,q=window.scrollX||pageXOffset,se=window.scrollY||pageYOffset,Se=T.getBoundingClientRect(),re=Se.height,C=Se.width,Z=Se.top,W=Se.right,k=Se.bottom,ne=Se.left,ge=B==="start"||B==="nearest"?Z:B==="end"?k:Z+re/2,Q=j==="center"?ne+C/2:j==="end"?W:ne,Pe=[],w=0;w<Ue.length;w++){var g=Ue[w],H=g.getBoundingClientRect(),be=H.height,Ce=H.width,Ke=H.top,Ye=H.right,Le=H.bottom,ke=H.left;if(Y==="if-needed"&&Z>=0&&ne>=0&&k<=me&&W<=te&&Z>=Ke&&k<=Le&&ne>=ke&&W<=Ye)return Pe;var ve=getComputedStyle(g),Ee=parseInt(ve.borderLeftWidth,10),z=parseInt(ve.borderTopWidth,10),R=parseInt(ve.borderRightWidth,10),Be=parseInt(ve.borderBottomWidth,10),$e=0,ft=0,rt="offsetWidth"in g?g.offsetWidth-g.clientWidth-Ee-R:0,Ge="offsetHeight"in g?g.offsetHeight-g.clientHeight-z-Be:0;if(Te===g)$e=B==="start"?ge:B==="end"?ge-me:B==="nearest"?pe(se,se+me,me,z,Be,se+ge,se+ge+re,re):ge-me/2,ft=j==="start"?Q:j==="center"?Q-te/2:j==="end"?Q-te:pe(q,q+te,te,Ee,R,q+Q,q+Q+C,C),$e=Math.max(0,$e+se),ft=Math.max(0,ft+q);else{$e=B==="start"?ge-Ke-z:B==="end"?ge-Le+Be+Ge:B==="nearest"?pe(Ke,Le,be,z,Be+Ge,ge,ge+re,re):ge-(Ke+be/2)+Ge/2,ft=j==="start"?Q-ke-Ee:j==="center"?Q-(ke+Ce/2)+rt/2:j==="end"?Q-Ye+R+rt:pe(ke,Ye,Ce,Ee,R+rt,Q,Q+C,C);var de=g.scrollLeft,Re=g.scrollTop;ge+=Re-($e=Math.max(0,Math.min(Re+$e,g.scrollHeight-be+Ge))),Q+=de-(ft=Math.max(0,Math.min(de+ft,g.scrollWidth-Ce+rt)))}Pe.push({el:g,top:$e,left:ft})}return Pe};function he(T){return T===Object(T)&&Object.keys(T).length!==0}function O(T,M){M===void 0&&(M="auto");var ie="scrollBehavior"in document.body.style;T.forEach(function(Y){var B=Y.el,j=Y.top,D=Y.left;B.scroll&&ie?B.scroll({top:j,left:D,behavior:M}):(B.scrollTop=j,B.scrollLeft=D)})}function X(T){return T===!1?{block:"end",inline:"nearest"}:he(T)?T:{block:"start",inline:"nearest"}}function K(T,M){var ie=!T.ownerDocument.documentElement.contains(T);if(he(M)&&typeof M.behavior=="function")return M.behavior(ie?[]:ue(T,M));if(ie)return;var Y=X(M);return O(ue(T,Y),Y.behavior)}var ae=Xe.a=K},bT9E:function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return Me});var U=b("VTBJ");function Me(ee,pe){var ue=Object(U.a)({},ee);return Array.isArray(pe)&&pe.forEach(function(he){delete ue[he]}),ue}},c5Ni:function(xt,Xe,b){},dejd:function(xt,Xe,b){},dmUQ:function(xt,Xe,b){"use strict";var U=b("Ff2n"),Me=b("rePB"),ee=b("1OyB"),pe=b("vuIU"),ue=b("Ji7U"),he=b("md7G"),O=b("foSv"),X=b("q1tI"),K=b.n(X),ae=b("TSYQ"),T=b.n(ae),M=b("4IlW");function ie(re,C){var Z=Object.keys(re);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(re);C&&(W=W.filter(function(k){return Object.getOwnPropertyDescriptor(re,k).enumerable})),Z.push.apply(Z,W)}return Z}function Y(re){for(var C=1;C<arguments.length;C++){var Z=arguments[C]!=null?arguments[C]:{};C%2?ie(Object(Z),!0).forEach(function(W){Object(Me.a)(re,W,Z[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(re,Object.getOwnPropertyDescriptors(Z)):ie(Object(Z)).forEach(function(W){Object.defineProperty(re,W,Object.getOwnPropertyDescriptor(Z,W))})}return re}function B(re){var C=j();return function(){var W=Object(O.a)(re),k;if(C){var ne=Object(O.a)(this).constructor;k=Reflect.construct(W,arguments,ne)}else k=W.apply(this,arguments);return Object(he.a)(this,k)}}function j(){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(re){return!1}}function D(){}function J(re){re.preventDefault()}var $=function(C){return C.replace(/[^\w.-]+/g,"")},Te=200,Ue=600,oe=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,te=function(C){return C!=null},me=function(C,Z){return Z===C||typeof Z=="number"&&typeof C=="number"&&isNaN(Z)&&isNaN(C)},q=function(re){Object(ue.a)(Z,re);var C=B(Z);function Z(W){var k;Object(ee.a)(this,Z),k=C.call(this,W),k.onKeyDown=function(Q){var Pe=k.props,w=Pe.onKeyDown,g=Pe.onPressEnter;if(Q.keyCode===M.a.UP){var H=k.getRatio(Q);k.up(Q,H,null),k.stop()}else if(Q.keyCode===M.a.DOWN){var be=k.getRatio(Q);k.down(Q,be,null),k.stop()}else Q.keyCode===M.a.ENTER&&g&&g(Q);if(k.recordCursorPosition(),k.lastKeyCode=Q.keyCode,w){for(var Ce=arguments.length,Ke=new Array(Ce>1?Ce-1:0),Ye=1;Ye<Ce;Ye++)Ke[Ye-1]=arguments[Ye];w.apply(void 0,[Q].concat(Ke))}},k.onKeyUp=function(Q){var Pe=k.props.onKeyUp;if(k.stop(),k.recordCursorPosition(),Pe){for(var w=arguments.length,g=new Array(w>1?w-1:0),H=1;H<w;H++)g[H-1]=arguments[H];Pe.apply(void 0,[Q].concat(g))}},k.onChange=function(Q){var Pe=k.props.onChange;k.state.focused&&(k.inputting=!0),k.rawInput=k.props.parser(k.getValueFromEvent(Q)),k.setState({inputValue:k.rawInput}),Pe(k.toNumber(k.rawInput))},k.onMouseUp=function(){var Q=k.props.onMouseUp;k.recordCursorPosition(),Q&&Q.apply(void 0,arguments)},k.onFocus=function(){var Q;k.setState({focused:!0}),(Q=k.props).onFocus.apply(Q,arguments)},k.onBlur=function(){var Q=k.props.onBlur;k.inputting=!1,k.setState({focused:!1});var Pe=k.getCurrentValidValue(k.state.inputValue),w=k.setValue(Pe,D);if(Q){var g=k.input.value,H=k.getInputDisplayValue({focus:!1,value:w});k.input.value=H&&Number(H),Q.apply(void 0,arguments),k.input.value=g}},k.getRatio=function(Q){var Pe=1;return Q.metaKey||Q.ctrlKey?Pe=.1:Q.shiftKey&&(Pe=10),Pe},k.getFullNum=function(Q){return isNaN(Q)?Q:/e/i.test(String(Q))?Number(Q).toFixed(18).replace(/\.?0+$/,""):Q},k.getPrecision=function(Q){if(te(k.props.precision))return k.props.precision;var Pe=String(Q);if(Pe.indexOf("e-")>=0)return parseInt(Pe.slice(Pe.indexOf("e-")+2),10);var w=0;return Pe.indexOf(".")>=0&&(w=Pe.length-Pe.indexOf(".")-1),w},k.getInputDisplayValue=function(Q){var Pe=Q||k.state,w=Pe.focused,g=Pe.inputValue,H=Pe.value,be;w?be=g:be=k.toPrecisionAsStep(H),be==null&&(be="");var Ce=k.formatWrapper(be);return te(k.props.decimalSeparator)&&(Ce=Ce.toString().replace(".",k.props.decimalSeparator)),Ce},k.recordCursorPosition=function(){try{k.cursorStart=k.input.selectionStart,k.cursorEnd=k.input.selectionEnd,k.currentValue=k.input.value,k.cursorBefore=k.input.value.substring(0,k.cursorStart),k.cursorAfter=k.input.value.substring(k.cursorEnd)}catch(Q){}},k.restoreByAfter=function(Q){if(Q===void 0)return!1;var Pe=k.input.value,w=Pe.lastIndexOf(Q);if(w===-1)return!1;var g=k.cursorBefore.length;return k.lastKeyCode===M.a.DELETE&&k.cursorBefore.charAt(g-1)===Q[0]?(k.fixCaret(g,g),!0):w+Q.length===Pe.length?(k.fixCaret(w,w),!0):!1},k.partRestoreByAfter=function(Q){return Q===void 0?!1:Array.prototype.some.call(Q,function(Pe,w){var g=Q.substring(w);return k.restoreByAfter(g)})},k.isNotCompleteNumber=function(Q){return isNaN(Q)||Q===""||Q===null||Q&&Q.toString().indexOf(".")===Q.toString().length-1},k.stop=function(){k.autoStepTimer&&clearTimeout(k.autoStepTimer)},k.down=function(Q,Pe,w){k.pressingUpOrDown=!0,k.step("down",Q,Pe,w)},k.up=function(Q,Pe,w){k.pressingUpOrDown=!0,k.step("up",Q,Pe,w)},k.saveInput=function(Q){k.input=Q};var ne=W.value;ne===void 0&&(ne=W.defaultValue),k.state={focused:W.autoFocus};var ge=k.getValidValue(k.toNumber(ne));return k.state=Y(Y({},k.state),{},{inputValue:k.toPrecisionAsStep(ge),value:ge}),k}return Object(pe.a)(Z,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(k){var ne=this.props,ge=ne.value,Q=ne.onChange,Pe=ne.max,w=ne.min,g=this.state.focused;if(k){if(!me(k.value,ge)||!me(k.max,Pe)||!me(k.min,w)){var H=g?ge:this.getValidValue(ge),be;this.pressingUpOrDown?be=H:this.inputting?be=this.rawInput:be=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:be})}var Ce="value"in this.props?ge:this.state.value;"max"in this.props&&k.max!==Pe&&typeof Ce=="number"&&Ce>Pe&&Q&&Q(Pe),"min"in this.props&&k.min!==w&&typeof Ce=="number"&&Ce<w&&Q&&Q(w)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ke=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===M.a.BACKSPACE?Ke=this.cursorStart-1:this.lastKeyCode===M.a.DELETE&&(Ke=this.cursorStart):Ke=this.input.value.length,this.fixCaret(Ke,Ke)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case M.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case M.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ye){}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(k){var ne=k;return ne===""?ne="":this.isNotCompleteNumber(parseFloat(ne))?ne=this.state.value:ne=this.getValidValue(ne),this.toNumber(ne)}},{key:"getValueFromEvent",value:function(k){var ne=k.target.value.trim().replace(/。/g,".");return te(this.props.decimalSeparator)&&(ne=ne.replace(this.props.decimalSeparator,".")),ne}},{key:"getValidValue",value:function(k){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,Q=parseFloat(k);return isNaN(Q)?k:(Q<ne&&(Q=ne),Q>ge&&(Q=ge),Q)}},{key:"setValue",value:function(k,ne){var ge=this.props.precision,Q=this.isNotCompleteNumber(parseFloat(k))?null:parseFloat(k),Pe=this.state.value,w=Pe===void 0?null:Pe,g=this.state.inputValue,H=g===void 0?null:g,be=typeof Q=="number"?Q.toFixed(ge):"".concat(Q),Ce=Q!==w||be!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},ne)):this.setState({value:Q,inputValue:this.toPrecisionAsStep(k)},ne),Ce&&this.props.onChange(Q),Q}},{key:"getMaxPrecision",value:function(k){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=this.props,Q=ge.precision,Pe=ge.step;if(te(Q))return Q;var w=this.getPrecision(ne),g=this.getPrecision(Pe),H=this.getPrecision(k);return k?Math.max(H,w+g):w+g}},{key:"getPrecisionFactor",value:function(k){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=this.getMaxPrecision(k,ne);return Math.pow(10,ge)}},{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(k){return this.props.formatter?this.props.formatter(k):k}},{key:"toPrecisionAsStep",value:function(k){if(this.isNotCompleteNumber(k)||k==="")return k;var ne=Math.abs(this.getMaxPrecision(k));return isNaN(ne)?k.toString():Number(k).toFixed(ne)}},{key:"toNumber",value:function(k){var ne=this.props.precision,ge=this.state.focused,Q=k&&k.length>16&≥return this.isNotCompleteNumber(k)||Q?k:te(ne)?Math.round(k*Math.pow(10,ne))/Math.pow(10,ne):Number(k)}},{key:"upStep",value:function(k,ne){var ge=this.props.step,Q=this.getPrecisionFactor(k,ne),Pe=Math.abs(this.getMaxPrecision(k,ne)),w=((Q*k+Q*ge*ne)/Q).toFixed(Pe);return this.toNumber(w)}},{key:"downStep",value:function(k,ne){var ge=this.props.step,Q=this.getPrecisionFactor(k,ne),Pe=Math.abs(this.getMaxPrecision(k,ne)),w=((Q*k-Q*ge*ne)/Q).toFixed(Pe);return this.toNumber(w)}},{key:"step",value:function(k,ne){var ge=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Pe=arguments.length>3?arguments[3]:void 0;this.stop(),ne&&(ne.persist(),ne.preventDefault());var w=this.props;if(w.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var H=this["".concat(k,"Step")](g,Q),be=H>w.max||H<w.min;if(H>w.max?H=w.max:H<w.min&&(H=w.min),this.setValue(H,null),this.setState({focused:!0},function(){ge.pressingUpOrDown=!1}),be)return;this.autoStepTimer=setTimeout(function(){ge[k](ne,Q,!0)},Pe?Te:Ue)}},{key:"fixCaret",value:function(k,ne){if(k===void 0||ne===void 0||!this.input||!this.input.value)return;try{var ge=this.input.selectionStart,Q=this.input.selectionEnd;(k!==ge||ne!==Q)&&this.input.setSelectionRange(k,ne)}catch(Pe){}}},{key:"render",value:function(){var k,ne=this.props,ge=ne.prefixCls,Q=ne.disabled,Pe=ne.readOnly,w=ne.useTouch,g=ne.autoComplete,H=ne.upHandler,be=ne.downHandler,Ce=ne.className,Ke=ne.max,Ye=ne.min,Le=ne.style,ke=ne.title,ve=ne.onMouseEnter,Ee=ne.onMouseLeave,z=ne.onMouseOver,R=ne.onMouseOut,Be=ne.required,$e=ne.onClick,ft=ne.tabIndex,rt=ne.type,Ge=ne.placeholder,de=ne.id,Re=ne.inputMode,je=ne.pattern,Je=ne.step,We=ne.maxLength,Oe=ne.autoFocus,Ie=ne.name,pt=ne.onPaste,qe=ne.onInput,Qe=Object(U.a)(ne,["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"]),et=this.state,yt=et.value,lt=et.focused,tt=T()(ge,(k={},Object(Me.a)(k,Ce,!!Ce),Object(Me.a)(k,"".concat(ge,"-disabled"),Q),Object(Me.a)(k,"".concat(ge,"-focused"),lt),k)),le={};Object.keys(Qe).forEach(function(S){(S.substr(0,5)==="data-"||S.substr(0,5)==="aria-"||S==="role")&&(le[S]=Qe[S])});var gt=!Pe&&!Q,it=this.getInputDisplayValue(null),fe=(yt||yt===0)&&(isNaN(yt)||Number(yt)>=Ke),De=(yt||yt===0)&&(isNaN(yt)||Number(yt)<=Ye),N=fe||Q||Pe,A=De||Q||Pe,P=T()("".concat(ge,"-handler"),"".concat(ge,"-handler-up"),Object(Me.a)({},"".concat(ge,"-handler-up-disabled"),N)),v=T()("".concat(ge,"-handler"),"".concat(ge,"-handler-down"),Object(Me.a)({},"".concat(ge,"-handler-down-disabled"),A)),y=w?{onTouchStart:N?D:this.up,onTouchEnd:this.stop}:{onMouseDown:N?D:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},x=w?{onTouchStart:A?D:this.down,onTouchEnd:this.stop}:{onMouseDown:A?D:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return K.a.createElement("div",{className:tt,style:Le,title:ke,onMouseEnter:ve,onMouseLeave:Ee,onMouseOver:z,onMouseOut:R,onFocus:function(){return null},onBlur:function(){return null}},K.a.createElement("div",{className:"".concat(ge,"-handler-wrap")},K.a.createElement("span",Object.assign({unselectable:"on"},y,{role:"button","aria-label":"Increase Value","aria-disabled":N,className:P}),H||K.a.createElement("span",{unselectable:"on",className:"".concat(ge,"-handler-up-inner"),onClick:J})),K.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Decrease Value","aria-disabled":A,className:v}),be||K.a.createElement("span",{unselectable:"on",className:"".concat(ge,"-handler-down-inner"),onClick:J}))),K.a.createElement("div",{className:"".concat(ge,"-input-wrap")},K.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ye,"aria-valuemax":Ke,"aria-valuenow":yt,required:Be,type:rt,placeholder:Ge,onPaste:pt,onClick:$e,onMouseUp:this.onMouseUp,className:"".concat(ge,"-input"),tabIndex:ft,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:gt?this.onKeyDown:D,onKeyUp:gt?this.onKeyUp:D,autoFocus:Oe,maxLength:We,readOnly:Pe,disabled:Q,max:Ke,min:Ye,step:Je,name:Ie,title:ke,id:de,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(it),pattern:je,inputMode:Re,onInput:qe},le))))}}]),Z}(K.a.Component);q.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:oe,min:-oe,step:1,style:{},onChange:D,onKeyDown:D,onPressEnter:D,onFocus:D,onBlur:D,parser:$,required:!1,autoComplete:"off"};var se=q,Se=Xe.a=se},fnXi:function(xt,Xe,b){"use strict";var U=b("2qtc"),Me=b("kLXV"),ee=b("q1tI"),pe=b.n(ee),ue=b("Ty5D"),he=b("9kvl"),O=b("93VE"),X=b.n(O),K=function(T){var M=T.activeIndex,ie=T.isEdit,Y=ie===void 0?!0:ie,B=T.dispatch,j=T.practiceSetting,D=Object(ue.i)(),J=D.id,$=D.challengesId,Te=Object(ee.useMemo)(function(){return[{name:"\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(J,"/edit/").concat($,"/editcheckpoint")},{name:"\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(J,"/edit/").concat($,"/tab=2")},{name:"\u53C2\u8003\u7B54\u6848",url:"/shixuns/".concat(J,"/edit/").concat($,"/tab=3")},{name:"\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(J,"/edit/").concat($,"/tab=4")}]},[J,$]),Ue=function(te){var me,q=function(){he.d.push(te),B({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};j!=null&&(me=j.sideBar)!==null&&me!==void 0&&me.confirmLeave?Me.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){q()}}):q()};return pe.a.createElement("ul",{className:"challenge-nav"},Y?Te.map(function(oe,te){return M===te?pe.a.createElement("li",{key:oe.url}," ",pe.a.createElement("a",{className:"active"},oe.name)," "):pe.a.createElement("li",{key:oe.url}," ",pe.a.createElement("a",{onClick:function(){return Ue(oe.url)}},oe.name)," ")}):pe.a.createElement("li",{key:Te[0].url}," ",pe.a.createElement("a",{className:"active"},Te[0].name)," "))};Xe.a=Object(he.a)(function(ae){var T=ae.globalSetting,M=ae.practiceSetting;return{globalSetting:T,practiceSetting:M}})(K)},kSUc:function(xt,Xe,b){},lZu9:function(xt,Xe,b){(function(U){U(b("VrN/"),b("1eCo"),b("8EBN"))})(function(U){"use strict";U.defineMode("markdown",function(Me,ee){var pe=U.getMode(Me,"text/html"),ue=pe.name=="null";function he(w){if(U.findModeByName){var g=U.findModeByName(w);g&&(w=g.mime||g.mimes[0])}var H=U.getMode(Me,w);return H.name=="null"?null:H}ee.highlightFormatting===void 0&&(ee.highlightFormatting=!1),ee.maxBlockquoteDepth===void 0&&(ee.maxBlockquoteDepth=0),ee.taskLists===void 0&&(ee.taskLists=!1),ee.strikethrough===void 0&&(ee.strikethrough=!1),ee.emoji===void 0&&(ee.emoji=!1),ee.fencedCodeBlockHighlighting===void 0&&(ee.fencedCodeBlockHighlighting=!0),ee.fencedCodeBlockDefaultMode===void 0&&(ee.fencedCodeBlockDefaultMode="text/plain"),ee.xml===void 0&&(ee.xml=!0),ee.tokenTypeOverrides===void 0&&(ee.tokenTypeOverrides={});var O={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 X in O)O.hasOwnProperty(X)&&ee.tokenTypeOverrides[X]&&(O[X]=ee.tokenTypeOverrides[X]);var K=/^([*\-_])(?:\s*\1){2,}\s*$/,ae=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,T=/^\[(x| )\](?=\s)/i,M=ee.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ie=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Y=/^[^#!\[\]*_\\<>` "'(~:]+/,B=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,j=/^\s*\[[^\]]+?\]:.*$/,D=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,J=" ";function $(w,g,H){return g.f=g.inline=H,H(w,g)}function Te(w,g,H){return g.f=g.block=H,H(w,g)}function Ue(w){return!w||!/\S/.test(w.string)}function oe(w){if(w.linkTitle=!1,w.linkHref=!1,w.linkText=!1,w.em=!1,w.strong=!1,w.strikethrough=!1,w.quote=0,w.indentedCode=!1,w.f==me){var g=ue;if(!g){var H=U.innerMode(pe,w.htmlState);g=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}g&&(w.f=re,w.block=te,w.htmlState=null)}return w.trailingSpace=0,w.trailingSpaceNewLine=!1,w.prevLine=w.thisLine,w.thisLine={stream:null},null}function te(w,g){var H=w.column()===g.indentation,be=Ue(g.prevLine.stream),Ce=g.indentedCode,Ke=g.prevLine.hr,Ye=g.list!==!1,Le=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var ke=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Ye)){for(g.list=null;ke<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=ke-g.listStack[g.listStack.length-1])}var ve=!be&&!Ke&&!g.prevLine.header&&(!Ye||!Ce)&&!g.prevLine.fencedCodeEnd,Ee=(g.list===!1||Ke||be)&&g.indentation<=Le&&w.match(K),z=null;if(g.indentationDiff>=4&&(Ce||g.prevLine.fencedCodeEnd||g.prevLine.header||be))return w.skipToEnd(),g.indentedCode=!0,O.code;if(w.eatSpace())return null;if(H&&g.indentation<=Le&&(z=w.match(M))&&z[1].length<=6)return g.quote=0,g.header=z[1].length,g.thisLine.header=!0,ee.highlightFormatting&&(g.formatting="header"),g.f=g.inline,se(g);if(g.indentation<=Le&&w.eat(">"))return g.quote=H?1:g.quote+1,ee.highlightFormatting&&(g.formatting="quote"),w.eatSpace(),se(g);if(!Ee&&!g.setext&&H&&g.indentation<=Le&&(z=w.match(ae))){var R=z[1]?"ol":"ul";return g.indentation=ke+w.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,ee.taskLists&&w.match(T,!1)&&(g.taskList=!0),g.f=g.inline,ee.highlightFormatting&&(g.formatting=["list","list-"+R]),se(g)}else{if(H&&g.indentation<=Le&&(z=w.match(B,!0)))return g.quote=0,g.fencedEndRE=new RegExp(z[1]+"+ *$"),g.localMode=ee.fencedCodeBlockHighlighting&&he(z[2]||ee.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=U.startState(g.localMode)),g.f=g.block=q,ee.highlightFormatting&&(g.formatting="code-block"),g.code=-1,se(g);if(g.setext||(!ve||!Ye)&&!g.quote&&g.list===!1&&!g.code&&!Ee&&!j.test(w.string)&&(z=w.lookAhead(1))&&(z=z.match(ie)))return g.setext?(g.header=g.setext,g.setext=0,w.skipToEnd(),ee.highlightFormatting&&(g.formatting="header")):(g.header=z[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,se(g);if(Ee)return w.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,O.hr;if(w.peek()==="[")return $(w,g,ne)}return $(w,g,g.inline)}function me(w,g){var H=pe.token(w,g.htmlState);if(!ue){var be=U.innerMode(pe,g.htmlState);(be.mode.name=="xml"&&be.state.tagStart===null&&!be.state.context&&be.state.tokenize.isInText||g.md_inside&&w.current().indexOf(">")>-1)&&(g.f=re,g.block=te,g.htmlState=null)}return H}function q(w,g){var H=g.listStack[g.listStack.length-1]||0,be=g.indentation<H,Ce=H+3;if(g.fencedEndRE&&g.indentation<=Ce&&(be||w.match(g.fencedEndRE))){ee.highlightFormatting&&(g.formatting="code-block");var Ke;return be||(Ke=se(g)),g.localMode=g.localState=null,g.block=te,g.f=re,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,be?Te(w,g,g.block):Ke}else return g.localMode?g.localMode.token(w,g.localState):(w.skipToEnd(),O.code)}function se(w){var g=[];if(w.formatting){g.push(O.formatting),typeof w.formatting=="string"&&(w.formatting=[w.formatting]);for(var H=0;H<w.formatting.length;H++)g.push(O.formatting+"-"+w.formatting[H]),w.formatting[H]==="header"&&g.push(O.formatting+"-"+w.formatting[H]+"-"+w.header),w.formatting[H]==="quote"&&(!ee.maxBlockquoteDepth||ee.maxBlockquoteDepth>=w.quote?g.push(O.formatting+"-"+w.formatting[H]+"-"+w.quote):g.push("error"))}if(w.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(w.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(w.linkHref?g.push(O.linkHref,"url"):(w.strong&&g.push(O.strong),w.em&&g.push(O.em),w.strikethrough&&g.push(O.strikethrough),w.emoji&&g.push(O.emoji),w.linkText&&g.push(O.linkText),w.code&&g.push(O.code),w.image&&g.push(O.image),w.imageAltText&&g.push(O.imageAltText,"link"),w.imageMarker&&g.push(O.imageMarker)),w.header&&g.push(O.header,O.header+"-"+w.header),w.quote&&(g.push(O.quote),!ee.maxBlockquoteDepth||ee.maxBlockquoteDepth>=w.quote?g.push(O.quote+"-"+w.quote):g.push(O.quote+"-"+ee.maxBlockquoteDepth)),w.list!==!1){var be=(w.listStack.length-1)%3;be?be===1?g.push(O.list2):g.push(O.list3):g.push(O.list1)}return w.trailingSpaceNewLine?g.push("trailing-space-new-line"):w.trailingSpace&&g.push("trailing-space-"+(w.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function Se(w,g){return w.match(Y,!0)?se(g):void 0}function re(w,g){var H=g.text(w,g);if(typeof H!="undefined")return H;if(g.list)return g.list=null,se(g);if(g.taskList){var be=w.match(T,!0)[1]===" ";return be?g.taskOpen=!0:g.taskClosed=!0,ee.highlightFormatting&&(g.formatting="task"),g.taskList=!1,se(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&w.match(/^#+$/,!0))return ee.highlightFormatting&&(g.formatting="header"),se(g);var Ce=w.next();if(g.linkTitle){g.linkTitle=!1;var Ke=Ce;Ce==="("&&(Ke=")"),Ke=(Ke+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+Ke+"\\\\]+|\\\\\\\\|\\\\.)"+Ke;if(w.match(new RegExp(Ye),!0))return O.linkHref}if(Ce==="`"){var Le=g.formatting;ee.highlightFormatting&&(g.formatting="code"),w.eatWhile("`");var ke=w.current().length;if(g.code==0&&(!g.quote||ke==1))return g.code=ke,se(g);if(ke==g.code){var ve=se(g);return g.code=0,ve}else return g.formatting=Le,se(g)}else if(g.code)return se(g);if(Ce==="\\"&&(w.next(),ee.highlightFormatting)){var Ee=se(g),z=O.formatting+"-escape";return Ee?Ee+" "+z:z}if(Ce==="!"&&w.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,ee.highlightFormatting&&(g.formatting="image"),se(g);if(Ce==="["&&g.imageMarker&&w.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,ee.highlightFormatting&&(g.formatting="image"),se(g);if(Ce==="]"&&g.imageAltText){ee.highlightFormatting&&(g.formatting="image");var Ee=se(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=Z,Ee}if(Ce==="["&&!g.image)return g.linkText&&w.match(/^.*?\]/)||(g.linkText=!0,ee.highlightFormatting&&(g.formatting="link")),se(g);if(Ce==="]"&&g.linkText){ee.highlightFormatting&&(g.formatting="link");var Ee=se(g);return g.linkText=!1,g.inline=g.f=w.match(/\(.*?\)| ?\[.*?\]/,!1)?Z:re,Ee}if(Ce==="<"&&w.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=C,ee.highlightFormatting&&(g.formatting="link");var Ee=se(g);return Ee?Ee+=" ":Ee="",Ee+O.linkInline}if(Ce==="<"&&w.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=C,ee.highlightFormatting&&(g.formatting="link");var Ee=se(g);return Ee?Ee+=" ":Ee="",Ee+O.linkEmail}if(ee.xml&&Ce==="<"&&w.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var R=w.string.indexOf(">",w.pos);if(R!=-1){var Be=w.string.substring(w.start,R);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Be)&&(g.md_inside=!0)}return w.backUp(1),g.htmlState=U.startState(pe),Te(w,g,me)}if(ee.xml&&Ce==="<"&&w.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(Ce==="*"||Ce==="_"){for(var $e=1,ft=w.pos==1?" ":w.string.charAt(w.pos-2);$e<3&&w.eat(Ce);)$e++;var rt=w.peek()||" ",Ge=!/\s/.test(rt)&&(!D.test(rt)||/\s/.test(ft)||D.test(ft)),de=!/\s/.test(ft)&&(!D.test(ft)||/\s/.test(rt)||D.test(rt)),Re=null,je=null;if($e%2&&(!g.em&&Ge&&(Ce==="*"||!de||D.test(ft))?Re=!0:g.em==Ce&&de&&(Ce==="*"||!Ge||D.test(rt))&&(Re=!1)),$e>1&&(!g.strong&&Ge&&(Ce==="*"||!de||D.test(ft))?je=!0:g.strong==Ce&&de&&(Ce==="*"||!Ge||D.test(rt))&&(je=!1)),je!=null||Re!=null){ee.highlightFormatting&&(g.formatting=Re==null?"strong":je==null?"em":"strong em"),Re===!0&&(g.em=Ce),je===!0&&(g.strong=Ce);var ve=se(g);return Re===!1&&(g.em=!1),je===!1&&(g.strong=!1),ve}}else if(Ce===" "&&(w.eat("*")||w.eat("_"))){if(w.peek()===" ")return se(g);w.backUp(1)}if(ee.strikethrough){if(Ce==="~"&&w.eatWhile(Ce)){if(g.strikethrough){ee.highlightFormatting&&(g.formatting="strikethrough");var ve=se(g);return g.strikethrough=!1,ve}else if(w.match(/^[^\s]/,!1))return g.strikethrough=!0,ee.highlightFormatting&&(g.formatting="strikethrough"),se(g)}else if(Ce===" "&&w.match(/^~~/,!0)){if(w.peek()===" ")return se(g);w.backUp(2)}}if(ee.emoji&&Ce===":"&&w.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,ee.highlightFormatting&&(g.formatting="emoji");var Je=se(g);return g.emoji=!1,Je}return Ce===" "&&(w.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),se(g)}function C(w,g){var H=w.next();if(H===">"){g.f=g.inline=re,ee.highlightFormatting&&(g.formatting="link");var be=se(g);return be?be+=" ":be="",be+O.linkInline}return w.match(/^[^>]+/,!0),O.linkInline}function Z(w,g){if(w.eatSpace())return null;var H=w.next();return H==="("||H==="["?(g.f=g.inline=k(H==="("?")":"]"),ee.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,se(g)):"error"}var W={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function k(w){return function(g,H){var be=g.next();if(be===w){H.f=H.inline=re,ee.highlightFormatting&&(H.formatting="link-string");var Ce=se(H);return H.linkHref=!1,Ce}return g.match(W[w]),H.linkHref=!0,se(H)}}function ne(w,g){return w.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=ge,w.next(),ee.highlightFormatting&&(g.formatting="link"),g.linkText=!0,se(g)):$(w,g,re)}function ge(w,g){if(w.match(/^\]:/,!0)){g.f=g.inline=Q,ee.highlightFormatting&&(g.formatting="link");var H=se(g);return g.linkText=!1,H}return w.match(/^([^\]\\]|\\.)+/,!0),O.linkText}function Q(w,g){return w.eatSpace()?null:(w.match(/^[^\s]+/,!0),w.peek()===void 0?g.linkTitle=!0:w.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=re,O.linkHref+" url")}var Pe={startState:function(){return{f:te,prevLine:{stream:null},thisLine:{stream:null},block:te,htmlState:null,indentation:0,inline:re,text:Se,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(w){return{f:w.f,prevLine:w.prevLine,thisLine:w.thisLine,block:w.block,htmlState:w.htmlState&&U.copyState(pe,w.htmlState),indentation:w.indentation,localMode:w.localMode,localState:w.localMode?U.copyState(w.localMode,w.localState):null,inline:w.inline,text:w.text,formatting:!1,linkText:w.linkText,linkTitle:w.linkTitle,linkHref:w.linkHref,code:w.code,em:w.em,strong:w.strong,strikethrough:w.strikethrough,emoji:w.emoji,header:w.header,setext:w.setext,hr:w.hr,taskList:w.taskList,list:w.list,listStack:w.listStack.slice(0),quote:w.quote,indentedCode:w.indentedCode,trailingSpace:w.trailingSpace,trailingSpaceNewLine:w.trailingSpaceNewLine,md_inside:w.md_inside,fencedEndRE:w.fencedEndRE}},token:function(w,g){if(g.formatting=!1,w!=g.thisLine.stream){if(g.header=0,g.hr=!1,w.match(/^\s*$/,!0))return oe(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:w},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=me)){var H=w.match(/^\s*/,!0)[0].replace(/\t/g,J).length;if(g.indentation=H,g.indentationDiff=null,H>0)return null}}return g.f(w,g)},innerMode:function(w){return w.block==me?{state:w.htmlState,mode:pe}:w.localState?{state:w.localState,mode:w.localMode}:{state:w,mode:Pe}},indent:function(w,g,H){return w.block==me&&pe.indent?pe.indent(w.htmlState,g,H):w.localState&&w.localMode.indent?w.localMode.indent(w.localState,g,H):U.Pass},blankLine:oe,getType:se,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Pe},"xml"),U.defineMIME("text/markdown","markdown"),U.defineMIME("text/x-markdown","markdown")})},nuEh:function(xt,Xe,b){"use strict";var U=b("T2oS"),Me=b("W9HT"),ee=b("q1tI"),pe=b.n(ee),ue=b("F8wB"),he=b.n(ue),O=function(K){var ae=K.loading;return ae?pe.a.createElement("div",{className:he.a.loading},pe.a.createElement(Me.a,null)):pe.a.createElement(pe.a.Fragment,null)};Xe.a=O},osHv:function(xt,Xe,b){(function(U){U(b("VrN/"))})(function(U){"use strict";var Me=U.Pos;function ee(D,J){return D.line-J.line||D.ch-J.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",ue=pe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",he=new RegExp("<(/?)(["+pe+"]["+ue+"]*)","g");function O(D,J,$,Te){this.line=J,this.ch=$,this.cm=D,this.text=D.getLine(J),this.min=Te?Math.max(Te.from,D.firstLine()):D.firstLine(),this.max=Te?Math.min(Te.to-1,D.lastLine()):D.lastLine()}function X(D,J){var $=D.cm.getTokenTypeAt(Me(D.line,J));return $&&/\btag\b/.test($)}function K(D){return D.line>=D.max?void 0:(D.ch=0,D.text=D.cm.getLine(++D.line),!0)}function ae(D){return D.line<=D.min?void 0:(D.text=D.cm.getLine(--D.line),D.ch=D.text.length,!0)}function T(D){for(;;){var J=D.text.indexOf(">",D.ch);if(J==-1){if(K(D))continue;return}if(!X(D,J+1)){D.ch=J+1;continue}var $=D.text.lastIndexOf("/",J),Te=$>-1&&!/\S/.test(D.text.slice($+1,J));return D.ch=J+1,Te?"selfClose":"regular"}}function M(D){for(;;){var J=D.ch?D.text.lastIndexOf("<",D.ch-1):-1;if(J==-1){if(ae(D))continue;return}if(!X(D,J+1)){D.ch=J;continue}he.lastIndex=J,D.ch=J;var $=he.exec(D.text);if($&&$.index==J)return $}}function ie(D){for(;;){he.lastIndex=D.ch;var J=he.exec(D.text);if(!J){if(K(D))continue;return}if(!X(D,J.index+1)){D.ch=J.index+1;continue}return D.ch=J.index+J[0].length,J}}function Y(D){for(;;){var J=D.ch?D.text.lastIndexOf(">",D.ch-1):-1;if(J==-1){if(ae(D))continue;return}if(!X(D,J+1)){D.ch=J;continue}var $=D.text.lastIndexOf("/",J),Te=$>-1&&!/\S/.test(D.text.slice($+1,J));return D.ch=J+1,Te?"selfClose":"regular"}}function B(D,J){for(var $=[];;){var Te=ie(D),Ue,oe=D.line,te=D.ch-(Te?Te[0].length:0);if(!Te||!(Ue=T(D)))return;if(Ue=="selfClose")continue;if(Te[1]){for(var me=$.length-1;me>=0;--me)if($[me]==Te[2]){$.length=me;break}if(me<0&&(!J||J==Te[2]))return{tag:Te[2],from:Me(oe,te),to:Me(D.line,D.ch)}}else $.push(Te[2])}}function j(D,J){for(var $=[];;){var Te=Y(D);if(!Te)return;if(Te=="selfClose"){M(D);continue}var Ue=D.line,oe=D.ch,te=M(D);if(!te)return;if(te[1])$.push(te[2]);else{for(var me=$.length-1;me>=0;--me)if($[me]==te[2]){$.length=me;break}if(me<0&&(!J||J==te[2]))return{tag:te[2],from:Me(D.line,D.ch),to:Me(Ue,oe)}}}}U.registerHelper("fold","xml",function(D,J){for(var $=new O(D,J.line,0);;){var Te=ie($);if(!Te||$.line!=J.line)return;var Ue=T($);if(!Ue)return;if(!Te[1]&&Ue!="selfClose"){var oe=Me($.line,$.ch),te=B($,Te[2]);return te&&ee(te.from,oe)>0?{from:oe,to:te.from}:null}}}),U.findMatchingTag=function(D,J,$){var Te=new O(D,J.line,J.ch,$);if(Te.text.indexOf(">")==-1&&Te.text.indexOf("<")==-1)return;var Ue=T(Te),oe=Ue&&Me(Te.line,Te.ch),te=Ue&&M(Te);if(!Ue||!te||ee(Te,J)>0)return;var me={from:Me(Te.line,Te.ch),to:oe,tag:te[2]};return Ue=="selfClose"?{open:me,close:null,at:"open"}:te[1]?{open:j(Te,te[2]),close:me,at:"close"}:(Te=new O(D,oe.line,oe.ch,$),{open:me,close:B(Te,te[2]),at:"open"})},U.findEnclosingTag=function(D,J,$,Te){for(var Ue=new O(D,J.line,J.ch,$);;){var oe=j(Ue,Te);if(!oe)break;var te=new O(D,J.line,J.ch,$),me=B(te,oe.tag);if(me)return{open:oe,close:me}}},U.scanForClosingTag=function(D,J,$,Te){var Ue=new O(D,J.line,J.ch,Te?{from:0,to:Te}:null);return B(Ue,$)}})},p5ED:function(xt,Xe,b){"use strict";var U=b("+L6B"),Me=b("2/Rp"),ee=b("5Dmo"),pe=b("3S7+"),ue=b("k1fw"),he=b("9og8"),O=b("tJVT"),X=b("WmNS"),K=b.n(X),ae=b("q1tI"),T=b.n(ae),M=b("vHTk"),ie=b.n(M),Y=b("yEEn"),B=b("ZW9T"),j=b("1vsH"),D=b("V0Rq"),J=b("m3rI"),$=function(Ue){var oe=Ue.name,te=Ue.data,me=Ue.theme,q=Ue.type,se=Ue.filename,Se=Ue.monacoEditor,re=Ue.className,C=Ue.style,Z=Ue.close,W=Ue.onClose,k=Ue.hasMask,ne=Ue.otherData,ge=ne===void 0?{}:ne,Q=Object(ae.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Pe=Object(O.a)(Q,2),w=Pe[0],g=Pe[1],H=Object(ae.useState)(""),be=Object(O.a)(H,2),Ce=be[0],Ke=be[1],Ye=Object(ae.useState)(),Le=Object(O.a)(Ye,2),ke=Le[0],ve=Le[1],Ee=window.ENV==="build"?"/react/build/office.html":"/office.html",z,R=1024*1024,Be=10*R,$e=Object(ae.useRef)();q==="office"&&(z=Object(j.P)(te).filesize,z>Be&&(q="other")),se&&(Se.filename=se),Object(ae.useEffect)(function(){var de,Re,je=(de=document.cookie)===null||de===void 0||((Re=de.replace(/\s/g,""))===null||Re===void 0)?void 0:Re.split(";");je==null||je.map(function(Je){var We=Je.split("=");We[0]==="_educoder_session"&&Ke(We[1])})},[]),Object(ae.useEffect)(function(){q==="office"&&ft()},[q]);var ft=function(){var de=Object(he.a)(K.a.mark(function Re(){var je,Je,We;return K.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return console.log("data:",te),je=te,te.startsWith("http")||(je=location.origin+je),Je=new URL(je).pathname.split("/").pop(),Ie.next=6,Object(D.U)({attachment_id:Je});case 6:We=Ie.sent,ve(We);case 8:case"end":return Ie.stop()}},Re)}));return function(){return de.apply(this,arguments)}}(),rt=function(){if(te.startsWith("http")||te.startsWith("blob:")){Ge();return}Object(j.x)(se||"educoder",te,se)},Ge=function(){Object(j.v)(se||"educoder",decodeURIComponent(te))};return T.a.createElement("div",{style:Object(ue.a)({},C||{}),className:"".concat(k&&ie.a.bgBlack," ").concat(q?ie.a.wrp:"hide")},Z&&T.a.createElement("div",{className:ie.a.close,ref:$e},T.a.createElement(pe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return $e.current}},T.a.createElement("span",{onClick:Ge},T.a.createElement("i",{className:"icon-quxiaozhiding"}))),T.a.createElement(pe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return $e.current}},T.a.createElement("span",{className:"",onClick:function(){W(),ve(null)}},T.a.createElement("i",{className:"icon-guanbi1"})))),T.a.createElement("div",{className:"".concat(ie.a[re]," ").concat(re," ").concat(ie.a.monaco," ").concat(q==="txt"?"show":"hide")},q==="txt"&&T.a.createElement(B.b,Se)),q==="audio"&&T.a.createElement("audio",{src:"".concat((te==null?void 0:te.indexOf("http://"))>-1||(te==null?void 0:te.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(te),autoPlay:!0}),q==="video"&&T.a.createElement(T.a.Fragment,null,(te==null?void 0:te.indexOf("/api"))>-1?T.a.createElement("video",{controls:!0,src:"".concat(te),autoPlay:!0}):T.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(te),autoPlay:!0})),q==="office"&&ke&&T.a.createElement("iframe",{src:"".concat(Ee,"?key=").concat(ke.key,"&url=").concat(J.a.API_SERVER+ke.url,"&callbackUrl=").concat(J.a.API_SERVER+ke.callbackUrl,"&fileType=").concat(ke.fileType,"&title=").concat(ke.title,"&model=view")}),(q==="xlsx"||q==="doc"||q==="pptx"||q==="docx")&&T.a.createElement("iframe",{src:"".concat(Ee,"?key=").concat(ge.key,"&url=").concat(J.a.API_SERVER+ge.url,"&callbackUrl=").concat(J.a.API_SERVER+ge.callbackUrl,"&fileType=").concat(ge.fileType,"&title=").concat(ge.title,"&model=").concat(ge.model)}),q==="html"&&T.a.createElement("iframe",{src:te+"&disposition=inline"}),q==="pdf"&&T.a.createElement("embed",{className:ie.a.embed,src:te,type:"application/pdf"}),q==="image"&&T.a.createElement("img",{src:"".concat((te==null?void 0:te.indexOf("http://"))>-1||(te==null?void 0:te.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(te)}),q==="other"&&T.a.createElement("div",null,T.a.createElement(Me.a,{type:"primary",size:"large",onClick:rt},T.a.createElement(Y.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),q==="download"&&T.a.createElement(Me.a,{type:"primary",size:"large",onClick:rt},T.a.createElement(Y.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Xe.a=$},"p77/":function(xt,Xe,b){},"rAM+":function(xt,Xe,b){"use strict";b.d(Xe,"a",function(){return Me});var U=b("Qw5x");function Me(ee,pe){var ue;if(typeof Symbol=="undefined"||ee[Symbol.iterator]==null){if(Array.isArray(ee)||(ue=Object(U.a)(ee))||pe&&ee&&typeof ee.length=="number"){ue&&(ee=ue);var he=0,O=function(){};return{s:O,n:function(){return he>=ee.length?{done:!0}:{done:!1,value:ee[he++]}},e:function(M){throw M},f:O}}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 X=!0,K=!1,ae;return{s:function(){ue=ee[Symbol.iterator]()},n:function(){var M=ue.next();return X=M.done,M},e:function(M){K=!0,ae=M},f:function(){try{!X&&ue.return!=null&&ue.return()}finally{if(K)throw ae}}}}},rUJ1:function(xt,Xe){const b=/[&<>"']/,U=/[&<>"']/g,Me=/[<>"']|&(?!#?\w+;)/,ee=/[<>"']|&(?!#?\w+;)/g,pe={"&":"&","<":"<",">":">",'"':""","'":"'"},ue=q=>pe[q];function he(q,se){if(se){if(b.test(q))return q.replace(U,ue)}else if(Me.test(q))return q.replace(ee,ue);return q}const O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function X(q){return q.replace(O,(se,Se)=>(Se=Se.toLowerCase(),Se==="colon"?":":Se.charAt(0)==="#"?Se.charAt(1)==="x"?String.fromCharCode(parseInt(Se.substring(2),16)):String.fromCharCode(+Se.substring(1)):""))}const K=/(^|[^\[])\^/g;function ae(q,se){q=q.source||q,se=se||"";const Se={replace:(re,C)=>(C=C.source||C,C=C.replace(K,"$1"),q=q.replace(re,C),Se),getRegex:()=>new RegExp(q,se)};return Se}const T=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ie(q,se,Se){if(q){let re;try{re=decodeURIComponent(X(Se)).replace(T,"").toLowerCase()}catch(C){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}se&&!M.test(Se)&&(Se=J(se,Se));try{Se=encodeURI(Se).replace(/%25/g,"%")}catch(re){return null}return Se}const Y={},B=/^[^:]+:\/*[^/]*$/,j=/^([^:]+:)[\s\S]*$/,D=/^([^:]+:\/*[^/]*)[\s\S]*$/;function J(q,se){Y[" "+q]||(B.test(q)?Y[" "+q]=q+"/":Y[" "+q]=oe(q,"/",!0)),q=Y[" "+q];const Se=q.indexOf(":")===-1;return se.substring(0,2)==="//"?Se?se:q.replace(j,"$1")+se:se.charAt(0)==="/"?Se?se:q.replace(D,"$1")+se:q+se}const $={exec:function(){}};function Te(q){let se=1,Se,re;for(;se<arguments.length;se++){Se=arguments[se];for(re in Se)Object.prototype.hasOwnProperty.call(Se,re)&&(q[re]=Se[re])}return q}function Ue(q,se){const Se=q.replace(/\|/g,(Z,W,k)=>{let ne=!1,ge=W;for(;--ge>=0&&k[ge]==="\\";)ne=!ne;return ne?"|":" |"}),re=Se.split(/ \|/);let C=0;if(re.length>se)re.splice(se);else for(;re.length<se;)re.push("");for(;C<re.length;C++)re[C]=re[C].trim().replace(/\\\|/g,"|");return re}function oe(q,se,Se){const re=q.length;if(re===0)return"";let C=0;for(;C<re;){const Z=q.charAt(re-C-1);if(Z===se&&!Se)C++;else if(Z!==se&&Se)C++;else break}return q.substr(0,re-C)}function te(q,se){if(q.indexOf(se[1])===-1)return-1;const Se=q.length;let re=0,C=0;for(;C<Se;C++)if(q[C]==="\\")C++;else if(q[C]===se[0])re++;else if(q[C]===se[1]&&(re--,re<0))return C;return-1}function me(q){q&&q.sanitize&&!q.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")}xt.exports={escape:he,unescape:X,edit:ae,cleanUrl:ie,resolveUrl:J,noopTest:$,merge:Te,splitCells:Ue,rtrim:oe,findClosingBracket:te,checkSanitizeDeprecation:me}},vHTk:function(xt,Xe,b){xt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|