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.
351 lines
717 KiB
351 lines
717 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[191,6,7,16,17],{"+NIl":function(lt,qe,v){(function(z){z(v("VrN/"))})(function(z){"use strict";z.defineMode("stex",function(be,ge){"use strict";function Me(ee,P){ee.cmdState.push(P)}function pe(ee){return ee.cmdState.length>0?ee.cmdState[ee.cmdState.length-1]:null}function q(ee){var P=ee.cmdState.pop();P&&P.closeBracket()}function D(ee){for(var P=ee.cmdState,$=P.length-1;$>=0;$--){var J=P[$];if(J.name=="DEFAULT")continue;return J}return{styleIdentifier:function(){return null}}}function j(ee,P,$){return function(){this.name=ee,this.bracketNo=0,this.style=P,this.styles=$,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var A={};A.importmodule=j("importmodule","tag",["string","builtin"]),A.documentclass=j("documentclass","tag",["","atom"]),A.usepackage=j("usepackage","tag",["atom"]),A.begin=j("begin","tag",["atom"]),A.end=j("end","tag",["atom"]),A.label=j("label","tag",["atom"]),A.ref=j("ref","tag",["atom"]),A.eqref=j("eqref","tag",["atom"]),A.cite=j("cite","tag",["atom"]),A.bibitem=j("bibitem","tag",["atom"]),A.Bibitem=j("Bibitem","tag",["atom"]),A.RBibitem=j("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function B(ee,P){ee.f=P}function O(ee,P){var $;if(ee.match(/^\\[a-zA-Z@]+/)){var J=ee.current().slice(1);return $=A.hasOwnProperty(J)?A[J]:A.DEFAULT,$=new $,Me(P,$),B(P,ue),$.style}if(ee.match(/^\\[$&%#{}_]/))return"tag";if(ee.match(/^\\[,;!\/\\]/))return"tag";if(ee.match("\\["))return B(P,function(fe,je){return I(fe,je,"\\]")}),"keyword";if(ee.match("\\("))return B(P,function(fe,je){return I(fe,je,"\\)")}),"keyword";if(ee.match("$$"))return B(P,function(fe,je){return I(fe,je,"$$")}),"keyword";if(ee.match("$"))return B(P,function(fe,je){return I(fe,je,"$")}),"keyword";var de=ee.next();if(de=="%")return ee.skipToEnd(),"comment";if(de=="}"||de=="]"){if($=pe(P),$)$.closeBracket(de),B(P,ue);else return"error";return"bracket"}else return de=="{"||de=="["?($=A.DEFAULT,$=new $,Me(P,$),"bracket"):/\d/.test(de)?(ee.eatWhile(/[\w.%]/),"atom"):(ee.eatWhile(/[\w\-_]/),$=D(P),$.name=="begin"&&($.argument=ee.current()),$.styleIdentifier())}function I(ee,P,$){if(ee.eatSpace())return null;if($&&ee.match($))return B(P,O),"keyword";if(ee.match(/^\\[a-zA-Z@]+/))return"tag";if(ee.match(/^[a-zA-Z]+/))return"variable-2";if(ee.match(/^\\[$&%#{}_]/))return"tag";if(ee.match(/^\\[,;!\/]/))return"tag";if(ee.match(/^[\^_&]/))return"tag";if(ee.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ee.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var J=ee.next();return J=="{"||J=="}"||J=="["||J=="]"||J=="("||J==")"?"bracket":J=="%"?(ee.skipToEnd(),"comment"):"error"}function ue(ee,P){var $=ee.peek(),J;return $=="{"||$=="["?(J=pe(P),J.openBracket($),ee.eat($),B(P,O),"bracket"):/[ \t\r]/.test($)?(ee.eat($),null):(B(P,O),q(P),O(ee,P))}return{startState:function(){var ee=ge.inMathMode?function(P,$){return I(P,$)}:O;return{cmdState:[],f:ee}},copyState:function(ee){return{cmdState:ee.cmdState.slice(),f:ee.f}},token:function(ee,P){return P.f(ee,P)},blankLine:function(ee){ee.f=O,ee.cmdState.length=0},lineComment:"%"}}),z.defineMIME("text/x-stex","stex"),z.defineMIME("text/x-latex","stex")})},"19Vz":function(lt,qe,v){(function(z){z(v("VrN/"))})(function(z){z.defineOption("placeholder","",function(j,A,B){var O=B&&B!=z.Init;if(A&&!O)j.on("blur",pe),j.on("change",q),j.on("swapDoc",q),z.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){Me(j)}),q(j);else if(!A&&O){j.off("blur",pe),j.off("change",q),j.off("swapDoc",q),z.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),be(j);var I=j.getWrapperElement();I.className=I.className.replace(" CodeMirror-empty","")}A&&!j.hasFocus()&&pe(j)});function be(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function ge(j){be(j);var A=j.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=j.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var B=j.getOption("placeholder");typeof B=="string"&&(B=document.createTextNode(B)),A.appendChild(B),j.display.lineSpace.insertBefore(A,j.display.lineSpace.firstChild)}function Me(j){setTimeout(function(){var A=!1,B=j.getInputField();B.nodeName=="TEXTAREA"?A=!B.value:j.lineCount()==1&&(A=!/[^\u200b]/.test(B.querySelector(".CodeMirror-line").textContent)),A?ge(j):be(j)},20)}function pe(j){D(j)&&ge(j)}function q(j){var A=j.getWrapperElement(),B=D(j);A.className=A.className.replace(" CodeMirror-empty","")+(B?" CodeMirror-empty":""),B?ge(j):be(j)}function D(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(lt,qe,v){(function(z){z(v("VrN/"))})(function(z){"use strict";var be={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},ge={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};z.defineMode("xml",function(Me,pe){var q=Me.indentUnit,D={},j=pe.htmlMode?be:ge;for(var A in j)D[A]=j[A];for(var A in pe)D[A]=pe[A];var B,O;function I(R,ye){function re(K){return ye.tokenize=K,K(R,ye)}var k=R.next();if(k=="<")return R.eat("!")?R.eat("[")?R.match("CDATA[")?re(P("atom","]]>")):null:R.match("--")?re(P("comment","-->")):R.match("DOCTYPE",!0,!0)?(R.eatWhile(/[\w\._\-]/),re($(1))):null:R.eat("?")?(R.eatWhile(/[\w\._\-]/),ye.tokenize=P("meta","?>"),"meta"):(B=R.eat("/")?"closeTag":"openTag",ye.tokenize=ue,"tag bracket");if(k=="&"){var T;return R.eat("#")?R.eat("x")?T=R.eatWhile(/[a-fA-F\d]/)&&R.eat(";"):T=R.eatWhile(/[\d]/)&&R.eat(";"):T=R.eatWhile(/[\w\.\-:]/)&&R.eat(";"),T?"atom":"error"}else return R.eatWhile(/[^&<]/),null}I.isInText=!0;function ue(R,ye){var re=R.next();if(re==">"||re=="/"&&R.eat(">"))return ye.tokenize=I,B=re==">"?"endTag":"selfcloseTag","tag bracket";if(re=="=")return B="equals",null;if(re=="<"){ye.tokenize=I,ye.state=je,ye.tagName=ye.tagStart=null;var k=ye.tokenize(R,ye);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(re)?(ye.tokenize=ee(re),ye.stringStartCol=R.column(),ye.tokenize(R,ye)):(R.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ee(R){var ye=function(re,k){for(;!re.eol();)if(re.next()==R){k.tokenize=ue;break}return"string"};return ye.isInAttribute=!0,ye}function P(R,ye){return function(re,k){for(;!re.eol();){if(re.match(ye)){k.tokenize=I;break}re.next()}return R}}function $(R){return function(ye,re){for(var k;(k=ye.next())!=null;){if(k=="<")return re.tokenize=$(R+1),re.tokenize(ye,re);if(k==">")if(R==1){re.tokenize=I;break}else return re.tokenize=$(R-1),re.tokenize(ye,re)}return"meta"}}function J(R,ye,re){this.prev=R.context,this.tagName=ye,this.indent=R.indented,this.startOfLine=re,(D.doNotIndent.hasOwnProperty(ye)||R.context&&R.context.noIndent)&&(this.noIndent=!0)}function de(R){R.context&&(R.context=R.context.prev)}function fe(R,ye){for(var re;;){if(!R.context)return;if(re=R.context.tagName,!D.contextGrabbers.hasOwnProperty(re)||!D.contextGrabbers[re].hasOwnProperty(ye))return;de(R)}}function je(R,ye,re){return R=="openTag"?(re.tagStart=ye.column(),Ue):R=="closeTag"?Te:je}function Ue(R,ye,re){return R=="word"?(re.tagName=ye.current(),O="tag",me):D.allowMissingTagName&&R=="endTag"?(O="tag bracket",me(R,ye,re)):(O="error",Ue)}function Te(R,ye,re){if(R=="word"){var k=ye.current();return re.context&&re.context.tagName!=k&&D.implicitlyClosed.hasOwnProperty(re.context.tagName)&&de(re),re.context&&re.context.tagName==k||D.matchClosing===!1?(O="tag",ne):(O="tag error",Se)}else return D.allowMissingTagName&&R=="endTag"?(O="tag bracket",ne(R,ye,re)):(O="error",Se)}function ne(R,ye,re){return R!="endTag"?(O="error",ne):(de(re),je)}function Se(R,ye,re){return O="error",ne(R,ye,re)}function me(R,ye,re){if(R=="word")return O="attribute",G;if(R=="endTag"||R=="selfcloseTag"){var k=re.tagName,T=re.tagStart;return re.tagName=re.tagStart=null,R=="selfcloseTag"||D.autoSelfClosers.hasOwnProperty(k)?fe(re,k):(fe(re,k),re.context=new J(re,k,T==re.indented)),je}return O="error",me}function G(R,ye,re){return R=="equals"?he:(D.allowMissing||(O="error"),me(R,ye,re))}function he(R,ye,re){return R=="string"?ie:R=="word"&&D.allowUnquoted?(O="string",me):(O="error",me(R,ye,re))}function ie(R,ye,re){return R=="string"?ie:me(R,ye,re)}return{startState:function(R){var ye={tokenize:I,state:je,indented:R||0,tagName:null,tagStart:null,context:null};return R!=null&&(ye.baseIndent=R),ye},token:function(R,ye){if(!ye.tagName&&R.sol()&&(ye.indented=R.indentation()),R.eatSpace())return null;B=null;var re=ye.tokenize(R,ye);return(re||B)&&re!="comment"&&(O=null,ye.state=ye.state(B||re,R,ye),O&&(re=O=="error"?re+" error":O)),re},indent:function(R,ye,re){var k=R.context;if(R.tokenize.isInAttribute)return R.tagStart==R.indented?R.stringStartCol+1:R.indented+q;if(k&&k.noIndent)return z.Pass;if(R.tokenize!=ue&&R.tokenize!=I)return re?re.match(/^(\s*)/)[0].length:0;if(R.tagName)return D.multilineTagIndentPastTag!==!1?R.tagStart+R.tagName.length+2:R.tagStart+q*(D.multilineTagIndentFactor||1);if(D.alignCDATA&&/<!\[CDATA\[/.test(ye))return 0;var T=ye&&/^<(\/)?([\w_:\.-]*)/.exec(ye);if(T&&T[1])for(;k;)if(k.tagName==T[2]){k=k.prev;break}else if(D.implicitlyClosed.hasOwnProperty(k.tagName))k=k.prev;else break;else if(T)for(;k;){var K=D.contextGrabbers[k.tagName];if(K&&K.hasOwnProperty(T[2]))k=k.prev;else break}for(;k&&k.prev&&!k.startOfLine;)k=k.prev;return k?k.indent+q:R.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:D.htmlMode?"html":"xml",helperType:D.htmlMode?"html":"xml",skipAttribute:function(R){R.state==he&&(R.state=me)},xmlCurrentTag:function(R){return R.tagName?{name:R.tagName,close:R.type=="closeTag"}:null},xmlCurrentContext:function(R){for(var ye=[],re=R.context;re;re=re.prev)re.tagName&&ye.push(re.tagName);return ye.reverse()}}}),z.defineMIME("text/xml","xml"),z.defineMIME("application/xml","xml"),z.mimeModes.hasOwnProperty("text/html")||z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(lt,qe,v){"use strict";var z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),be=new Uint8Array(16);function ge(){if(!z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(be)}var Me=/^(?:[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 pe(ue){return typeof ue=="string"&&Me.test(ue)}for(var q=pe,D=[],j=0;j<256;++j)D.push((j+256).toString(16).substr(1));function A(ue){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=(D[ue[ee+0]]+D[ue[ee+1]]+D[ue[ee+2]]+D[ue[ee+3]]+"-"+D[ue[ee+4]]+D[ue[ee+5]]+"-"+D[ue[ee+6]]+D[ue[ee+7]]+"-"+D[ue[ee+8]]+D[ue[ee+9]]+"-"+D[ue[ee+10]]+D[ue[ee+11]]+D[ue[ee+12]]+D[ue[ee+13]]+D[ue[ee+14]]+D[ue[ee+15]]).toLowerCase();if(!q(P))throw TypeError("Stringified UUID is invalid");return P}var B=A;function O(ue,ee,P){ue=ue||{};var $=ue.random||(ue.rng||ge)();if($[6]=$[6]&15|64,$[8]=$[8]&63|128,ee){P=P||0;for(var J=0;J<16;++J)ee[P+J]=$[J];return ee}return B($)}var I=qe.a=O},"7ahc":function(lt,qe,v){"use strict";v.d(qe,"a",function(){return Ue});var z=v("k1fw"),be=v("0Owb"),ge=v("+L6B"),Me=v("2/Rp"),pe=v("y8nQ"),q=v("Vl3Y"),D=v("tJVT"),j=v("OaEy"),A=v("2fM7"),B=v("q1tI"),O=v.n(B),I=v("VrN/"),ue=v.n(I),ee=v("p77/"),P=v.n(ee),$=v("c5Ni"),J=v.n($),de=A.a.Option,fe={labelCol:{span:4},wrapperCol:{span:20}},je={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};qe.b=function(Te){var ne=Te.callback,Se=Te.onCancel,me=Object(B.useState)("python"),G=Object(D.a)(me,2),he=G[0],ie=G[1];function R(re){ie(je[re][1])}function ye(re){ne(re)}return O.a.createElement(q.a,Object(be.a)({},fe,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ye}),O.a.createElement(q.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},O.a.createElement(A.a,{onChange:R},Object.keys(je).map(function(re){return O.a.createElement(de,{key:re,value:re},je[re][0])}))),O.a.createElement(q.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},O.a.createElement(Ue,{mode:he})),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(Me.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(Me.a,{type:"ghost",onClick:Se},"\u53D6\u6D88")))};function Ue(Te){var ne=Te.value,Se=Te.onChange,me=Te.mode,G=Te.options,he=G===void 0?{}:G,ie=Object(B.useRef)(),R=Object(B.useState)(),ye=Object(D.a)(R,2),re=ye[0],k=ye[1];return Object(B.useEffect)(function(){if(re){function T(K){var L=K.getValue();Se&&Se(L)}return re.on("change",T),function(){re.off("change",T)}}},[re,Se]),Object(B.useEffect)(function(){re&&re.setOption("mode",me)},[re,me]),Object(B.useEffect)(function(){re&&((ne!==re.getValue()||ne==="")&&setTimeout(function(){re.setValue(ne||" ")},300))},[re,ne]),Object(B.useEffect)(function(){if(ie.current&&!re){var T=ue.a.fromTextArea(ie.current,Object(z.a)({mode:me,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},he));k(T)}},[ie.current,re]),O.a.createElement("div",{className:"my-codemirror-container"},O.a.createElement("textarea",{ref:ie}))}},"7ixt":function(lt,qe,v){"use strict";v.d(qe,"a",function(){return ge});var z={adjustX:1,adjustY:1},be=[0,0],ge={left:{points:["cr","cl"],overflow:z,offset:[-4,0],targetOffset:be},right:{points:["cl","cr"],overflow:z,offset:[4,0],targetOffset:be},top:{points:["bc","tc"],overflow:z,offset:[0,-4],targetOffset:be},bottom:{points:["tc","bc"],overflow:z,offset:[0,4],targetOffset:be},topLeft:{points:["bl","tl"],overflow:z,offset:[0,-4],targetOffset:be},leftTop:{points:["tr","tl"],overflow:z,offset:[-4,0],targetOffset:be},topRight:{points:["br","tr"],overflow:z,offset:[0,-4],targetOffset:be},rightTop:{points:["tl","tr"],overflow:z,offset:[4,0],targetOffset:be},bottomRight:{points:["tr","br"],overflow:z,offset:[0,4],targetOffset:be},rightBottom:{points:["bl","br"],overflow:z,offset:[4,0],targetOffset:be},bottomLeft:{points:["tl","bl"],overflow:z,offset:[0,4],targetOffset:be},leftBottom:{points:["br","bl"],overflow:z,offset:[-4,0],targetOffset:be}},Me=ge},"815F":function(lt,qe,v){"use strict";v.d(qe,"e",function(){return D}),v.d(qe,"c",function(){return A}),v.d(qe,"d",function(){return B}),v.d(qe,"a",function(){return I}),v.d(qe,"f",function(){return ue}),v.d(qe,"b",function(){return ee});var z=v("KQm4"),be=v("VTBJ"),ge=v("Ff2n"),Me=v("Zm9Q"),pe=v("Kwbf"),q=v("OZM5");function D(P,$){return P!=null?P:$}function j(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=new Map;function J(de){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(de||[]).forEach(function(je){var Ue=je.key,Te=je.children;Object(pe.a)(Ue!=null,"Tree node must have a certain key: [".concat(fe).concat(Ue,"]"));var ne=String(Ue);Object(pe.a)(!$.has(ne)||Ue===null||Ue===void 0,"Same 'key' exist in the Tree: ".concat(ne)),$.set(ne,!0),J(Te,"".concat(fe).concat(ne," > "))})}J(P)}function A(P){function $(J){var de=Object(Me.a)(J);return de.map(function(fe){if(!Object(q.i)(fe))return Object(pe.a)(!fe,"Tree/TreeNode can only accept TreeNode as children."),null;var je=fe.key,Ue=fe.props,Te=Ue.children,ne=Object(ge.a)(Ue,["children"]),Se=Object(be.a)({key:je},ne),me=$(Te);return me.length&&(Se.children=me),Se}).filter(function(fe){return fe})}return $(P)}function B(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],J=new Set($===!0?[]:$),de=[];function fe(je){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return je.map(function(Te,ne){var Se=Object(q.h)(Ue?Ue.pos:"0",ne),me=D(Te.key,Se),G=Object(be.a)(Object(be.a)({},Te),{},{parent:Ue,pos:Se,children:null,data:Te,isStart:[].concat(Object(z.a)(Ue?Ue.isStart:[]),[ne===0]),isEnd:[].concat(Object(z.a)(Ue?Ue.isEnd:[]),[ne===je.length-1])});return de.push(G),$===!0||J.has(me)?G.children=fe(Te.children||[],G):G.children=[],G})}return fe(P),de}function O(P,$,J){var de;J?typeof J=="string"?de=function(Ue){return Ue[J]}:typeof J=="function"&&(de=function(Ue){return J(Ue)}):de=function(Ue,Te){return D(Ue.key,Te)};function fe(je,Ue,Te){var ne=je?je.children:P,Se=je?Object(q.h)(Te.pos,Ue):"0";if(je){var me=de(je,Se),G={node:je,index:Ue,pos:Se,key:me,parentPos:Te.node?Te.pos:null,level:Te.level+1};$(G)}ne&&ne.forEach(function(he,ie){fe(he,ie,{node:je,pos:Se,level:Te?Te.level+1:-1})})}fe(null)}function I(P){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=$.initWrapper,de=$.processEntity,fe=$.onProcessFinished,je=arguments.length>2?arguments[2]:void 0,Ue={},Te={},ne={posEntities:Ue,keyEntities:Te};return J&&(ne=J(ne)||ne),O(P,function(Se){var me=Se.node,G=Se.index,he=Se.pos,ie=Se.key,R=Se.parentPos,ye=Se.level,re={node:me,index:G,key:ie,pos:he,level:ye},k=D(ie,he);Ue[he]=re,Te[k]=re,re.parent=Ue[R],re.parent&&(re.parent.children=re.parent.children||[],re.parent.children.push(re)),de&&de(re,ne)},je),fe&&fe(ne),ne}function ue(P,$){var J=$.expandedKeys,de=$.selectedKeys,fe=$.loadedKeys,je=$.loadingKeys,Ue=$.checkedKeys,Te=$.halfCheckedKeys,ne=$.dragOverNodeKey,Se=$.dropPosition,me=$.keyEntities,G=me[P],he={eventKey:P,expanded:J.indexOf(P)!==-1,selected:de.indexOf(P)!==-1,loaded:fe.indexOf(P)!==-1,loading:je.indexOf(P)!==-1,checked:Ue.indexOf(P)!==-1,halfChecked:Te.indexOf(P)!==-1,pos:String(G?G.pos:""),dragOver:ne===P&&Se===0,dragOverGapTop:ne===P&&Se===-1,dragOverGapBottom:ne===P&&Se===1};return he}function ee(P){var $=P.data,J=P.expanded,de=P.selected,fe=P.checked,je=P.loaded,Ue=P.loading,Te=P.halfChecked,ne=P.dragOver,Se=P.dragOverGapTop,me=P.dragOverGapBottom,G=P.pos,he=P.active,ie=Object(be.a)(Object(be.a)({},$),{},{expanded:J,selected:de,checked:fe,loaded:je,loading:Ue,halfChecked:Te,dragOver:ne,dragOverGapTop:Se,dragOverGapBottom:me,pos:G,active:he});return"props"in ie||Object.defineProperty(ie,"props",{get:function(){return Object(pe.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),P}}),ie}},"8EBN":function(lt,qe,v){(function(z){z(v("VrN/"))})(function(z){"use strict";z.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 be=0;be<z.modeInfo.length;be++){var ge=z.modeInfo[be];ge.mimes&&(ge.mime=ge.mimes[0])}z.findModeByMIME=function(Me){Me=Me.toLowerCase();for(var pe=0;pe<z.modeInfo.length;pe++){var q=z.modeInfo[pe];if(q.mime==Me)return q;if(q.mimes){for(var D=0;D<q.mimes.length;D++)if(q.mimes[D]==Me)return q}}if(/\+xml$/.test(Me))return z.findModeByMIME("application/xml");if(/\+json$/.test(Me))return z.findModeByMIME("application/json")},z.findModeByExtension=function(Me){Me=Me.toLowerCase();for(var pe=0;pe<z.modeInfo.length;pe++){var q=z.modeInfo[pe];if(q.ext){for(var D=0;D<q.ext.length;D++)if(q.ext[D]==Me)return q}}},z.findModeByFileName=function(Me){for(var pe=0;pe<z.modeInfo.length;pe++){var q=z.modeInfo[pe];if(q.file&&q.file.test(Me))return q}var D=Me.lastIndexOf("."),j=D>-1&&Me.substring(D+1,Me.length);if(j)return z.findModeByExtension(j)},z.findModeByName=function(Me){Me=Me.toLowerCase();for(var pe=0;pe<z.modeInfo.length;pe++){var q=z.modeInfo[pe];if(q.name.toLowerCase()==Me)return q;if(q.alias){for(var D=0;D<q.alias.length;D++)if(q.alias[D].toLowerCase()==Me)return q}}}})},"8Jsi":function(lt,qe,v){"use strict";v.d(qe,"d",function(){return R}),v.d(qe,"a",function(){return S}),v.d(qe,"b",function(){return ce}),v.d(qe,"c",function(){return W});var z=v("1OyB"),be=v("vuIU"),ge=v("Ji7U"),Me=v("LK+K"),pe=v("KQm4"),q=v("U8pU"),D=v("ODXe"),j=v("VTBJ"),A=v("q1tI"),B=v("qNPg"),O=v("2Qr1"),I=v("815F"),ue=v("NvD2"),ee=v("wPlo"),P=v("6cGi"),$=v("Kwbf"),J=v("4IlW"),de=v("YrtM"),fe=v("fAei"),je=A.createContext(null);function Ue(xe,Ie){if(!xe)return!0;var Be=xe.data,Ke=Be.disabled,$e=Be.disableCheckbox;switch(Ie){case"select":return Ke;case"checkbox":return Ke||$e}return!1}function Te(xe,Ie){var Be=A.useCallback(function($e){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",_e=arguments.length>2?arguments[2]:void 0,nt=xe.get($e);return!_e&&Ue(nt,Ge)?null:nt},[xe]),Ke=A.useCallback(function($e){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",_e=arguments.length>2?arguments[2]:void 0,nt=Ie.get($e);return!_e&&Ue(nt,Ge)?null:nt},[Ie]);return[Be,Ke]}function ne(xe){return A.useMemo(function(){var Ie=new Map,Be=new Map;return xe.forEach(function(Ke){Ie.set(Ke.key,Ke),Be.set(Ke.data.value,Ke)}),[Ie,Be]},[xe])}var Se={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},me=function(Ie,Be){var Ke=Ie.prefixCls,$e=Ie.height,Ge=Ie.itemHeight,_e=Ie.virtual,nt=Ie.options,Qe=Ie.flattenOptions,Ae=Ie.multiple,We=Ie.searchValue,se=Ie.onSelect,Q=Ie.onToggleOpen,le=Ie.open,E=Ie.notFoundContent,M=Ie.onMouseEnter,U=A.useContext(je),X=U.checkable,ke=U.checkedKeys,De=U.halfCheckedKeys,et=U.treeExpandedKeys,yt=U.treeDefaultExpandAll,St=U.treeDefaultExpandedKeys,Je=U.onTreeExpand,bt=U.treeIcon,mt=U.showTreeIcon,rt=U.switcherIcon,Dt=U.treeLine,Ot=U.treeNodeFilterProp,kt=U.loadData,Et=U.treeLoadedKeys,xt=U.treeMotion,Pt=U.onTreeLoad,Ft=A.useRef(),ht=Object(de.a)(function(){return nt},[le,nt],function(ut,Xe){return Xe[0]&&ut[1]!==Xe[1]}),rn=ne(Qe),Ut=Object(D.a)(rn,2),Zt=Ut[0],on=Ut[1],qt=Te(Zt,on),mn=Object(D.a)(qt,2),jt=mn[0],ft=mn[1],an=A.useMemo(function(){return ke.map(function(ut){var Xe=ft(ut);return Xe?Xe.key:null})},[ke]),Ln=A.useMemo(function(){return X?{checked:an,halfChecked:De}:null},[an,De,X]);A.useEffect(function(){if(le&&!Ae&&an.length){var ut;(ut=Ft.current)===null||ut===void 0||ut.scrollTo({key:an[0]})}},[le]);var En=String(We).toLowerCase(),It=function(Xe){return En?String(Xe[Ot]).toLowerCase().includes(En):!1},Sn=A.useState(St),vn=Object(D.a)(Sn,2),ri=vn[0],tt=vn[1],_t=A.useState(null),Un=Object(D.a)(_t,2),Pn=Un[0],Yn=Un[1],Jn=A.useMemo(function(){return et?Object(pe.a)(et):We?Pn:ri},[ri,Pn,En,et]);A.useEffect(function(){We&&Yn(Qe.map(function(ut){return ut.key}))},[We]);var d=function(Xe){tt(Xe),Yn(Xe),Je&&Je(Xe)},o=function(Xe){Xe.preventDefault()},a=function(Xe,vt){var pt=vt.node.key,Rt=jt(pt,X?"checkbox":"select");Rt!==null&&se(Rt.data.value,{selected:!ke.includes(Rt.data.value)}),Ae||Q(!1)},u=A.useState(null),b=Object(D.a)(u,2),c=b[0],oe=b[1],Ye=jt(c);if(A.useImperativeHandle(Be,function(){return{onKeyDown:function(Xe){var vt,pt=Xe.which;switch(pt){case J.a.UP:case J.a.DOWN:case J.a.LEFT:case J.a.RIGHT:(vt=Ft.current)===null||vt===void 0||vt.onKeyDown(Xe);break;case J.a.ENTER:{Ye!==null&&a(null,{node:{key:c},selected:!ke.includes(Ye.data.value)});break}case J.a.ESC:Q(!1)}},onKeyUp:function(){}}}),ht.length===0)return A.createElement("div",{role:"listbox",className:"".concat(Ke,"-empty"),onMouseDown:o},E);var Le={};return Et&&(Le.loadedKeys=Et),Jn&&(Le.expandedKeys=Jn),A.createElement("div",{onMouseDown:o,onMouseEnter:M},Ye&&le&&A.createElement("span",{style:Se,"aria-live":"assertive"},Ye.data.value),A.createElement(fe.b,Object.assign({ref:Ft,focusable:!1,prefixCls:"".concat(Ke,"-tree"),treeData:ht,height:$e,itemHeight:Ge,virtual:_e,multiple:Ae,icon:bt,showIcon:mt,switcherIcon:rt,showLine:Dt,loadData:We?null:kt,motion:xt,checkable:X,checkStrictly:!0,checkedKeys:Ln,selectedKeys:X?[]:an,defaultExpandAll:yt},Le,{onActiveChange:oe,onSelect:a,onCheck:a,onExpand:d,onLoad:Pt,filterTreeNode:It})))},G=A.forwardRef(me);G.displayName="OptionList";var he=G,ie=function(){return null},R=ie,ye=v("Ff2n"),re=v("Zm9Q");function k(xe){return Object(re.a)(xe).map(function(Ie){if(!A.isValidElement(Ie)||!Ie.type)return null;var Be=Ie.key,Ke=Ie.props,$e=Ke.children,Ge=Ke.value,_e=Object(ye.a)(Ke,["children","value"]),nt=Object(j.a)({key:Be,value:Ge},_e),Qe=k($e);return Qe.length&&(nt.children=Qe),nt}).filter(function(Ie){return Ie})}function T(xe){if(!xe)return xe;var Ie=Object(j.a)({},xe);return"props"in Ie||Object.defineProperty(Ie,"props",{get:function(){return Object($.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),Ie}}),Ie}function K(xe,Ie,Be,Ke,$e){var Ge=null,_e=null;function nt(){function Qe(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ae.map(function(Q,le){var E="".concat(We,"-").concat(le),M=Be.includes(Q.value),U=Qe(Q.children||[],E,M),X=A.createElement(R,Object.assign({},Q),U.map(function(De){return De.node}));if(Ie===Q.value&&(Ge=X),M){var ke={pos:E,node:X,children:U};return se||_e.push(ke),ke}return null}).filter(function(Q){return Q})}_e||(_e=[],Qe(Ke),_e.sort(function(Ae,We){var se=Ae.node.props.value,Q=We.node.props.value,le=Be.indexOf(se),E=Be.indexOf(Q);return le-E}))}Object.defineProperty(xe,"triggerNode",{get:function(){return Object($.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),nt(),Ge}}),Object.defineProperty(xe,"allCheckedNodes",{get:function(){return Object($.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),nt(),$e?_e:_e.map(function(Ae){var We=Ae.node;return We})}})}function L(xe){return Array.isArray(xe)?xe:xe!==void 0?[xe]:[]}function V(xe,Ie){var Be=new Map;return Ie.forEach(function(Ke){var $e=Ke.data;Be.set($e.value,$e)}),xe.map(function(Ke){return T(Be.get(Ke))})}function p(xe,Ie){var Be=V([xe],Ie)[0];return Be?Be.disabled:!1}function h(xe){return xe.disabled||xe.disableCheckbox||xe.checkable===!1}function N(xe){for(var Ie=xe.parent,Be=0,Ke=Ie;Ke;)Ke=Ke.parent,Be+=1;return Be}function te(xe){function Ie(Ke){return(Ke||[]).map(function($e){var Ge=$e.value,_e=$e.key,nt=$e.children,Qe=Object(j.a)(Object(j.a)({},$e),{},{key:"key"in $e?_e:Ge});return nt&&(Qe.children=Ie(nt)),Qe})}var Be=Object(I.d)(Ie(xe),!0);return Be.map(function(Ke){return{key:Ke.data.key,data:Ke.data,level:N(Ke)}})}function ve(xe){return function(Ie,Be){var Ke=Be[xe];return String(Ke).toLowerCase().includes(String(Ie).toLowerCase())}}function Pe(xe,Ie,Be){var Ke=Be.optionFilterProp,$e=Be.filterOption;if($e===!1)return Ie;var Ge;typeof $e=="function"?Ge=$e:Ge=ve(Ke);function _e(nt){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nt.map(function(Ae){var We=Ae.children,se=Qe||Ge(xe,T(Ae)),Q=_e(We||[],se);return se||Q.length?Object(j.a)(Object(j.a)({},Ae),{},{children:Q}):null}).filter(function(Ae){return Ae})}return _e(Ie)}function Ee(xe,Ie,Be,Ke){var $e=new Map;return L(Ie).forEach(function(Ge){Ge&&Object(q.a)(Ge)==="object"&&"value"in Ge&&$e.set(Ge.value,Ge)}),xe.map(function(Ge){var _e={value:Ge},nt=Be(Ge,"select",!0),Qe=nt?Ke(nt.data):Ge;if($e.has(Ge)){var Ae=$e.get(Ge);_e.label="label"in Ae?Ae.label:Qe,"halfChecked"in Ae&&(_e.halfChecked=Ae.halfChecked)}else _e.label=Qe;return _e})}function we(xe,Ie){var Be=new Set(xe);return Be.add(Ie),Array.from(Be)}function H(xe,Ie){var Be=new Set(xe);return Be.delete(Ie),Array.from(Be)}function x(xe){var Ie=xe.searchPlaceholder,Be=xe.treeCheckStrictly,Ke=xe.treeCheckable,$e=xe.labelInValue,Ge=xe.value,_e=xe.multiple;Object($.a)(!Ie,"`searchPlaceholder` has been removed."),Be&&$e===!1&&Object($.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),($e||Be)&&Object($.a)(L(Ge).every(function(nt){return nt&&Object(q.a)(nt)==="object"&&"value"in nt}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),Be||_e||Ke?Object($.a)(!Ge||Array.isArray(Ge),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object($.a)(!Array.isArray(Ge),"`value` should not be array when `TreeSelect` is single mode.")}var F=x,w=10;function _(xe,Ie){var Be=Ie.id,Ke=Ie.pId,$e=Ie.rootPId,Ge={},_e=[],nt=xe.map(function(Qe){var Ae=Object(j.a)({},Qe),We=Ae[Be];return Ge[We]=Ae,Ae.key=Ae.key||We,Ae});return nt.forEach(function(Qe){var Ae=Qe[Ke],We=Ge[Ae];We&&(We.children=We.children||[],We.children.push(Qe)),(Ae===$e||!We&&$e===null)&&_e.push(Qe)}),_e}function g(xe,Ie){var Be=0,Ke=new Set;function $e(Ge){return(Ge||[]).map(function(_e){var nt=_e.key,Qe=_e.value,Ae=_e.children,We=Object(ye.a)(_e,["key","value","children"]),se="value"in _e?Qe:nt,Q=Object(j.a)(Object(j.a)({},We),{},{key:nt!=null?nt:se,value:se,title:Ie(_e)});return"children"in _e&&(Q.children=$e(Ae)),Q})}return $e(xe)}function y(xe,Ie,Be){var Ke=Be.getLabelProp,$e=Be.simpleMode,Ge=A.useRef({});return xe?(Ge.current.formatTreeData=Ge.current.treeData===xe?Ge.current.formatTreeData:g($e?_(xe,Object(j.a)({id:"id",pId:"pId",rootPId:null},$e!==!0?$e:{})):xe,Ke),Ge.current.treeData=xe):Ge.current.formatTreeData=Ge.current.children===Ie?Ge.current.formatTreeData:g(k(Ie),Ke),Ge.current.formatTreeData}var S="SHOW_ALL",W="SHOW_PARENT",ce="SHOW_CHILD";function Y(xe,Ie,Be){var Ke=new Set(xe);return Ie===ce?xe.filter(function($e){var Ge=Be[$e];return!(Ge&&Ge.children&&Ge.children.every(function(_e){var nt=_e.node;return h(nt)||Ke.has(nt.key)}))}):Ie===W?xe.filter(function($e){var Ge=Be[$e],_e=Ge?Ge.parent:null;return!(_e&&!h(_e.node)&&Ke.has(_e.node.key))}):xe}function Ce(xe,Ie){var Be=Ie.value,Ke=Ie.getEntityByValue,$e=Ie.getEntityByKey,Ge=Ie.treeConduction,_e=Ie.showCheckedStrategy,nt=Ie.conductKeyEntities,Qe=Ie.getLabelProp;return A.useMemo(function(){var Ae=xe;if(Ge){var We=Y(xe.map(function(se){var Q=Ke(se);return Q?Q.key:se}),_e,nt);Ae=We.map(function(se){var Q=$e(se);return Q?Q.data.value:se})}return Ee(Ae,Be,Ke,Qe)},[xe,Be,Ge,_e,Ke])}var Re=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Fe=Object(B.a)({prefixCls:"rc-tree-select",components:{optionList:he},convertChildrenToData:function(){return null},flattenOptions:te,getLabeledValue:O.e,filterOptions:Pe,isValueDisabled:p,findValueOption:V,omitDOMProps:function(Ie){var Be=Object(j.a)({},Ie);return Re.forEach(function(Ke){delete Be[Ke]}),Be}});Fe.displayName="Select";var Ve=A.forwardRef(function(xe,Ie){var Be=xe.multiple,Ke=xe.treeCheckable,$e=xe.treeCheckStrictly,Ge=xe.showCheckedStrategy,_e=Ge===void 0?"SHOW_CHILD":Ge,nt=xe.labelInValue,Qe=xe.loadData,Ae=xe.treeLoadedKeys,We=xe.treeNodeFilterProp,se=We===void 0?"value":We,Q=xe.treeNodeLabelProp,le=xe.treeDataSimpleMode,E=xe.treeData,M=xe.treeExpandedKeys,U=xe.treeDefaultExpandedKeys,X=xe.treeDefaultExpandAll,ke=xe.children,De=xe.treeIcon,et=xe.showTreeIcon,yt=xe.switcherIcon,St=xe.treeLine,Je=xe.treeMotion,bt=xe.filterTreeNode,mt=xe.dropdownPopupAlign,rt=xe.onChange,Dt=xe.onTreeExpand,Ot=xe.onTreeLoad,kt=xe.onDropdownVisibleChange,Et=xe.onSelect,xt=xe.onDeselect,Pt=Ke||$e,Ft=Be||Pt,ht=Ke&&!$e,rn=$e||nt,Ut=A.useRef(null);A.useImperativeHandle(Ie,function(){return{focus:Ut.current.focus,blur:Ut.current.blur}});var Zt=function(pt){return E&&pt.label||pt.title},on=function(pt){return Q?pt[Q]:Zt(pt)},qt=y(E,ke,{getLabelProp:Zt,simpleMode:le}),mn=Object(A.useMemo)(function(){return te(qt)},[qt]),jt=ne(mn),ft=Object(D.a)(jt,2),an=ft[0],Ln=ft[1],En=Te(an,Ln),It=Object(D.a)(En,2),Sn=It[0],vn=It[1],ri=Object(A.useMemo)(function(){return ht?Object(I.a)(qt):{keyEntities:null}},[qt,Ke,$e]),tt=ri.keyEntities,_t=Object(P.a)(xe.defaultValue,{value:xe.value}),Un=Object(D.a)(_t,2),Pn=Un[0],Yn=Un[1],Jn=function(pt){var Rt=[],dn=[];return pt.forEach(function(en){vn(en)?dn.push(en):Rt.push(en)}),{missingRawValues:Rt,existRawValues:dn}},d=Object(A.useMemo)(function(){var vt=[],pt=[];if(L(Pn).forEach(function(Vt){if(Vt&&Object(q.a)(Vt)==="object"&&"value"in Vt)if(Vt.halfChecked&&$e){var kn=vn(Vt.value);vt.push(kn?kn.key:Vt.value)}else pt.push(Vt.value);else pt.push(Vt)}),ht){var Rt=Jn(pt),dn=Rt.missingRawValues,en=Rt.existRawValues,Jt=en.map(function(Vt){return vn(Vt).key}),Cn=Object(ue.a)(Jt,!0,tt),Gn=Cn.checkedKeys,bn=Cn.halfCheckedKeys;return[[].concat(Object(pe.a)(dn),Object(pe.a)(Gn.map(function(Vt){return Sn(Vt).data.value}))),bn]}return[pt,vt]},[Pn,Ft,rn,Ke,$e]),o=Object(D.a)(d,2),a=o[0],u=o[1],b=Ce(a,{treeConduction:ht,value:Pn,showCheckedStrategy:_e,conductKeyEntities:tt,getEntityByValue:vn,getEntityByKey:Sn,getLabelProp:on}),c=function(pt,Rt,dn){if(Yn(Ft?pt:pt[0]),rt){var en=pt;if(ht&&_e!=="SHOW_ALL"){var Jt=pt.map(function(hn){var Bn=vn(hn);return Bn?Bn.key:hn}),Cn=Y(Jt,_e,tt);en=Cn.map(function(hn){var Bn=Sn(hn);return Bn?Bn.data.value:hn})}var Gn=Rt||{triggerValue:void 0,selected:void 0},bn=Gn.triggerValue,Vt=Gn.selected,kn=rn?Ee(en,Pn,vn,on):en;if($e){var Zn=u.map(function(hn){var Bn=Sn(hn);return Bn?Bn.data.value:hn}).filter(function(hn){return!en.includes(hn)});kn=[].concat(Object(pe.a)(kn),Object(pe.a)(Ee(Zn,Pn,vn,on)))}var yn={preValue:b,triggerValue:bn},oi=!0;($e||dn==="selection"&&!Vt)&&(oi=!1),K(yn,bn,pt,qt,oi),Pt?yn.checked=Vt:yn.selected=Vt,rt(Ft?kn:kn[0],rn?null:en.map(function(hn){var Bn=vn(hn);return Bn?on(Bn.data):null}),yn)}},oe=function(pt,Rt,dn){var en=pt;if(!Ft)c([pt],{selected:!0,triggerValue:pt},dn);else{var Jt=we(a,pt);if(ht){var Cn=Jn(Jt),Gn=Cn.missingRawValues,bn=Cn.existRawValues,Vt=bn.map(function(yn){return vn(yn).key}),kn=Object(ue.a)(Vt,!0,tt),Zn=kn.checkedKeys;Jt=[].concat(Object(pe.a)(Gn),Object(pe.a)(Zn.map(function(yn){return Sn(yn).data.value})))}c(Jt,{selected:!0,triggerValue:pt},dn)}Et&&Et(en,Rt)},Ye=function(pt,Rt,dn){var en=pt,Jt=H(a,pt);if(ht){var Cn=Jn(Jt),Gn=Cn.missingRawValues,bn=Cn.existRawValues,Vt=bn.map(function(yn){return vn(yn).key}),kn=Object(ue.a)(Vt,{checked:!1,halfCheckedKeys:u},tt),Zn=kn.checkedKeys;Jt=[].concat(Object(pe.a)(Gn),Object(pe.a)(Zn.map(function(yn){return Sn(yn).data.value})))}c(Jt,{selected:!1,triggerValue:pt},dn),xt&&xt(en,Rt)},Le=function(){c([],null,"clear")},ut=A.useCallback(function(vt){if(kt){var pt={};Object.defineProperty(pt,"documentClickClose",{get:function(){return Object($.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),kt(vt,pt)}},[kt]),Xe={optionLabelProp:null,optionFilterProp:se,dropdownAlign:mt,internalProps:{mark:ee.a,onClear:Le,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:oe,onRawDeselect:Ye}};return"filterTreeNode"in xe&&(Xe.filterOption=bt),A.createElement(je.Provider,{value:{checkable:Pt,loadData:Qe,treeLoadedKeys:Ae,onTreeLoad:Ot,checkedKeys:a,halfCheckedKeys:u,treeDefaultExpandAll:X,treeExpandedKeys:M,treeDefaultExpandedKeys:U,onTreeExpand:Dt,treeIcon:De,treeMotion:Je,showTreeIcon:et,switcherIcon:yt,treeLine:St,treeNodeFilterProp:se}},A.createElement(Fe,Object.assign({ref:Ut,mode:Ft?"multiple":null},xe,Xe,{value:b,labelInValue:!0,options:qt,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:ut})))}),He=function(xe){Object(ge.a)(Be,xe);var Ie=Object(Me.a)(Be);function Be(){var Ke;return Object(z.a)(this,Be),Ke=Ie.apply(this,arguments),Ke.selectRef=A.createRef(),Ke.focus=function(){Ke.selectRef.current.focus()},Ke.blur=function(){Ke.selectRef.current.blur()},Ke}return Object(be.a)(Be,[{key:"render",value:function(){return A.createElement(Ve,Object.assign({ref:this.selectRef},this.props))}}]),Be}(A.Component);He.TreeNode=R,He.SHOW_ALL=S,He.SHOW_PARENT=W,He.SHOW_CHILD=ce;var ze=He,at=qe.e=ze},"8hTe":function(lt,qe,v){lt.exports={button:"button___1wy9m"}},"8pgt":function(lt,qe,v){lt.exports={flexRow:"flexRow___2kcn2",flexColumn:"flexColumn___2bS_0",formWrap:"formWrap___3t-wi",example:"example___2J2YZ",footerWrap:"footerWrap___3u6gg"}},"9Bee":function(lt,qe,v){"use strict";var z=v("DYRE"),be=v("zeV3"),ge=v("+L6B"),Me=v("2/Rp"),pe=v("k1fw"),q=v("9og8"),D=v("tJVT"),j=v("WmNS"),A=v.n(j),B=v("q1tI"),O=v.n(B),I=v("vg9a"),ue=v("DlQD"),ee=v.n(ue),P=v("rUJ1");function $(d,o){var a=d.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(b){var c=b.match(/^\s+/);if(c===null)return b;var oe=Object(D.a)(c,1),Ye=oe[0];return Ye.length>=u.length?b.slice(u.length):b}).join(`
|
|
`)}var J=[],de=["<ul>"],fe=new ee.a.Renderer,je=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ue(){J.length=0,de=["<ul>"]}var Te={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ne(d,o,a,u){if(o>=d.length||d[o].level<=a)return o;var b=d[o];u.push("<li><a href='#"+b.anchor+"'>"+b.text+"</a>"),o++;var c=[];return o=ne(d,o,b.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(oe){u.push(oe)}),u.push("</ul>")),u.push("</li>"),o=ne(d,o,a,u),o}function Se(){return ne(J,0,0,de),de.push("</ul>"),de.join("")}var me={heading:function(o){var a=je.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],b=$(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var oe=ie(),Ye=b;b=oe,R[oe]={type:"block",expression:Ye}}return{type:"code",raw:u,lang:c,text:b}}}},G=/(?:\${2})([^\n`]+?)(?:\${2})/gi,he=0,ie=function(){return"__special_katext_id_".concat(he++,"__")},R={};function ye(){return R}function re(){he=0,R={}}function k(d){return d=d.replace(G,function(o,a){var u=ie();return R[u]={type:"inline",expression:a},u}),d}var T=fe.listitem;fe.listitem=function(d){return T(k(d))};var K=fe.paragraph;fe.paragraph=function(d){return K(k(d))};var L=fe.tablecell;fe.tablecell=function(d,o){return L(k(d),o)},fe.code=function(d,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(d,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?d:Object(P.escape)(d,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?d:Object(P.escape)(d,!0))+"</code></pre>"},fe.heading=function(d,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return J.push({anchor:u,level:o,text:d}),"<h"+o+' id="'+u+'">'+d+"</h"+o+">"},ee.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),ee.a.use({tokenizer:me,renderer:fe});var V=ee.a,p=v("SJMd"),h=v("ulZh"),N=v.n(h),te=v("m3rI"),ve=v("Oy/b"),Pe=v("p5ED"),Ee=v("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 we=function(d,o){return(we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(a[b]=u[b])})(d,o)};function H(d,o){function a(){this.constructor=d}we(d,o),d.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function x(d,o,a,u){return new(a||(a=Promise))(function(b,c){function oe(ut){try{Le(u.next(ut))}catch(Xe){c(Xe)}}function Ye(ut){try{Le(u.throw(ut))}catch(Xe){c(Xe)}}function Le(ut){var Xe;ut.done?b(ut.value):(Xe=ut.value,Xe instanceof a?Xe:new a(function(vt){vt(Xe)})).then(oe,Ye)}Le((u=u.apply(d,o||[])).next())})}function F(d,o){var a,u,b,c,oe={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return c={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ye(Le){return function(ut){return function(Xe){if(a)throw new TypeError("Generator is already executing.");for(;oe;)try{if(a=1,u&&(b=2&Xe[0]?u.return:Xe[0]?u.throw||((b=u.return)&&b.call(u),0):u.next)&&!(b=b.call(u,Xe[1])).done)return b;switch(u=0,b&&(Xe=[2&Xe[0],b.value]),Xe[0]){case 0:case 1:b=Xe;break;case 4:return oe.label++,{value:Xe[1],done:!1};case 5:oe.label++,u=Xe[1],Xe=[0];continue;case 7:Xe=oe.ops.pop(),oe.trys.pop();continue;default:if(!(b=oe.trys,(b=b.length>0&&b[b.length-1])||Xe[0]!==6&&Xe[0]!==2)){oe=0;continue}if(Xe[0]===3&&(!b||Xe[1]>b[0]&&Xe[1]<b[3])){oe.label=Xe[1];break}if(Xe[0]===6&&oe.label<b[1]){oe.label=b[1],b=Xe;break}if(b&&oe.label<b[2]){oe.label=b[2],oe.ops.push(Xe);break}b[2]&&oe.ops.pop(),oe.trys.pop();continue}Xe=o.call(d,oe)}catch(vt){Xe=[6,vt],u=0}finally{a=b=0}if(5&Xe[0])throw Xe[1];return{value:Xe[0]?Xe[1]:void 0,done:!0}}([Le,ut])}}}function w(){for(var d=0,o=0,a=arguments.length;o<a;o++)d+=arguments[o].length;var u=Array(d),b=0;for(o=0;o<a;o++)for(var c=arguments[o],oe=0,Ye=c.length;oe<Ye;oe++,b++)u[b]=c[oe];return u}var _=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(o,a){for(var u=0,b=a;u<b.length;u++){var c=b[u],oe=c[0],Ye=c[1];o.setAttribute(oe,Ye)}},d.createRect=function(o,a,u){var b=document.createElementNS("http://www.w3.org/2000/svg","rect");return b.setAttribute("width",o.toString()),b.setAttribute("height",a.toString()),u&&d.setAttributes(b,u),b},d.createLine=function(o,a,u,b,c){var oe=document.createElementNS("http://www.w3.org/2000/svg","line");return oe.setAttribute("x1",o.toString()),oe.setAttribute("y1",a.toString()),oe.setAttribute("x2",u.toString()),oe.setAttribute("y2",b.toString()),c&&d.setAttributes(oe,c),oe},d.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&d.setAttributes(u,a),u},d.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&&d.setAttributes(u,a),u},d.createEllipse=function(o,a,u){var b=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return b.setAttribute("cx",(o/2).toString()),b.setAttribute("cy",(a/2).toString()),b.setAttribute("rx",(o/2).toString()),b.setAttribute("ry",(a/2).toString()),u&&d.setAttributes(b,u),b},d.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&d.setAttributes(a,o),a},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(o,a,u,b,c,oe,Ye){var Le=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(Le,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",b.toString()],["refX",c.toString()],["refY",oe.toString()]]),Le.appendChild(Ye),Le},d.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&d.setAttributes(a,o),a},d.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&d.setAttributes(u,a),u},d.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&d.setAttributes(a,o),a},d.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},d.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&d.setAttributes(u,a),u},d}(),g=function(){function d(){}return d.addKey=function(o){d.key=o},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),y=function(){function d(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return d.prototype.rasterize=function(o,a,u){var b=this;return new Promise(function(c){var oe=u!==void 0?u:document.createElement("canvas");o===null&&(b.markersOnly=!0,b.naturalSize=!1);var Ye=document.createElementNS("http://www.w3.org/2000/svg","svg");Ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ye.setAttribute("width",a.width.baseVal.valueAsString),Ye.setAttribute("height",a.height.baseVal.valueAsString),Ye.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ye.innerHTML=a.innerHTML,b.naturalSize===!0?(Ye.width.baseVal.value=o.naturalWidth,Ye.height.baseVal.value=o.naturalHeight):b.width!==void 0&&b.height!==void 0&&(Ye.width.baseVal.value=b.width,Ye.height.baseVal.value=b.height),oe.width=Ye.width.baseVal.value,oe.height=Ye.height.baseVal.value;var Le=Ye.outerHTML,ut=oe.getContext("2d");b.markersOnly!==!0&&ut.drawImage(o,0,0,oe.width,oe.height);var Xe=window.URL,vt=new Image(oe.width,oe.height);vt.setAttribute("crossOrigin","anonymous");var pt=new Blob([Le],{type:"image/svg+xml"}),Rt=Xe.createObjectURL(pt);vt.onload=function(){ut.drawImage(vt,0,0),Xe.revokeObjectURL(Rt);var dn=oe.toDataURL(b.imageType,b.imageQuality);c(dn)},vt.src=Rt})},d}(),S=function(){},W=function(){function d(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),d.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},d.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)},d.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 ce("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ce("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ce("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Y("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Y("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},d.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),ce=function(d,o){this.selector=d,this.style=o},Y=function(d,o){this.localName=d,this.style=o},Ce=function(){function d(o,a,u,b,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=b,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return d.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(c){var oe=document.createElement("div");oe.className=""+a.toolbarButtonStyleClass.name,oe.setAttribute("data-type-name",c.typeName),oe.innerHTML=c.icon,oe.addEventListener("click",function(){a.markerToolbarButtonClicked(oe,c)}),a.buttons.push(oe),a.markerButtons.push(oe)}),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 b=document.createElement("div");b.className=this.toolbarBlockStyleClass.name,b.style.whiteSpace="nowrap",b.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(b),this.addActionButton(b,'<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(b,'<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()},d.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},d.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},d.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},d.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]))}},d.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")},d.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)})},d.prototype.addActionButton=function(o,a,u){var b=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){b.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Y("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 Y("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Y("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Y("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 Y("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Y("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 Y("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ce("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ce("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},d.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"},d.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])},d.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)},d.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},d.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")})},d}(),Re=function(){function d(o,a,u,b){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=b,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return d.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Y("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 Y("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Y("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Y("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Y("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 Y("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Y("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 Y("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new ce("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ce("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},d.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)},d.prototype.setPanelButtons=function(o){var a,u,b=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(c){var oe;c.uiStyleSettings=b.uiStyleSettings;var Ye=document.createElement("div");Ye.className=b.toolboxButtonStyleClass.name+" "+((oe=b.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&oe!==void 0?oe:b.toolboxButtonStyleColorsClass.name),Ye.innerHTML=c.icon,Ye.title=c.title,Ye.addEventListener("click",function(){b.panelButtonClick(c)}),b.panelButtons.push(Ye),b.buttonRow.appendChild(Ye)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},d.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var b=o.getUi();b.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(b),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(c,oe){var Ye,Le;c.className=a.toolboxButtonStyleClass.name+" "+(oe===u?""+((Ye=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:a.toolboxActiveButtonStyleColorsClass.name):""+((Le=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Le!==void 0?Le:a.toolboxButtonStyleColorsClass.name))})},d}(),Fe=function(d,o){this.title=d,this.icon=o},Ve=function(d){function o(a,u,b,c){var oe=d.call(this,a,c||'<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 oe.colors=[],oe.addTransparent=!1,oe.colorBoxes=[],oe.colors=u,oe.currentColor=b,oe.setCurrentColor=oe.setCurrentColor.bind(oe),oe.getColorBox=oe.getColorBox.bind(oe),oe}return H(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(b){var c=a.getColorBox(b);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,b=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-b,oe=document.createElement("div");oe.style.display="inline-block",oe.style.boxSizing="content-box",oe.style.width=c-2+"px",oe.style.height=c-2+"px",oe.style.padding="1px",oe.style.marginRight="2px",oe.style.marginBottom="2px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderRadius=(c+2)/2+"px",oe.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){u.setCurrentColor(a,oe)});var Ye=document.createElement("div");return Ye.style.display="inline-block",Ye.style.width=c-2+"px",Ye.style.height=c-2+"px",Ye.style.backgroundColor=a,Ye.style.borderRadius=c/2+"px",a==="transparent"&&(Ye.style.fill=this.uiStyleSettings.toolboxAccentColor,Ye.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>`),oe.appendChild(Ye),oe},o.prototype.setCurrentColor=function(a,u){var b=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?b.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Fe),He=function(){function d(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(d.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(o){return!1},Object.defineProperty(d.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),d.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},d.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},d.prototype.pointerDown=function(o,a){},d.prototype.dblClick=function(o,a){},d.prototype.manipulate=function(o){},d.prototype.pointerUp=function(o){this.stateChanged()},d.prototype.dispose=function(){},d.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},d.prototype.getState=function(){return{typeName:d.typeName,state:this.state,notes:this.notes}},d.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},d.prototype.scale=function(o,a){},d.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},d.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},d.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)}},d.typeName="MarkerBase",d}(),ze=function(){function d(){this.findGripByVisual=this.findGripByVisual.bind(this)}return d.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},d}(),at=function(){function d(){this.GRIP_SIZE=10,this.visual=_.createGroup(),this.visual.appendChild(_.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d}(),xe=function(){function d(){}return d.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},d.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},d}(),Ie=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(_.createTransform()),c.setupControlBox(),c}return H(o,d),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=_.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!d.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){d.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 b=this.unrotatePoint(a);if(this.manipulationStartX=b.x,this.manipulationStartY=b.y,this.offsetX=b.x-this.left,this.offsetY=b.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 c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var oe=this.container.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(oe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;d.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,b=this.manipulationStartWidth,c=this.manipulationStartTop,oe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,b=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:b=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,oe=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:oe=this.manipulationStartHeight+a.y-this.manipulationStartY}b>=0?(this.left=u,this.width=b):(this.left=u+b,this.width=-b),oe>=0?(this.top=c,this.height=oe):(this.top=c+oe,this.height=-oe),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(),b=_.createPoint(a.x,a.y);return{x:(b=b.matrixTransform(u)).x,y:b.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var b=_.createPoint(a.x,a.y);return{x:(b=b.matrixTransform(u)).x,y:b.y}},o.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=_.createGroup();var a=_.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=_.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=_.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 ze,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 at;return a.visual.transform.baseVal.appendItem(_.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,b=u,c=(this.width+this.CB_DISTANCE)/2-a/2,oe=(this.height+this.CB_DISTANCE)/2-a/2,Ye=this.height+this.CB_DISTANCE-a/2,Le=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,b),this.positionGrip(this.controlGrips.topCenter.visual,c,b),this.positionGrip(this.controlGrips.topRight.visual,Le,b),this.positionGrip(this.controlGrips.centerLeft.visual,u,oe),this.positionGrip(this.controlGrips.centerRight.visual,Le,oe),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ye),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ye),this.positionGrip(this.controlGrips.bottomRight.visual,Le,Ye),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,b-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,b){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,b),a.transform.baseVal.replaceItem(c,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:xe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:xe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){d.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(xe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(xe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u);var b=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:b.x*a,y:b.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(He),Be=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return H(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=_.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){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){d.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&_.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&_.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&_.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&_.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},d.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(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(Ie),Ke=function(d){function o(a,u,b,c){var oe=d.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return oe.widths=[],oe.widthBoxes=[],oe.widths=u,oe.currentWidth=b,oe.setCurrentWidth=oe.setCurrentWidth.bind(oe),oe}return H(o,d),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(b){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=b===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(b,c)}),u.appendChild(c);var oe=document.createElement("div");oe.innerText=b.toString(),oe.style.marginRight="5px",c.appendChild(oe);var Ye=document.createElement("div");Ye.style.minHeight="20px",Ye.style.flexGrow="2",Ye.style.display="flex",Ye.style.alignItems="center";var Le=document.createElement("hr");Le.style.minWidth="20px",Le.style.border="0px",Le.style.borderTop=b+"px solid "+a.uiStyleSettings.toolboxColor,Le.style.flexGrow="2",Ye.appendChild(Le),c.appendChild(Ye),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var b=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?b.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Fe),$e=function(d){function o(a,u,b,c){var oe=d.call(this,a,c||'<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 oe.styles=[],oe.styleBoxes=[],oe.styles=u,oe.currentStyle=b,oe.setCurrentStyle=oe.setCurrentStyle.bind(oe),oe}return H(o,d),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(b){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=b===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(b,c)}),u.appendChild(c);var oe=document.createElement("div");oe.style.minHeight="20px",oe.style.flexGrow="2",oe.style.overflow="hidden";var Ye=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(b!==""?'stroke-dasharray="'+b+'"':"")+` />
|
|
</svg>`;oe.innerHTML=Ye,c.appendChild(oe),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var b=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?b.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Fe),Ge=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.strokeColor=b.defaultColor,c.strokeWidth=b.defaultStrokeWidth,c.strokeDasharray=b.defaultStrokeDasharray,c.strokePanel=new Ve("Line color",b.defaultColorSet,b.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ke("Line width",b.defaultStrokeWidths,b.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new $e("Line style",b.defaultStrokeDasharrays,b.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return H(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.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}(Be),_e=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},nt=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return H(o,d),o.prototype.ownsTarget=function(a){return!!d.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){d.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;d.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(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=_.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 at;return a.visual.transform.baseVal.appendItem(_.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,b){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,b),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){d.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){d.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}(He),Qe=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=b.defaultColor,c.strokeWidth=b.defaultStrokeWidth,c.strokeDasharray=b.defaultStrokeDasharray,c.strokePanel=new Ve("Line color",b.defaultColorSet,b.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ke("Line width",b.defaultStrokeWidths,b.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new $e("Line style",b.defaultStrokeDasharrays,b.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return H(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.selectorLine=_.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_.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){d.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()),_.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_.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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(nt),Ae=function(d){function o(a,u,b,c){var oe=d.call(this,a,c||'<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 oe.fonts=[],oe.fontBoxes=[],oe.fonts=u,oe.currentFont=b,oe.setCurrentFont=oe.setCurrentFont.bind(oe),oe}return H(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(b){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=b===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(b,c)}),u.appendChild(c);var oe=document.createElement("div");oe.style.display="flex",oe.style.minHeight="20px",oe.style.flexGrow="2",oe.style.fontFamily=b,oe.style.overflow="hidden";var Ye=document.createElement("div");Ye.style.whiteSpace="nowrap",Ye.style.overflow="hidden",Ye.style.textOverflow="ellipsis",Ye.innerHTML="The quick brown fox jumps over the lazy dog",oe.appendChild(Ye),c.appendChild(oe),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var b=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?b.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Fe),We=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=b.defaultColor,c.fontFamily=b.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new Ve("Color",b.defaultColorSet,b.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new Ae("Font",b.defaultFontFamilies,b.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return H(o,d),o.prototype.ownsTarget=function(a){if(d.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(b){b===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.bgRectangle=_.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_.createTransform()),this.textElement.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){d.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(_.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 b=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(b,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),b=0,c=0;return u.width>0&&u.height>0&&(b=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:b,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),b=this.getTextPosition(u);b.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+b.x+"px, "+b.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(b.x,b.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){d.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){d.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){d.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_.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),d.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 b=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(b)),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}),b=this.textElement.getBBox(),c={x:b.width*a,y:b.height*a};u.x-=c.x/2,u.y-=c.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(){d.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),d.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){d.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&_.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&&_.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},d.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(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.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}(Ie),se=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=b.defaultColor,c.lineWidth=b.defaultStrokeWidth,c.pixelRatio=b.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new Ve("Color",b.defaultColorSet,b.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Ke("Line width",b.defaultStrokeWidths,b.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return H(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.drawingImage=_.createImage(),this.visual.appendChild(this.drawingImage);var a=_.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):d.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()):d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_.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()):d.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(),d.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),d.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],b=u[0],c=u[1],oe=u[2],Ye=u[3],Le=!1,ut=0;ut<this.canvasElement.height;ut++)for(var Xe=0;Xe<this.canvasElement.width;Xe++)a.data[ut*this.canvasElement.width*4+4*Xe+3]>0&&(Le=!0,ut<c&&(c=ut),Xe<b&&(b=Xe),ut>Ye&&(Ye=ut),Xe>oe&&(oe=Xe));if(Le){this.left=b/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(oe-b)/this.pixelRatio,this.height=(Ye-c)/this.pixelRatio;var vt=document.createElement("canvas");vt.width=oe-b,vt.height=Ye-c,vt.getContext("2d").putImageData(this.canvasContext.getImageData(b,c,oe-b,Ye-c),0,0),this.drawingImgUrl=vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){_.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_.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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),d.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){d.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}(Ie),Q=function(d){function o(a,u,b){var c=d.call(this,a,b||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return H(o,d),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 b=function(Ye){var Le="both";switch(Ye){case 0:Le="both";break;case 1:Le="start";break;case 2:Le="end";break;case 3:Le="none"}var ut=document.createElement("div");if(ut.style.display="flex",ut.style.flexGrow="2",ut.style.alignItems="center",ut.style.justifyContent="space-between",ut.style.padding="5px",ut.style.borderWidth="2px",ut.style.borderStyle="solid",ut.style.borderColor=Le===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",ut.addEventListener("click",function(){a.setCurrentType(Le,ut)}),u.appendChild(ut),Le==="both"||Le==="start"){var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.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="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Xe.style.marginLeft="5px",ut.appendChild(Xe)}var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.style.flexGrow="2";var pt=document.createElement("hr");if(pt.style.minWidth="20px",pt.style.border="0px",pt.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),pt.style.flexGrow="2",vt.appendChild(pt),ut.appendChild(vt),Le==="both"||Le==="end"){var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.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="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Rt.style.marginRight="5px",ut.appendChild(Rt)}c.typeBoxes.push(ut)},c=this,oe=0;oe<4;oe++)b(oe);return u},o.prototype.setCurrentType=function(a,u){var b=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?b.uiStyleSettings!==void 0?b.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Fe),le=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new Q("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return H(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var b=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-b/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+b/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=_.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.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",_.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_.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 b=this.arrow2.transform.baseVal.getItem(0);b.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(b,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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(Qe),E=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.fillColor=b.defaultFillColor,c.strokeWidth=0,c.fillPanel=new Ve("Color",b.defaultColorSet,b.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return H(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.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}(Be),M=function(d){function o(a,u,b,c){var oe=d.call(this,a,c||'<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 oe.opacities=[],oe.opacityBoxes=[],oe.opacities=u,oe.currentOpacity=b,oe.setCurrentOpacity=oe.setCurrentOpacity.bind(oe),oe}return H(o,d),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(b){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=b===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(b,c)}),u.appendChild(c);var oe=document.createElement("div");oe.innerText=100*b+"%",c.appendChild(oe),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var b=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?b.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Fe),U=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=b.defaultHighlightColor,c.strokeWidth=0,c.opacity=b.defaultHighlightOpacity,c.fillPanel=new Ve("Color",b.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new M("Opacity",b.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return H(o,d),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&_.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=d.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}(E),X='<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>',ke=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=b.defaultStrokeColor,c.bgColor=b.defaultFillColor,c.fontFamily=b.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new Ve("Text color",b.defaultColorSet,c.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>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new Ve("Fill color",b.defaultColorSet,c.bgColor,X),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new Ae("Font",b.defaultFontFamilies,b.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new at,c.tipGrip.visual.transform.baseVal.appendItem(_.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return H(o,d),o.prototype.ownsTarget=function(a){return d.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){_.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&d.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):d.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,d.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";d.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 d.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(_.setAttributes(this.bgRectangle,[["fill",a]]),_.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),b=this.height/5;a&&(this.tipPosition={x:u+b/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(b=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+b,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+b}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(b=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-b,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+b}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(b=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-b,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-b},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(b=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+b,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-b})},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){_.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(),d.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},d.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,d.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){d.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}(We),De=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=b.defaultColor,c.strokeWidth=b.defaultStrokeWidth,c.strokeDasharray=b.defaultStrokeDasharray,c.fillColor=b.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new Ve("Line color",w(b.defaultColorSet,["transparent"]),b.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new Ve("Fill color",w(b.defaultColorSet,["transparent"]),c.fillColor,X),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Ke("Line width",b.defaultStrokeWidths,b.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new $e("Line style",b.defaultStrokeDasharrays,b.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new M("Opacity",b.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return H(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=_.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){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),_.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){d.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&_.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&_.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&_.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&_.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&_.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},d.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(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.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}(Ie),et=function(d){function o(a,u,b){return d.call(this,a,u,b)||this}return H(o,d),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=_.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(_.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_.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(_.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(_.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()]]),_.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 b=this.tip2.transform.baseVal.getItem(0);b.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(b,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=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(Qe),yt=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.strokePanel.colors=b.defaultColorSet,c.fillColor="transparent",c}return H(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.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}(De),St=function(){function d(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),d.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))},d.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},d.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},d.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}},d.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},d}(),Je=function(d){function o(a,u,b){var c=d.call(this,a,u,b)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=b.defaultColor,c.strokeWidth=b.defaultStrokeWidth,c.strokeDasharray=b.defaultStrokeDasharray,c.strokePanel=new Ve("Line color",b.defaultColorSet,b.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ke("Line width",b.defaultStrokeWidths,b.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new $e("Line style",b.defaultStrokeDasharrays,b.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return H(o,d),o.prototype.ownsTarget=function(a){return!(!d.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=_.createGroup(),this.selectorCurve=_.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_.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){d.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()),_.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){d.prototype.setupControlBox.call(this),this.curveControlLine1=_.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_.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,d.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){d.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),d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),d.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,d.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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(nt),bt=function(){function d(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(d.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),d.prototype.preventDefault=function(){this._defaultPrevented=!0},d}(),mt=function(d){function o(a,u,b){var c=d.call(this,a,!1)||this;return c.dataUrl=u,c.state=b,c}return H(o,d),o}(bt),rt=function(d){function o(a,u,b){b===void 0&&(b=!1);var c=d.call(this,a,b)||this;return c.marker=u,c}return H(o,d),o}(bt),Dt=function(){function d(){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 d.prototype.addEventListener=function(o,a){this[o].push(a)},d.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},d}(),Ot=function(){function d(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 _e,this._isOpen=!1,this.undoRedoManager=new St,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 Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=d.instanceCounter++,this.styles=new W(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(d.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ge,se,le,We,yt,De,U,ke,et,E,Qe,Je]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ge,se,le,We,De,U,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ge,se,le,We,U]},enumerable:!1,configurable:!0}),Object.defineProperty(d.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 b=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});b!==void 0&&a._availableMarkerTypes.push(b)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),g.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},d.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&S.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=S.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new bt(o))})},d.prototype.render=function(){return x(this,void 0,void 0,function(){var o;return F(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new y).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()]}})})},d.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(b){var c=new bt(a,!0);b(c),c.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(b){return b(new bt(a))}),this.detachEvents(),this._isOpen=!1)}},d.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},d.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},d.prototype.removeRenderEventListener=function(o){},d.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},d.prototype.removeCloseEventListener=function(o){},d.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))},d.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)},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,b=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,b),this._isResizing=!1},d.prototype.scaleMarkers=function(o,a){var u,b=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==b._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},d.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"},d.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},d.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)},d.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=_.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},d.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},d.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)},d.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},d.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},d.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)},d.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},d.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)},d.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()},d.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")},d.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"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ce(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Re(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},d.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},d.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())},d.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()}},d.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(b){var c=new rt(o,o._currentMarker,!0);b(c),c.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(b){return b(new rt(o,u))})}}},d.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(oe){var Ye=new rt(o,void 0,!0);oe(Ye),Ye.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(oe){var Ye=b.markers[oe];b.setCurrentMarker(b.markers[oe]),b._currentMarker.dispose(),b.markerImage.removeChild(b._currentMarker.container),b.markers.splice(b.markers.indexOf(b._currentMarker),1),b.eventListeners.markerdelete.forEach(function(Le){return Le(new rt(o,Ye))})},b=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(d.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),d.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))},d.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)},d.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},d.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 b=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),b<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new bt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new bt(o))})}},d.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},d.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 bt(o))}))},d.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},d.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 bt(o))}))},d.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},d.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},d.prototype.startRenderAndClose=function(){return x(this,void 0,void 0,function(){var o,a,u=this;return F(this,function(b){switch(b.label){case 0:return[4,this.render()];case 1:return o=b.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new mt(u,o,a))}),this.close(!0),[2]}})})},d.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},d.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 b=a._availableMarkerTypes.find(function(oe){return oe.typeName===u.typeName});if(b!==void 0){var c=a.addNewMarker(b);c.restoreState(u),a.markers.push(c)}}),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 bt(a))})},d.prototype.addNewMarker=function(o){var a=_.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},d.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(b){return b.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(b){return b(new rt(u,u._currentMarker))}))},d.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof se&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(se):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new rt(a,a._currentMarker))})},d.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},d.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},d.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new rt(a,o))})},d.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 rt(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 rt(a,a._currentMarker))}))},d.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))},d.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()}},d.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}))},d.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()},d.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},d.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},d.prototype.onWindowResize=function(){this.positionUI()},d.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()},d.prototype.addLicenseKey=function(o){g.addKey(o)},d.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},d.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},d.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(d.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),d.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 bt(o))}))},d.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 bt(o))}))},d.instanceCounter=0,d}();/* **********************************
|
|
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 kt=function(d,o){return(kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(a[b]=u[b])})(d,o)};function Et(d,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=d}kt(d,o),d.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function xt(d,o,a,u){return new(a||(a=Promise))(function(b,c){function oe(ut){try{Le(u.next(ut))}catch(Xe){c(Xe)}}function Ye(ut){try{Le(u.throw(ut))}catch(Xe){c(Xe)}}function Le(ut){var Xe;ut.done?b(ut.value):(Xe=ut.value,Xe instanceof a?Xe:new a(function(vt){vt(Xe)})).then(oe,Ye)}Le((u=u.apply(d,o||[])).next())})}function Pt(d,o){var a,u,b,c,oe={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return c={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ye(Le){return function(ut){return function(Xe){if(a)throw new TypeError("Generator is already executing.");for(;oe;)try{if(a=1,u&&(b=2&Xe[0]?u.return:Xe[0]?u.throw||((b=u.return)&&b.call(u),0):u.next)&&!(b=b.call(u,Xe[1])).done)return b;switch(u=0,b&&(Xe=[2&Xe[0],b.value]),Xe[0]){case 0:case 1:b=Xe;break;case 4:return oe.label++,{value:Xe[1],done:!1};case 5:oe.label++,u=Xe[1],Xe=[0];continue;case 7:Xe=oe.ops.pop(),oe.trys.pop();continue;default:if(!(b=oe.trys,(b=b.length>0&&b[b.length-1])||Xe[0]!==6&&Xe[0]!==2)){oe=0;continue}if(Xe[0]===3&&(!b||Xe[1]>b[0]&&Xe[1]<b[3])){oe.label=Xe[1];break}if(Xe[0]===6&&oe.label<b[1]){oe.label=b[1],b=Xe;break}if(b&&oe.label<b[2]){oe.label=b[2],oe.ops.push(Xe);break}b[2]&&oe.ops.pop(),oe.trys.pop();continue}Xe=o.call(d,oe)}catch(vt){Xe=[6,vt],u=0}finally{a=b=0}if(5&Xe[0])throw Xe[1];return{value:Xe[0]?Xe[1]:void 0,done:!0}}([Le,ut])}}}var Ft=function(){function d(){}return d.addKey=function(o){d.key=o},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),ht=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(o,a){for(var u=0,b=a;u<b.length;u++){var c=b[u],oe=c[0],Ye=c[1];o.setAttribute(oe,Ye)}},d.createRect=function(o,a,u){var b=document.createElementNS("http://www.w3.org/2000/svg","rect");return b.setAttribute("width",o.toString()),b.setAttribute("height",a.toString()),u&&d.setAttributes(b,u),b},d.createLine=function(o,a,u,b,c){var oe=document.createElementNS("http://www.w3.org/2000/svg","line");return oe.setAttribute("x1",o.toString()),oe.setAttribute("y1",a.toString()),oe.setAttribute("x2",u.toString()),oe.setAttribute("y2",b.toString()),c&&d.setAttributes(oe,c),oe},d.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&d.setAttributes(u,a),u},d.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&&d.setAttributes(u,a),u},d.createEllipse=function(o,a,u){var b=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return b.setAttribute("cx",(o/2).toString()),b.setAttribute("cy",(a/2).toString()),b.setAttribute("rx",(o/2).toString()),b.setAttribute("ry",(a/2).toString()),u&&d.setAttributes(b,u),b},d.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&d.setAttributes(a,o),a},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(o,a,u,b,c,oe,Ye){var Le=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(Le,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",b.toString()],["refX",c.toString()],["refY",oe.toString()]]),Le.appendChild(Ye),Le},d.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&d.setAttributes(a,o),a},d.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&d.setAttributes(u,a),u},d.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&d.setAttributes(a,o),a},d.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},d.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&d.setAttributes(u,a),u},d.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&d.setAttributes(u,a),u},d.getHollowRectanglePath=function(o,a,u,b,c,oe,Ye,Le){return"M"+o+","+a+"V"+(a+b)+"H"+(o+u)+"V"+a+"H"+c+"V"+oe+"H"+(c+Ye)+"V"+(oe+Le)+"H"+c+"V"+a+"Z"},d}(),rn=function(){function d(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),d.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},d.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)},d.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 Ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Zt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Zt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},d.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),Ut=function(d,o){this.selector=d,this.style=o},Zt=function(d,o){this.localName=d,this.style=o},on=function(){function d(){this.blocks=[],this.display=""}return d.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},d.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},d.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},d}(),qt=function(){function d(){}return d.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},d}(),mn=function(d){function o(){var a=d!==null&&d.apply(this,arguments)||this;return a.buttons=[],a}return Et(o,d),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=d.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(qt),jt=function(){function d(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(d.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),d.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},d.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,"")))},d.prototype.hide=function(){this._isHidden=!0},d}(),ft=function(d){function o(){var a=d!==null&&d.apply(this,arguments)||this;return a.elements=[],a}return Et(o,d),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=d.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(qt),an=function(){function d(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(d.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),d.prototype.getVerticalLength=function(o){return o/this.ratio},d.prototype.getHorizontalLength=function(o){return o*this.ratio},d}(),Ln=function(){function d(){}return d.getIcon=function(o,a){if(o>0&&a>0){var u=new an(o,a),b=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),oe=document.createElementNS("http://www.w3.org/2000/svg","svg");oe.setAttribute("xmlns","http://www.w3.org/2000/svg"),oe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(oe);var Ye=ht.createDefs();oe.appendChild(Ye);var Le=ht.createElement("clipPath",[["id","text-bg-clip"]]);Ye.appendChild(Le);var ut=ht.createPath(ht.getHollowRectanglePath((24-b)/2,(24-c)/2,b,c,(24-b)/2+2,(24-c)/2+2,b-4,c-4));oe.appendChild(ut);var Xe=ht.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Xe.appendChild(ht.createTSpan(o+":"+a)),oe.appendChild(Xe);var vt=Xe.getBBox();ht.setAttributes(Xe,[["x",((24-vt.width)/2).toString()],["y",((24-vt.height)/2-vt.y).toString()]]);var pt=ht.createPath(ht.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(vt.width))/2,(24-Math.ceil(vt.height))/2,Math.ceil(vt.width),Math.ceil(vt.height)));return Le.appendChild(pt),ht.setAttributes(ut,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(oe),oe.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>'},d}(),En=function(d){function o(a,u,b){var c=d.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=b,c}return Et(o,d),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}(jt),It=function(){function d(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=ht.createGroup(),this.visual.appendChild(ht.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ht.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return ht.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},d}(),Sn=function(){function d(o,a,u,b){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=b,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(d.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(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&ht.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),d.prototype.open=function(){var o=this;this.cropShadeElement=ht.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ht.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(ht.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ht.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=ht.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},d.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),ht.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(c,oe){var Ye=a.y+u*(oe+1);ht.setAttributes(c,[["x1",""+a.x],["y1",""+Ye],["x2",""+(a.x+a.width)],["y2",""+Ye]])});var b=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,oe){var Ye=a.x+b*(oe+1);ht.setAttributes(c,[["x1",""+Ye],["y1",""+a.y],["x2",""+Ye],["y2",""+(a.y+a.height)]])}),ht.setAttributes(this.cropShadeElement,[["d",ht.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},d.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)},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},d.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)},d.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()},d.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},d.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},d.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,b=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+=b,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+=b}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))},d.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),b=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<b/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=b,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)}},d.prototype.getRescaledRect=function(o,a,u,b,c,oe){var Ye=u/o,Le=b/a;return{x:(c.x-oe)*Ye+oe,y:(c.y-oe)*Le+oe,width:c.width*Ye,height:c.height*Le}},d.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)},d}(),vn=function(){function d(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(d.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),d.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},d.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},d.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},d.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},d.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();ht.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},d.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)}},d.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 b=u%5==0?this.height/3:this.height/6;a+="h4v"+-b+"h1v"+b}a+="v1H0Z",this.scaleShape=ht.createPath(a);var c=ht.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=ht.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ht.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var oe=ht.createTSpan("");return oe.innerHTML="°",this.angleLabelElement.appendChild(oe),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},d}(),ri=function(){function d(){this.naturalSize=!1,this.imageType="image/png"}return d.prototype.rasterize=function(o,a,u,b,c,oe,Ye){var Le=this;return new Promise(function(ut){var Xe=document.createElement("canvas");Xe.width=o.width.baseVal.value-2*b,Xe.height=o.height.baseVal.value-2*b;var vt=1,pt=1;Le.naturalSize===!0?(vt=a.naturalWidth/(o.width.baseVal.value-2*b)/oe,pt=a.naturalHeight/(o.height.baseVal.value-2*b)/Ye,Xe.width=a.naturalWidth/oe,Xe.height=a.naturalHeight/Ye):Le.width!==void 0&&Le.height!==void 0&&(vt=Le.width/u.width,pt=Le.height/u.height,Xe.width*=vt,Xe.height*=pt);var Rt=Xe.getContext("2d");Rt.translate(Xe.width/2,Xe.height/2),Rt.rotate(c*Math.PI/180),Rt.scale(oe,Ye),Rt.translate(-Xe.width/2,-Xe.height/2),Rt.drawImage(a,0,0,Xe.width,Xe.height);var dn=document.createElement("canvas");dn.width=u.width*vt,dn.height=u.height*pt,dn.getContext("2d").putImageData(Rt.getImageData((u.x-b)*vt,(u.y-b)*pt,u.width*vt,u.height*pt),0,0),ut(dn.toDataURL(Le.imageType,Le.imageQuality))})},d}(),tt=function(){function d(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=d.instanceCounter++,this.styles=new rn(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(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.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(d.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(d.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.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}),d.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},d.prototype.show=function(){this.showUI(),this.open()},d.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)},d.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},d.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},d.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},d.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},d.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))},d.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)}},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.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",ht.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},d.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()},d.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();ht.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},d.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},d.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=ht.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ht.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ht.createGroup(),this.editingTargetRotationScaleContainer=ht.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=ht.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=ht.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=ht.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)},d.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},d.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ht.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Sn(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()},d.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)}},d.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)},d.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},d.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},d.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"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.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},d.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},d.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new on,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 mn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(pt){var Rt=new jt(Ln.getIcon(pt.horizontal,pt.vertical),pt.horizontal===0&&pt.vertical===0?"FREE":pt.horizontal+":"+pt.vertical);Rt.onClick=function(){return o.ratioButtonClicked(pt)},u.push(Rt)}),this.aspectRatioButton=new En(Ln.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 b=new jt('<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");b.isActive=this.isGridVisible,b.onClick=function(){o.isGridVisible=!o.isGridVisible,b.isActive=o.isGridVisible},a.addButton(b);var c=new jt('<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(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!Ft.isLicensed){var oe=new ft;this.topToolbar.addElementBlock(oe);var Ye=document.createElement("div");Ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Le=document.createElement("a");Le.style.color="currentColor",Le.href="https://markerjs.com/products/cropro",Le.target="_blank",Le.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>',Ye.appendChild(Le),oe.addElement(Ye)}var ut=new mn;ut.minWidth=3*this.toolbarHeight+"px",ut.contentAlign="end",this.topToolbar.addButtonBlock(ut);var Xe=new jt('<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");Xe.onClick=this.startRenderAndClose,ut.addButton(Xe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Xe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var vt=new jt('<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");vt.onClick=this.close,ut.addButton(vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},d.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new on,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 mn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new jt('<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 b=new jt('<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");b.onClick=this.rotateRightButtonClicked,a.addButton(b);var c=new ft;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new vn("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(ut){o.rotateBy(ut),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var oe=new mn;oe.minWidth=2*this.toolbarHeight+"px",oe.contentAlign="end",this.bottomToolbar.addButtonBlock(oe);var Ye=new jt('<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");Ye.onClick=this.flipHorizontallyButtonClicked,oe.addButton(Ye);var Le=new jt('<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");Le.onClick=this.flipVerticallyButtonClicked,oe.addButton(Le)},d.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},d.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ln.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},d.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new an(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},d.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},d.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()}},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},d.prototype.onWindowResize=function(){this.positionUI()},d.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()},d.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)},d.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)},d.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},d.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},d.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},d.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},d.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},d.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},d.prototype.startRenderAndClose=function(){return xt(this,void 0,void 0,function(){var o,a;return Pt(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(b){return b(o,a)}),this.close(!0),[2]}})})},d.prototype.render=function(){return xt(this,void 0,void 0,function(){var o;return Pt(this,function(a){switch(a.label){case 0:return(o=new ri).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),ht.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()]}})})},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Zt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Zt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Ut("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ut("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Zt("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 Zt("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 Zt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},d.instanceCounter=0,d}(),_t=v("8hTe"),Un=v.n(_t),Pn=/<pre[^>]*>/g;function Yn(d){var o=document.createElement("div");return o.innerHTML=d,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Jn=qe.a=function(d){var o=d.value,a=o===void 0?"":o,u=d.edit,b=u===void 0?!1:u,c=d.className,oe=d.showTextOnly,Ye=d.showLines,Le=d.replaces,ut=d.zoomImg,Xe=d.hasMask,vt=d.style,pt=vt===void 0?{}:vt,Rt=d.stylesPrev,dn=Rt===void 0?{}:Rt,en=String(a),Jt=Object(B.useRef)(),Cn=Object(B.useRef)(),Gn=Object(B.useState)(""),bn=Object(D.a)(Gn,2),Vt=bn[0],kn=bn[1],Zn=Object(B.useState)("office"),yn=Object(D.a)(Zn,2),oi=yn[0],hn=yn[1],Bn=function(){var Ht=new tt(Cn.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var Tn=Object(q.a)(A.a.mark(function Wt(xn){var $t;return A.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Jt.current.style.display="none",gn.next=3,Object(Ee.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xn}});case 3:$t=gn.sent,$t!=null&&$t.id&&Le(Cn.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return gn.stop()}},Wt)}));return function(Wt){return Tn.apply(this,arguments)}}()),Ht.show()},Xt=function(){var Ht=new Ot(Cn.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var Tn=Object(q.a)(A.a.mark(function Wt(xn){var $t;return A.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(Jt.current.style.display="none",!Cn.current){gn.next=6;break}return gn.next=4,Object(Ee.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xn.dataUrl}});case 4:$t=gn.sent,$t!=null&&$t.id&&Le(Cn.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return gn.stop()}},Wt)}));return function(Wt){return Tn.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},wt=Object(B.useMemo)(function(){try{var un=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Tn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;en=en.replace(un,"("+te.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+te.a.API_SERVER+"/api/attachments/").replace(Tn,'"'+te.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),en=en.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(ti){}var Wt=V(en),xn=ye();if(en.match(/\[TOC\]/)&&(Wt=Wt.replace("<p>[TOC]</p>",Se()),Ue()),Wt=Wt.replace(/(__special_katext_id_\d+__)/g,function(ti,gn){var fn=xn[gn],ai=fn.type,Qn=fn.expression;return Object(ve.renderToString)(Yn(Qn)||"",{displayMode:ai==="block",throwOnError:!1,output:"html"})}),Wt=Wt.replace(/▁/g,"\u2581\u2581\u2581"),re(),oe){var $t=document.createElement("div");return $t.innerHTML=Wt,$t.innerText}return setTimeout(function(){return tn()},500),Wt},[en]),st=Object(B.useRef)();Te.WebkitLineClamp=Ye,Ye&&(pt=Object(pe.a)(Object(pe.a)({},pt),Te));function Mn(un){var Ht=un.target;if(Ht.tagName.toUpperCase()==="IMG"){if(ut){var Tn=Ht.getAttribute("src");kn(Tn),hn("image")}}else if(Ht.tagName.toUpperCase()==="A"){var Wt=Ht.getAttribute("href");if(Wt.indexOf("office")>-1)un.preventDefault(),kn(Wt),hn("office");else if(Wt.indexOf("application/pdf")>-1)un.preventDefault(),kn(Wt),hn("pdf");else if(Wt.indexOf("type=text")>-1)un.preventDefault(),kn(Wt),hn("html");else if(Wt.startsWith("#")){un.preventDefault();var xn=document.getElementById(Wt.replace("#",""));xn&&xn.scrollIntoView(!0)}}}var tn=function(){var Ht,Tn=(Ht=st.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");Tn==null||Tn.forEach(function(Wt){if(Wt.oncontextmenu=function(){return!1},Wt.src.indexOf(".m3u8")>-1&&!Wt.canPlayType("application/vnd.apple.mpegurl")){if(N.a.isSupported()){var xn=new N.a;xn.loadSource(Wt.src),xn.attachMedia(Wt)}}})};Object(B.useEffect)(function(){if(st.current&&wt&&(wt.match(Pn)&&window.PR.prettyPrint()),st.current)return st.current.addEventListener("click",Mn),function(){st.current.removeEventListener("click",Mn),re(),Ue()}},[wt,st.current,Mn]);var jn=function(Ht){if(!b)return;Ht.target.nodeName==="IMG"?(Jt.current.style.display="flex",Jt.current.style.width=Ht.target.clientWidth+"px",Jt.current.style.height=Ht.target.clientHeight+"px",Jt.current.style.top=Ht.target.offsetTop+"px",Jt.current.style.left=Ht.target.offsetLeft+"px",Cn.current.src=Ht.target.getAttribute("src")):Jt.current.style.display="none"};return O.a.createElement("div",{style:{position:"relative"}},O.a.createElement("div",{ref:st,style:Object(pe.a)({},pt),className:"".concat(c||""," markdown-body ").concat(Un.a.mdBody),onMouseOver:jn,dangerouslySetInnerHTML:{__html:wt}}),O.a.createElement("div",{ref:Jt,className:Un.a.button},O.a.createElement(be.a,null,O.a.createElement(Me.a,{onClick:function(){return Bn()}},"\u88C1\u526A"),O.a.createElement(Me.a,{onClick:function(){return Xt()}},"\u7F16\u8F91"))),O.a.createElement("img",{ref:Cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),O.a.createElement(Pe.a,{close:!0,data:Vt,hasMask:Xe,type:Vt!=null&&Vt.length?oi:"",style:Object(pe.a)({},dn),onClose:function(){return kn("")}}))}},"9VGf":function(lt,qe,v){"use strict";v.d(qe,"a",function(){return ge});var z=v("q1tI"),be=v.n(z);function ge(Me,pe){var q=Object(z.useRef)();Object(z.useEffect)(function(){q.current=Me}),Object(z.useEffect)(function(){function D(){q.current()}if(pe!==null){var j=setInterval(D,pe);return function(){return clearInterval(j)}}},[pe])}},Bd2K:function(lt,qe,v){(function(z){z(v("VrN/"),v("osHv"))})(function(z){z.defineOption("autoCloseTags",!1,function(A,B,O){if(O!=z.Init&&O&&A.removeKeyMap("autoCloseTags"),!B)return;var I={name:"autoCloseTags"};(typeof B!="object"||B.whenClosing!==!1)&&(I["'/'"]=function(ue){return q(ue)}),(typeof B!="object"||B.whenOpening!==!1)&&(I["'>'"]=function(ue){return Me(ue)}),A.addKeyMap(I)});var be=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ge=["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 Me(A){if(A.getOption("disableInput"))return z.Pass;for(var B=A.listSelections(),O=[],I=A.getOption("autoCloseTags"),ue=0;ue<B.length;ue++){if(!B[ue].empty())return z.Pass;var ee=B[ue].head,P=A.getTokenAt(ee),$=z.innerMode(A.getMode(),P.state),J=$.state,de=$.mode.xmlCurrentTag&&$.mode.xmlCurrentTag(J),fe=de&&de.name;if(!fe)return z.Pass;var je=$.mode.configuration=="html",Ue=typeof I=="object"&&I.dontCloseTags||je&&be,Te=typeof I=="object"&&I.indentTags||je&≥P.end>ee.ch&&(fe=fe.slice(0,fe.length-P.end+ee.ch));var ne=fe.toLowerCase();if(!fe||P.type=="string"&&(P.end!=ee.ch||!/[\"\']/.test(P.string.charAt(P.string.length-1))||P.string.length==1)||P.type=="tag"&&de.close||P.string.indexOf("/")==ee.ch-P.start-1||Ue&&D(Ue,ne)>-1||j(A,$.mode.xmlCurrentContext&&$.mode.xmlCurrentContext(J)||[],fe,ee,!0))return z.Pass;var Se=typeof I=="object"&&I.emptyTags;if(Se&&D(Se,fe)>-1){O[ue]={text:"/>",newPos:z.Pos(ee.line,ee.ch+2)};continue}var me=Te&&D(Te,ne)>-1;O[ue]={indent:me,text:">"+(me?`
|
|
|
|
`:"")+"</"+fe+">",newPos:me?z.Pos(ee.line+1,0):z.Pos(ee.line,ee.ch+1)}}for(var G=typeof I=="object"&&I.dontIndentOnAutoClose,ue=B.length-1;ue>=0;ue--){var he=O[ue];A.replaceRange(he.text,B[ue].head,B[ue].anchor,"+insert");var ie=A.listSelections().slice(0);ie[ue]={head:he.newPos,anchor:he.newPos},A.setSelections(ie),!G&&he.indent&&(A.indentLine(he.newPos.line,null,!0),A.indentLine(he.newPos.line+1,null,!0))}}function pe(A,B){for(var O=A.listSelections(),I=[],ue=B?"/":"</",ee=A.getOption("autoCloseTags"),P=typeof ee=="object"&&ee.dontIndentOnSlash,$=0;$<O.length;$++){if(!O[$].empty())return z.Pass;var J=O[$].head,de=A.getTokenAt(J),fe=z.innerMode(A.getMode(),de.state),je=fe.state;if(B&&(de.type=="string"||de.string.charAt(0)!="<"||de.start!=J.ch-1))return z.Pass;var Ue,Te=fe.mode.name!="xml"&&A.getMode().name=="htmlmixed";if(Te&&fe.mode.name=="javascript")Ue=ue+"script";else if(Te&&fe.mode.name=="css")Ue=ue+"style";else{var ne=fe.mode.xmlCurrentContext&&fe.mode.xmlCurrentContext(je);if(!ne||ne.length&&j(A,ne,ne[ne.length-1],J))return z.Pass;Ue=ue+ne[ne.length-1]}A.getLine(J.line).charAt(de.end)!=">"&&(Ue+=">"),I[$]=Ue}if(A.replaceSelections(I),O=A.listSelections(),!P)for(var $=0;$<O.length;$++)($==O.length-1||O[$].head.line<O[$+1].head.line)&&A.indentLine(O[$].head.line)}function q(A){return A.getOption("disableInput")?z.Pass:pe(A,!0)}z.commands.closeTag=function(A){return pe(A)};function D(A,B){if(A.indexOf)return A.indexOf(B);for(var O=0,I=A.length;O<I;++O)if(A[O]==B)return O;return-1}function j(A,B,O,I,ue){if(!z.scanForClosingTag)return!1;var ee=Math.min(A.lastLine()+1,I.line+500),P=z.scanForClosingTag(A,I,null,ee);if(!P||P.tag!=O)return!1;for(var $=ue?1:0,J=B.length-1;J>=0&&B[J]==O;J--)++$;I=P.to;for(var J=1;J<$;J++){var de=z.scanForClosingTag(A,I,null,ee);if(!de||de.tag!=O)return!1;I=de.to}return!0}})},BjJ7:function(lt,qe,v){"use strict";v.d(qe,"d",function(){return be}),v.d(qe,"c",function(){return ge}),v.d(qe,"e",function(){return Me}),v.d(qe,"b",function(){return pe}),v.d(qe,"a",function(){return D});var z=v("m3rI");function be(j){var A=!0;if(j.length>0){for(var B=0;B<j.length;B++)if(j[B].compile_success==0||!j[B].compile_success){A=!1;break}}else A=!1;return A}function ge(j){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",B=[],O=0;O<j.length;O++){var I=j[O],ue=A?"".concat(A,"/").concat(I.name):"".concat(I.name);B.push({title:I.name,isLeaf:!(I.type==="tree"),key:ue})}return B}function Me(j,A,B){for(var O=0;O<j.length;O++){var I=j[O];if(I.key===A){I.children=B;break}I.children&&Me(I.children,A,B)}return j}function pe(j,A,B){var O;return function(){var I=this,ue=arguments,ee=function(){O=null,B||j.apply(I,ue)},P=B&&!O;clearTimeout(O),O=setTimeout(ee,A),P&&j.apply(I,ue)}}var q=!0,D=z.a.API_SERVER},"C+DQ":function(lt,qe,v){},D1Df:function(lt,qe,v){"use strict";function z(k){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(K){return typeof K}:z=function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},z(k)}function be(){return be=Object.assign||function(k){for(var T=1;T<arguments.length;T++){var K=arguments[T];for(var L in K)Object.prototype.hasOwnProperty.call(K,L)&&(k[L]=K[L])}return k},be.apply(this,arguments)}function ge(k,T){var K=Object.keys(k);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(k);T&&(L=L.filter(function(V){return Object.getOwnPropertyDescriptor(k,V).enumerable})),K.push.apply(K,L)}return K}function Me(k){for(var T=1;T<arguments.length;T++){var K=arguments[T]!=null?arguments[T]:{};T%2?ge(K,!0).forEach(function(L){P(k,L,K[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(K)):ge(K).forEach(function(L){Object.defineProperty(k,L,Object.getOwnPropertyDescriptor(K,L))})}return k}function pe(k,T){if(k==null)return{};var K=q(k,T),L,V;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(k);for(V=0;V<p.length;V++){if(L=p[V],T.indexOf(L)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,L))continue;K[L]=k[L]}}return K}function q(k,T){if(k==null)return{};var K={},L=Object.keys(k),V,p;for(p=0;p<L.length;p++){if(V=L[p],T.indexOf(V)>=0)continue;K[V]=k[V]}return K}function D(k,T){if(!(k instanceof T))throw new TypeError("Cannot call a class as a function")}function j(k,T){for(var K=0;K<T.length;K++){var L=T[K];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}function A(k,T,K){return T&&j(k.prototype,T),K&&j(k,K),k}function B(k,T){return T&&(z(T)==="object"||typeof T=="function")?T:I(k)}function O(k){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(K){return K.__proto__||Object.getPrototypeOf(K)},O(k)}function I(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function ue(k,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(T&&T.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),T&&ee(k,T)}function ee(k,T){return ee=Object.setPrototypeOf||function(L,V){return L.__proto__=V,L},ee(k,T)}function P(k,T,K){return T in k?Object.defineProperty(k,T,{value:K,enumerable:!0,configurable:!0,writable:!0}):k[T]=K,k}var $=v("q1tI"),J=v("17x9"),de=v("H38U"),fe=v("aRTE");function je(k){for(var T="",K=0;K<k.length;K++){var L=k.charCodeAt(K);L<128?T+=String.fromCharCode(L):L<2048?(T+=String.fromCharCode(192|L>>6),T+=String.fromCharCode(128|L&63)):L<55296||L>=57344?(T+=String.fromCharCode(224|L>>12),T+=String.fromCharCode(128|L>>6&63),T+=String.fromCharCode(128|L&63)):(K++,L=65536+((L&1023)<<10|k.charCodeAt(K)&1023),T+=String.fromCharCode(240|L>>18),T+=String.fromCharCode(128|L>>12&63),T+=String.fromCharCode(128|L>>6&63),T+=String.fromCharCode(128|L&63))}return T}var Ue={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},Te={},ne=4,Se=.1;function me(k){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,K=[];return k.forEach(function(L,V){var p=null;L.forEach(function(h,N){if(!h&&p!==null){K.push("M".concat(p+T," ").concat(V+T,"h").concat(N-p,"v1H").concat(p+T,"z")),p=null;return}if(N===L.length-1){if(!h)return;p===null?K.push("M".concat(N+T,",").concat(V+T," h1v1H").concat(N+T,"z")):K.push("M".concat(p+T,",").concat(V+T," h").concat(N+1-p,"v1H").concat(p+T,"z"));return}h&&p===null&&(p=N)})}),K.join("")}function G(k,T){return k.slice().map(function(K,L){return L<T.y||L>=T.y+T.h?K:K.map(function(V,p){return p<T.x||p>=T.x+T.w?V:!1})})}function he(k,T){var K=k.imageSettings,L=k.size,V=k.includeMargin;if(K==null)return null;var p=V?ne:0,h=T.length+p*2,N=Math.floor(L*Se),te=h/L,ve=(K.width||N)*te,Pe=(K.height||N)*te,Ee=K.x==null?T.length/2-ve/2:K.x*te,we=K.y==null?T.length/2-Pe/2:K.y*te,H=null;if(K.excavate){var x=Math.floor(Ee),F=Math.floor(we),w=Math.ceil(ve+Ee-x),_=Math.ceil(Pe+we-F);H={x,y:F,w,h:_}}return{x:Ee,y:we,h:Pe,w:ve,excavation:H}}var ie=function(){try{new Path2D().addPath(new Path2D)}catch(k){return!1}return!0}(),R=function(k){ue(T,k);function T(){var K,L;D(this,T);for(var V=arguments.length,p=new Array(V),h=0;h<V;h++)p[h]=arguments[h];return L=B(this,(K=O(T)).call.apply(K,[this].concat(p))),P(I(L),"_canvas",void 0),P(I(L),"_image",void 0),P(I(L),"state",{imgLoaded:!1}),P(I(L),"handleImageLoad",function(){L.setState({imgLoaded:!0})}),L}return A(T,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var L=this.props,V=L.value,p=L.size,h=L.level,N=L.bgColor,te=L.fgColor,ve=L.includeMargin,Pe=L.imageSettings,Ee=new de(-1,fe[h]);if(Ee.addData(je(V)),Ee.make(),this._canvas!=null){var we=this._canvas,H=we.getContext("2d");if(!H)return;var x=Ee.modules;if(x===null)return;var F=ve?ne:0,w=x.length+F*2,_=he(this.props,x);Pe!=null&&_!=null&&(_.excavation!=null&&(x=G(x,_.excavation)));var g=window.devicePixelRatio||1;we.height=we.width=p*g;var y=p/w*g;H.scale(y,y),H.fillStyle=N,H.fillRect(0,0,w,w),H.fillStyle=te,ie?H.fill(new Path2D(me(x,F))):x.forEach(function(S,W){S.forEach(function(ce,Y){ce&&H.fillRect(Y+F,W+F,1,1)})}),this.state.imgLoaded&&this._image&&_!=null&&H.drawImage(this._image,_.x+F,_.y+F,_.w,_.h)}}},{key:"render",value:function(){var L=this,V=this.props,p=V.value,h=V.size,N=V.level,te=V.bgColor,ve=V.fgColor,Pe=V.style,Ee=V.includeMargin,we=V.imageSettings,H=pe(V,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),x=Me({height:h,width:h},Pe),F=null,w=we&&we.src;return we!=null&&w!=null&&(F=$.createElement("img",{src:w,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(g){return L._image=g}})),$.createElement($.Fragment,null,$.createElement("canvas",be({style:x,height:h,width:h,ref:function(g){return L._canvas=g}},H)),F)}}]),T}($.PureComponent);P(R,"defaultProps",Ue);var ye=function(k){ue(T,k);function T(){return D(this,T),B(this,O(T).apply(this,arguments))}return A(T,[{key:"render",value:function(){var L=this.props,V=L.value,p=L.size,h=L.level,N=L.bgColor,te=L.fgColor,ve=L.includeMargin,Pe=L.imageSettings,Ee=pe(L,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),we=new de(-1,fe[h]);we.addData(je(V)),we.make();var H=we.modules;if(H===null)return null;var x=ve?ne:0,F=H.length+x*2,w=he(this.props,H),_=null;Pe!=null&&w!=null&&(w.excavation!=null&&(H=G(H,w.excavation)),_=$.createElement("image",{xlinkHref:Pe.src,height:w.h,width:w.w,x:w.x+x,y:w.y+x,preserveAspectRatio:"none"}));var g=me(H,x);return $.createElement("svg",be({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(F," ").concat(F)},Ee),$.createElement("path",{fill:N,d:"M0,0 h".concat(F,"v").concat(F,"H0z")}),$.createElement("path",{fill:te,d:g}),_)}}]),T}($.PureComponent);P(ye,"defaultProps",Ue);var re=function(T){var K=T.renderAs,L=pe(T,["renderAs"]),V=K==="svg"?ye:R;return $.createElement(V,L)};re.defaultProps=Me({renderAs:"canvas"},Ue),lt.exports=re},DlQD:function(lt,qe,v){(function(z,be){lt.exports=be()})(this,function(){"use strict";function z(se,Q){for(var le=0;le<Q.length;le++){var E=Q[le];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(se,E.key,E)}}function be(se,Q,le){return Q&&z(se.prototype,Q),le&&z(se,le),se}function ge(se,Q){if(!se)return;if(typeof se=="string")return Me(se,Q);var le=Object.prototype.toString.call(se).slice(8,-1);if(le==="Object"&&se.constructor&&(le=se.constructor.name),le==="Map"||le==="Set")return Array.from(se);if(le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le))return Me(se,Q)}function Me(se,Q){(Q==null||Q>se.length)&&(Q=se.length);for(var le=0,E=new Array(Q);le<Q;le++)E[le]=se[le];return E}function pe(se,Q){var le;if(typeof Symbol=="undefined"||se[Symbol.iterator]==null){if(Array.isArray(se)||(le=ge(se))||Q&&se&&typeof se.length=="number"){le&&(se=le);var E=0;return function(){return E>=se.length?{done:!0}:{done:!1,value:se[E++]}}}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 le=se[Symbol.iterator](),le.next.bind(le)}function q(se,Q){return Q={exports:{}},se(Q,Q.exports),Q.exports}var D=q(function(se){function Q(){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 le(E){se.exports.defaults=E}se.exports={defaults:Q(),getDefaults:Q,changeDefaults:le}}),j=D.defaults,A=D.getDefaults,B=D.changeDefaults,O=/[&<>"']/,I=/[&<>"']/g,ue=/[<>"']|&(?!#?\w+;)/,ee=/[<>"']|&(?!#?\w+;)/g,P={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(Q){return P[Q]};function J(se,Q){if(Q){if(O.test(se))return se.replace(I,$)}else if(ue.test(se))return se.replace(ee,$);return se}var de=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function fe(se){return se.replace(de,function(Q,le){return le=le.toLowerCase(),le==="colon"?":":le.charAt(0)==="#"?le.charAt(1)==="x"?String.fromCharCode(parseInt(le.substring(2),16)):String.fromCharCode(+le.substring(1)):""})}var je=/(^|[^\[])\^/g;function Ue(se,Q){se=se.source||se,Q=Q||"";var le={replace:function(M,U){return U=U.source||U,U=U.replace(je,"$1"),se=se.replace(M,U),le},getRegex:function(){return new RegExp(se,Q)}};return le}var Te=/[^\w:]/g,ne=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Se(se,Q,le){if(se){var E;try{E=decodeURIComponent(fe(le)).replace(Te,"").toLowerCase()}catch(M){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}Q&&!ne.test(le)&&(le=R(Q,le));try{le=encodeURI(le).replace(/%25/g,"%")}catch(M){return null}return le}var me={},G=/^[^:]+:\/*[^/]*$/,he=/^([^:]+:)[\s\S]*$/,ie=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(se,Q){me[" "+se]||(G.test(se)?me[" "+se]=se+"/":me[" "+se]=T(se,"/",!0)),se=me[" "+se];var le=se.indexOf(":")===-1;return Q.substring(0,2)==="//"?le?Q:se.replace(he,"$1")+Q:Q.charAt(0)==="/"?le?Q:se.replace(ie,"$1")+Q:se+Q}var ye={exec:function(){}};function re(se){for(var Q=1,le,E;Q<arguments.length;Q++){le=arguments[Q];for(E in le)Object.prototype.hasOwnProperty.call(le,E)&&(se[E]=le[E])}return se}function k(se,Q){var le=se.replace(/\|/g,function(U,X,ke){for(var De=!1,et=X;--et>=0&&ke[et]==="\\";)De=!De;return De?"|":" |"}),E=le.split(/ \|/),M=0;if(E.length>Q)E.splice(Q);else for(;E.length<Q;)E.push("");for(;M<E.length;M++)E[M]=E[M].trim().replace(/\\\|/g,"|");return E}function T(se,Q,le){var E=se.length;if(E===0)return"";for(var M=0;M<E;){var U=se.charAt(E-M-1);if(U===Q&&!le)M++;else if(U!==Q&&le)M++;else break}return se.substr(0,E-M)}function K(se,Q){if(se.indexOf(Q[1])===-1)return-1;for(var le=se.length,E=0,M=0;M<le;M++)if(se[M]==="\\")M++;else if(se[M]===Q[0])E++;else if(se[M]===Q[1]&&(E--,E<0))return M;return-1}function L(se){se&&se.sanitize&&!se.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 V={escape:J,unescape:fe,edit:Ue,cleanUrl:Se,resolveUrl:R,noopTest:ye,merge:re,splitCells:k,rtrim:T,findClosingBracket:K,checkSanitizeDeprecation:L},p=D.defaults,h=V.rtrim,N=V.splitCells,te=V.escape,ve=V.findClosingBracket;function Pe(se,Q,le){var E=Q.href,M=Q.title?te(Q.title):null,U=se[1].replace(/\\([\[\]])/g,"$1");return se[0].charAt(0)!=="!"?{type:"link",raw:le,href:E,title:M,text:U}:{type:"image",raw:le,href:E,title:M,text:te(U)}}function Ee(se,Q){var le=se.match(/^(\s+)(?:```)/);if(le===null)return Q;var E=le[1];return Q.split(`
|
|
`).map(function(M){var U=M.match(/^\s+/);if(U===null)return M;var X=U[0];return X.length>=E.length?M.slice(E.length):M}).join(`
|
|
`)}var we=function(){function se(le){this.options=le||p}var Q=se.prototype;return Q.space=function(E){var M=this.rules.block.newline.exec(E);if(M)return M[0].length>1?{type:"space",raw:M[0]}:{raw:`
|
|
`}},Q.code=function(E,M){var U=this.rules.block.code.exec(E);if(U){var X=M[M.length-1];if(X&&X.type==="paragraph")return{raw:U[0],text:U[0].trimRight()};var ke=U[0].replace(/^ {4}/gm,"");return{type:"code",raw:U[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:h(ke,`
|
|
`)}}},Q.fences=function(E){var M=this.rules.block.fences.exec(E);if(M){var U=M[0],X=Ee(U,M[3]||"");return{type:"code",raw:U,lang:M[2]?M[2].trim():M[2],text:X}}},Q.heading=function(E){var M=this.rules.block.heading.exec(E);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},Q.nptable=function(E){var M=this.rules.block.nptable.exec(E);if(M){var U={type:"table",header:N(M[1].replace(/^ *| *\| *$/g,"")),align:M[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:M[3]?M[3].replace(/\n$/,"").split(`
|
|
`):[],raw:M[0]};if(U.header.length===U.align.length){var X=U.align.length,ke;for(ke=0;ke<X;ke++)/^ *-+: *$/.test(U.align[ke])?U.align[ke]="right":/^ *:-+: *$/.test(U.align[ke])?U.align[ke]="center":/^ *:-+ *$/.test(U.align[ke])?U.align[ke]="left":U.align[ke]=null;for(X=U.cells.length,ke=0;ke<X;ke++)U.cells[ke]=N(U.cells[ke],U.header.length);return U}}},Q.hr=function(E){var M=this.rules.block.hr.exec(E);if(M)return{type:"hr",raw:M[0]}},Q.blockquote=function(E){var M=this.rules.block.blockquote.exec(E);if(M){var U=M[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:M[0],text:U}}},Q.list=function(E){var M=this.rules.block.list.exec(E);if(M){for(var U=M[0],X=M[2],ke=X.length>1,De=X[X.length-1]===")",et={type:"list",raw:U,ordered:ke,start:ke?+X.slice(0,-1):"",loose:!1,items:[]},yt=M[0].match(this.rules.block.item),St=!1,Je,bt,mt,rt,Dt,Ot,kt,Et=yt.length,xt=0;xt<Et;xt++)Je=yt[xt],U=Je,bt=Je.length,Je=Je.replace(/^ *([*+-]|\d+[.)]) */,""),~Je.indexOf(`
|
|
`)&&(bt-=Je.length,Je=this.options.pedantic?Je.replace(/^ {1,4}/gm,""):Je.replace(new RegExp("^ {1,"+bt+"}","gm"),"")),xt!==Et-1&&(mt=this.rules.block.bullet.exec(yt[xt+1])[0],(ke?mt.length===1||!De&&mt[mt.length-1]===")":mt.length>1||this.options.smartLists&&mt!==X)&&(rt=yt.slice(xt+1).join(`
|
|
`),et.raw=et.raw.substring(0,et.raw.length-rt.length),xt=Et-1)),Dt=St||/\n\n(?!\s*$)/.test(Je),xt!==Et-1&&(St=Je.charAt(Je.length-1)===`
|
|
`,Dt||(Dt=St)),Dt&&(et.loose=!0),Ot=/^\[[ xX]\] /.test(Je),kt=void 0,Ot&&(kt=Je[1]!==" ",Je=Je.replace(/^\[[ xX]\] +/,"")),et.items.push({type:"list_item",raw:U,task:Ot,checked:kt,loose:Dt,text:Je});return et}},Q.html=function(E){var M=this.rules.block.html.exec(E);if(M)return{type:this.options.sanitize?"paragraph":"html",raw:M[0],pre:!this.options.sanitizer&&(M[1]==="pre"||M[1]==="script"||M[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):te(M[0]):M[0]}},Q.def=function(E){var M=this.rules.block.def.exec(E);if(M){M[3]&&(M[3]=M[3].substring(1,M[3].length-1));var U=M[1].toLowerCase().replace(/\s+/g," ");return{tag:U,raw:M[0],href:M[2],title:M[3]}}},Q.table=function(E){var M=this.rules.block.table.exec(E);if(M){var U={type:"table",header:N(M[1].replace(/^ *| *\| *$/g,"")),align:M[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:M[3]?M[3].replace(/\n$/,"").split(`
|
|
`):[]};if(U.header.length===U.align.length){U.raw=M[0];var X=U.align.length,ke;for(ke=0;ke<X;ke++)/^ *-+: *$/.test(U.align[ke])?U.align[ke]="right":/^ *:-+: *$/.test(U.align[ke])?U.align[ke]="center":/^ *:-+ *$/.test(U.align[ke])?U.align[ke]="left":U.align[ke]=null;for(X=U.cells.length,ke=0;ke<X;ke++)U.cells[ke]=N(U.cells[ke].replace(/^ *\| *| *\| *$/g,""),U.header.length);return U}}},Q.lheading=function(E){var M=this.rules.block.lheading.exec(E);if(M)return{type:"heading",raw:M[0],depth:M[2].charAt(0)==="="?1:2,text:M[1]}},Q.paragraph=function(E){var M=this.rules.block.paragraph.exec(E);if(M)return{type:"paragraph",raw:M[0],text:M[1].charAt(M[1].length-1)===`
|
|
`?M[1].slice(0,-1):M[1]}},Q.text=function(E,M){var U=this.rules.block.text.exec(E);if(U){var X=M[M.length-1];return X&&X.type==="text"?{raw:U[0],text:U[0]}:{type:"text",raw:U[0],text:U[0]}}},Q.escape=function(E){var M=this.rules.inline.escape.exec(E);if(M)return{type:"escape",raw:M[0],text:te(M[1])}},Q.tag=function(E,M,U){var X=this.rules.inline.tag.exec(E);if(X)return!M&&/^<a /i.test(X[0])?M=!0:M&&/^<\/a>/i.test(X[0])&&(M=!1),!U&&/^<(pre|code|kbd|script)(\s|>)/i.test(X[0])?U=!0:U&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(X[0])&&(U=!1),{type:this.options.sanitize?"text":"html",raw:X[0],inLink:M,inRawBlock:U,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):te(X[0]):X[0]}},Q.link=function(E){var M=this.rules.inline.link.exec(E);if(M){var U=ve(M[2],"()");if(U>-1){var X=M[0].indexOf("!")===0?5:4,ke=X+M[1].length+U;M[2]=M[2].substring(0,U),M[0]=M[0].substring(0,ke).trim(),M[3]=""}var De=M[2],et="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);yt?(De=yt[1],et=yt[3]):et=""}else et=M[3]?M[3].slice(1,-1):"";De=De.trim().replace(/^<([\s\S]*)>$/,"$1");var St=Pe(M,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:et&&et.replace(this.rules.inline._escapes,"$1")},M[0]);return St}},Q.reflink=function(E,M){var U;if((U=this.rules.inline.reflink.exec(E))||(U=this.rules.inline.nolink.exec(E))){var X=(U[2]||U[1]).replace(/\s+/g," ");if(X=M[X.toLowerCase()],!X||!X.href){var ke=U[0].charAt(0);return{type:"text",raw:ke,text:ke}}var De=Pe(U,X,U[0]);return De}},Q.strong=function(E,M,U){U===void 0&&(U="");var X=this.rules.inline.strong.start.exec(E);if(X&&(!X[1]||X[1]&&(U===""||this.rules.inline.punctuation.exec(U)))){M=M.slice(-1*E.length);var ke=X[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ke.lastIndex=0;for(var De;(X=ke.exec(M))!=null;)if(De=this.rules.inline.strong.middle.exec(M.slice(0,X.index+3)),De)return{type:"strong",raw:E.slice(0,De[0].length),text:E.slice(2,De[0].length-2)}}},Q.em=function(E,M,U){U===void 0&&(U="");var X=this.rules.inline.em.start.exec(E);if(X&&(!X[1]||X[1]&&(U===""||this.rules.inline.punctuation.exec(U)))){M=M.slice(-1*E.length);var ke=X[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ke.lastIndex=0;for(var De;(X=ke.exec(M))!=null;)if(De=this.rules.inline.em.middle.exec(M.slice(0,X.index+2)),De)return{type:"em",raw:E.slice(0,De[0].length),text:E.slice(1,De[0].length-1)}}},Q.codespan=function(E){var M=this.rules.inline.code.exec(E);if(M){var U=M[2].replace(/\n/g," "),X=/[^ ]/.test(U),ke=U.startsWith(" ")&&U.endsWith(" ");return X&&ke&&(U=U.substring(1,U.length-1)),U=te(U,!0),{type:"codespan",raw:M[0],text:U}}},Q.br=function(E){var M=this.rules.inline.br.exec(E);if(M)return{type:"br",raw:M[0]}},Q.del=function(E){var M=this.rules.inline.del.exec(E);if(M)return{type:"del",raw:M[0],text:M[1]}},Q.autolink=function(E,M){var U=this.rules.inline.autolink.exec(E);if(U){var X,ke;return U[2]==="@"?(X=te(this.options.mangle?M(U[1]):U[1]),ke="mailto:"+X):(X=te(U[1]),ke=X),{type:"link",raw:U[0],text:X,href:ke,tokens:[{type:"text",raw:X,text:X}]}}},Q.url=function(E,M){var U;if(U=this.rules.inline.url.exec(E)){var X,ke;if(U[2]==="@")X=te(this.options.mangle?M(U[0]):U[0]),ke="mailto:"+X;else{var De;do De=U[0],U[0]=this.rules.inline._backpedal.exec(U[0])[0];while(De!==U[0]);X=te(U[0]),U[1]==="www."?ke="http://"+X:ke=X}return{type:"link",raw:U[0],text:X,href:ke,tokens:[{type:"text",raw:X,text:X}]}}},Q.inlineText=function(E,M,U){var X=this.rules.inline.text.exec(E);if(X){var ke;return M?ke=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):te(X[0]):X[0]:ke=te(this.options.smartypants?U(X[0]):X[0]),{type:"text",raw:X[0],text:ke}}},se}(),H=V.noopTest,x=V.edit,F=V.merge,w={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:H,table:H,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};w._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,w._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,w.def=x(w.def).replace("label",w._label).replace("title",w._title).getRegex(),w.bullet=/(?:[*+-]|\d{1,9}[.)])/,w.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,w.item=x(w.item,"gm").replace(/bull/g,w.bullet).getRegex(),w.list=x(w.list).replace(/bull/g,w.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+w.def.source+")").getRegex(),w._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",w._comment=/<!--(?!-?>)[\s\S]*?-->/,w.html=x(w.html,"i").replace("comment",w._comment).replace("tag",w._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),w.paragraph=x(w._paragraph).replace("hr",w.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",w._tag).getRegex(),w.blockquote=x(w.blockquote).replace("paragraph",w.paragraph).getRegex(),w.normal=F({},w),w.gfm=F({},w.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*|$)"}),w.gfm.nptable=x(w.gfm.nptable).replace("hr",w.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",w._tag).getRegex(),w.gfm.table=x(w.gfm.table).replace("hr",w.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",w._tag).getRegex(),w.pedantic=F({},w.normal,{html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",w._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:H,paragraph:x(w.normal._paragraph).replace("hr",w.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",w.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:H,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:H,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};_._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",_.punctuation=x(_.punctuation).replace(/punctuation/g,_._punctuation).getRegex(),_._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_.em.start=x(_.em.start).replace(/punctuation/g,_._punctuation).getRegex(),_.em.middle=x(_.em.middle).replace(/punctuation/g,_._punctuation).replace(/overlapSkip/g,_._overlapSkip).getRegex(),_.em.endAst=x(_.em.endAst,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.em.endUnd=x(_.em.endUnd,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.strong.start=x(_.strong.start).replace(/punctuation/g,_._punctuation).getRegex(),_.strong.middle=x(_.strong.middle).replace(/punctuation/g,_._punctuation).replace(/blockSkip/g,_._blockSkip).getRegex(),_.strong.endAst=x(_.strong.endAst,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.strong.endUnd=x(_.strong.endUnd,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.blockSkip=x(_._blockSkip,"g").getRegex(),_.overlapSkip=x(_._overlapSkip,"g").getRegex(),_._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_._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])?)+(?![-_])/,_.autolink=x(_.autolink).replace("scheme",_._scheme).replace("email",_._email).getRegex(),_._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_.tag=x(_.tag).replace("comment",w._comment).replace("attribute",_._attribute).getRegex(),_._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_.link=x(_.link).replace("label",_._label).replace("href",_._href).replace("title",_._title).getRegex(),_.reflink=x(_.reflink).replace("label",_._label).getRegex(),_.reflinkSearch=x(_.reflinkSearch,"g").replace("reflink",_.reflink).replace("nolink",_.nolink).getRegex(),_.normal=F({},_),_.pedantic=F({},_.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:x(/^!?\[(label)\]\((.*?)\)/).replace("label",_._label).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_._label).getRegex()}),_.gfm=F({},_.normal,{escape:x(_.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),_.gfm.url=x(_.gfm.url,"i").replace("email",_.gfm._extended_email).getRegex(),_.breaks=F({},_.gfm,{br:x(_.br).replace("{2,}","*").getRegex(),text:x(_.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var g={block:w,inline:_},y=D.defaults,S=g.block,W=g.inline;function ce(se){return se.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 Y(se){var Q="",le,E,M=se.length;for(le=0;le<M;le++)E=se.charCodeAt(le),Math.random()>.5&&(E="x"+E.toString(16)),Q+="&#"+E+";";return Q}var Ce=function(){function se(le){this.tokens=[],this.tokens.links=Object.create(null),this.options=le||y,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var E={block:S.normal,inline:W.normal};this.options.pedantic?(E.block=S.pedantic,E.inline=W.pedantic):this.options.gfm&&(E.block=S.gfm,this.options.breaks?E.inline=W.breaks:E.inline=W.gfm),this.tokenizer.rules=E}se.lex=function(E,M){var U=new se(M);return U.lex(E)};var Q=se.prototype;return Q.lex=function(E){return E=E.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(E,this.tokens,!0),this.inline(this.tokens),this.tokens},Q.blockTokens=function(E,M,U){M===void 0&&(M=[]),U===void 0&&(U=!0),E=E.replace(/^ +$/gm,"");for(var X,ke,De,et;E;){if(X=this.tokenizer.space(E)){E=E.substring(X.raw.length),X.type&&M.push(X);continue}if(X=this.tokenizer.code(E,M)){E=E.substring(X.raw.length),X.type?M.push(X):(et=M[M.length-1],et.raw+=`
|
|
`+X.raw,et.text+=`
|
|
`+X.text);continue}if(X=this.tokenizer.fences(E)){E=E.substring(X.raw.length),M.push(X);continue}if(X=this.tokenizer.heading(E)){E=E.substring(X.raw.length),M.push(X);continue}if(X=this.tokenizer.nptable(E)){E=E.substring(X.raw.length),M.push(X);continue}if(X=this.tokenizer.hr(E)){E=E.substring(X.raw.length),M.push(X);continue}if(X=this.tokenizer.blockquote(E)){E=E.substring(X.raw.length),X.tokens=this.blockTokens(X.text,[],U),M.push(X);continue}if(X=this.tokenizer.list(E)){for(E=E.substring(X.raw.length),De=X.items.length,ke=0;ke<De;ke++)X.items[ke].tokens=this.blockTokens(X.items[ke].text,[],!1);M.push(X);continue}if(X=this.tokenizer.html(E)){E=E.substring(X.raw.length),M.push(X);continue}if(U&&(X=this.tokenizer.def(E))){E=E.substring(X.raw.length),this.tokens.links[X.tag]||(this.tokens.links[X.tag]={href:X.href,title:X.title});continue}if(X=this.tokenizer.table(E)){E=E.substring(X.raw.length),M.push(X);continue}if(X=this.tokenizer.lheading(E)){E=E.substring(X.raw.length),M.push(X);continue}if(U&&(X=this.tokenizer.paragraph(E))){E=E.substring(X.raw.length),M.push(X);continue}if(X=this.tokenizer.text(E,M)){E=E.substring(X.raw.length),X.type?M.push(X):(et=M[M.length-1],et.raw+=`
|
|
`+X.raw,et.text+=`
|
|
`+X.text);continue}if(E){var yt="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return M},Q.inline=function(E){var M,U,X,ke,De,et,yt=E.length;for(M=0;M<yt;M++){et=E[M];switch(et.type){case"paragraph":case"text":case"heading":{et.tokens=[],this.inlineTokens(et.text,et.tokens);break}case"table":{for(et.tokens={header:[],cells:[]},ke=et.header.length,U=0;U<ke;U++)et.tokens.header[U]=[],this.inlineTokens(et.header[U],et.tokens.header[U]);for(ke=et.cells.length,U=0;U<ke;U++)for(De=et.cells[U],et.tokens.cells[U]=[],X=0;X<De.length;X++)et.tokens.cells[U][X]=[],this.inlineTokens(De[X],et.tokens.cells[U][X]);break}case"blockquote":{this.inline(et.tokens);break}case"list":{for(ke=et.items.length,U=0;U<ke;U++)this.inline(et.items[U].tokens);break}}}return E},Q.inlineTokens=function(E,M,U,X,ke){M===void 0&&(M=[]),U===void 0&&(U=!1),X===void 0&&(X=!1),ke===void 0&&(ke="");var De,et=E,yt;if(this.tokens.links){var St=Object.keys(this.tokens.links);if(St.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(et))!=null;)St.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(et=et.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(et))!=null;)et=et.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;E;){if(De=this.tokenizer.escape(E)){E=E.substring(De.raw.length),M.push(De);continue}if(De=this.tokenizer.tag(E,U,X)){E=E.substring(De.raw.length),U=De.inLink,X=De.inRawBlock,M.push(De);continue}if(De=this.tokenizer.link(E)){E=E.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,X)),M.push(De);continue}if(De=this.tokenizer.reflink(E,this.tokens.links)){E=E.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,X)),M.push(De);continue}if(De=this.tokenizer.strong(E,et,ke)){E=E.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],U,X),M.push(De);continue}if(De=this.tokenizer.em(E,et,ke)){E=E.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],U,X),M.push(De);continue}if(De=this.tokenizer.codespan(E)){E=E.substring(De.raw.length),M.push(De);continue}if(De=this.tokenizer.br(E)){E=E.substring(De.raw.length),M.push(De);continue}if(De=this.tokenizer.del(E)){E=E.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],U,X),M.push(De);continue}if(De=this.tokenizer.autolink(E,Y)){E=E.substring(De.raw.length),M.push(De);continue}if(!U&&(De=this.tokenizer.url(E,Y))){E=E.substring(De.raw.length),M.push(De);continue}if(De=this.tokenizer.inlineText(E,X,ce)){E=E.substring(De.raw.length),ke=De.raw.slice(-1),M.push(De);continue}if(E){var Je="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return M},be(se,null,[{key:"rules",get:function(){return{block:S,inline:W}}}]),se}(),Re=D.defaults,Fe=V.cleanUrl,Ve=V.escape,He=function(){function se(le){this.options=le||Re}var Q=se.prototype;return Q.code=function(E,M,U){var X=(M||"").match(/\S*/)[0];if(this.options.highlight){var ke=this.options.highlight(E,X);ke!=null&&ke!==E&&(U=!0,E=ke)}return X?'<pre><code class="'+this.options.langPrefix+Ve(X,!0)+'">'+(U?E:Ve(E,!0))+`</code></pre>
|
|
`:"<pre><code>"+(U?E:Ve(E,!0))+`</code></pre>
|
|
`},Q.blockquote=function(E){return`<blockquote>
|
|
`+E+`</blockquote>
|
|
`},Q.html=function(E){return E},Q.heading=function(E,M,U,X){return this.options.headerIds?"<h"+M+' id="'+this.options.headerPrefix+X.slug(U)+'">'+E+"</h"+M+`>
|
|
`:"<h"+M+">"+E+"</h"+M+`>
|
|
`},Q.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Q.list=function(E,M,U){var X=M?"ol":"ul",ke=M&&U!==1?' start="'+U+'"':"";return"<"+X+ke+`>
|
|
`+E+"</"+X+`>
|
|
`},Q.listitem=function(E){return"<li>"+E+`</li>
|
|
`},Q.checkbox=function(E){return"<input "+(E?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Q.paragraph=function(E){return"<p>"+E+`</p>
|
|
`},Q.table=function(E,M){return M&&(M="<tbody>"+M+"</tbody>"),`<table>
|
|
<thead>
|
|
`+E+`</thead>
|
|
`+M+`</table>
|
|
`},Q.tablerow=function(E){return`<tr>
|
|
`+E+`</tr>
|
|
`},Q.tablecell=function(E,M){var U=M.header?"th":"td",X=M.align?"<"+U+' align="'+M.align+'">':"<"+U+">";return X+E+"</"+U+`>
|
|
`},Q.strong=function(E){return"<strong>"+E+"</strong>"},Q.em=function(E){return"<em>"+E+"</em>"},Q.codespan=function(E){return"<code>"+E+"</code>"},Q.br=function(){return this.options.xhtml?"<br/>":"<br>"},Q.del=function(E){return"<del>"+E+"</del>"},Q.link=function(E,M,U){if(E=Fe(this.options.sanitize,this.options.baseUrl,E),E===null)return U;var X='<a href="'+Ve(E)+'"';return M&&(X+=' title="'+M+'"'),X+=">"+U+"</a>",X},Q.image=function(E,M,U){if(E=Fe(this.options.sanitize,this.options.baseUrl,E),E===null)return U;var X='<img src="'+E+'" alt="'+U+'"';return M&&(X+=' title="'+M+'"'),X+=this.options.xhtml?"/>":">",X},Q.text=function(E){return E},se}(),ze=function(){function se(){}var Q=se.prototype;return Q.strong=function(E){return E},Q.em=function(E){return E},Q.codespan=function(E){return E},Q.del=function(E){return E},Q.html=function(E){return E},Q.text=function(E){return E},Q.link=function(E,M,U){return""+U},Q.image=function(E,M,U){return""+U},Q.br=function(){return""},se}(),at=function(){function se(){this.seen={}}var Q=se.prototype;return Q.slug=function(E){var M=E.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(M)){var U=M;do this.seen[U]++,M=U+"-"+this.seen[U];while(this.seen.hasOwnProperty(M))}return this.seen[M]=0,M},se}(),xe=D.defaults,Ie=V.unescape,Be=function(){function se(le){this.options=le||xe,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ze,this.slugger=new at}se.parse=function(E,M){var U=new se(M);return U.parse(E)};var Q=se.prototype;return Q.parse=function(E,M){M===void 0&&(M=!0);var U="",X,ke,De,et,yt,St,Je,bt,mt,rt,Dt,Ot,kt,Et,xt,Pt,Ft,ht,rn=E.length;for(X=0;X<rn;X++){rt=E[X];switch(rt.type){case"space":continue;case"hr":{U+=this.renderer.hr();continue}case"heading":{U+=this.renderer.heading(this.parseInline(rt.tokens),rt.depth,Ie(this.parseInline(rt.tokens,this.textRenderer)),this.slugger);continue}case"code":{U+=this.renderer.code(rt.text,rt.lang,rt.escaped);continue}case"table":{for(bt="",Je="",et=rt.header.length,ke=0;ke<et;ke++)Je+=this.renderer.tablecell(this.parseInline(rt.tokens.header[ke]),{header:!0,align:rt.align[ke]});for(bt+=this.renderer.tablerow(Je),mt="",et=rt.cells.length,ke=0;ke<et;ke++){for(St=rt.tokens.cells[ke],Je="",yt=St.length,De=0;De<yt;De++)Je+=this.renderer.tablecell(this.parseInline(St[De]),{header:!1,align:rt.align[De]});mt+=this.renderer.tablerow(Je)}U+=this.renderer.table(bt,mt);continue}case"blockquote":{mt=this.parse(rt.tokens),U+=this.renderer.blockquote(mt);continue}case"list":{for(Dt=rt.ordered,Ot=rt.start,kt=rt.loose,et=rt.items.length,mt="",ke=0;ke<et;ke++)xt=rt.items[ke],Pt=xt.checked,Ft=xt.task,Et="",xt.task&&(ht=this.renderer.checkbox(Pt),kt?xt.tokens.length>0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=ht+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=ht+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:ht}):Et+=ht),Et+=this.parse(xt.tokens,kt),mt+=this.renderer.listitem(Et,Ft,Pt);U+=this.renderer.list(mt,Dt,Ot);continue}case"html":{U+=this.renderer.html(rt.text);continue}case"paragraph":{U+=this.renderer.paragraph(this.parseInline(rt.tokens));continue}case"text":{for(mt=rt.tokens?this.parseInline(rt.tokens):rt.text;X+1<rn&&E[X+1].type==="text";)rt=E[++X],mt+=`
|
|
`+(rt.tokens?this.parseInline(rt.tokens):rt.text);U+=M?this.renderer.paragraph(mt):mt;continue}default:{var Ut='Token with "'+rt.type+'" type was not found.';if(this.options.silent){console.error(Ut);return}else throw new Error(Ut)}}}return U},Q.parseInline=function(E,M){M=M||this.renderer;var U="",X,ke,De=E.length;for(X=0;X<De;X++){ke=E[X];switch(ke.type){case"escape":{U+=M.text(ke.text);break}case"html":{U+=M.html(ke.text);break}case"link":{U+=M.link(ke.href,ke.title,this.parseInline(ke.tokens,M));break}case"image":{U+=M.image(ke.href,ke.title,ke.text);break}case"strong":{U+=M.strong(this.parseInline(ke.tokens,M));break}case"em":{U+=M.em(this.parseInline(ke.tokens,M));break}case"codespan":{U+=M.codespan(ke.text);break}case"br":{U+=M.br();break}case"del":{U+=M.del(this.parseInline(ke.tokens,M));break}case"text":{U+=M.text(ke.text);break}default:{var et='Token with "'+ke.type+'" type was not found.';if(this.options.silent){console.error(et);return}else throw new Error(et)}}}return U},se}(),Ke=V.merge,$e=V.checkSanitizeDeprecation,Ge=V.escape,_e=D.getDefaults,nt=D.changeDefaults,Qe=D.defaults;function Ae(se,Q,le){if(typeof se=="undefined"||se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");if(typeof Q=="function"&&(le=Q,Q=null),Q=Ke({},Ae.defaults,Q||{}),$e(Q),le){var E=Q.highlight,M;try{M=Ce.lex(se,Q)}catch(De){return le(De)}var U=function(et){var yt;if(!et)try{yt=Be.parse(M,Q)}catch(St){et=St}return Q.highlight=E,et?le(et):le(null,yt)};if(!E||E.length<3)return U();if(delete Q.highlight,!M.length)return U();var X=0;Ae.walkTokens(M,function(De){De.type==="code"&&(X++,setTimeout(function(){E(De.text,De.lang,function(et,yt){if(et)return U(et);yt!=null&&yt!==De.text&&(De.text=yt,De.escaped=!0),X--,X===0&&U()})},0))}),X===0&&U();return}try{var ke=Ce.lex(se,Q);return Q.walkTokens&&Ae.walkTokens(ke,Q.walkTokens),Be.parse(ke,Q)}catch(De){if(De.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Q.silent)return"<p>An error occurred:</p><pre>"+Ge(De.message+"",!0)+"</pre>";throw De}}Ae.options=Ae.setOptions=function(se){return Ke(Ae.defaults,se),nt(Ae.defaults),Ae},Ae.getDefaults=_e,Ae.defaults=Qe,Ae.use=function(se){var Q=Ke({},se);if(se.renderer&&function(){var E=Ae.defaults.renderer||new He,M=function(ke){var De=E[ke];E[ke]=function(){for(var et=arguments.length,yt=new Array(et),St=0;St<et;St++)yt[St]=arguments[St];var Je=se.renderer[ke].apply(E,yt);return Je===!1&&(Je=De.apply(E,yt)),Je}};for(var U in se.renderer)M(U);Q.renderer=E}(),se.tokenizer&&function(){var E=Ae.defaults.tokenizer||new we,M=function(ke){var De=E[ke];E[ke]=function(){for(var et=arguments.length,yt=new Array(et),St=0;St<et;St++)yt[St]=arguments[St];var Je=se.tokenizer[ke].apply(E,yt);return Je===!1&&(Je=De.apply(E,yt)),Je}};for(var U in se.tokenizer)M(U);Q.tokenizer=E}(),se.walkTokens){var le=Ae.defaults.walkTokens;Q.walkTokens=function(E){se.walkTokens(E),le&&le(E)}}Ae.setOptions(Q)},Ae.walkTokens=function(se,Q){for(var le=pe(se),E;!(E=le()).done;){var M=E.value;Q(M);switch(M.type){case"table":{for(var U=pe(M.tokens.header),X;!(X=U()).done;){var ke=X.value;Ae.walkTokens(ke,Q)}for(var De=pe(M.tokens.cells),et;!(et=De()).done;)for(var yt=et.value,St=pe(yt),Je;!(Je=St()).done;){var bt=Je.value;Ae.walkTokens(bt,Q)}break}case"list":{Ae.walkTokens(M.items,Q);break}default:M.tokens&&Ae.walkTokens(M.tokens,Q)}}},Ae.Parser=Be,Ae.parser=Be.parse,Ae.Renderer=He,Ae.TextRenderer=ze,Ae.Lexer=Ce,Ae.lexer=Ce.lex,Ae.Tokenizer=we,Ae.Slugger=at,Ae.parse=Ae;var We=Ae;return We})},ELLl:function(lt,qe,v){(function(z){z(v("VrN/"))})(function(z){var be={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ge=z.Pos;z.defineOption("autoCloseBrackets",!1,function(P,$,J){J&&J!=z.Init&&(P.removeKeyMap(pe),P.state.closeBrackets=null),$&&(q(Me($,"pairs")),P.state.closeBrackets=$,P.addKeyMap(pe))});function Me(P,$){return $=="pairs"&&typeof P=="string"?P:typeof P=="object"&&P[$]!=null?P[$]:be[$]}var pe={Backspace:A,Enter:B};function q(P){for(var $=0;$<P.length;$++){var J=P.charAt($),de="'"+J+"'";pe[de]||(pe[de]=D(J))}}q(be.pairs+"`");function D(P){return function($){return I($,P)}}function j(P){var $=P.state.closeBrackets;if(!$||$.override)return $;var J=P.getModeAt(P.getCursor());return J.closeBrackets||$}function A(P){var $=j(P);if(!$||P.getOption("disableInput"))return z.Pass;for(var J=Me($,"pairs"),de=P.listSelections(),fe=0;fe<de.length;fe++){if(!de[fe].empty())return z.Pass;var je=ue(P,de[fe].head);if(!je||J.indexOf(je)%2!=0)return z.Pass}for(var fe=de.length-1;fe>=0;fe--){var Ue=de[fe].head;P.replaceRange("",ge(Ue.line,Ue.ch-1),ge(Ue.line,Ue.ch+1),"+delete")}}function B(P){var $=j(P),J=$&&Me($,"explode");if(!J||P.getOption("disableInput"))return z.Pass;for(var de=P.listSelections(),fe=0;fe<de.length;fe++){if(!de[fe].empty())return z.Pass;var je=ue(P,de[fe].head);if(!je||J.indexOf(je)%2!=0)return z.Pass}P.operation(function(){var Ue=P.lineSeparator()||`
|
|
`;P.replaceSelection(Ue+Ue,null),P.execCommand("goCharLeft"),de=P.listSelections();for(var Te=0;Te<de.length;Te++){var ne=de[Te].head.line;P.indentLine(ne,null,!0),P.indentLine(ne+1,null,!0)}})}function O(P){var $=z.cmpPos(P.anchor,P.head)>0;return{anchor:new ge(P.anchor.line,P.anchor.ch+($?-1:1)),head:new ge(P.head.line,P.head.ch+($?1:-1))}}function I(P,$){var J=j(P);if(!J||P.getOption("disableInput"))return z.Pass;var de=Me(J,"pairs"),fe=de.indexOf($);if(fe==-1)return z.Pass;for(var je=Me(J,"closeBefore"),Ue=Me(J,"triples"),Te=de.charAt(fe+1)==$,ne=P.listSelections(),Se=fe%2==0,me,G=0;G<ne.length;G++){var he=ne[G],ie=he.head,R,ye=P.getRange(ie,ge(ie.line,ie.ch+1));if(Se&&!he.empty())R="surround";else if((Te||!Se)&&ye==$)Te&&ee(P,ie)?R="both":Ue.indexOf($)>=0&&P.getRange(ie,ge(ie.line,ie.ch+3))==$+$+$?R="skipThree":R="skip";else if(Te&&ie.ch>1&&Ue.indexOf($)>=0&&P.getRange(ge(ie.line,ie.ch-2),ie)==$+$){if(ie.ch>2&&/\bstring/.test(P.getTokenTypeAt(ge(ie.line,ie.ch-2))))return z.Pass;R="addFour"}else if(Te){var re=ie.ch==0?" ":P.getRange(ge(ie.line,ie.ch-1),ie);if(!z.isWordChar(ye)&&re!=$&&!z.isWordChar(re))R="both";else return z.Pass}else if(Se&&(ye.length===0||/\s/.test(ye)||je.indexOf(ye)>-1))R="both";else return z.Pass;if(!me)me=R;else if(me!=R)return z.Pass}var k=fe%2?de.charAt(fe-1):$,T=fe%2?$:de.charAt(fe+1);P.operation(function(){if(me=="skip")P.execCommand("goCharRight");else if(me=="skipThree")for(var K=0;K<3;K++)P.execCommand("goCharRight");else if(me=="surround"){for(var L=P.getSelections(),K=0;K<L.length;K++)L[K]=k+L[K]+T;P.replaceSelections(L,"around"),L=P.listSelections().slice();for(var K=0;K<L.length;K++)L[K]=O(L[K]);P.setSelections(L)}else me=="both"?(P.replaceSelection(k+T,null),P.triggerElectric(k+T),P.execCommand("goCharLeft")):me=="addFour"&&(P.replaceSelection(k+k+k+k,"before"),P.execCommand("goCharRight"))})}function ue(P,$){var J=P.getRange(ge($.line,$.ch-1),ge($.line,$.ch+1));return J.length==2?J:null}function ee(P,$){var J=P.getTokenAt(ge($.line,$.ch+1));return/\bstring/.test(J.type)&&J.start==$.ch&&($.ch==0||!/\bstring/.test(P.getTokenTypeAt($)))}})},GfqC:function(lt,qe,v){"use strict";var z=v("q1tI"),be=v.n(z),ge=v("TSYQ"),Me=v.n(ge);function pe(V,p){var h="cannot "+V.method+" "+V.action+" "+p.status+"'",N=new Error(h);return N.status=p.status,N.method=V.method,N.url=V.action,N}function q(V){var p=V.responseText||V.response;if(!p)return p;try{return JSON.parse(p)}catch(h){return p}}function D(V){var p=new XMLHttpRequest;V.onProgress&&p.upload&&(p.upload.onprogress=function(ve){ve.total>0&&(ve.percent=ve.loaded/ve.total*100),V.onProgress(ve)});var h=new FormData;V.data&&Object.keys(V.data).forEach(function(te){var ve=V.data[te];if(Array.isArray(ve)){ve.forEach(function(Pe){h.append(te+"[]",Pe)});return}h.append(te,V.data[te])}),V.file instanceof Blob?h.append(V.filename,V.file,V.file.name):h.append(V.filename,V.file),p.onerror=function(ve){V.onError(ve)},p.onload=function(){return p.status<200||p.status>=300?V.onError(pe(V,p),q(p)):V.onSuccess(q(p),p)},p.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var N=V.headers||{};return N["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(N).forEach(function(te){N[te]!==null&&p.setRequestHeader(te,N[te])}),p.send(h),{abort:function(){p.abort()}}}var j=+new Date,A=0;function B(){return"rc-upload-"+j+"-"+ ++A}function O(V,p){return V.indexOf(p,V.length-p.length)!==-1}var I=function(V,p){if(V&&p){var h=Array.isArray(p)?p:p.split(","),N=V.name||"",te=V.type||"",ve=te.replace(/\/.*$/,"");return h.some(function(Pe){var Ee=Pe.trim();return Ee.charAt(0)==="."?O(N.toLowerCase(),Ee.toLowerCase()):/\/\*$/.test(Ee)?ve===Ee.replace(/\/.*$/,""):te===Ee})}return!0};function ue(V,p){var h=V.createReader(),N=[];function te(){h.readEntries(function(ve){var Pe=Array.prototype.slice.apply(ve);N=N.concat(Pe);var Ee=!Pe.length;Ee?p(N):te()})}te()}var ee=function(p,h,N){var te=function ve(Pe,Ee){Ee=Ee||"",Pe.isFile?Pe.file(function(we){N(we)&&(Pe.fullPath&&!we.webkitRelativePath&&(Object.defineProperties(we,{webkitRelativePath:{writable:!0}}),we.webkitRelativePath=Pe.fullPath.replace(/^\//,""),Object.defineProperties(we,{webkitRelativePath:{writable:!1}})),h([we]))}):Pe.isDirectory&&ue(Pe,function(we){we.forEach(function(H){ve(H,""+Ee+Pe.name+"/")})})};p.forEach(function(ve){te(ve.webkitGetAsEntry())})},P=ee,$=Object.assign||function(V){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var N in h)Object.prototype.hasOwnProperty.call(h,N)&&(V[N]=h[N])}return V},J=function(){function V(p,h){var N=[],te=!0,ve=!1,Pe=void 0;try{for(var Ee=p[Symbol.iterator](),we;!(te=(we=Ee.next()).done)&&!(N.push(we.value),h&&N.length===h);te=!0);}catch(H){ve=!0,Pe=H}finally{try{!te&&Ee.return&&Ee.return()}finally{if(ve)throw Pe}}return N}return function(p,h){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return V(p,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),de=function(){function V(p,h){for(var N=0;N<h.length;N++){var te=h[N];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(p,te.key,te)}}return function(p,h,N){return h&&V(p.prototype,h),N&&V(p,N),p}}();function fe(V,p,h){return p in V?Object.defineProperty(V,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):V[p]=h,V}function je(V,p){var h={};for(var N in V){if(p.indexOf(N)>=0)continue;if(!Object.prototype.hasOwnProperty.call(V,N))continue;h[N]=V[N]}return h}function Ue(V,p){if(!(V instanceof p))throw new TypeError("Cannot call a class as a function")}function Te(V,p){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:V}function ne(V,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);V.prototype=Object.create(p&&p.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(V,p):V.__proto__=p)}var Se=function(p){return Object.keys(p).reduce(function(h,N){return(N.substr(0,5)==="data-"||N.substr(0,5)==="aria-"||N==="role")&&(h[N]=p[N]),h},{})},me=function(V){ne(p,V);function p(){var h,N,te,ve;Ue(this,p);for(var Pe=arguments.length,Ee=Array(Pe),we=0;we<Pe;we++)Ee[we]=arguments[we];return ve=(N=(te=Te(this,(h=p.__proto__||Object.getPrototypeOf(p)).call.apply(h,[this].concat(Ee))),te),te.state={uid:B()},te.reqs={},te.onChange=function(H){var x=H.target.files;te.uploadFiles(x),te.reset()},te.onClick=function(H){var x=te.fileInput;if(!x)return;var F=te.props,w=F.children,_=F.onClick;w&&w.type==="button"&&(x.parentNode.focus(),x.parentNode.querySelector("button").blur()),x.click(),_&&_(H)},te.onKeyDown=function(H){H.key==="Enter"&&te.onClick()},te.onFileDrop=function(H){var x=te.props.multiple;if(H.preventDefault(),H.type==="dragover")return;if(te.props.directory)P(Array.prototype.slice.call(H.dataTransfer.items),te.uploadFiles,function(w){return I(w,te.props.accept)});else{var F=Array.prototype.slice.call(H.dataTransfer.files).filter(function(w){return I(w,te.props.accept)});x===!1&&(F=F.slice(0,1)),te.uploadFiles(F)}},te.uploadFiles=function(H){var x=Array.prototype.slice.call(H);x.map(function(F){return F.uid=B(),F}).forEach(function(F){te.upload(F,x)})},te.saveFileInput=function(H){te.fileInput=H},N),Te(te,ve)}return de(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(N,te){var ve=this,Pe=this.props;if(!Pe.beforeUpload)return setTimeout(function(){return ve.post(N)},0);var Ee=Pe.beforeUpload(N,te);Ee&&Ee.then?Ee.then(function(we){var H=Object.prototype.toString.call(we);return H==="[object File]"||H==="[object Blob]"?ve.post(we):ve.post(N)}).catch(function(we){console.log(we)}):Ee!==!1&&setTimeout(function(){return ve.post(N)},0);return}},{key:"post",value:function(N){var te=this;if(!this._isMounted)return;var ve=this.props,Pe=ve.onStart,Ee=ve.onProgress,we=ve.transformFile,H=we===void 0?function(x){return x}:we;new Promise(function(x){var F=ve.action;return typeof F=="function"&&(F=F(N)),x(F)}).then(function(x){var F=N.uid,w=ve.customRequest||D,_=Promise.resolve(H(N)).then(function(g){var y=ve.data;return typeof y=="function"&&(y=y(g)),Promise.all([g,y])}).catch(function(g){console.error(g)});_.then(function(g){var y=J(g,2),S=y[0],W=y[1],ce={action:x,filename:ve.name,data:W,file:S,headers:ve.headers,withCredentials:ve.withCredentials,method:ve.method||"post",onProgress:Ee?function(Y){Ee(Y,N)}:null,onSuccess:function(Ce,Re){delete te.reqs[F],ve.onSuccess(Ce,N,Re)},onError:function(Ce,Re){delete te.reqs[F],ve.onError(Ce,Re,N)}};Pe(N),te.reqs[F]=w(ce)})})}},{key:"reset",value:function(){this.setState({uid:B()})}},{key:"abort",value:function(N){var te=this.reqs;if(N){var ve=N;N&&N.uid&&(ve=N.uid),te[ve]&&te[ve].abort&&te[ve].abort(),delete te[ve]}else Object.keys(te).forEach(function(Pe){te[Pe]&&te[Pe].abort&&te[Pe].abort(),delete te[Pe]})}},{key:"render",value:function(){var N,te=this.props,ve=te.component,Pe=te.prefixCls,Ee=te.className,we=te.disabled,H=te.id,x=te.style,F=te.multiple,w=te.accept,_=te.children,g=te.directory,y=te.openFileDialogOnClick,S=te.onMouseEnter,W=te.onMouseLeave,ce=je(te,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Y=Me()((N={},fe(N,Pe,!0),fe(N,Pe+"-disabled",we),fe(N,Ee,Ee),N)),Ce=we?{}:{onClick:y?this.onClick:function(){},onKeyDown:y?this.onKeyDown:function(){},onMouseEnter:S,onMouseLeave:W,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return be.a.createElement(ve,$({},Ce,{className:Y,role:"button",style:x}),be.a.createElement("input",$({},Se(ce),{id:H,type:"file",ref:this.saveFileInput,onClick:function(Fe){return Fe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:w,directory:g?"directory":null,webkitdirectory:g?"webkitdirectory":null,multiple:F,onChange:this.onChange})),_)}}]),p}(z.Component),G=me,he=Object.assign||function(V){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var N in h)Object.prototype.hasOwnProperty.call(h,N)&&(V[N]=h[N])}return V},ie=function(){function V(p,h){for(var N=0;N<h.length;N++){var te=h[N];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(p,te.key,te)}}return function(p,h,N){return h&&V(p.prototype,h),N&&V(p,N),p}}();function R(V,p){if(!(V instanceof p))throw new TypeError("Cannot call a class as a function")}function ye(V,p){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:V}function re(V,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);V.prototype=Object.create(p&&p.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(V,p):V.__proto__=p)}function k(){}var T=function(V){re(p,V);function p(){var h,N,te,ve;R(this,p);for(var Pe=arguments.length,Ee=Array(Pe),we=0;we<Pe;we++)Ee[we]=arguments[we];return ve=(N=(te=ye(this,(h=p.__proto__||Object.getPrototypeOf(p)).call.apply(h,[this].concat(Ee))),te),te.saveUploader=function(H){te.uploader=H},N),ye(te,ve)}return ie(p,[{key:"abort",value:function(N){this.uploader.abort(N)}},{key:"render",value:function(){return be.a.createElement(G,he({},this.props,{ref:this.saveUploader}))}}]),p}(z.Component);T.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:k,onError:k,onSuccess:k,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var K=T,L=qe.a=K},Gytx:function(lt,qe){lt.exports=function(z,be,ge,Me){var pe=ge?ge.call(Me,z,be):void 0;if(pe!==void 0)return!!pe;if(z===be)return!0;if(typeof z!="object"||!z||typeof be!="object"||!be)return!1;var q=Object.keys(z),D=Object.keys(be);if(q.length!==D.length)return!1;for(var j=Object.prototype.hasOwnProperty.bind(be),A=0;A<q.length;A++){var B=q[A];if(!j(B))return!1;var O=z[B],I=be[B];if(pe=ge?ge.call(Me,O,I,B):void 0,pe===!1||pe===void 0&&O!==I)return!1}return!0}},H38U:function(lt,qe,v){var z=v("f4xo"),be=v("rcnY"),ge=v("wU8J"),Me=v("Iq15"),pe=v("dWSS");function q(j,A){this.typeNumber=j,this.errorCorrectLevel=A,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var D=q.prototype;D.addData=function(j){var A=new z(j);this.dataList.push(A),this.dataCache=null},D.isDark=function(j,A){if(j<0||this.moduleCount<=j||A<0||this.moduleCount<=A)throw new Error(j+","+A);return this.modules[j][A]},D.getModuleCount=function(){return this.moduleCount},D.make=function(){if(this.typeNumber<1){var j=1;for(j=1;j<40;j++){for(var A=be.getRSBlocks(j,this.errorCorrectLevel),B=new ge,O=0,I=0;I<A.length;I++)O+=A[I].dataCount;for(var I=0;I<this.dataList.length;I++){var ue=this.dataList[I];B.put(ue.mode,4),B.put(ue.getLength(),Me.getLengthInBits(ue.mode,j)),ue.write(B)}if(B.getLengthInBits()<=O*8)break}this.typeNumber=j}this.makeImpl(!1,this.getBestMaskPattern())},D.makeImpl=function(j,A){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var B=0;B<this.moduleCount;B++){this.modules[B]=new Array(this.moduleCount);for(var O=0;O<this.moduleCount;O++)this.modules[B][O]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(j,A),this.typeNumber>=7&&this.setupTypeNumber(j),this.dataCache==null&&(this.dataCache=q.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,A)},D.setupPositionProbePattern=function(j,A){for(var B=-1;B<=7;B++){if(j+B<=-1||this.moduleCount<=j+B)continue;for(var O=-1;O<=7;O++){if(A+O<=-1||this.moduleCount<=A+O)continue;0<=B&&B<=6&&(O==0||O==6)||0<=O&&O<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=O&&O<=4?this.modules[j+B][A+O]=!0:this.modules[j+B][A+O]=!1}}},D.getBestMaskPattern=function(){for(var j=0,A=0,B=0;B<8;B++){this.makeImpl(!0,B);var O=Me.getLostPoint(this);(B==0||j>O)&&(j=O,A=B)}return A},D.createMovieClip=function(j,A,B){var O=j.createEmptyMovieClip(A,B),I=1;this.make();for(var ue=0;ue<this.modules.length;ue++)for(var ee=ue*I,P=0;P<this.modules[ue].length;P++){var $=P*I,J=this.modules[ue][P];J&&(O.beginFill(0,100),O.moveTo($,ee),O.lineTo($+I,ee),O.lineTo($+I,ee+I),O.lineTo($,ee+I),O.endFill())}return O},D.setupTimingPattern=function(){for(var j=8;j<this.moduleCount-8;j++){if(this.modules[j][6]!=null)continue;this.modules[j][6]=j%2==0}for(var A=8;A<this.moduleCount-8;A++){if(this.modules[6][A]!=null)continue;this.modules[6][A]=A%2==0}},D.setupPositionAdjustPattern=function(){for(var j=Me.getPatternPosition(this.typeNumber),A=0;A<j.length;A++)for(var B=0;B<j.length;B++){var O=j[A],I=j[B];if(this.modules[O][I]!=null)continue;for(var ue=-2;ue<=2;ue++)for(var ee=-2;ee<=2;ee++)ue==-2||ue==2||ee==-2||ee==2||ue==0&&ee==0?this.modules[O+ue][I+ee]=!0:this.modules[O+ue][I+ee]=!1}},D.setupTypeNumber=function(j){for(var A=Me.getBCHTypeNumber(this.typeNumber),B=0;B<18;B++){var O=!j&&(A>>B&1)==1;this.modules[Math.floor(B/3)][B%3+this.moduleCount-8-3]=O}for(var B=0;B<18;B++){var O=!j&&(A>>B&1)==1;this.modules[B%3+this.moduleCount-8-3][Math.floor(B/3)]=O}},D.setupTypeInfo=function(j,A){for(var B=this.errorCorrectLevel<<3|A,O=Me.getBCHTypeInfo(B),I=0;I<15;I++){var ue=!j&&(O>>I&1)==1;I<6?this.modules[I][8]=ue:I<8?this.modules[I+1][8]=ue:this.modules[this.moduleCount-15+I][8]=ue}for(var I=0;I<15;I++){var ue=!j&&(O>>I&1)==1;I<8?this.modules[8][this.moduleCount-I-1]=ue:I<9?this.modules[8][15-I-1+1]=ue:this.modules[8][15-I-1]=ue}this.modules[this.moduleCount-8][8]=!j},D.mapData=function(j,A){for(var B=-1,O=this.moduleCount-1,I=7,ue=0,ee=this.moduleCount-1;ee>0;ee-=2)for(ee==6&&ee--;;){for(var P=0;P<2;P++)if(this.modules[O][ee-P]==null){var $=!1;ue<j.length&&($=(j[ue]>>>I&1)==1);var J=Me.getMask(A,O,ee-P);J&&($=!$),this.modules[O][ee-P]=$,I--,I==-1&&(ue++,I=7)}if(O+=B,O<0||this.moduleCount<=O){O-=B,B=-B;break}}},q.PAD0=236,q.PAD1=17,q.createData=function(j,A,B){for(var O=be.getRSBlocks(j,A),I=new ge,ue=0;ue<B.length;ue++){var ee=B[ue];I.put(ee.mode,4),I.put(ee.getLength(),Me.getLengthInBits(ee.mode,j)),ee.write(I)}for(var P=0,ue=0;ue<O.length;ue++)P+=O[ue].dataCount;if(I.getLengthInBits()>P*8)throw new Error("code length overflow. ("+I.getLengthInBits()+">"+P*8+")");for(I.getLengthInBits()+4<=P*8&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=P*8);){if(I.put(q.PAD0,8),I.getLengthInBits()>=P*8)break;I.put(q.PAD1,8)}return q.createBytes(I,O)},q.createBytes=function(j,A){for(var B=0,O=0,I=0,ue=new Array(A.length),ee=new Array(A.length),P=0;P<A.length;P++){var $=A[P].dataCount,J=A[P].totalCount-$;O=Math.max(O,$),I=Math.max(I,J),ue[P]=new Array($);for(var de=0;de<ue[P].length;de++)ue[P][de]=255&j.buffer[de+B];B+=$;var fe=Me.getErrorCorrectPolynomial(J),je=new pe(ue[P],fe.getLength()-1),Ue=je.mod(fe);ee[P]=new Array(fe.getLength()-1);for(var de=0;de<ee[P].length;de++){var Te=de+Ue.getLength()-ee[P].length;ee[P][de]=Te>=0?Ue.get(Te):0}}for(var ne=0,de=0;de<A.length;de++)ne+=A[de].totalCount;for(var Se=new Array(ne),me=0,de=0;de<O;de++)for(var P=0;P<A.length;P++)de<ue[P].length&&(Se[me++]=ue[P][de]);for(var de=0;de<I;de++)for(var P=0;P<A.length;P++)de<ee[P].length&&(Se[me++]=ee[P][de]);return Se},lt.exports=q},HmJG:function(lt,qe,v){},Iq15:function(lt,qe,v){var z=v("nVVt"),be=v("dWSS"),ge=v("dQei"),Me={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},pe={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(q){for(var D=q<<10;pe.getBCHDigit(D)-pe.getBCHDigit(pe.G15)>=0;)D^=pe.G15<<pe.getBCHDigit(D)-pe.getBCHDigit(pe.G15);return(q<<10|D)^pe.G15_MASK},getBCHTypeNumber:function(q){for(var D=q<<12;pe.getBCHDigit(D)-pe.getBCHDigit(pe.G18)>=0;)D^=pe.G18<<pe.getBCHDigit(D)-pe.getBCHDigit(pe.G18);return q<<12|D},getBCHDigit:function(q){for(var D=0;q!=0;)D++,q>>>=1;return D},getPatternPosition:function(q){return pe.PATTERN_POSITION_TABLE[q-1]},getMask:function(q,D,j){switch(q){case Me.PATTERN000:return(D+j)%2==0;case Me.PATTERN001:return D%2==0;case Me.PATTERN010:return j%3==0;case Me.PATTERN011:return(D+j)%3==0;case Me.PATTERN100:return(Math.floor(D/2)+Math.floor(j/3))%2==0;case Me.PATTERN101:return D*j%2+D*j%3==0;case Me.PATTERN110:return(D*j%2+D*j%3)%2==0;case Me.PATTERN111:return(D*j%3+(D+j)%2)%2==0;default:throw new Error("bad maskPattern:"+q)}},getErrorCorrectPolynomial:function(q){for(var D=new be([1],0),j=0;j<q;j++)D=D.multiply(new be([1,ge.gexp(j)],0));return D},getLengthInBits:function(q,D){if(1<=D&&D<10)switch(q){case z.MODE_NUMBER:return 10;case z.MODE_ALPHA_NUM:return 9;case z.MODE_8BIT_BYTE:return 8;case z.MODE_KANJI:return 8;default:throw new Error("mode:"+q)}else if(D<27)switch(q){case z.MODE_NUMBER:return 12;case z.MODE_ALPHA_NUM:return 11;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 10;default:throw new Error("mode:"+q)}else if(D<41)switch(q){case z.MODE_NUMBER:return 14;case z.MODE_ALPHA_NUM:return 13;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 12;default:throw new Error("mode:"+q)}else throw new Error("type:"+D)},getLostPoint:function(q){for(var D=q.getModuleCount(),j=0,A=0;A<D;A++)for(var B=0;B<D;B++){for(var O=0,I=q.isDark(A,B),ue=-1;ue<=1;ue++){if(A+ue<0||D<=A+ue)continue;for(var ee=-1;ee<=1;ee++){if(B+ee<0||D<=B+ee)continue;if(ue==0&&ee==0)continue;I==q.isDark(A+ue,B+ee)&&O++}}O>5&&(j+=3+O-5)}for(var A=0;A<D-1;A++)for(var B=0;B<D-1;B++){var P=0;q.isDark(A,B)&&P++,q.isDark(A+1,B)&&P++,q.isDark(A,B+1)&&P++,q.isDark(A+1,B+1)&&P++,(P==0||P==4)&&(j+=3)}for(var A=0;A<D;A++)for(var B=0;B<D-6;B++)q.isDark(A,B)&&!q.isDark(A,B+1)&&q.isDark(A,B+2)&&q.isDark(A,B+3)&&q.isDark(A,B+4)&&!q.isDark(A,B+5)&&q.isDark(A,B+6)&&(j+=40);for(var B=0;B<D;B++)for(var A=0;A<D-6;A++)q.isDark(A,B)&&!q.isDark(A+1,B)&&q.isDark(A+2,B)&&q.isDark(A+3,B)&&q.isDark(A+4,B)&&!q.isDark(A+5,B)&&q.isDark(A+6,B)&&(j+=40);for(var $=0,B=0;B<D;B++)for(var A=0;A<D;A++)q.isDark(A,B)&&$++;var J=Math.abs(100*$/D/D-50)/5;return j+=J*10,j}};lt.exports=pe},LdHM:function(lt,qe,v){"use strict";v.d(qe,"b",function(){return je}),v.d(qe,"a",function(){return Te});var z=v("1OyB"),be=v("vuIU"),ge=v("Ji7U"),Me=v("LK+K"),pe=v("q1tI"),q=v("rePB"),D=v("Ff2n"),j=v("ODXe"),A=v("4IlW"),B=v("bX4T"),O=v("YrtM"),I=v("TSYQ"),ue=v.n(I),ee=v("+nKL"),P=v("8OUc"),$=function(N,te){var ve=N.prefixCls,Pe=N.id,Ee=N.flattenOptions,we=N.childrenAsData,H=N.values,x=N.searchValue,F=N.multiple,w=N.defaultActiveFirstOption,_=N.height,g=N.itemHeight,y=N.notFoundContent,S=N.open,W=N.menuItemSelectedIcon,ce=N.virtual,Y=N.onSelect,Ce=N.onToggleOpen,Re=N.onActiveValue,Fe=N.onScroll,Ve=N.onMouseEnter,He="".concat(ve,"-item"),ze=Object(O.a)(function(){return Ee},[S,Ee],function(We,se){return se[0]&&We[1]!==se[1]}),at=pe.useRef(null),xe=function(se){se.preventDefault()},Ie=function(se){at.current&&at.current.scrollTo({index:se})},Be=function(se){for(var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,le=ze.length,E=0;E<le;E+=1){var M=(se+E*Q+le)%le,U=ze[M],X=U.group,ke=U.data;if(!X&&!ke.disabled)return M}return-1},Ke=pe.useState(function(){return Be(0)}),$e=Object(j.a)(Ke,2),Ge=$e[0],_e=$e[1],nt=function(se){_e(se);var Q=ze[se];if(!Q){Re(null,-1);return}Re(Q.data.value,se)};pe.useEffect(function(){nt(w!==!1?Be(0):-1)},[ze.length,x]),pe.useEffect(function(){var We=setTimeout(function(){if(!F&&S&&H.size===1){var se=Array.from(H)[0],Q=ze.findIndex(function(le){var E=le.data;return E.value===se});nt(Q),Ie(Q)}});return function(){return clearTimeout(We)}},[S]);var Qe=function(se){se!==void 0&&Y(se,{selected:!H.has(se)}),F||Ce(!1)};if(pe.useImperativeHandle(te,function(){return{onKeyDown:function(se){var Q=se.which;switch(Q){case A.a.UP:case A.a.DOWN:{var le=0;if(Q===A.a.UP?le=-1:Q===A.a.DOWN&&(le=1),le!==0){var E=Be(Ge+le,le);Ie(E),nt(E)}break}case A.a.ENTER:{var M=ze[Ge];M&&!M.data.disabled?Qe(M.data.value):Qe(void 0),S&&se.preventDefault();break}case A.a.ESC:Ce(!1)}},onKeyUp:function(){},scrollTo:function(se){Ie(se)}}}),ze.length===0)return pe.createElement("div",{role:"listbox",id:"".concat(Pe,"_list"),className:"".concat(He,"-empty"),onMouseDown:xe},y);function Ae(We){var se=ze[We];if(!se)return null;var Q=se.data||{},le=Q.value,E=Q.label,M=Q.children,U=Object(B.a)(Q,!0),X=we?M:E;return se?pe.createElement("div",Object.assign({"aria-label":typeof X=="string"?X:null},U,{key:We,role:"option",id:"".concat(Pe,"_list_").concat(We),"aria-selected":H.has(le)}),le):null}return pe.createElement(pe.Fragment,null,pe.createElement("div",{role:"listbox",id:"".concat(Pe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ae(Ge-1),Ae(Ge),Ae(Ge+1)),pe.createElement(ee.a,{itemKey:"key",ref:at,data:ze,height:_,itemHeight:g,fullHeight:!1,onMouseDown:xe,onScroll:Fe,virtual:ce,onMouseEnter:Ve},function(We,se){var Q,le=We.group,E=We.groupOption,M=We.data,U=M.label,X=M.key;if(le)return pe.createElement("div",{className:ue()(He,"".concat(He,"-group"))},U!==void 0?U:X);var ke=M.disabled,De=M.value,et=M.title,yt=M.children,St=M.style,Je=M.className,bt=Object(D.a)(M,["disabled","value","title","children","style","className"]),mt=H.has(De),rt="".concat(He,"-option"),Dt=ue()(He,rt,Je,(Q={},Object(q.a)(Q,"".concat(rt,"-grouped"),E),Object(q.a)(Q,"".concat(rt,"-active"),Ge===se&&!ke),Object(q.a)(Q,"".concat(rt,"-disabled"),ke),Object(q.a)(Q,"".concat(rt,"-selected"),mt),Q)),Ot=we?yt:U,kt=!W||typeof W=="function"||mt;return pe.createElement("div",Object.assign({},bt,{"aria-selected":mt,className:Dt,title:et,onMouseMove:function(){if(Ge===se||ke)return;nt(se)},onClick:function(){ke||Qe(De)},style:St}),pe.createElement("div",{className:"".concat(rt,"-content")},Ot||De),pe.isValidElement(W)||mt,kt&&pe.createElement(P.a,{className:"".concat(He,"-option-state"),customizeIcon:W,customizeIconProps:{isSelected:mt}},mt?"\u2713":null))}))},J=pe.forwardRef($);J.displayName="OptionList";var de=J,fe=function(){return null};fe.isSelectOption=!0;var je=fe,Ue=function(){return null};Ue.isSelectOptGroup=!0;var Te=Ue,ne=v("VTBJ"),Se=v("Zm9Q");function me(h){var N=h.key,te=h.props,ve=te.children,Pe=te.value,Ee=Object(D.a)(te,["children","value"]);return Object(ne.a)({key:N,value:Pe!==void 0?Pe:N,children:ve},Ee)}function G(h){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Se.a)(h).map(function(te,ve){if(!pe.isValidElement(te)||!te.type)return null;var Pe=te.type.isSelectOptGroup,Ee=te.key,we=te.props,H=we.children,x=Object(D.a)(we,["children"]);return N||!Pe?me(te):Object(ne.a)(Object(ne.a)({key:"__RC_SELECT_GRP__".concat(Ee===null?ve:Ee,"__"),label:Ee},x),{},{options:G(H)})}).filter(function(te){return te})}var he=v("2Qr1"),ie=v("qNPg"),R=v("U8pU"),ye=v("Kwbf"),re=v("WKfj");function k(h){var N=h.mode,te=h.options,ve=h.children,Pe=h.backfill,Ee=h.allowClear,we=h.placeholder,H=h.getInputElement,x=h.showSearch,F=h.onSearch,w=h.defaultOpen,_=h.autoFocus,g=h.labelInValue,y=h.value,S=h.inputValue,W=h.optionLabelProp,ce=N==="multiple"||N==="tags",Y=x!==void 0?x:ce||N==="combobox",Ce=te||G(ve);if(Object(ye.a)(N!=="tags"||Ce.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),N==="tags"||N==="combobox"){var Re=Ce.some(function(He){return He.options?He.options.some(function(ze){return typeof("value"in ze?ze.value:ze.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(ye.a)(!Re,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ye.a)(N!=="combobox"||!W,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ye.a)(N==="combobox"||!Pe,"`backfill` only works with `combobox` mode."),Object(ye.a)(N==="combobox"||!H,"`getInputElement` only work with `combobox` mode."),Object(ye.b)(N!=="combobox"||!H||!Ee||!we,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),F&&!Y&&N!=="combobox"&&N!=="tags"&&Object(ye.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ye.b)(!w||_,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),y!=null){var Fe=Object(re.d)(y);Object(ye.a)(!g||Fe.every(function(He){return Object(R.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ye.a)(!ce||Array.isArray(y),"`value` should be array when `mode` is `multiple` or `tags`")}if(ve){var Ve=null;Object(Se.a)(ve).some(function(He){if(!pe.isValidElement(He)||!He.type)return!1;var ze=He.type;if(ze.isSelectOption)return!1;if(ze.isSelectOptGroup){var at=Object(Se.a)(He.props.children).every(function(xe){return!pe.isValidElement(xe)||!He.type||xe.type.isSelectOption?!0:(Ve=xe.type,!1)});return!at}return Ve=ze,!0}),Ve&&Object(ye.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ve.displayName||Ve.name||Ve,"`.")),Object(ye.a)(S===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var T=k,K=Object(ie.a)({prefixCls:"rc-select",components:{optionList:de},convertChildrenToData:G,flattenOptions:he.d,getLabeledValue:he.e,filterOptions:he.b,isValueDisabled:he.g,findValueOption:he.c,warningProps:T,fillOptionsWithMissingValue:he.a}),L=function(h){Object(ge.a)(te,h);var N=Object(Me.a)(te);function te(){var ve;return Object(z.a)(this,te),ve=N.apply(this,arguments),ve.selectRef=pe.createRef(),ve.focus=function(){ve.selectRef.current.focus()},ve.blur=function(){ve.selectRef.current.blur()},ve}return Object(be.a)(te,[{key:"render",value:function(){return pe.createElement(K,Object.assign({ref:this.selectRef},this.props))}}]),te}(pe.Component);L.Option=je,L.OptGroup=Te;var V=L,p=qe.c=V},M8RZ:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return A});var z=v("fWQN"),be=v("mtLc"),ge=v("yKVA"),Me=v("879j"),pe=v("q1tI"),q=v.n(pe),D=v("i8i4"),j=v.n(D),A=function(B){Object(ge.a)(I,B);var O=Object(Me.a)(I);function I(ue){var ee;Object(z.a)(this,I),ee=O.call(this,ue);var P=window.document;return ee.node=P.createElement("div"),P.body.appendChild(ee.node),ee}return Object(be.a)(I,[{key:"render",value:function(){var ee=this.props.children;return Object(D.createPortal)(ee,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),I}(q.a.Component)},NvD2:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return q});var z=v("Kwbf");function be(D,j){var A=new Set;return D.forEach(function(B){j.has(B)||A.add(B)}),A}function ge(D){var j=D||{},A=j.disabled,B=j.disableCheckbox,O=j.checkable;return!!(A||B)||O===!1}function Me(D,j,A,B){for(var O=new Set(D),I=new Set,ue=0;ue<=A;ue+=1){var ee=j.get(ue)||new Set;ee.forEach(function(de){var fe=de.key,je=de.node,Ue=de.children,Te=Ue===void 0?[]:Ue;O.has(fe)&&!B(je)&&Te.filter(function(ne){return!B(ne.node)}).forEach(function(ne){O.add(ne.key)})})}for(var P=new Set,$=A;$>=0;$-=1){var J=j.get($)||new Set;J.forEach(function(de){var fe=de.parent,je=de.node;if(B(je)||!de.parent||P.has(de.parent.key))return;if(B(de.parent.node)){P.add(fe.key);return}var Ue=!0,Te=!1;(fe.children||[]).filter(function(ne){return!B(ne.node)}).forEach(function(ne){var Se=ne.key,me=O.has(Se);Ue&&!me&&(Ue=!1),!Te&&(me||I.has(Se))&&(Te=!0)}),Ue&&O.add(fe.key),Te&&I.add(fe.key),P.add(fe.key)})}return{checkedKeys:Array.from(O),halfCheckedKeys:Array.from(be(I,O))}}function pe(D,j,A,B,O){for(var I=new Set(D),ue=new Set(j),ee=0;ee<=B;ee+=1){var P=A.get(ee)||new Set;P.forEach(function(fe){var je=fe.key,Ue=fe.node,Te=fe.children,ne=Te===void 0?[]:Te;!I.has(je)&&!ue.has(je)&&!O(Ue)&&ne.filter(function(Se){return!O(Se.node)}).forEach(function(Se){I.delete(Se.key)})})}ue=new Set;for(var $=new Set,J=B;J>=0;J-=1){var de=A.get(J)||new Set;de.forEach(function(fe){var je=fe.parent,Ue=fe.node;if(O(Ue)||!fe.parent||$.has(fe.parent.key))return;if(O(fe.parent.node)){$.add(je.key);return}var Te=!0,ne=!1;(je.children||[]).filter(function(Se){return!O(Se.node)}).forEach(function(Se){var me=Se.key,G=I.has(me);Te&&!G&&(Te=!1),!ne&&(G||ue.has(me))&&(ne=!0)}),Te||I.delete(je.key),ne&&ue.add(je.key),$.add(je.key)})}return{checkedKeys:Array.from(I),halfCheckedKeys:Array.from(be(ue,I))}}function q(D,j,A,B){var O=[],I;B?I=B:I=ge;var ue=new Set(D.filter(function(J){var de=!!A[J];return de||O.push(J),de})),ee=new Map,P=0;Object.keys(A).forEach(function(J){var de=A[J],fe=de.level,je=ee.get(fe);je||(je=new Set,ee.set(fe,je)),je.add(de),P=Math.max(P,fe)}),Object(z.a)(!O.length,"Tree missing follow keys: ".concat(O.slice(0,100).map(function(J){return"'".concat(J,"'")}).join(", ")));var $;return j===!0?$=Me(ue,ee,P,I):$=pe(ue,j.halfCheckedKeys,ee,P,I),$}},OLES:function(lt,qe,v){"use strict";var z=v("U8pU"),be=v("VTBJ"),ge=v("Ff2n"),Me=v("q1tI"),pe=v("uciX"),q=v("7ixt"),D=function(ue){var ee=ue.overlay,P=ue.prefixCls,$=ue.id,J=ue.overlayInnerStyle;return Me.createElement("div",{className:"".concat(P,"-inner"),id:$,role:"tooltip",style:J},typeof ee=="function"?ee():ee)},j=D,A=function(ue,ee){var P=ue.overlayClassName,$=ue.trigger,J=$===void 0?["hover"]:$,de=ue.mouseEnterDelay,fe=de===void 0?0:de,je=ue.mouseLeaveDelay,Ue=je===void 0?.1:je,Te=ue.overlayStyle,ne=ue.prefixCls,Se=ne===void 0?"rc-tooltip":ne,me=ue.children,G=ue.onVisibleChange,he=ue.afterVisibleChange,ie=ue.transitionName,R=ue.animation,ye=ue.placement,re=ye===void 0?"right":ye,k=ue.align,T=k===void 0?{}:k,K=ue.destroyTooltipOnHide,L=K===void 0?!1:K,V=ue.defaultVisible,p=ue.getTooltipContainer,h=ue.overlayInnerStyle,N=Object(ge.a)(ue,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(Me.useRef)(null);Object(Me.useImperativeHandle)(ee,function(){return te.current});var ve=Object(be.a)({},N);"visible"in ue&&(ve.popupVisible=ue.visible);var Pe=function(){var F=ue.arrowContent,w=F===void 0?null:F,_=ue.overlay,g=ue.id;return[Me.createElement("div",{className:"".concat(Se,"-arrow"),key:"arrow"},w),Me.createElement(j,{key:"content",prefixCls:Se,id:g,overlay:_,overlayInnerStyle:h})]},Ee=!1,we=!1;if(typeof L=="boolean")Ee=L;else if(L&&Object(z.a)(L)==="object"){var H=L.keepParent;Ee=H===!0,we=H===!1}return Me.createElement(pe.a,Object.assign({popupClassName:P,prefixCls:Se,popup:Pe,action:J,builtinPlacements:q.a,popupPlacement:re,ref:te,popupAlign:T,getPopupContainer:p,onPopupVisibleChange:G,afterPopupVisibleChange:he,popupTransitionName:ie,popupAnimation:R,defaultPopupVisible:V,destroyPopupOnHide:Ee,autoDestroy:we,mouseLeaveDelay:Ue,popupStyle:Te,mouseEnterDelay:fe},ve),me)},B=Object(Me.forwardRef)(A),O=qe.a=B},OZM5:function(lt,qe,v){"use strict";v.d(qe,"b",function(){return B}),v.d(qe,"a",function(){return O}),v.d(qe,"k",function(){return I}),v.d(qe,"h",function(){return ue}),v.d(qe,"i",function(){return ee}),v.d(qe,"g",function(){return P}),v.d(qe,"c",function(){return $}),v.d(qe,"d",function(){return J}),v.d(qe,"j",function(){return je}),v.d(qe,"e",function(){return Ue}),v.d(qe,"f",function(){return Te});var z=v("KQm4"),be=v("U8pU"),ge=v("Ff2n"),Me=v("q1tI"),pe=v.n(Me),q=v("Kwbf"),D=v("WaYH"),j=.25,A=2;function B(ne,Se){var me=ne.slice(),G=me.indexOf(Se);return G>=0&&me.splice(G,1),me}function O(ne,Se){var me=ne.slice();return me.indexOf(Se)===-1&&me.push(Se),me}function I(ne){return ne.split("-")}function ue(ne,Se){return"".concat(ne,"-").concat(Se)}function ee(ne){return ne&&ne.type&&ne.type.isTreeNode}function P(ne,Se){var me=[ne],G=Se[ne];function he(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];ie.forEach(function(R){var ye=R.key,re=R.children;me.push(ye),he(re)})}return he(G.children),me}function $(ne,Se){var me=ne.clientY,G=Se.selectHandle.getBoundingClientRect(),he=G.top,ie=G.bottom,R=G.height,ye=Math.max(R*j,A);return me<=he+ye?-1:me>=ie-ye?1:0}function J(ne,Se){if(!ne)return;var me=Se.multiple;return me?ne.slice():ne.length?[ne[0]]:ne}var de=function(Se){return Se};function fe(ne,Se){if(!ne)return[];var me=Se||{},G=me.processProps,he=G===void 0?de:G,ie=Array.isArray(ne)?ne:[ne];return ie.map(function(R){var ye=R.children,re=Object(ge.a)(R,["children"]),k=fe(ye,Se);return pe.a.createElement(D.a,Object.assign({},he(re)),k)})}function je(ne){if(!ne)return null;var Se;if(Array.isArray(ne))Se={checkedKeys:ne,halfCheckedKeys:void 0};else if(Object(be.a)(ne)==="object")Se={checkedKeys:ne.checked||void 0,halfCheckedKeys:ne.halfChecked||void 0};else return Object(q.a)(!1,"`checkedKeys` is not an array or an object"),null;return Se}function Ue(ne,Se){var me=new Set;function G(he){if(me.has(he))return;var ie=Se[he];if(!ie)return;me.add(he);var R=ie.parent,ye=ie.node;if(ye.disabled)return;R&&G(R.key)}return(ne||[]).forEach(function(he){G(he)}),Object(z.a)(me)}function Te(ne){var Se={};return Object.keys(ne).forEach(function(me){(me.startsWith("data-")||me.startsWith("aria-"))&&(Se[me]=ne[me])}),Se}},Ot1p:function(lt,qe,v){"use strict";var z=v("2qtc"),be=v("kLXV"),ge=v("rAM+"),Me=v("miYZ"),pe=v("tsqr"),q=v("9og8"),D=v("tJVT"),j=v("jrin"),A=v("WmNS"),B=v.n(A),O=v("q1tI"),I=v.n(O),ue=v("VrN/"),ee=v.n(ue),P=v("bdgK"),$=v("p77/"),J=v("Bd2K"),de=v("ELLl"),fe=v("19Vz"),je=v("lZu9"),Ue=v("+NIl"),Te=v("kSUc"),ne=v("9Bee"),Se=function(Je){var bt=Je.value,mt=bt===void 0?"":bt,rt=Je.className,Dt=Je.showTextOnly,Ot=Je.showLines,kt=Je.style,Et=kt===void 0?{}:kt,xt=Object(O.useMemo)(function(){return""},[mt]);return I.a.createElement(I.a.Fragment,null,I.a.createElement("div",{dangerouslySetInnerHTML:{__html:xt}}))},me=v("Q9mQ"),G=v("diRs"),he=v("0Owb"),ie=v("dejd"),R=v("C+DQ"),ye=v("D1Df"),re=v.n(ye),k=v("1vsH"),T=v("m3rI"),K=[{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 L(Je){var bt=Je.onActionCallback,mt=Je.title,rt=Je.icon,Dt=Je.actionName,Ot=Je.className,kt=Ot===void 0?"":Ot,Et=Je.children;function xt(){bt(Dt)}return I.a.createElement("a",{title:mt,className:kt,onClick:xt},I.a.createElement("i",{className:"md-iconfont ".concat(rt)}),Et)}var V=function(Je){var bt=Je.watch,mt=Je.showNullButton,rt=Je.onActionCallback,Dt=Je.fullScreen,Ot=Je.insertTemp,kt=Je.hidetoolBar,Et=Je.uuid,xt=Je.setOpenPhones,Pt=Object(k.E)("_educoder_session_login"),Ft=Object(k.E)("_educoder_session"),ht=[].concat(K,[{title:"".concat(bt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(bt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return I.a.createElement("ul",{className:"markdown-toolbar-container"},!kt&&ht.map(function(rn,Ut){return I.a.createElement("li",{key:Ut},rn.actionName?I.a.createElement(L,Object(he.a)({},rn,{onActionCallback:rt})):I.a.createElement("span",{className:"v-line"}))}),mt?I.a.createElement("li",null,I.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},I.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ot&&I.a.createElement("li",null,I.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ot),onActionCallback:rt},I.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),I.a.createElement("li",null,I.a.createElement(G.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:I.a.createElement("div",null,I.a.createElement("span",{style:{display:"none"}},location.origin+"/react/build/upload.html?_educoder_session_login="+Pt+"&_educoder_session="+Ft+"&key="+Et+"&api="+encodeURIComponent(T.a.API_SERVER)),I.a.createElement(re.a,{size:150,fgColor:"#000",value:location.origin+"/react/build/upload.html?_educoder_session_login="+Pt+"&_educoder_session="+Ft+"&key="+Et+"&api="+encodeURIComponent(T.a.API_SERVER)}))},I.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return xt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),I.a.createElement("li",{className:"btn-full-screen"},I.a.createElement(L,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},p=v("M8RZ"),h=v("+L6B"),N=v("2/Rp"),te=v("y8nQ"),ve=v("Vl3Y"),Pe=v("5NDa"),Ee=v("5rEg"),we={labelCol:{span:4},wrapperCol:{span:20}},H=function(Je){var bt=Je.callback,mt=Je.onCancel;function rt(Dt){bt(Dt)}return I.a.createElement(ve.a,Object(he.a)({},we,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),I.a.createElement(ve.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},I.a.createElement(Ee.a,null)),I.a.createElement(ve.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},I.a.createElement(Ee.a,null)),I.a.createElement("div",{className:"flex-container flex-end"},I.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),I.a.createElement(N.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},x=v("7ahc"),F=v("k1fw"),w=v("HmJG"),_=v("BjJ7"),g=ve.a.useForm,y={width:280,marginRight:10},S={labelCol:{span:5},wrapperCol:{span:19}},W=function(Je){var bt=Je.callback,mt=Je.onCancel,rt=g(),Dt=Object(D.a)(rt,1),Ot=Dt[0],kt=Object(O.useRef)();function Et(Ft){bt(Object(F.a)(Object(F.a)({},Ft),{},{name:kt.current}))}function xt(Ft,ht){Ot.setFieldsValue({src:"/api/attachments/".concat(Ft.id,"?type=").concat(Ft.content_type),type:ht.type})}function Pt(Ft){var ht=Ft.target.files[0];kt.current=ht.name,Y(ht,xt)}return I.a.createElement(ve.a,Object(he.a)({form:Ot},S,{className:"upload-image-panel",onFinish:Et}),I.a.createElement(ve.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},I.a.createElement("div",{className:"flex-container"},I.a.createElement(ve.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},I.a.createElement(Ee.a,{style:y})),I.a.createElement(ce,{onFileChange:Pt}))),I.a.createElement(ve.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},I.a.createElement(Ee.a,{style:{width:264}})),I.a.createElement(ve.a.Item,{style:{textAlign:"right"}},I.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),I.a.createElement(N.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))};function ce(Je){var bt=Je.onFileChange;return I.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",I.a.createElement("input",{type:"file",onChange:bt}))}function Y(Je,bt){if(!Je)throw new String("\u6CA1\u6709\u6587\u4EF6");var mt=new FormData;mt.append("editormd-image-file",Je),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(Dt){bt(JSON.parse(Dt.target.responseText),Je)},!1),rt.addEventListener("error",function(Dt){console.error(Dt)},!1),rt.open("POST","".concat(_.a,"/api/attachments.json")),rt.send(mt)}var Ce=v("giR+"),Re=v("fyUT"),Fe=v("7Kak"),Ve=v("9yH6"),He=Ve.a.Group,ze={margin:"0 8px"},at=function(Je){var bt=Je.callback,mt=Je.onCancel;function rt(Dt){bt(Dt)}return I.a.createElement(ve.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},I.a.createElement("div",{className:"flex-container"},I.a.createElement("span",{style:ze},"\u5355\u5143\u683C\u6570\uFF1A"),I.a.createElement("span",{style:ze},"\u884C\u6570"),I.a.createElement(ve.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},I.a.createElement(Re.a,null)),I.a.createElement("span",{style:ze},"\u5217\u6570"),I.a.createElement(ve.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},I.a.createElement(Re.a,null))),I.a.createElement("div",{className:"flex-container",style:{marginTop:12}},I.a.createElement("span",{style:ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),I.a.createElement(ve.a.Item,{name:"align"},I.a.createElement(He,null,I.a.createElement(Ve.a,{value:"default"},I.a.createElement("i",{className:"fa fa-align-justify"})),I.a.createElement(Ve.a,{value:"left"},I.a.createElement("i",{className:"fa fa-align-left"})),I.a.createElement(Ve.a,{value:"center"},I.a.createElement("i",{className:"fa fa-align-center"})),I.a.createElement(Ve.a,{value:"right"},I.a.createElement("i",{className:"fa fa-align-right"}))))),I.a.createElement("div",{className:"flex-container flex-end"},I.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),I.a.createElement(N.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},xe=v("ErOA"),Ie=v("7Cbv"),Be="link",Ke="upload-image",$e="code-block",Ge="add-table",_e="------------",nt={default:_e,left:":".concat(_e),center:":".concat(_e,":"),right:"".concat(_e,":")},Qe=v("9VGf"),Ae,We;function se(){}var Q=0,le=1e4,E="\u2581",M=`
|
|
**\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 U(Je){return/^\d+$/.test(Je)?"".concat(Je,"px"):Je}var X=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=X?"Cmd":"Ctrl",De=["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"],et=(Ae={},Object(j.a)(Ae,ke+"-B","bold"),Object(j.a)(Ae,ke+"-I","italic"),Ae),yt=(We={},Object(j.a)(We,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(We,$e,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(We,Ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(We,Ge,"\u6DFB\u52A0\u8868\u683C"),We),St=qe.a=function(Je){var bt=Je.defaultValue,mt=bt===void 0?"":bt,rt=Je.onChange,Dt=Je.width,Ot=Dt===void 0?"100%":Dt,kt=Je.height,Et=kt===void 0?400:kt,xt=Je.miniToolbar,Pt=xt===void 0?!1:xt,Ft=Je.isFocus,ht=Ft===void 0?!1:Ft,rn=Je.watch,Ut=Je.insertTemp,Zt=Je.mode,on=Zt===void 0?"markdown":Zt,qt=Je.id,mn=qt===void 0?"markdown-editor-id":qt,jt=Je.showResizeBar,ft=jt===void 0?!1:jt,an=Je.noStorage,Ln=an===void 0?!1:an,En=Je.showNullButton,It=En===void 0?!1:En,Sn=Je.hidetoolBar,vn=Sn===void 0?!1:Sn,ri=Je.fullScreen,tt=ri===void 0?!1:ri,_t=Je.onBlur,Un=Je.onCMBeforeChange,Pn=Je.onFullScreen,Yn=Je.className,Jn=Yn===void 0?"":Yn,d=Je.disablePaste,o=d===void 0?!1:d,a=Je.placeholder,u=a===void 0?"":a,b=Je.values,c=b===void 0?"":b,oe=Object(O.useState)(null),Ye=Object(D.a)(oe,2),Le=Ye[0],ut=Ye[1],Xe=Object(O.useState)(mt),vt=Object(D.a)(Xe,2),pt=vt[0],Rt=vt[1],dn=Object(O.useState)(rn),en=Object(D.a)(dn,2),Jt=en[0],Cn=en[1],Gn=Object(O.useState)(tt),bn=Object(D.a)(Gn,2),Vt=bn[0],kn=bn[1],Zn=Object(O.useState)(""),yn=Object(D.a)(Zn,2),oi=yn[0],hn=yn[1],Bn=Object(O.useState)(0),Xt=Object(D.a)(Bn,2),wt=Xt[0],st=Xt[1],Mn=Object(O.useState)(Et),tn=Object(D.a)(Mn,2),jn=tn[0],un=tn[1],Ht=Object(O.useState)(!1),Tn=Object(D.a)(Ht,2),Wt=Tn[0],xn=Tn[1],$t=Object(O.useRef)(Object(Ie.a)()),ti=Object(O.useRef)(!1),gn=Object(O.useRef)(),fn=Object(O.useRef)(),ai=Object(O.useRef)(),Qn=Object(O.useRef)(),hi=Object(O.useRef)(),pr=function(){var Tt=Object(q.a)(B.a.mark(function Nt(){var Lt,zt;return B.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Object(xe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:$t.current}});case 2:zt=nn.sent,zt!=null&&(Lt=zt.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Le,fn),zt.attachments.map(function(Gt){Gt.content_type.indexOf("image")>-1?Le.replaceSelection(".concat(Gt.content_type,")")):Gt.content_type.indexOf("video")>-1?Le.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Gt.content_type.indexOf("pdf")>-1?Le.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,'&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):Le.replaceSelection("[".concat(Gt.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}));case 4:case"end":return nn.stop()}},Nt)}));return function(){return Tt.apply(this,arguments)}}();Object(O.useEffect)(function(){Rt(c),Le==null||Le.setValue(c)},[c]),Object(O.useEffect)(function(){Pn==null||Pn(Vt)},[Vt]),Object(O.useEffect)(function(){if(fn.current){var Tt=ee.a.fromTextArea(fn.current,{mode:on,lineNumbers:!Pt,lineWrapping:!0,value:mt,autoCloseTags:!0,autoCloseBrackets:!0});ht&&Tt.focus();function Nt(Lt,zt){if(o){zt.preventDefault();return}var Yt=zt.clipboardData;if(Yt){var nn=Yt.types.toString(),Gt=Yt.items;if(nn==="Files"||Yt.types.indexOf("Files")>-1){if(zt.preventDefault(),on=="stex")return;try{var _n,Hn=Gt[1];((_n=Gt[0])===null||_n===void 0?void 0:_n.kind)==="file"&&(Hn=Gt[0]);var Kt=Hn.getAsFile(),Bi=Kt.name.split(".").pop();Y(Kt,function(sn){if(sn.id){var Xn,cn,bi;(Kt==null||((Xn=Kt.type)===null||Xn===void 0)?void 0:Xn.indexOf("image"))>-1?Tt.replaceSelection(".concat(sn.content_type,")")):(Kt==null||((cn=Kt.type)===null||cn===void 0)?void 0:cn.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,'"></video>')):(Kt==null||((bi=Kt.type)===null||bi===void 0)?void 0:bi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat(Kt.type,'&disposition=inline" target="_blank">').concat(Kt.name,"</a>")):De.includes(Bi)?Tt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,'?type=office&disposition=inline" target="_blank">').concat(Kt.name,"</a>")):Tt.replaceSelection("[".concat(Kt.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat(sn.content_type,")"))}else(sn==null?void 0:sn.status)===401&&(document.location.href="/user/login")})}catch(sn){pe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",Nt),Tt.on("dragleave",function(Lt,zt){ai.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(Lt,zt){ai.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(Lt,zt){ai.current.classList.add("mouse-hover-md");var Yt;if(Yt=zt.dataTransfer.files,Yt.length>0){zt.preventDefault(),zt.stopPropagation();for(var nn=function(Hn){var Kt=Yt[Hn],Bi=Kt.name.split(".").pop();Y(Kt,function(sn){if(sn.id){var Xn,cn,bi;(Kt==null||((Xn=Kt.type)===null||Xn===void 0)?void 0:Xn.indexOf("image"))>-1?Tt.replaceSelection(".concat(sn.content_type,")")):(Kt==null||((cn=Kt.type)===null||cn===void 0)?void 0:cn.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,'"></video>')):(Kt==null||((bi=Kt.type)===null||bi===void 0)?void 0:bi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat(Kt.type,'&disposition=inline" target="_blank">').concat(Kt.name,"</a>")):De.includes(Bi)?Tt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,'?type=office&disposition=inline" target="_blank">').concat(Kt.name,"</a>")):Tt.replaceSelection("[".concat(Kt.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat(sn.content_type,")"))}else(sn==null?void 0:sn.status)===401&&(document.location.href="/user/login")})},Gt=0;Gt<Yt.length;Gt++)nn(Gt)}}),ut(Tt),function(){Tt.off("paste",Nt)}}},[]);var Fn=Object(O.useCallback)(function(){if(ai.current)try{}catch(Tt){console.log(Tt,"---- to set md editor body height")}},[jn,ai,Vt]);Object(O.useEffect)(function(){function Tt(){var Lt=new P.default(function(zt){var Yt=Object(ge.a)(zt),nn;try{for(Yt.s();!(nn=Yt.n()).done;){var Gt=nn.value;(Gt.target.offsetHeight>0||Gt.target.offsetWidth>0)&&(Fn(),Le.setSize("100%","100%"),Le.refresh())}}catch(_n){Yt.e(_n)}finally{Yt.f()}});return Lt.observe(fn.current.parentElement),Lt}if(Le){var Nt=Tt();return function(){Nt.unobserve(fn.current.parentElement)}}},[Le,Fn]),Object(O.useEffect)(function(){if(Le){for(var Tt=[],Nt=function(){var Gt=zt[Lt];Yt=Object(D.a)(Gt,2);var _n=Yt[0],Hn=Yt[1],Kt=Object(j.a)({},_n,function(){ki(Hn)});Tt.push(Kt),Le.addKeyMap(Kt)},Lt=0,zt=Object.entries(et);Lt<zt.length;Lt++){var Yt;Nt()}return gn.current=setInterval(function(){ti.current&&pr()},4e3),function(){clearInterval(gn.current);var nn=Object(ge.a)(Tt),Gt;try{for(nn.s();!(Gt=nn.n()).done;){var _n=Gt.value;Le.removeKeyMap(_n)}}catch(Hn){nn.e(Hn)}finally{nn.f()}}}},[Le]),Object(O.useEffect)(function(){tt!==Vt&&kn(tt)},[tt]),Object(Qe.a)(function(){if(!Ln&&wt>0){var Tt=new Date().getTime(),Nt=window.sessionStorage.getItem(mn);Tt>=wt+le&&(!Nt||Nt!==pt)&&(window.sessionStorage.setItem(mn,pt),xn(!0))}},le),Object(O.useEffect)(function(){Cn(rn)},[Le,rn]),Object(O.useEffect)(function(){Le&&(ht&&Le.focus())},[Le,ht]),Object(O.useEffect)(function(){if(Jt&&Le){var Tt=Le.getScrollerElement();function Nt(Lt){var zt=Lt.target;if(hi.current){var Yt=zt.scrollTop/zt.scrollHeight;hi.current.scrollTop=hi.current.scrollHeight*Yt}}return Tt.addEventListener("scroll",Nt),function(){Tt.removeEventListener("scroll",Nt)}}},[Le,Jt]),Object(O.useEffect)(function(){if(Le&&Un){function Tt(Nt,Lt){Un(Nt,Lt)}return Le.on("beforeChange",Tt),function(){Le.off("beforeChange",Tt)}}},[Le,Un]),Object(O.useEffect)(function(){if(Le&&_t){function Tt(){_t(Le.getValue())}return Le.on("blur",Tt),function(){Le.off("blur",Tt)}}},[Le,_t]),Object(O.useEffect)(function(){if(Le){function Tt(Nt){var Lt=Nt.getValue();Rt(Lt),st(new Date().getTime()),Nt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(Lt)}return Le.on("change",Tt),function(){Le.off("change",Tt)}}},[Le,rt]),Object(O.useEffect)(function(){Le&&(mt==null?(Le.setValue(""),Rt("")):mt!==Le.getValue()&&(Le.setValue(mt),Rt(mt),Le.setCursor(Le.lineCount(),0)))},[Le,mt]);var ki=Object(O.useCallback)(function(Tt){var Nt=Le.getCursor(),Lt=Le.getSelection(),zt=Lt.split(`
|
|
`);switch(Tt){case"bold":return Le.replaceSelection("**"+Lt+"**"),Lt===""&&Le.setCursor(Nt.line,Nt.ch+2),Le.focus();case"italic":return Le.replaceSelection("*"+Lt+"*"),Lt===""&&Le.setCursor(Nt.line,Nt.ch+1),Le.focus();case"code":return Le.replaceSelection("`"+Lt+"`"),Lt===""&&Le.setCursor(Nt.line,Nt.ch+1),Le.focus();case"inline-latex":return Le.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&Le.setCursor(Nt.line,Nt.ch+3),Le.focus();case"latex":return Le.replaceSelection("```latex\n"+Lt+"\n```"),Le.setCursor(Nt.line+1,Lt.length+1),Le.focus();case"line-break":return Le.replaceSelection(`<br/>
|
|
`),Le.focus();case"list-ul":return Lt===""?Le.replaceSelection("- "+Lt):Le.replaceSelection(zt.map(function(Yt){return Yt===""?"":"- ".concat(Yt)}).join(`
|
|
`)),Le.focus();case"list-ol":return Lt===""?Le.replaceSelection("1. "+Lt):Le.replaceSelection(zt.map(function(Yt,nn){return Yt===""?"":"".concat(nn+1,". ").concat(Yt)}).join(`
|
|
`)),Le.focus();case"add-null-ch":return Lt===""&&Le.setCursor(Nt.line,Nt.ch+1),Le.replaceSelection(E),Le.focus();case"inster-template-1":return Lt===""&&Le.setCursor(Nt.line,Nt.ch),Le.replaceSelection(M),Le.focus();case"eraser":return Le.setValue(""),Le.focus();case"trigger-watch":return Cn(!Jt),Le.focus();case"trigger-full-screen":return kn(!Vt),Le.focus();case Be:hn(Be);return;case $e:hn($e);return;case Ke:hn(Ke);return;case Ge:hn(Ge);return;default:throw new Error}},[Le,Jt,Vt]),fi=Object(O.useCallback)(function(Tt){hn("");switch(oi){case Be:var Nt=Tt.title,Lt=Tt.link;return Le.replaceSelection("[".concat(Nt,"](").concat(Lt,")")),Le.focus();case $e:var zt=Tt.language,Yt=Tt.content;return Le.replaceSelection(["```"+zt,Yt,"```"].join(`
|
|
`)),Le.focus();case Ke:var nn=Tt.src,Gt=Tt.alt,_n=Tt.name;return nn.indexOf("type=image")>-1?Le.replaceSelection(".concat(nn,' "').concat(Gt||"",'" )')):nn.indexOf("type=application/pdf")>-1?Le.replaceSelection('<a href="'.concat(nn,'&disposition=inline" target="_blank">').concat(_n,"</a>")):Le.replaceSelection('<a href="'.concat(nn,'" target="_blank">').concat(_n,"</a>")),Le.focus();case Ge:for(var Hn=Tt.row,Kt=Tt.col,Bi=Tt.align,sn=`
|
|
`,Xn=0;Xn<Hn;Xn++){for(var cn=[],bi=[],mr=0;mr<Kt;mr++)Xn===1&&bi.push(nt[Bi]),cn.push(" ");Xn===1&&(sn+="| ".concat(bi.join(" | "),` |
|
|
`)),sn+="| ".concat(cn.join(Kt===1?"":" | "),` |
|
|
`)}return Le.replaceSelection(sn+`
|
|
`),Le.focus();default:throw new Error}},[Le,oi]),Ji=Object(O.useMemo)(function(){switch(oi){case Be:return I.a.createElement(H,{callback:fi,onCancel:Ti});case $e:return I.a.createElement(x.b,{callback:fi,onCancel:Ti});case Ke:return I.a.createElement(W,{callback:fi,onCancel:Ti});case Ge:return I.a.createElement(at,{callback:fi,onCancel:Ti});default:return null}},[oi]);function Ti(){hn("")}Object(O.useEffect)(function(){if(Qn.current){var Tt=Qn.current,Nt=!1,Lt=0;function zt(Gt){Nt=!0,Lt=Gt.pageY}function Yt(){Nt=!1}function nn(Gt){if(Nt){var _n=Gt.pageY-Lt;_n<0&&(_n=0),_n>300&&(_n=300);var Hn=Et+_n+"px";un(Hn)}}return Tt.addEventListener("mousedown",zt),document.addEventListener("mousemove",nn),document.addEventListener("mouseup",Yt),function(){Tt.removeEventListener("mousedown",zt),document.removeEventListener("mousemove",nn),document.removeEventListener("mouseup",Yt)}}},[Le,Qn]),Object(O.useEffect)(function(){un(Et)},[Et]);var Li=U(Ot),uo=U(jn),co={width:Li,height:uo},Zo=Object(O.useMemo)(function(){if(wt){var Tt=new Date(wt),Nt=Tt.getHours(),Lt=Tt.getMinutes(),zt=Tt.getSeconds();return Nt=Nt<10?"0"+Nt:Nt,Lt=Lt<10?"0"+Lt:Lt,zt=zt<10?"0"+zt:zt,"".concat(Nt,":").concat(Lt,":").concat(zt)}return 0},[wt]);function Qo(){window.sessionStorage.removeItem(mn),xn(!1),st(0)}function ho(){xn(!1),st(0),Le.setValue(window.sessionStorage.getItem(mn))}function Fr(Tt,Nt){var Lt=Le.getValue();Lt=Lt.replace(Tt,Nt),Rt(Lt),Le==null||Le.setValue(Lt)}return I.a.createElement(O.Fragment,null,I.a.createElement("div",{className:"markdown-editor-wrapper",ref:ai},I.a.createElement("div",{className:"markdown-editor-container ".concat(Jn," ").concat(Jt?"on-preview":""," ").concat(Pt?"mini":""," ").concat(Vt?"full-screen":""),style:co},I.a.createElement(V,{insertTemp:Ut,watch:Jt,fullScreen:Vt,showNullButton:It,onActionCallback:ki,hidetoolBar:vn,uuid:$t.current,setOpenPhones:function(){ti.current=!0}}),I.a.createElement("div",{className:"markdown-editor-body"},I.a.createElement("div",{className:"codemirror-container"},I.a.createElement("textarea",{ref:fn,placeholder:u})),Jt?I.a.createElement("div",{ref:hi,className:"preview-container"},on==="stex"&&I.a.createElement(Se,{value:pt}),on!=="stex"&&I.a.createElement(ne.a,{edit:!0,value:pt,replaces:Fr})):null))),ft?I.a.createElement("a",{ref:Qn,className:"editor-resize"}):null,I.a.createElement(p.a,null,yt[oi]?I.a.createElement(be.a,{centered:!0,title:yt[oi],visible:!0,onCancel:Ti,footer:null},Ji):null))}},RxwV:function(lt,qe,v){"use strict";var z=v("q1tI"),be=v("uciX"),ge=v("2W6z"),Me=v.n(ge),pe=v("4IlW"),q=v("uK0f"),D=v.n(q);function j(x,F){if(x===F)return!0;if(!x||!F)return!1;var w=x.length;if(F.length!==w)return!1;for(var _=0;_<w;_++)if(x[_]!==F[_])return!1;return!0}function A(x){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(w){return typeof w}:A=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},A(x)}function B(x,F){if(!(x instanceof F))throw new TypeError("Cannot call a class as a function")}function O(x,F){for(var w=0;w<F.length;w++){var _=F[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function I(x,F,w){return F&&O(x.prototype,F),w&&O(x,w),x}function ue(x,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(F&&F.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),F&&ee(x,F)}function ee(x,F){return ee=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},ee(x,F)}function P(x){var F=de();return function(){var w=fe(x),_;if(F){var g=fe(this).constructor;_=Reflect.construct(w,arguments,g)}else _=w.apply(this,arguments);return $(this,_)}}function $(x,F){return F&&(A(F)==="object"||typeof F=="function")?F:J(x)}function J(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function de(){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(x){return!1}}function fe(x){return fe=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},fe(x)}var je=function(){var x=function(F){ue(_,F);var w=P(_);function _(){var g;return B(this,_),g=w.apply(this,arguments),g.menuItems={},g.saveMenuItem=function(y){return function(S){g.menuItems[y]=S}},g}return I(_,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(y){!y.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(y){var S=this.props,W=S.fieldNames,ce=S.defaultFieldNames;return W[y]||ce[y]}},{key:"getOption",value:function(y,S){var W=this.props,ce=W.prefixCls,Y=W.expandTrigger,Ce=W.expandIcon,Re=W.loadingIcon,Fe=this.props.onSelect.bind(this,y,S),Ve=this.props.onItemDoubleClick.bind(this,y,S),He={onClick:Fe,onDoubleClick:Ve},ze="".concat(ce,"-menu-item"),at=null,xe=y[this.getFieldName("children")]&&y[this.getFieldName("children")].length>0;(xe||y.isLeaf===!1)&&(ze+=" ".concat(ce,"-menu-item-expand"),y.loading||(at=z.createElement("span",{className:"".concat(ce,"-menu-item-expand-icon")},Ce))),Y==="hover"&&(xe||y.isLeaf===!1)&&(He={onMouseEnter:this.delayOnSelect.bind(this,Fe),onMouseLeave:this.delayOnSelect.bind(this),onClick:Fe}),this.isActiveOption(y,S)&&(ze+=" ".concat(ce,"-menu-item-active"),He.ref=this.saveMenuItem(S)),y.disabled&&(ze+=" ".concat(ce,"-menu-item-disabled"));var Ie=null;y.loading&&(ze+=" ".concat(ce,"-menu-item-loading"),Ie=Re||null);var Be="";return"title"in y?Be=y.title:typeof y[this.getFieldName("label")]=="string"&&(Be=y[this.getFieldName("label")]),z.createElement("li",Object.assign({key:y[this.getFieldName("value")],className:ze,title:Be},He,{role:"menuitem",onMouseDown:function($e){return $e.preventDefault()}}),y[this.getFieldName("label")],at,Ie)}},{key:"getActiveOptions",value:function(y){var S=this,W=this.props.options,ce=y||this.props.activeValue;return D()(W,function(Y,Ce){return Y[S.getFieldName("value")]===ce[Ce]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var y=this,S=this.props.options,W=this.getActiveOptions().map(function(ce){return ce[y.getFieldName("children")]}).filter(function(ce){return!!ce});return W.unshift(S),W}},{key:"delayOnSelect",value:function(y){for(var S=this,W=arguments.length,ce=new Array(W>1?W-1:0),Y=1;Y<W;Y++)ce[Y-1]=arguments[Y];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof y=="function"&&(this.delayTimer=window.setTimeout(function(){y(ce),S.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var y=this.getShowOptions().length,S=0;S<y;S++){var W=this.menuItems[S];W&&W.parentElement&&(W.parentElement.scrollTop=W.offsetTop)}}},{key:"isActiveOption",value:function(y,S){var W=this.props.activeValue,ce=W===void 0?[]:W;return ce[S]===y[this.getFieldName("value")]}},{key:"render",value:function(){var y=this,S=this.props,W=S.prefixCls,ce=S.dropdownMenuColumnStyle;return z.createElement("div",null,this.getShowOptions().map(function(Y,Ce){return z.createElement("ul",{className:"".concat(W,"-menu"),key:Ce,style:ce},Y.map(function(Re){return y.getOption(Re,Ce)}))}))}}]),_}(z.Component);return x.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},x}(),Ue=je,Te={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},ne=Te;function Se(x){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Se=function(w){return typeof w}:Se=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},Se(x)}function me(x,F){if(x==null)return{};var w=G(x,F),_,g;if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);for(g=0;g<y.length;g++){if(_=y[g],F.indexOf(_)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(x,_))continue;w[_]=x[_]}}return w}function G(x,F){if(x==null)return{};var w={},_=Object.keys(x),g,y;for(y=0;y<_.length;y++){if(g=_[y],F.indexOf(g)>=0)continue;w[g]=x[g]}return w}function he(x){return re(x)||ye(x)||R(x)||ie()}function ie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(x,F){if(!x)return;if(typeof x=="string")return k(x,F);var w=Object.prototype.toString.call(x).slice(8,-1);if(w==="Object"&&x.constructor&&(w=x.constructor.name),w==="Map"||w==="Set")return Array.from(x);if(w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w))return k(x,F)}function ye(x){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(x))return Array.from(x)}function re(x){if(Array.isArray(x))return k(x)}function k(x,F){(F==null||F>x.length)&&(F=x.length);for(var w=0,_=new Array(F);w<F;w++)_[w]=x[w];return _}function T(x,F){if(!(x instanceof F))throw new TypeError("Cannot call a class as a function")}function K(x,F){for(var w=0;w<F.length;w++){var _=F[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function L(x,F,w){return F&&K(x.prototype,F),w&&K(x,w),x}function V(x,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(F&&F.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),F&&p(x,F)}function p(x,F){return p=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},p(x,F)}function h(x){var F=ve();return function(){var w=Pe(x),_;if(F){var g=Pe(this).constructor;_=Reflect.construct(w,arguments,g)}else _=w.apply(this,arguments);return N(this,_)}}function N(x,F){return F&&(Se(F)==="object"||typeof F=="function")?F:te(x)}function te(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function ve(){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(x){return!1}}function Pe(x){return Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},Pe(x)}var Ee=function(){var x=function(F){V(_,F);var w=h(_);function _(g){var y;T(this,_),y=w.call(this,g),y.setPopupVisible=function(W){var ce=y.state.value;"popupVisible"in y.props||y.setState({popupVisible:W}),W&&!y.state.popupVisible&&y.setState({activeValue:ce}),y.props.onPopupVisibleChange(W)},y.handleChange=function(W,ce,Y){var Ce=ce.visible;(Y.type!=="keydown"||Y.keyCode===pe.a.ENTER)&&(y.props.onChange(W.map(function(Re){return Re[y.getFieldName("value")]}),W),y.setPopupVisible(Ce))},y.handlePopupVisibleChange=function(W){y.setPopupVisible(W)},y.handleMenuSelect=function(W,ce,Y){var Ce=y.trigger.getRootDomNode();Ce&&Ce.focus&&Ce.focus();var Re=y.props,Fe=Re.changeOnSelect,Ve=Re.loadData,He=Re.expandTrigger;if(!W||W.disabled)return;var ze=y.state.activeValue;ze=ze.slice(0,ce+1),ze[ce]=W[y.getFieldName("value")];var at=y.getActiveOptions(ze);if(W.isLeaf===!1&&!W[y.getFieldName("children")]&&Ve){Fe&&y.handleChange(at,{visible:!0},Y),y.setState({activeValue:ze}),Ve(at);return}var xe={};!W[y.getFieldName("children")]||!W[y.getFieldName("children")].length?(y.handleChange(at,{visible:!1},Y),xe.value=ze):Fe&&(Y.type==="click"||Y.type==="keydown")&&(He==="hover"?y.handleChange(at,{visible:!1},Y):y.handleChange(at,{visible:!0},Y),xe.value=ze),xe.activeValue=ze,("value"in y.props||Y.type==="keydown"&&Y.keyCode!==pe.a.ENTER)&&delete xe.value,y.setState(xe)},y.handleItemDoubleClick=function(){var W=y.props.changeOnSelect;W&&y.setPopupVisible(!1)},y.handleKeyDown=function(W){var ce=y.props.children;if(ce&&ce.props.onKeyDown){ce.props.onKeyDown(W);return}var Y=he(y.state.activeValue),Ce=Y.length-1<0?0:Y.length-1,Re=y.getCurrentLevelOptions(),Fe=Re.map(function(at){return at[y.getFieldName("value")]}).indexOf(Y[Ce]);if(W.keyCode!==pe.a.DOWN&&W.keyCode!==pe.a.UP&&W.keyCode!==pe.a.LEFT&&W.keyCode!==pe.a.RIGHT&&W.keyCode!==pe.a.ENTER&&W.keyCode!==pe.a.SPACE&&W.keyCode!==pe.a.BACKSPACE&&W.keyCode!==pe.a.ESC&&W.keyCode!==pe.a.TAB)return;if(!y.state.popupVisible&&W.keyCode!==pe.a.BACKSPACE&&W.keyCode!==pe.a.LEFT&&W.keyCode!==pe.a.RIGHT&&W.keyCode!==pe.a.ESC&&W.keyCode!==pe.a.TAB){y.setPopupVisible(!0);return}if(W.keyCode===pe.a.DOWN||W.keyCode===pe.a.UP){W.preventDefault();var Ve=Fe;Ve!==-1?W.keyCode===pe.a.DOWN?(Ve+=1,Ve=Ve>=Re.length?0:Ve):(Ve-=1,Ve=Ve<0?Re.length-1:Ve):Ve=0,Y[Ce]=Re[Ve][y.getFieldName("value")]}else if(W.keyCode===pe.a.LEFT||W.keyCode===pe.a.BACKSPACE)W.preventDefault(),Y.splice(Y.length-1,1);else if(W.keyCode===pe.a.RIGHT)W.preventDefault(),Re[Fe]&&Re[Fe][y.getFieldName("children")]&&Y.push(Re[Fe][y.getFieldName("children")][0][y.getFieldName("value")]);else if(W.keyCode===pe.a.ESC||W.keyCode===pe.a.TAB){y.setPopupVisible(!1);return}(!Y||Y.length===0)&&y.setPopupVisible(!1);var He=y.getActiveOptions(Y),ze=He[He.length-1];y.handleMenuSelect(ze,He.length-1,W),y.props.onKeyDown&&y.props.onKeyDown(W)},y.saveTrigger=function(W){y.trigger=W};var S=[];return"value"in g?S=g.value||[]:"defaultValue"in g&&(S=g.defaultValue||[]),Me()(!("filedNames"in g),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),y.state={popupVisible:g.popupVisible,activeValue:S,value:S,prevProps:g},y.defaultFieldNames={label:"label",value:"value",children:"children"},y}return L(_,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(y){var S=this.defaultFieldNames,W=this.props,ce=W.fieldNames,Y=W.filedNames;return"filedNames"in this.props?Y[y]||S[y]:ce[y]||S[y]}},{key:"getFieldNames",value:function(){var y=this.props,S=y.fieldNames,W=y.filedNames;return"filedNames"in this.props?W:S}},{key:"getCurrentLevelOptions",value:function(){var y=this,S=this.props.options,W=S===void 0?[]:S,ce=this.state.activeValue,Y=ce===void 0?[]:ce,Ce=D()(W,function(Re,Fe){return Re[y.getFieldName("value")]===Y[Fe]},{childrenKeyName:this.getFieldName("children")});return Ce[Ce.length-2]?Ce[Ce.length-2][this.getFieldName("children")]:he(W).filter(function(Re){return!Re.disabled})}},{key:"getActiveOptions",value:function(y){var S=this;return D()(this.props.options||[],function(W,ce){return W[S.getFieldName("value")]===y[ce]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var y=this.props,S=y.prefixCls,W=y.transitionName,ce=y.popupClassName,Y=y.options,Ce=Y===void 0?[]:Y,Re=y.disabled,Fe=y.builtinPlacements,Ve=y.popupPlacement,He=y.children,ze=y.dropdownRender,at=me(y,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),xe=z.createElement("div",null),Ie="";Ce&&Ce.length>0?xe=z.createElement(Ue,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Ie=" ".concat(S,"-menus-empty");var Be=xe;return ze&&(Be=ze(xe)),z.createElement(be.a,Object.assign({ref:this.saveTrigger},at,{popupPlacement:Ve,builtinPlacements:Fe,popupTransitionName:W,action:Re?[]:["click"],popupVisible:Re?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(S,"-menus"),popupClassName:ce+Ie,popup:Be}),z.cloneElement(He,{onKeyDown:this.handleKeyDown,tabIndex:Re?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(y,S){var W=S.prevProps,ce=W===void 0?{}:W,Y={prevProps:y};return"value"in y&&!j(ce.value,y.value)&&(Y.value=y.value||[],"loadData"in y||(Y.activeValue=y.value||[])),"popupVisible"in y&&(Y.popupVisible=y.popupVisible),Y}}]),_}(z.Component);return x.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:ne,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},x}(),we=Ee,H=qe.a=we},SJMd:function(lt,qe){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var v,z,be,ge=!1,Me,pe;window.PR_SHOULD_USE_CONTINUATION=!0;var q,D;(function(){var j=window,A=["break,continue,do,else,for,if,return,while"],B=[A,"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"],O=[B,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],I=[O,"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"],ue=[O,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],ee=[O,"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"],P="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",$=[O,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],J="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",de=[A,"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"],fe=[A,"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"],je=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ue=[I,ee,ue,$,J,de,fe,je],Te=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ne="str",Se="kwd",me="com",G="typ",he="lit",ie="pun",R="pln",ye="tag",re="dec",k="src",T="atn",K="atv",L="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(Y){for(var Ce=0,Re=!1,Fe=!1,Ve=0,He=Y.length;Ve<He;++Ve){var ze=Y[Ve];if(ze.ignoreCase)Fe=!0;else if(/[a-z]/i.test(ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Re=!0,Fe=!1;break}}var at={b:8,t:9,n:10,v:11,f:12,r:13};function xe(Ge){var _e=Ge.charCodeAt(0);if(_e!==92)return _e;var nt=Ge.charAt(1);return _e=at[nt],_e||("0"<=nt&&nt<="7"?parseInt(Ge.substring(1),8):nt==="u"||nt==="x"?parseInt(Ge.substring(2),16):Ge.charCodeAt(1))}function Ie(Ge){if(Ge<32)return(Ge<16?"\\x0":"\\x")+Ge.toString(16);var _e=String.fromCharCode(Ge);return _e==="\\"||_e==="-"||_e==="]"||_e==="^"?"\\"+_e:_e}function Be(Ge){var _e=Ge.substring(1,Ge.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")),nt=[],Qe=_e[0]==="^",Ae=["["];Qe&&Ae.push("^");for(var We=Qe?1:0,se=_e.length;We<se;++We){var Q=_e[We];if(/\\[bdsw]/i.test(Q))Ae.push(Q);else{var le=xe(Q),E;We+2<se&&_e[We+1]==="-"?(E=xe(_e[We+2]),We+=2):E=le,nt.push([le,E]),E<65||le>122||(E<65||le>90||nt.push([Math.max(65,le)|32,Math.min(E,90)|32]),E<97||le>122||nt.push([Math.max(97,le)&~32,Math.min(E,122)&~32]))}}nt.sort(function(ke,De){return ke[0]-De[0]||De[1]-ke[1]});for(var M=[],U=[],We=0;We<nt.length;++We){var X=nt[We];X[0]<=U[1]+1?U[1]=Math.max(U[1],X[1]):M.push(U=X)}for(var We=0;We<M.length;++We){var X=M[We];Ae.push(Ie(X[0])),X[1]>X[0]&&(X[1]+1>X[0]&&Ae.push("-"),Ae.push(Ie(X[1])))}return Ae.push("]"),Ae.join("")}function Ke(Ge){for(var _e=Ge.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),nt=_e.length,Qe=[],Ae=0,We=0;Ae<nt;++Ae){var se=_e[Ae];if(se==="(")++We;else if(se.charAt(0)==="\\"){var Q=+se.substring(1);Q&&(Q<=We?Qe[Q]=-1:_e[Ae]=Ie(Q))}}for(var Ae=1;Ae<Qe.length;++Ae)Qe[Ae]===-1&&(Qe[Ae]=++Ce);for(var Ae=0,We=0;Ae<nt;++Ae){var se=_e[Ae];if(se==="(")++We,Qe[We]||(_e[Ae]="(?:");else if(se.charAt(0)==="\\"){var Q=+se.substring(1);Q&&Q<=We&&(_e[Ae]="\\"+Qe[Q])}}for(var Ae=0;Ae<nt;++Ae)_e[Ae]==="^"&&_e[Ae+1]!=="^"&&(_e[Ae]="");if(Ge.ignoreCase&&Re)for(var Ae=0;Ae<nt;++Ae){var se=_e[Ae],le=se.charAt(0);se.length>=2&&le==="["?_e[Ae]=Be(se):le!=="\\"&&(_e[Ae]=se.replace(/[a-zA-Z]/g,function(U){var X=U.charCodeAt(0);return"["+String.fromCharCode(X&~32,X|32)+"]"}))}return _e.join("")}for(var $e=[],Ve=0,He=Y.length;Ve<He;++Ve){var ze=Y[Ve];if(ze.global||ze.multiline)throw new Error(""+ze);$e.push("(?:"+Ke(ze)+")")}return new RegExp($e.join("|"),Fe?"gi":"g")}function h(Y,Ce){var Re=/(?:^|\s)nocode(?:\s|$)/,Fe=[],Ve=0,He=[],ze=0;function at(xe){var Ie=xe.nodeType;if(Ie==1){if(Re.test(xe.className))return;for(var Be=xe.firstChild;Be;Be=Be.nextSibling)at(Be);var Ke=xe.nodeName.toLowerCase();(Ke==="br"||Ke==="li")&&(Fe[ze]=`
|
|
`,He[ze<<1]=Ve++,He[ze++<<1|1]=xe)}else if(Ie==3||Ie==4){var $e=xe.nodeValue;$e.length&&(Ce?$e=$e.replace(/\r\n?/g,`
|
|
`):$e=$e.replace(/[ \t\r\n]+/g," "),Fe[ze]=$e,He[ze<<1]=Ve,Ve+=$e.length,He[ze++<<1|1]=xe)}}return at(Y),{sourceCode:Fe.join("").replace(/\n$/,""),spans:He}}function N(Y,Ce,Re,Fe,Ve){if(!Re)return;var He={sourceNode:Y,pre:1,langExtension:null,numberLines:null,sourceCode:Re,spans:null,basePos:Ce,decorations:null};Fe(He),Ve.push.apply(Ve,He.decorations)}var te=/\S/;function ve(Y){for(var Ce=void 0,Re=Y.firstChild;Re;Re=Re.nextSibling){var Fe=Re.nodeType;Ce=Fe===1?Ce?Y:Re:Fe===3&&te.test(Re.nodeValue)?Y:Ce}return Ce===Y?void 0:Ce}function Pe(Y,Ce){var Re={},Fe;(function(){for(var ze=Y.concat(Ce),at=[],xe={},Ie=0,Be=ze.length;Ie<Be;++Ie){var Ke=ze[Ie],$e=Ke[3];if($e)for(var Ge=$e.length;--Ge>=0;)Re[$e.charAt(Ge)]=Ke;var _e=Ke[1],nt=""+_e;xe.hasOwnProperty(nt)||(at.push(_e),xe[nt]=null)}at.push(/[\0-\uffff]/),Fe=p(at)})();var Ve=Ce.length,He=function(ze){for(var at=ze.sourceCode,xe=ze.basePos,Ie=ze.sourceNode,Be=[xe,R],Ke=0,$e=at.match(Fe)||[],Ge={},_e=0,nt=$e.length;_e<nt;++_e){var Qe=$e[_e],Ae=Ge[Qe],We=void 0,se;if(typeof Ae=="string")se=!1;else{var Q=Re[Qe.charAt(0)];if(Q)We=Qe.match(Q[1]),Ae=Q[0];else{for(var le=0;le<Ve;++le)if(Q=Ce[le],We=Qe.match(Q[1]),We){Ae=Q[0];break}We||(Ae=R)}se=Ae.length>=5&&Ae.substring(0,5)==="lang-",se&&!(We&&typeof We[1]=="string")&&(se=!1,Ae=k),se||(Ge[Qe]=Ae)}var E=Ke;if(Ke+=Qe.length,!se)Be.push(xe+E,Ae);else{var M=We[1],U=Qe.indexOf(M),X=U+M.length;We[2]&&(X=Qe.length-We[2].length,U=X-M.length);var ke=Ae.substring(5);N(Ie,xe+E,Qe.substring(0,U),He,Be),N(Ie,xe+E+U,M,_(ke,M),Be),N(Ie,xe+E+X,Qe.substring(X),He,Be)}}ze.decorations=Be};return He}function Ee(Y){var Ce=[],Re=[];Y.tripleQuotedStrings?Ce.push([ne,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Y.multiLineStrings?Ce.push([ne,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ce.push([ne,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Y.verbatimStrings&&Re.push([ne,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Fe=Y.hashComments;Fe&&(Y.cStyleComments?(Fe>1?Ce.push([me,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ce.push([me,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Re.push([ne,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ce.push([me,/^#[^\r\n]*/,null,"#"])),Y.cStyleComments&&(Re.push([me,/^\/\/[^\r\n]*/,null]),Re.push([me,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ve=Y.regexLiterals;if(Ve){var He=Ve>1?"":`
|
|
\r`,ze=He?".":"[\\S\\s]",at="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+ze+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+ze+")*(?:\\x5D|$))+/";Re.push(["lang-regex",RegExp("^"+V+"("+at+")")])}var xe=Y.types;xe&&Re.push([G,xe]);var Ie=(""+Y.keywords).replace(/^ | $/g,"");Ie.length&&Re.push([Se,new RegExp("^(?:"+Ie.replace(/[\s,]+/g,"|")+")\\b"),null]),Ce.push([R,/^\s+/,null,` \r
|
|
\xA0`]);var Be="^.[^\\s\\w.$@'\"`/\\\\]*";return Y.regexLiterals&&(Be+="(?!s*/)"),Re.push([he,/^@[a-z_$][a-z_$@0-9]*/i,null],[G,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[R,/^[a-z_$][a-z_$@0-9]*/i,null],[he,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[R,/^\\[\s\S]?/,null],[ie,new RegExp(Be),null]),Pe(Ce,Re)}var we=Ee({keywords:Ue,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function H(Y,Ce,Re){for(var Fe=/(?:^|\s)nocode(?:\s|$)/,Ve=/\r\n?|\n/,He=Y.ownerDocument,ze=He.createElement("li");Y.firstChild;)ze.appendChild(Y.firstChild);var at=[ze];function xe(_e){var nt=_e.nodeType;if(nt==1&&!Fe.test(_e.className))if(_e.nodeName==="br")Ie(_e),_e.parentNode&&_e.parentNode.removeChild(_e);else for(var Qe=_e.firstChild;Qe;Qe=Qe.nextSibling)xe(Qe);else if((nt==3||nt==4)&&Re){var Ae=_e.nodeValue,We=Ae.match(Ve);if(We){var se=Ae.substring(0,We.index);_e.nodeValue=se;var Q=Ae.substring(We.index+We[0].length);if(Q){var le=_e.parentNode;le.insertBefore(He.createTextNode(Q),_e.nextSibling)}Ie(_e),se||_e.parentNode.removeChild(_e)}}}function Ie(_e){for(;!_e.nextSibling;)if(_e=_e.parentNode,!_e)return;function nt(We,se){var Q=se?We.cloneNode(!1):We,le=We.parentNode;if(le){var E=nt(le,1),M=We.nextSibling;E.appendChild(Q);for(var U=M;U;U=M)M=U.nextSibling,E.appendChild(U)}return Q}for(var Qe=nt(_e.nextSibling,0),Ae;(Ae=Qe.parentNode)&&Ae.nodeType===1;)Qe=Ae;at.push(Qe)}for(var Be=0;Be<at.length;++Be)xe(at[Be]);Ce===(Ce|0)&&at[0].setAttribute("value",Ce);var Ke=He.createElement("ol");Ke.className="linenums";for(var $e=Math.max(0,Ce-1|0)||0,Be=0,Ge=at.length;Be<Ge;++Be)ze=at[Be],ze.className="L"+(Be+$e)%10,ze.firstChild||ze.appendChild(He.createTextNode("\xA0")),Ke.appendChild(ze);Y.appendChild(Ke)}function x(Y){var Ce=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ce=Ce&&+Ce[1]<=8;var Re=/\n/g,Fe=Y.sourceCode,Ve=Fe.length,He=0,ze=Y.spans,at=ze.length,xe=0,Ie=Y.decorations,Be=Ie.length,Ke=0;Ie[Be]=Ve;var $e,Ge;for(Ge=$e=0;Ge<Be;)Ie[Ge]!==Ie[Ge+2]?(Ie[$e++]=Ie[Ge++],Ie[$e++]=Ie[Ge++]):Ge+=2;for(Be=$e,Ge=$e=0;Ge<Be;){for(var _e=Ie[Ge],nt=Ie[Ge+1],Qe=Ge+2;Qe+2<=Be&&Ie[Qe+1]===nt;)Qe+=2;Ie[$e++]=_e,Ie[$e++]=nt,Ge=Qe}Be=Ie.length=$e;var Ae=Y.sourceNode,We="";Ae&&(We=Ae.style.display,Ae.style.display="none");try{for(var se=null;xe<at;){var Q=ze[xe],le=ze[xe+2]||Ve,E=Ie[Ke+2]||Ve,Qe=Math.min(le,E),M=ze[xe+1],U;if(M.nodeType!==1&&(U=Fe.substring(He,Qe))){Ce&&(U=U.replace(Re,"\r")),M.nodeValue=U;var X=M.ownerDocument,ke=X.createElement("span");ke.className=Ie[Ke+1];var De=M.parentNode;De.replaceChild(ke,M),ke.appendChild(M),He<le&&(ze[xe+1]=M=X.createTextNode(Fe.substring(Qe,le)),De.insertBefore(M,ke.nextSibling))}He=Qe,He>=le&&(xe+=2),He>=E&&(Ke+=2)}}finally{Ae&&(Ae.style.display=We)}}var F={};function w(Y,Ce){for(var Re=Ce.length;--Re>=0;){var Fe=Ce[Re];F.hasOwnProperty(Fe)?j.console&&console.warn("cannot override language handler %s",Fe):F[Fe]=Y}}function _(Y,Ce){return Y&&F.hasOwnProperty(Y)||(Y=/^\s*</.test(Ce)?"default-markup":"default-code"),F[Y]}w(we,["default-code"]),w(Pe([],[[R,/^[^<?]+/],[re,/^<!\w[^>]*(?:>|$)/],[me,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ie,/^(?:<[%?]|[%?]>)/],["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"]),w(Pe([[R,/^[\s]+/,null,` \r
|
|
`],[K,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ye,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[T,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ie,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),w(Pe([],[[K,/^[\s\S]+/]]),["uq.val"]),w(Ee({keywords:I,hashComments:!0,cStyleComments:!0,types:Te}),["c","cc","cpp","cxx","cyc","m"]),w(Ee({keywords:"null,true,false"}),["json"]),w(Ee({keywords:ee,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Te}),["cs"]),w(Ee({keywords:ue,cStyleComments:!0}),["java"]),w(Ee({keywords:je,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),w(Ee({keywords:de,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),w(Ee({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),w(Ee({keywords:fe,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),w(Ee({keywords:$,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),w(Ee({keywords:P,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),w(Pe([],[[ne,/^[\s\S]+/]]),["regex"]);function g(Y){var Ce=Y.langExtension;try{var Re=h(Y.sourceNode,Y.pre),Fe=Re.sourceCode;Y.sourceCode=Fe,Y.spans=Re.spans,Y.basePos=0,_(Ce,Fe)(Y),x(Y)}catch(Ve){j.console&&console.log(Ve&&Ve.stack||Ve)}}function y(Y,Ce,Re){var Fe=Re||!1,Ve=Ce||null,He=document.createElement("div");He.innerHTML="<pre>"+Y+"</pre>",He=He.firstChild,Fe&&H(He,Fe,!0);var ze={langExtension:Ve,numberLines:Fe,sourceNode:He,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return g(ze),He.innerHTML}function S(Y,Ce){var Re=Ce||document.body,Fe=Re.ownerDocument||document;function Ve(Q){return Re.getElementsByTagName(Q)}for(var He=[Ve("pre"),Ve("code"),Ve("xmp")],ze=[],at=0;at<He.length;++at)for(var xe=0,Ie=He[at].length;xe<Ie;++xe)ze.push(He[at][xe]);He=null;var Be=Date;Be.now||(Be={now:function(){return+new Date}});var Ke=0,$e=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ge=/\bprettyprint\b/,_e=/\bprettyprinted\b/,nt=/pre|xmp/i,Qe=/^code$/i,Ae=/^(?:pre|code|xmp)$/i,We={};function se(){for(var Q=j.PR_SHOULD_USE_CONTINUATION?Be.now()+250:Infinity;Ke<ze.length&&Be.now()<Q;Ke++){for(var le=ze[Ke],E=We,M=le;M=M.previousSibling;){var U=M.nodeType,X=(U===7||U===8)&&M.nodeValue;if(X?!/^\??prettify\b/.test(X):U!==3||/\S/.test(M.nodeValue))break;if(X){E={},X.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Et,xt,Pt){E[xt]=Pt});break}}var ke=le.className;if((E!==We||Ge.test(ke))&&!_e.test(ke)){for(var De=!1,et=le.parentNode;et;et=et.parentNode){var yt=et.tagName;if(Ae.test(yt)&&et.className&&Ge.test(et.className)){De=!0;break}}if(!De){le.className+=" prettyprinted";var St=E.lang;if(!St){St=ke.match($e);var Je;!St&&(Je=ve(le))&&Qe.test(Je.tagName)&&(St=Je.className.match($e)),St&&(St=St[1])}var bt;if(nt.test(le.tagName))bt=1;else{var mt=le.currentStyle,rt=Fe.defaultView,Dt=mt?mt.whiteSpace:rt&&rt.getComputedStyle?rt.getComputedStyle(le,null).getPropertyValue("white-space"):0;bt=Dt&&Dt.substring(0,3)==="pre"}var Ot=E.linenums;(Ot=Ot==="true"||+Ot)||(Ot=ke.match(/\blinenums\b(?::(\d+))?/),Ot=Ot?Ot[1]&&Ot[1].length?+Ot[1]:!0:!1),Ot&&H(le,Ot,bt);var kt={langExtension:St,sourceNode:le,numberLines:Ot,pre:bt,sourceCode:null,basePos:null,spans:null,decorations:null};g(kt)}}}Ke<ze.length?j.setTimeout(se,250):typeof Y=="function"&&Y()}se()}var W=j.PR={createSimpleLexer:Pe,registerLangHandler:w,sourceDecorator:Ee,PR_ATTRIB_NAME:T,PR_ATTRIB_VALUE:K,PR_COMMENT:me,PR_DECLARATION:re,PR_KEYWORD:Se,PR_LITERAL:he,PR_NOCODE:L,PR_PLAIN:R,PR_PUNCTUATION:ie,PR_SOURCE:k,PR_STRING:ne,PR_TAG:ye,PR_TYPE:G,prettyPrintOne:ge?j.prettyPrintOne=y:q=y,prettyPrint:D=ge?j.prettyPrint=S:D=S},ce=j.define;typeof ce=="function"&&ce.amd&&ce("google-code-prettify",[],function(){return W})})()},"VrN/":function(lt,qe,v){(function(z,be){lt.exports=be()})(this,function(){"use strict";var z=navigator.userAgent,be=navigator.platform,ge=/gecko\/\d/i.test(z),Me=/MSIE \d/.test(z),pe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(z),q=/Edge\/(\d+)/.exec(z),D=Me||pe||q,j=D&&(Me?document.documentMode||6:+(q||pe)[1]),A=!q&&/WebKit\//.test(z),B=A&&/Qt\/\d+\.\d+/.test(z),O=!q&&/Chrome\//.test(z),I=/Opera\//.test(z),ue=/Apple Computer/.test(navigator.vendor),ee=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(z),P=/PhantomJS/.test(z),$=!q&&/AppleWebKit/.test(z)&&/Mobile\/\w+/.test(z),J=/Android/.test(z),de=$||J||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(z),fe=$||/Mac/.test(be),je=/\bCrOS\b/.test(z),Ue=/win/i.test(be),Te=I&&z.match(/Version\/(\d*\.\d*)/);Te&&(Te=Number(Te[1])),Te&&Te>=15&&(I=!1,A=!0);var ne=fe&&(B||I&&(Te==null||Te<12.11)),Se=ge||D&&j>=9;function me(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var G=function(e,t){var i=e.className,n=me(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function he(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ie(e,t){return he(e).appendChild(t)}function R(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function ye(e,t,i,n){var r=R(e,t,i,n);return r.setAttribute("role","presentation"),r}var re;document.createRange?re=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:re=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function 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 T(){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 K(e,t){var i=e.className;me(t).test(i)||(e.className+=(i?" ":"")+t)}function L(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!me(i[n]).test(t)&&(t+=" "+i[n]);return t}var V=function(e){e.select()};$?V=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(V=function(e){try{e.select()}catch(t){}});function p(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function h(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function N(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ve(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Pe=50,Ee={toString:function(){return"CodeMirror.Pass"}},we={scroll:!1},H={origin:"*mouse"},x={origin:"+move"};function F(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var w=[""];function _(e){for(;w.length<=e;)w.push(g(w)+" ");return w[e]}function g(e){return e[e.length-1]}function y(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function S(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function W(){}function ce(e,t){var i;return Object.create?i=Object.create(e):(W.prototype=e,i=new W),t&&h(t,i),i}var Y=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ce(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Y.test(e))}function Re(e,t){return t?t.source.indexOf("\\w")>-1&&Ce(e)?!0:t.test(e):Ce(e)}function Fe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ve=/[\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 He(e){return e.charCodeAt(0)>=768&&Ve.test(e)}function ze(e,t,i){for(;(i<0?t>0:t<e.length)&&He(e.charAt(t));)t+=i;return t}function at(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function xe(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var Ie=null;function Be(e,t,i){var n;Ie=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:Ie=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:Ie=r)}return n!=null?n:Ie}var Ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(C){return C<=247?e.charAt(C):1424<=C&&C<=1524?"R":1536<=C&&C<=1785?t.charAt(C-1536):1774<=C&&C<=2220?"r":8192<=C&&C<=8203?"w":C==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(C,Z,ae){this.level=C,this.from=Z,this.to=ae}return function(C,Z){var ae=Z=="ltr"?"L":"R";if(C.length==0||Z=="ltr"&&!n.test(C))return!1;for(var Ne=C.length,Oe=[],Ze=0;Ze<Ne;++Ze)Oe.push(i(C.charCodeAt(Ze)));for(var it=0,ot=ae;it<Ne;++it){var ct=Oe[it];ct=="m"?Oe[it]=ot:ot=ct}for(var gt=0,dt=ae;gt<Ne;++gt){var Ct=Oe[gt];Ct=="1"&&dt=="r"?Oe[gt]="n":s.test(Ct)&&(dt=Ct,Ct=="r"&&(Oe[gt]="R"))}for(var Mt=1,At=Oe[0];Mt<Ne-1;++Mt){var Bt=Oe[Mt];Bt=="+"&&At=="1"&&Oe[Mt+1]=="1"?Oe[Mt]="1":Bt==","&&At==Oe[Mt+1]&&(At=="1"||At=="n")&&(Oe[Mt]=At),At=Bt}for(var pn=0;pn<Ne;++pn){var Kn=Oe[pn];if(Kn==",")Oe[pn]="N";else if(Kn=="%"){var On=void 0;for(On=pn+1;On<Ne&&Oe[On]=="%";++On);for(var mi=pn&&Oe[pn-1]=="!"||On<Ne&&Oe[On]=="1"?"1":"N",ui=pn;ui<On;++ui)Oe[ui]=mi;pn=On-1}}for(var Rn=0,ci=ae;Rn<Ne;++Rn){var $n=Oe[Rn];ci=="L"&&$n=="1"?Oe[Rn]="L":s.test($n)&&(ci=$n)}for(var In=0;In<Ne;++In)if(r.test(Oe[In])){var Nn=void 0;for(Nn=In+1;Nn<Ne&&r.test(Oe[Nn]);++Nn);for(var An=(In?Oe[In-1]:ae)=="L",di=(Nn<Ne?Oe[Nn]:ae)=="L",hr=An==di?An?"L":"R":ae,Ui=In;Ui<Nn;++Ui)Oe[Ui]=hr;In=Nn-1}for(var ei=[],Si,Vn=0;Vn<Ne;)if(l.test(Oe[Vn])){var Yo=Vn;for(++Vn;Vn<Ne&&l.test(Oe[Vn]);++Vn);ei.push(new m(0,Yo,Vn))}else{var Ai=Vn,$i=ei.length,Yi=Z=="rtl"?1:0;for(++Vn;Vn<Ne&&Oe[Vn]!="L";++Vn);for(var ii=Ai;ii<Vn;)if(f.test(Oe[ii])){Ai<ii&&(ei.splice($i,0,new m(1,Ai,ii)),$i+=Yi);var fr=ii;for(++ii;ii<Vn&&f.test(Oe[ii]);++ii);ei.splice($i,0,new m(2,fr,ii)),$i+=Yi,Ai=ii}else++ii;Ai<Vn&&ei.splice($i,0,new m(1,Ai,Vn))}return Z=="ltr"&&(ei[0].level==1&&(Si=C.match(/^\s+/))&&(ei[0].from=Si[0].length,ei.unshift(new m(0,0,Si[0].length))),g(ei).level==1&&(Si=C.match(/\s+$/))&&(g(ei).to-=Si[0].length,ei.push(new m(0,Ne-Si[0].length,Ne)))),Z=="rtl"?ei.reverse():ei}}();function $e(e,t){var i=e.order;return i==null&&(i=e.order=Ke(e.text,t)),i}var Ge=[],_e=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Ge).concat(i)}};function nt(e,t){return e._handlers&&e._handlers[t]||Ge}function Qe(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=ve(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Ae(e,t){var i=nt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,i||t.type,e,t),U(t)||t.codemirrorIgnore}function se(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ve(i,t[n])==-1&&i.push(t[n])}function Q(e,t){return nt(e,t).length>0}function le(e){e.prototype.on=function(t,i){_e(this,t,i)},e.prototype.off=function(t,i){Qe(this,t,i)}}function E(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function M(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function U(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function X(e){E(e),M(e)}function ke(e){return e.target||e.srcElement}function De(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),fe&&e.ctrlKey&&t==1&&(t=3),t}var et=function(){if(D&&j<9)return!1;var e=R("div");return"draggable"in e||"dragDrop"in e}(),yt;function St(e){if(yt==null){var t=R("span","\u200B");ie(e,R("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(D&&j<8))}var i=yt?R("span","\u200B"):R("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Je;function bt(e){if(Je!=null)return Je;var t=ie(e,document.createTextNode("A\u062EA")),i=re(t,0,1).getBoundingClientRect(),n=re(t,1,2).getBoundingClientRect();return he(e),!i||i.left==i.right?!1:Je=n.right-i.right<3}var mt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
|
|
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},rt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Dt=function(){var e=R("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ot=null;function kt(e){if(Ot!=null)return Ot;var t=ie(e,R("span","x")),i=t.getBoundingClientRect(),n=re(t,0,1).getBoundingClientRect();return Ot=Math.abs(i.left-n.left)>1}var Et={},xt={};function Pt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Et[e]=t}function Ft(e,t){xt[e]=t}function ht(e){if(typeof e=="string"&&xt.hasOwnProperty(e))e=xt[e];else if(e&&typeof e.name=="string"&&xt.hasOwnProperty(e.name)){var t=xt[e.name];typeof t=="string"&&(t={name:t}),e=ce(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ht("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ht("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function rn(e,t){t=ht(t);var i=Et[t.name];if(!i)return rn(e,"text/plain");var n=i(e,t);if(Ut.hasOwnProperty(t.name)){var r=Ut[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Ut={};function Zt(e,t){var i=Ut.hasOwnProperty(e)?Ut[e]:Ut[e]={};h(t,i)}function on(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function qt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function mn(e,t,i){return e.startState?e.startState(t,i):!0}var jt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};jt.prototype.eol=function(){return this.pos>=this.string.length},jt.prototype.sol=function(){return this.pos==this.lineStart},jt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},jt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},jt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},jt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},jt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},jt.prototype.skipToEnd=function(){this.pos=this.string.length},jt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},jt.prototype.backUp=function(e){this.pos-=e},jt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=N(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?N(this.string,this.lineStart,this.tabSize):0)},jt.prototype.indentation=function(){return N(this.string,null,this.tabSize)-(this.lineStart?N(this.string,this.lineStart,this.tabSize):0)},jt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},jt.prototype.current=function(){return this.string.slice(this.start,this.pos)},jt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},jt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},jt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ft(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function an(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function Ln(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function En(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function It(e){if(e.parent==null)return null;for(var t=e.parent,i=ve(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Sn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var f=e.lines[l],m=f.height;if(t<m)break;t-=m}return i+l}function vn(e,t){return t>=e.first&&t<e.first+e.size}function ri(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,i){if(i===void 0&&(i=null),!(this instanceof tt))return new tt(e,t,i);this.line=e,this.ch=t,this.sticky=i}function _t(e,t){return e.line-t.line||e.ch-t.ch}function Un(e,t){return e.sticky==t.sticky&&_t(e,t)==0}function Pn(e){return tt(e.line,e.ch)}function Yn(e,t){return _t(e,t)<0?t:e}function Jn(e,t){return _t(e,t)<0?e:t}function d(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 tt(e.first,0);var i=e.first+e.size-1;return t.line>i?tt(i,ft(e,i).text.length):a(t,ft(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?tt(e.line,t):i<0?tt(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var b=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.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}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof b?new c(e,on(e.mode,t.state),i,t.lookAhead):new c(e,on(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?on(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new b(t,this.maxLookAhead):t};function oe(e,t,i,n){var r=[e.state.modeGen],s={};en(e,t.text,e.doc.mode,i,function(C,Z){return r.push(C,Z)},s,n);for(var l=i.state,f=function(C){i.baseTokens=r;var Z=e.state.overlays[C],ae=1,Ne=0;i.state=!0,en(e,t.text,Z.mode,i,function(Oe,Ze){for(var it=ae;Ne<Oe;){var ot=r[ae];ot>Oe&&r.splice(ae,1,Oe,r[ae+1],ot),ae+=2,Ne=Math.min(Oe,ot)}if(!Ze)return;if(Z.opaque)r.splice(it,ae-it,Oe,"overlay "+Ze),ae=it+2;else for(;it<ae;it+=2){var ct=r[it+1];r[it+1]=(ct?ct+" ":"")+"overlay "+Ze}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)f(m);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ye(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Le(e,It(t)),r=t.text.length>e.options.maxHighlightLength&&on(e.doc.mode,n.state),s=oe(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Le(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=Jt(e,t,i),l=s>n.first&&ft(n,s-1).stateAfter,f=l?c.fromSaved(n,l,s):new c(n,mn(n.mode),s);return n.iter(s,t,function(m){ut(e,m.text,f);var C=f.line;m.stateAfter=C==t-1||C%5==0||C>=r.viewFrom&&C<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function ut(e,t,i,n){var r=e.doc.mode,s=new jt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Xe(r,i.state);!s.eol();)vt(r,s,i.state),s.start=s.pos}function Xe(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=qt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function vt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=qt(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var pt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Rt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ft(r,t.line),m=Le(e,t.line,i),C=new jt(f.text,e.options.tabSize,m),Z;for(n&&(Z=[]);(n||C.pos<t.ch)&&!C.eol();)C.start=C.pos,l=vt(s,C,m.state),n&&Z.push(new pt(C,l,on(r.mode,m.state)));return n?Z:new pt(C,l,m.state)}function dn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function en(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var m=0,C=null,Z=new jt(t,e.options.tabSize,n),ae,Ne=e.options.addModeClass&&[null];for(t==""&&dn(Xe(i,n.state),s);!Z.eol();){if(Z.pos>e.options.maxHighlightLength?(f=!1,l&&ut(e,t,n,Z.pos),Z.pos=t.length,ae=null):ae=dn(vt(i,Z,n.state,Ne),s),Ne){var Oe=Ne[0].name;Oe&&(ae="m-"+(ae?Oe+" "+ae:Oe))}if(!f||C!=ae){for(;m<Z.start;)m=Math.min(Z.start,m+5e3),r(m,C);C=ae}Z.start=Z.pos}for(;m<Z.pos;){var Ze=Math.min(Z.pos,m+5e3);r(Ze,C),m=Ze}}function Jt(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var m=ft(s,f-1),C=m.stateAfter;if(C&&(!i||f+(C instanceof b?C.lookAhead:0)<=s.modeFrontier))return f;var Z=N(m.text,null,e.options.tabSize);(r==null||n>Z)&&(r=f-1,n=Z)}return r}function Cn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var r=ft(e,n).stateAfter;if(r&&(!(r instanceof b)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Gn=!1,bn=!1;function Vt(){Gn=!0}function kn(){bn=!0}function Zn(e,t,i){this.marker=e,this.from=t,this.to=i}function yn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function oi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function hn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Bn(e,t,i){var n;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"&&(!i||!s.marker.insertLeft)){var m=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new Zn(l,s.from,m?null:s.to))}}return n}function Xt(e,t,i){var n;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"&&(!i||s.marker.insertLeft)){var m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new Zn(l,m?null:s.from-t,s.to==null?null:s.to-t))}}return n}function wt(e,t){if(t.full)return null;var i=vn(e,t.from.line)&&ft(e,t.from.line).markedSpans,n=vn(e,t.to.line)&&ft(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=_t(t.from,t.to)==0,f=Bn(i,r,l),m=Xt(n,s,l),C=t.text.length==1,Z=g(t.text).length+(C?r:0);if(f)for(var ae=0;ae<f.length;++ae){var Ne=f[ae];if(Ne.to==null){var Oe=yn(m,Ne.marker);Oe?C&&(Ne.to=Oe.to==null?null:Oe.to+Z):Ne.to=r}}if(m)for(var Ze=0;Ze<m.length;++Ze){var it=m[Ze];if(it.to!=null&&(it.to+=Z),it.from==null){var ot=yn(f,it.marker);ot||(it.from=Z,C&&(f||(f=[])).push(it))}else it.from+=Z,C&&(f||(f=[])).push(it)}f&&(f=st(f)),m&&m!=f&&(m=st(m));var ct=[f];if(!C){var gt=t.text.length-2,dt;if(gt>0&&f)for(var Ct=0;Ct<f.length;++Ct)f[Ct].to==null&&(dt||(dt=[])).push(new Zn(f[Ct].marker,null,null));for(var Mt=0;Mt<gt;++Mt)ct.push(dt);ct.push(m)}return ct}function st(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mn(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Oe){if(Oe.markedSpans)for(var Ze=0;Ze<Oe.markedSpans.length;++Ze){var it=Oe.markedSpans[Ze].marker;it.readOnly&&(!n||ve(n,it)==-1)&&(n||(n=[])).push(it)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),m=0;m<r.length;++m){var C=r[m];if(_t(C.to,f.from)<0||_t(C.from,f.to)>0)continue;var Z=[m,1],ae=_t(C.from,f.from),Ne=_t(C.to,f.to);(ae<0||!l.inclusiveLeft&&!ae)&&Z.push({from:C.from,to:f.from}),(Ne>0||!l.inclusiveRight&&!Ne)&&Z.push({from:f.to,to:C.to}),r.splice.apply(r,Z),m+=Z.length-3}return r}function tn(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function jn(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function un(e){return e.inclusiveLeft?-1:0}function Ht(e){return e.inclusiveRight?1:0}function Tn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=_t(n.from,r.from)||un(e)-un(t);if(s)return-s;var l=_t(n.to,r.to)||Ht(e)-Ht(t);return l||t.id-e.id}function Wt(e,t){var i=bn&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||Tn(n,r.marker)<0)&&(n=r.marker);return n}function xn(e){return Wt(e,!0)}function $t(e){return Wt(e,!1)}function ti(e,t){var i=bn&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||Tn(n,s.marker)<0)&&(n=s.marker)}return n}function gn(e,t,i,n,r){var s=ft(e,t),l=bn&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var m=l[f];if(!m.marker.collapsed)continue;var C=m.marker.find(0),Z=_t(C.from,i)||un(m.marker)-un(r),ae=_t(C.to,n)||Ht(m.marker)-Ht(r);if(Z>=0&&ae<=0||Z<=0&&ae>=0)continue;if(Z<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?_t(C.to,i)>=0:_t(C.to,i)>0)||Z>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?_t(C.from,n)<=0:_t(C.from,n)<0))return!0}}function fn(e){for(var t;t=xn(e);)e=t.find(-1,!0).line;return e}function ai(e){for(var t;t=$t(e);)e=t.find(1,!0).line;return e}function Qn(e){for(var t,i;t=$t(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function hi(e,t){var i=ft(e,t),n=fn(i);return i==n?t:It(n)}function pr(e,t){if(t>e.lastLine())return t;var i=ft(e,t),n;if(!Fn(e,i))return t;for(;n=$t(i);)i=n.find(1,!0).line;return It(i)+1}function Fn(e,t){var i=bn&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&ki(e,t,n))return!0}}function ki(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return ki(e,n.line,yn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&ki(e,t,r))return!0}function fi(e){e=fn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var f=s.children[l];if(f==i)break;t+=f.height}return t}function Ji(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=xn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=$t(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function Ti(e){var t=e.display,i=e.doc;t.maxLine=ft(i,i.first),t.maxLineLength=Ji(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Ji(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Li=function(e,t,i){this.text=e,jn(this,t),this.height=i?i(this):1};Li.prototype.lineNo=function(){return It(this)},le(Li);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),tn(e),jn(e,i);var r=n?n(e):1;r!=e.height&&En(e,r)}function co(e){e.parent=null,tn(e)}var Zo={},Qo={};function ho(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=ye("span",null,null,A?"padding-right: .1px":null),n={pre:ye("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=Nt,bt(e.display.measure)&&(l=$e(s,e.doc.direction))&&(n.addToken=zt(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&It(s);nn(s,n,Ye(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=L(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=L(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(St(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(A){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=L(n.pre.className,n.textClass||"")),n}function Tt(e){var t=R("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?Lt(t,e.trailingSpace):t,m=e.cm.state.specialChars,C=!1,Z;if(!m.test(t))e.col+=t.length,Z=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,Z),D&&j<9&&(C=!0),e.pos+=t.length;else{Z=document.createDocumentFragment();for(var ae=0;;){m.lastIndex=ae;var Ne=m.exec(t),Oe=Ne?Ne.index-ae:t.length-ae;if(Oe){var Ze=document.createTextNode(f.slice(ae,ae+Oe));D&&j<9?Z.appendChild(R("span",[Ze])):Z.appendChild(Ze),e.map.push(e.pos,e.pos+Oe,Ze),e.col+=Oe,e.pos+=Oe}if(!Ne)break;ae+=Oe+1;var it=void 0;if(Ne[0]==" "){var ot=e.cm.options.tabSize,ct=ot-e.col%ot;it=Z.appendChild(R("span",_(ct),"cm-tab")),it.setAttribute("role","presentation"),it.setAttribute("cm-text"," "),e.col+=ct}else Ne[0]=="\r"||Ne[0]==`
|
|
`?(it=Z.appendChild(R("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",Ne[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(Ne[0]),it.setAttribute("cm-text",Ne[0]),D&&j<9?Z.appendChild(R("span",[it])):Z.appendChild(it),e.col+=1);e.map.push(e.pos,e.pos+1,it),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||C||s||l){var gt=i||"";n&&(gt+=n),r&&(gt+=r);var dt=R("span",[Z],gt,s);if(l)for(var Ct in l)l.hasOwnProperty(Ct)&&Ct!="style"&&Ct!="class"&&dt.setAttribute(Ct,l[Ct]);return e.content.appendChild(dt)}e.content.appendChild(Z)}function Lt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function zt(e,t){return function(i,n,r,s,l,f,m){r=r?r+" cm-force-border":"cm-force-border";for(var C=i.pos,Z=C+n.length;;){for(var ae=void 0,Ne=0;Ne<t.length&&!(ae=t[Ne],ae.to>C&&ae.from<=C);Ne++);if(ae.to>=Z)return e(i,n,r,s,l,f,m);e(i,n.slice(0,ae.to-C),r,s,null,f,m),s=null,n=n.slice(ae.to-C),C=ae.to}}}function Yt(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),ho(i[l+1],t.cm.options));return}for(var f=r.length,m=0,C=1,Z="",ae,Ne,Oe=0,Ze,it,ot,ct,gt;;){if(Oe==m){Ze=it=ot=Ne="",gt=null,ct=null,Oe=Infinity;for(var dt=[],Ct=void 0,Mt=0;Mt<n.length;++Mt){var At=n[Mt],Bt=At.marker;if(Bt.type=="bookmark"&&At.from==m&&Bt.widgetNode)dt.push(Bt);else if(At.from<=m&&(At.to==null||At.to>m||Bt.collapsed&&At.to==m&&At.from==m)){if(At.to!=null&&At.to!=m&&Oe>At.to&&(Oe=At.to,it=""),Bt.className&&(Ze+=" "+Bt.className),Bt.css&&(Ne=(Ne?Ne+";":"")+Bt.css),Bt.startStyle&&At.from==m&&(ot+=" "+Bt.startStyle),Bt.endStyle&&At.to==Oe&&(Ct||(Ct=[])).push(Bt.endStyle,At.to),Bt.title&&((gt||(gt={})).title=Bt.title),Bt.attributes)for(var pn in Bt.attributes)(gt||(gt={}))[pn]=Bt.attributes[pn];Bt.collapsed&&(!ct||Tn(ct.marker,Bt)<0)&&(ct=At)}else At.from>m&&Oe>At.from&&(Oe=At.from)}if(Ct)for(var Kn=0;Kn<Ct.length;Kn+=2)Ct[Kn+1]==Oe&&(it+=" "+Ct[Kn]);if(!ct||ct.from==m)for(var On=0;On<dt.length;++On)Yt(t,0,dt[On]);if(ct&&(ct.from||0)==m){if(Yt(t,(ct.to==null?f+1:ct.to)-m,ct.marker,ct.from==null),ct.to==null)return;ct.to==m&&(ct=!1)}}if(m>=f)break;for(var mi=Math.min(f,Oe);;){if(Z){var ui=m+Z.length;if(!ct){var Rn=ui>mi?Z.slice(0,mi-m):Z;t.addToken(t,Rn,ae?ae+Ze:Ze,ot,m+Rn.length==Oe?it:"",Ne,gt)}if(ui>=mi){Z=Z.slice(mi-m),m=mi;break}m=ui,ot=""}Z=r.slice(s,s=i[C++]),ae=ho(i[C++],t.cm.options)}}}function Gt(e,t,i){this.line=t,this.rest=Qn(t),this.size=this.rest?It(g(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Fn(e,t)}function _n(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Gt(e.doc,ft(e.doc,s),s);r=s+l.size,n.push(l)}return n}var Hn=null;function Kt(e){Hn?Hn.ops.push(e):e.ownsGroup=Hn={ops:[e],delayedCallbacks:[]}}function Bi(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function sn(e,t){var i=e.ownsGroup;if(!i)return;try{Bi(i)}finally{Hn=null,t(i)}}var Xn=null;function cn(e,t){var i=nt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;Hn?r=Hn.delayedCallbacks:Xn?r=Xn:(r=Xn=[],setTimeout(bi,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function bi(){var e=Xn;Xn=null;for(var t=0;t<e.length;++t)e[t]()}function mr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ns(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ps(e,t,n)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=R("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),D&&j<8&&(e.node.style.zIndex=2)),e.node}function Rs(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=gr(t);t.background=n.insertBefore(R("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Fr(e,t)}function Ns(e,t){var i=t.text.className,n=qo(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Rs(e,t),t.line.wrapClass?gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ea(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=gr(t);t.gutterBackground=R("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=gr(t),f=t.gutter=R("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.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(R("div",ri(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var m=0;m<e.display.gutterSpecs.length;++m){var C=e.display.gutterSpecs[m].className,Z=s.hasOwnProperty(C)&&s[C];Z&&f.appendChild(R("div",[Z],"CodeMirror-gutter-elt","left: "+n.gutterLeft[C]+"px; width: "+n.gutterWidth[C]+"px"))}}}function Ps(e,t,i){t.alignable&&(t.alignable=null);for(var n=me("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ta(e,t,i)}function js(e,t,i,n){var r=qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),fo(e,t),ea(e,t,i,n),ta(e,t,n),t.node}function ta(e,t,i){if(na(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)na(e,t.rest[n],t,i,!1)}function na(e,t,i,n,r){if(!t.widgets)return;for(var s=gr(i),l=0,f=t.widgets;l<f.length;++l){var m=f[l],C=R("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||C.setAttribute("cm-ignore-events","true"),Is(m,C,i,n),e.display.input.setUneditable(C),r&&m.above?s.insertBefore(C,i.gutter||i.text):s.appendChild(C),cn(m,"redraw")}}function Is(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!k(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),ie(t.display.measure,R("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function _i(e,t){for(var i=ke(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ie(e.measure,R("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function wi(e){return Pe-e.display.nativeBarWidth}function Fi(e){return e.display.scroller.clientWidth-wi(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-wi(e)-e.display.barHeight}function Us(e,t,i){var n=e.options.lineWrapping,r=n&&Fi(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),f=0;f<l.length-1;f++){var m=l[f],C=l[f+1];Math.abs(m.bottom-C.bottom)>2&&s.push((m.bottom+C.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(It(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Bs(e,t){t=fn(t);var i=It(t),n=e.display.externalMeasured=new Gt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,ie(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return Ei(e,Zi(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[zi(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Zi(e,t){var i=It(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(mr(e,n,i,wo(e)),e.curOp.forceUpdate=!0),n||(n=Bs(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Ei(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),l=Hs(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,f,m,C=0;C<e.length;C+=3)if(f=e[C],m=e[C+1],t<f?(r=0,s=1,l="left"):t<m?(r=t-f,s=r+1):(C==e.length-3||t==m&&e[C+3]>t)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[C+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;C&&e[C-2]==e[C-3]&&e[C-1].insertLeft;)n=e[(C-=3)+2],l="left";if(i=="right"&&r==m-f)for(;C<e.length-3&&e[C+3]==e[C+4]&&!e[C+5].insertLeft;)n=e[(C+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:m}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Hs(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,C;if(s.nodeType==3){for(var Z=0;Z<4;Z++){for(;l&&He(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&He(t.line.text.charAt(r.coverStart+f));)++f;if(D&&j<9&&l==0&&f==r.coverEnd-r.coverStart?C=s.parentNode.getBoundingClientRect():C=Fs(re(s,l,f).getClientRects(),n),C.left||C.right||l==0)break;f=l,l=l-1,m="right"}D&&j<11&&(C=Ws(e.display.measure,C))}else{l>0&&(m=n="right");var ae;e.options.lineWrapping&&(ae=s.getClientRects()).length>1?C=ae[n=="right"?ae.length-1:0]:C=s.getBoundingClientRect()}if(D&&j<9&&!l&&(!C||!C.left&&!C.right)){var Ne=s.parentNode.getClientRects()[0];Ne?C={left:Ne.left,right:Ne.left+qi(e.display),top:Ne.top,bottom:Ne.bottom}:C=aa}for(var Oe=C.top-t.rect.top,Ze=C.bottom-t.rect.top,it=(Oe+Ze)/2,ot=t.view.measure.heights,ct=0;ct<ot.length-1&&!(it<ot[ct]);ct++);var gt=ct?ot[ct-1]:0,dt=ot[ct],Ct={left:(m=="right"?C.right:C.left)-t.rect.left,right:(m=="left"?C.left:C.right)-t.rect.left,top:gt,bottom:dt};return!C.left&&!C.right&&(Ct.bogus=!0),e.options.singleCursorHeightPerLine||(Ct.rtop=Oe,Ct.rbottom=Ze),Ct}function Ws(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!kt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function la(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 ua(e){e.display.externalMeasure=null,he(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function br(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ca(){return O&&J?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function da(){return O&&J?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=vr(e.widgets[i]));return t}function Wr(e,t,i,n,r){if(!r){var s=vo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=fi(t);if(n=="local"?l+=Hr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:da());var m=f.left+(n=="window"?0:ca());i.left+=m,i.right+=m}return i.top+=l,i.bottom+=l,i}function ha(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ca(),r-=da();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function bo(e,t,i,n,r){return n||(n=ft(e.doc,t.line)),Wr(e,n,oa(e,n,t.ch,r),i)}function yi(e,t,i,n,r,s){n=n||ft(e.doc,t.line),r||(r=Zi(e,n));function l(Ze,it){var ot=Ei(e,r,Ze,it?"right":"left",s);return it?ot.left=ot.right:ot.right=ot.left,Wr(e,n,ot,i)}var f=$e(n,e.doc.direction),m=t.ch,C=t.sticky;if(m>=n.text.length?(m=n.text.length,C="before"):m<=0&&(m=0,C="after"),!f)return l(C=="before"?m-1:m,C=="before");function Z(Ze,it,ot){var ct=f[it],gt=ct.level==1;return l(ot?Ze-1:Ze,gt!=ot)}var ae=Be(f,m,C),Ne=Ie,Oe=Z(m,ae,C=="before");return Ne!=null&&(Oe.other=Z(m,Ne,C!="before")),Oe}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=qi(e.display)*t.ch);var n=ft(e.doc,t.line),r=fi(n)+Hr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function yo(e,t,i,n,r){var s=tt(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function Co(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return yo(n.first,0,null,-1,-1);var r=Sn(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,ft(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ft(n,r);;){var f=zs(e,l,r,t,i),m=ti(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var C=m.find(1);if(C.line==r)return C;l=ft(n,r=C.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=at(function(l){return Ei(e,i,l-1).bottom<=n},r,0);return r=at(function(l){return Ei(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=Zi(e,t));var r=Wr(e,t,Ei(e,i,n),"line").top;return pa(e,t,i,r)}function xo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=fi(t);var s=Zi(e,t),l=vo(t),f=0,m=t.text.length,C=!0,Z=$e(t,e.doc.direction);if(Z){var ae=(e.options.lineWrapping?Vs:Ks)(e,t,i,s,Z,n,r);C=ae.level!=1,f=C?ae.from:ae.to-1,m=C?ae.to:ae.from-1}var Ne=null,Oe=null,Ze=at(function(Mt){var At=Ei(e,s,Mt);return At.top+=l,At.bottom+=l,xo(At,n,r,!1)?(At.top<=r&&At.left<=n&&(Ne=Mt,Oe=At),!0):!1},f,m),it,ot,ct=!1;if(Oe){var gt=n-Oe.left<Oe.right-n,dt=gt==C;Ze=Ne+(dt?0:1),ot=dt?"after":"before",it=gt?Oe.left:Oe.right}else{!C&&(Ze==m||Ze==f)&&Ze++,ot=Ze==0?"after":Ze==t.text.length?"before":Ei(e,s,Ze-(C?1:0)).bottom+l<=r==C?"after":"before";var Ct=yi(e,tt(i,Ze,ot),"line",t,s);it=Ct.left,ct=r<Ct.top?-1:r>=Ct.bottom?1:0}return Ze=ze(t.text,Ze,1),yo(i,Ze,ot,ct,n-it)}function Ks(e,t,i,n,r,s,l){var f=at(function(ae){var Ne=r[ae],Oe=Ne.level!=1;return xo(yi(e,tt(i,Oe?Ne.to:Ne.from,Oe?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var C=m.level!=1,Z=yi(e,tt(i,C?m.from:m.to,C?"after":"before"),"line",t,n);xo(Z,s,l,!0)&&Z.top>l&&(m=r[f-1])}return m}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),m=f.begin,C=f.end;/\s/.test(t.text.charAt(C-1))&&C--;for(var Z=null,ae=null,Ne=0;Ne<r.length;Ne++){var Oe=r[Ne];if(Oe.from>=C||Oe.to<=m)continue;var Ze=Oe.level!=1,it=Ei(e,n,Ze?Math.min(C,Oe.to)-1:Math.max(m,Oe.from)).right,ot=it<s?s-it+1e9:it-s;(!Z||ae>ot)&&(Z=Oe,ae=ot)}return Z||(Z=r[r.length-1]),Z.from<m&&(Z={from:m,to:Z.to,level:Z.level}),Z.to>C&&(Z={from:Z.from,to:C,level:Z.level}),Z}var Hi;function Qi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Hi==null){Hi=R("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hi.appendChild(document.createTextNode("x")),Hi.appendChild(R("br"));Hi.appendChild(document.createTextNode("x"))}ie(e.measure,Hi);var i=Hi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),he(e.measure),i||1}function qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=R("span","xxxxxxxxxx"),i=R("pre",[t],"CodeMirror-line-like");ie(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function wo(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=s.clientWidth}return{fixedPos:Eo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Eo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Qi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/qi(e.display)-3);return function(r){if(Fn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function So(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&En(n,r)})}function Wi(e,t,i,n){var r=e.display;if(!i&&ke(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(ae){return null}var m=Co(e,s,l),C;if(n&&m.xRel>0&&(C=ft(e.doc,m.line).text).length==m.ch){var Z=N(C,C.length,e.options.tabSize)-C.length;m=tt(m.line,Math.max(0,Math.round((s-ia(e.display).left)/qi(e.display))-Z))}return m}function zi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function si(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)bn&&hi(e.doc,t)<r.viewTo&&Di(e);else if(i<=r.viewFrom)bn&&pr(e.doc,i+n)>r.viewFrom?Di(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Di(e);else if(t<=r.viewFrom){var s=zr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Di(e)}else if(i>=r.viewTo){var l=zr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Di(e)}else{var f=zr(e,t,t,-1),m=zr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(_n(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):Di(e)}var C=r.externalMeasured;C&&(i<C.lineN?C.lineN+=n:t<C.lineN+C.size&&(r.externalMeasured=null))}function Mi(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[zi(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);ve(l,i)==-1&&l.push(i)}function Di(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,i,n){var r=zi(e,t),s,l=e.display.view;if(!bn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m<r;m++)f+=l[m].size;if(f!=t){if(n>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,i+=s}for(;hi(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Gs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=_n(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=_n(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(zi(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(_n(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,zi(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ba(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var m=f.empty();(m||e.options.showCursorWhenSelecting)&&ya(e,f.head,r),m||Xs(e,f,s)}return n}function ya(e,t,i){var n=yi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(R("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(R("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Kr(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),f=l.left,m=Math.max(n.sizerWidth,Fi(e)-n.sizer.offsetLeft)-l.right,C=r.direction=="ltr";function Z(dt,Ct,Mt,At){Ct<0&&(Ct=0),Ct=Math.round(Ct),At=Math.round(At),s.appendChild(R("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px;
|
|
top: `+Ct+"px; width: "+(Mt==null?m-dt:Mt)+`px;
|
|
height: `+(At-Ct)+"px"))}function ae(dt,Ct,Mt){var At=ft(r,dt),Bt=At.text.length,pn,Kn;function On(Rn,ci){return bo(e,tt(dt,Rn),"div",At,ci)}function mi(Rn,ci,$n){var In=ma(e,At,null,Rn),Nn=ci=="ltr"==($n=="after")?"left":"right",An=$n=="after"?In.begin:In.end-(/\s/.test(At.text.charAt(In.end-1))?2:1);return On(An,Nn)[Nn]}var ui=$e(At,r.direction);return xe(ui,Ct||0,Mt==null?Bt:Mt,function(Rn,ci,$n,In){var Nn=$n=="ltr",An=On(Rn,Nn?"left":"right"),di=On(ci-1,Nn?"right":"left"),hr=Ct==null&&Rn==0,Ui=Mt==null&&ci==Bt,ei=In==0,Si=!ui||In==ui.length-1;if(di.top-An.top<=3){var Vn=(C?hr:Ui)&&ei,Yo=(C?Ui:hr)&&Si,Ai=Vn?f:(Nn?An:di).left,$i=Yo?m:(Nn?di:An).right;Z(Ai,An.top,$i-Ai,An.bottom)}else{var Yi,ii,fr,Jo;Nn?(Yi=C&&hr&&ei?f:An.left,ii=C?m:mi(Rn,$n,"before"),fr=C?f:mi(ci,$n,"after"),Jo=C&&Ui&&Si?m:di.right):(Yi=C?mi(Rn,$n,"before"):f,ii=!C&&hr&&ei?m:An.right,fr=!C&&Ui&&Si?f:di.left,Jo=C?mi(ci,$n,"after"):m),Z(Yi,An.top,ii-Yi,An.bottom),An.bottom<di.top&&Z(f,An.bottom,null,di.top),Z(fr,di.top,Jo-fr,di.bottom)}(!pn||Kr(An,pn)<0)&&(pn=An),Kr(di,pn)<0&&(pn=di),(!Kn||Kr(An,Kn)<0)&&(Kn=An),Kr(di,Kn)<0&&(Kn=di)}),{start:pn,end:Kn}}var Ne=t.from(),Oe=t.to();if(Ne.line==Oe.line)ae(Ne.line,Ne.ch,Oe.ch);else{var Ze=ft(r,Ne.line),it=ft(r,Oe.line),ot=fn(Ze)==fn(it),ct=ae(Ne.line,Ne.ch,ot?Ze.text.length+1:null).end,gt=ae(Oe.line,ot?0:null,Oe.ch).start;ot&&(ct.top<gt.top-2?(Z(ct.right,ct.top,null,ct.bottom),Z(f,gt.top,gt.left,gt.bottom)):Z(ct.right,ct.top,gt.left-ct.right,ct.bottom)),ct.bottom<gt.top&&Z(f,ct.bottom,null,gt.top)}i.appendChild(s)}function ko(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||er(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ca(e){e.state.focused||(e.display.input.focus(),To(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,er(e))},100)}function To(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,K(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),A&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e)}function er(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,G(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,f=0;if(r.hidden)continue;if(D&&j<8){var m=r.node.offsetTop+r.node.offsetHeight;l=m-i,i=m}else{var C=r.node.getBoundingClientRect();l=C.bottom-C.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-C.left-1)}var Z=r.line.height-l;if((Z>.005||Z<-.005)&&(En(r.line,l),wa(r.line),r.rest))for(var ae=0;ae<r.rest.length;ae++)wa(r.rest[ae]);if(f>e.display.sizerWidth){var Ne=Math.ceil(f/qi(e.display));Ne>e.display.maxLineLength&&(e.display.maxLineLength=Ne,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Gr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Hr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Sn(t,n),l=Sn(t,r);if(i&&i.ensure){var f=i.ensure.from.line,m=i.ensure.to.line;f<s?(s=f,l=Sn(t,fi(ft(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=Sn(t,fi(ft(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!P){var s=R("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+wi(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function Ys(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?tt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?tt(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=yi(e,t),m=!i||i==t?f:yi(e,i);r={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var C=_o(e,r),Z=e.doc.scrollTop,ae=e.doc.scrollLeft;if(C.scrollTop!=null&&(xr(e,C.scrollTop),Math.abs(e.doc.scrollTop-Z)>1&&(l=!0)),C.scrollLeft!=null&&(Ki(e,C.scrollLeft),Math.abs(e.doc.scrollLeft-ae)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=_o(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Ki(e,i.scrollLeft)}function _o(e,t){var i=e.display,n=Qi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+po(i),m=t.top<n,C=t.bottom>f-n;if(t.top<r)l.scrollTop=m?0:t.top;else if(t.bottom>r+s){var Z=Math.min(t.top,(C?f:t.bottom)-s);Z!=r&&(l.scrollTop=Z)}var ae=e.options.fixedGutter?0:i.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ae,Oe=Fi(e)-i.gutters.offsetWidth,Ze=t.right-t.left>Oe;return Ze&&(t.right=t.left+Oe),t.left<10?l.scrollLeft=0:t.left<Ne?l.scrollLeft=Math.max(0,t.left+ae-(Ze?0:10)):t.right>Oe+Ne-3&&(l.scrollLeft=t.right+(Ze?0:10)-Oe),l}function Oo(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function tr(e){Xr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Cr(e,t,i){(t!=null||i!=null)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);Ea(e,i,n,t.margin)}}function Ea(e,t,i,n){var r=_o(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});Cr(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ge||Lo(e,{top:t}),Sa(e,t,!0),ge&&Lo(e),Sr(e,100)}function Sa(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ki(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Aa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function wr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+po(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+wi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Vi=function(e,t,i){this.cm=i;var n=this.vert=R("div",[R("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=R("div",[R("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),_e(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),_e(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&j<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vi.prototype.zeroWidthHack=function(){var e=fe&&!ee?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},Vi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Er=function(){};Er.prototype.update=function(){return{bottom:0,right:0}},Er.prototype.setScrollLeft=function(){},Er.prototype.setScrollTop=function(){},Er.prototype.clear=function(){};function nr(e,t){t||(t=wr(e));var i=e.display.barWidth,n=e.display.barHeight;ka(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),ka(e,wr(e)),i=e.display.barWidth,n=e.display.barHeight}function ka(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Ta={native:Vi,null:Er};function _a(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&G(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),_e(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ki(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Gi(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},Kt(e.curOp)}function Xi(e){var t=e.curOp;t&&sn(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&Ti(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ao(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=wr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+wi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Fi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ki(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==T();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&nr(t,e.barMeasure),e.updatedDisplay&&Do(t,e.barMeasure),e.selectionChanged&&ko(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ca(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Oa(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ki(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||Ae(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&Ae(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ae(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function pi(e,t){if(e.curOp)return t();Gi(e);try{return t()}finally{Xi(e)}}function Wn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gi(e);try{return t.apply(e,arguments)}finally{Xi(e)}}}function ni(e){return function(){if(this.curOp)return e.apply(this,arguments);Gi(this);try{return e.apply(this,arguments)}finally{Xi(this)}}}function zn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gi(t);try{return e.apply(this,arguments)}finally{Xi(t)}}}function Sr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,p(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Le(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?on(t.mode,n.state):null,m=oe(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var C=s.styleClasses,Z=m.classes;Z?s.styleClasses=Z:C&&(s.styleClasses=null);for(var ae=!l||l.length!=s.styles.length||C!=Z&&(!C||!Z||C.bgClass!=Z.bgClass||C.textClass!=Z.textClass),Ne=0;!ae&&Ne<l.length;++Ne)ae=l[Ne]!=s.styles[Ne];ae&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ut(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Sr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&pi(e,function(){for(var s=0;s<r.length;s++)Mi(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Gr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Fi(e),this.force=i,this.dims=wo(e),this.events=[]};$r.prototype.signal=function(e,t){Q(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ae.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=wi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=wi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=T();if(!t||!k(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&k(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==T())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(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ao(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Di(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&va(e)==0)return!1;La(e)&&(Di(e),t.dims=wo(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),bn&&(s=hi(e.doc,s),l=pr(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Gs(e,s,l),i.viewOffset=fi(ft(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=va(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var C=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(C),he(i.cursorDiv),he(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Sr(e,400)),i.updateLineNumbers=null,!0}function Oa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Fi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Gr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Gr(e.display,e.doc,i));if(!Ao(e,t))break;Vr(e);var r=wr(e);yr(e),nr(e,r),Do(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Lo(e,t){var i=new $r(e,t);if(Ao(e,i)){Vr(e),Oa(e,i);var n=wr(e);yr(e),nr(e,n),Do(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Ze){var it=Ze.nextSibling;return A&&fe&&e.display.currentWheelTarget==Ze?Ze.style.display="none":Ze.parentNode.removeChild(Ze),it}for(var m=n.view,C=n.viewFrom,Z=0;Z<m.length;Z++){var ae=m[Z];if(!ae.hidden)if(!ae.node||ae.node.parentNode!=s){var Ne=js(e,ae,C,i);s.insertBefore(Ne,l)}else{for(;l!=ae.node;)l=f(l);var Oe=r&&t!=null&&t<=C&&ae.lineNumber;ae.changes&&(ve(ae.changes,"gutter")>-1&&(Oe=!1),mr(e,ae,C,i)),Oe&&(he(ae.lineNumber),ae.lineNumber.appendChild(document.createTextNode(ri(e.options,C)))),l=ae.node.nextSibling}C+=ae.size}for(;l;)l=f(l)}function Mo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Do(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+wi(e)+"px"}function Aa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Eo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var f=i[l].alignable;if(f)for(var m=0;m<f.length;m++)f[m].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function La(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ri(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(R("div",[R("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Mo(e.display),!0}return!1}function Ro(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ma(e){var t=e.gutters,i=e.gutterSpecs;he(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,f=t.appendChild(R("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=i.length?"":"none",Mo(e)}function kr(e){Ma(e.display),si(e),Aa(e)}function cl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=R("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=R("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ye("div",null,"CodeMirror-code"),r.selectionDiv=R("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=R("div",null,"CodeMirror-cursors"),r.measure=R("div",null,"CodeMirror-measure"),r.lineMeasure=R("div",null,"CodeMirror-measure"),r.lineSpace=ye("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ye("div",[r.lineSpace],"CodeMirror-lines");r.mover=R("div",[s],null,"position: relative"),r.sizer=R("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=R("div",null,null,"position: absolute; height: "+Pe+"px; width: 1px;"),r.gutters=R("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=R("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=R("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),D&&j<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!A&&!(ge&&de)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Ro(n.gutters,n.lineNumbers),Ma(r),i.init(r)}var Yr=0,gi=null;D?gi=-.53:ge?gi=15:O?gi=-.7:ue&&(gi=-1/3);function Da(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Da(e);return t.x*=gi,t.y*=gi,t}function Ra(e,t){var i=Da(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&fe&&A){e:for(var C=t.target,Z=s.view;C!=l;C=C.parentNode)for(var ae=0;ae<Z.length;ae++)if(Z[ae].node==C){e.display.currentWheelTarget=C;break e}}if(n&&!ge&&!I&&gi!=null){r&&m&&xr(e,Math.max(0,l.scrollTop+r*gi)),Ki(e,Math.max(0,l.scrollLeft+n*gi)),(!r||r&&m)&&E(t),s.wheelStartX=null;return}if(r&&gi!=null){var Ne=r*gi,Oe=e.doc.scrollTop,Ze=Oe+s.wrapper.clientHeight;Ne<0?Oe=Math.max(0,Oe+Ne-50):Ze=Math.min(e.doc.height,Ze+Ne+50),Lo(e,{top:Oe,bottom:Ze})}Yr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var it=l.scrollLeft-s.wheelStartX,ot=l.scrollTop-s.wheelStartY,ct=ot&&s.wheelDY&&ot/s.wheelDY||it&&s.wheelDX&&it/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!ct)return;gi=(gi*Yr+ct)/(Yr+1),++Yr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var vi=function(e,t){this.ranges=e,this.primIndex=t};vi.prototype.primary=function(){return this.ranges[this.primIndex]},vi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!Un(i.anchor,n.anchor)||!Un(i.head,n.head))return!1}return!0},vi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Qt(Pn(this.ranges[t].anchor),Pn(this.ranges[t].head));return new vi(e,this.primIndex)},vi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},vi.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(_t(t,n.from())>=0&&_t(e,n.to())<=0)return i}return-1};var Qt=function(e,t){this.anchor=e,this.head=t};Qt.prototype.from=function(){return Jn(this.anchor,this.head)},Qt.prototype.to=function(){return Yn(this.anchor,this.head)},Qt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ci(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(Ne,Oe){return _t(Ne.from(),Oe.from())}),i=ve(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],m=_t(f.to(),l.from());if(n&&!l.empty()?m>0:m>=0){var C=Jn(f.from(),l.from()),Z=Yn(f.to(),l.to()),ae=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Qt(ae?Z:C,ae?C:Z))}}return new vi(t,i)}function Ri(e,t){return new vi([new Qt(e,t||e)],0)}function Ni(e){return e.text?tt(e.from.line+e.text.length-1,g(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Na(e,t){if(_t(e,t.from)<0)return e;if(_t(e,t.to)<=0)return Ni(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ni(t).ch-t.to.ch),tt(i,n)}function No(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Qt(Na(r.anchor,t),Na(r.head,t)))}return Ci(e.cm,i,e.sel.primIndex)}function Pa(e,t,i){return e.line==t.line?tt(i.line,e.ch-t.ch+i.ch):tt(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],r=tt(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],m=Pa(f.from,r,s),C=Pa(Ni(f),r,s);if(r=f.to,s=C,i=="around"){var Z=e.sel.ranges[l],ae=_t(Z.head,Z.anchor)<0;n[l]=new Qt(ae?C:m,ae?m:C)}else n[l]=new Qt(m,m)}return new vi(n,e.sel.primIndex)}function Po(e){e.doc.mode=rn(e.options,e.doc.modeOption),Tr(e)}function Tr(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&&si(e)}function ja(e,t){return t.from.ch==0&&t.to.ch==0&&g(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function jo(e,t,i,n){function r(gt){return i?i[gt]:null}function s(gt,dt,Ct){uo(gt,dt,Ct,n),cn(gt,"change",gt,t)}function l(gt,dt){for(var Ct=[],Mt=gt;Mt<dt;++Mt)Ct.push(new Li(C[Mt],r(Mt),n));return Ct}var f=t.from,m=t.to,C=t.text,Z=ft(e,f.line),ae=ft(e,m.line),Ne=g(C),Oe=r(C.length-1),Ze=m.line-f.line;if(t.full)e.insert(0,l(0,C.length)),e.remove(C.length,e.size-C.length);else if(ja(e,t)){var it=l(0,C.length-1);s(ae,ae.text,Oe),Ze&&e.remove(f.line,Ze),it.length&&e.insert(f.line,it)}else if(Z==ae)if(C.length==1)s(Z,Z.text.slice(0,f.ch)+Ne+Z.text.slice(m.ch),Oe);else{var ot=l(1,C.length-1);ot.push(new Li(Ne+Z.text.slice(m.ch),Oe,n)),s(Z,Z.text.slice(0,f.ch)+C[0],r(0)),e.insert(f.line+1,ot)}else if(C.length==1)s(Z,Z.text.slice(0,f.ch)+C[0]+ae.text.slice(m.ch),r(0)),e.remove(f.line+1,Ze);else{s(Z,Z.text.slice(0,f.ch)+C[0],r(0)),s(ae,Ne+ae.text.slice(m.ch),Oe);var ct=l(1,C.length-1);Ze>1&&e.remove(f.line+1,Ze-1),e.insert(f.line+1,ct)}cn(e,"change",e,t)}function Pi(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var m=r.linked[f];if(m.doc==s)continue;var C=l&&m.sharedHist;if(i&&!C)continue;t(m.doc,C),n(m.doc,r,C)}}n(e,null,!0)}function Ia(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,So(e),Po(e),Ua(e),e.options.lineWrapping||Ti(e),e.options.mode=t.modeOption,si(e)}function Ua(e){(e.doc.direction=="rtl"?K:G)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){pi(e,function(){Ua(e),si(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Io(e,t){var i={from:Pn(t.from),to:Ni(t),text:an(e,t.from,t.to)};return Ha(e,i,t.from.line,t.to.line+1),Pi(e,function(n){return Ha(n,i,t.from.line,t.to.line+1)},!0),i}function Ba(e){for(;e.length;){var t=g(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ba(e.done),g(e.done);if(e.done.length&&!g(e.done).ranges)return g(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),g(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,f;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))f=g(l.changes),_t(t.from,t.to)==0&&_t(t.from,f.to)==0?f.to=Ni(t):l.changes.push(Io(e,t));else{var m=g(r.done);for((!m||!m.ranges)&&Zr(e.sel,r.done),l={changes:[Io(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,f||Ae(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,g(r.done),t))?r.done[r.done.length-1]=t:Zr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ba(r.undone)}function Zr(e,t){var i=g(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ha(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function bl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function Wa(e,t){var i=bl(e,t),n=wt(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var f=0;f<l.length;++f){for(var m=l[f],C=0;C<s.length;++C)if(s[C].marker==m.marker)continue e;s.push(m)}}else l&&(i[r]=l)}return i}function ir(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?vi.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var m=0;m<l.length;++m){var C=l[m],Z=void 0;if(f.push({from:C.from,to:C.to,text:C.text}),t)for(var ae in C)(Z=ae.match(/^spans_(\d+)$/))&&(ve(t,Number(Z[1]))>-1&&(g(f)[ae]=C[ae],delete C[ae]))}}return n}function Uo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=_t(t,r)<0;s!=_t(i,r)<0?(r=t,t=i):s!=_t(t,i)<0&&(t=i)}return new Qt(r,t)}else return new Qt(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),qn(e,new vi([Uo(e.sel.primary(),t,i,r)],0),n)}function za(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=Uo(e.sel.ranges[s],t[s],null,r);var l=Ci(e.cm,n,e.sel.primIndex);qn(e,l,i)}function Bo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,qn(e,Ci(e.cm,r,e.sel.primIndex),n)}function Ka(e,t,i,n){qn(e,Ri(t,i),n)}function yl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Qt(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Ae(e,"beforeSelectionChange",e,n),e.cm&&Ae(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Ci(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=g(n);r&&r.ranges?(n[n.length-1]=t,qr(e,t,i)):qn(e,t,i)}function qn(e,t,i){qr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qr(e,t,i){(Q(e,"beforeSelectionChange")||e.cm&&Q(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,i));var n=i&&i.bias||(_t(t.primary().head,e.sel.primary().head)<0?-1:1);Ga(e,$a(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&tr(e.cm)}function Ga(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,se(e.cm)),cn(e,"cursorActivity",e)}function Xa(e){Ga(e,$a(e,e.sel,null,!1))}function $a(e,t,i,n){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],m=eo(e,l.anchor,f&&f.anchor,i,n),C=eo(e,l.head,f&&f.head,i,n);(r||m!=l.anchor||C!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Qt(m,C))}return r?Ci(e.cm,r,t.primIndex):t}function rr(e,t,i,n,r){var s=ft(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],m=f.marker,C="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,Z="selectRight"in m?!m.selectRight:m.inclusiveRight;if((f.from==null||(C?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(Z?f.to>=t.ch:f.to>t.ch))){if(r&&(Ae(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var ae=m.find(n<0?1:-1),Ne=void 0;if((n<0?Z:C)&&(ae=Ya(e,ae,-n,ae&&ae.line==t.line?s:null)),ae&&ae.line==t.line&&(Ne=_t(ae,i))&&(n<0?Ne<0:Ne>0))return rr(e,ae,t,n,r)}var Oe=m.find(n<0?-1:1);return(n<0?C:Z)&&(Oe=Ya(e,Oe,n,Oe.line==t.line?s:null)),Oe?rr(e,Oe,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=rr(e,t,i,s,r)||!r&&rr(e,t,i,s,!0)||rr(e,t,i,-s,r)||!r&&rr(e,t,i,-s,!0);return l||(e.cantEdit=!0,tt(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,tt(t.line-1)):null:i>0&&t.ch==(n||ft(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+i)}function Ja(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),we)}function Za(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,f){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),f!==void 0&&(n.origin=f)}),Ae(e,"beforeChange",e,n),e.cm&&Ae(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function or(e,t,i){if(e.cm){if(!e.cm.curOp)return Wn(e.cm,or)(e,t,i);if(e.cm.state.suppressEdits)return}if((Q(e,"beforeChange")||e.cm&&Q(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Gn&&!i&&Mn(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&_t(t.from,t.to)==0)return;var i=No(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),_r(e,t,i,wt(e,t));var n=[];Pi(e,function(r,s){!s&&ve(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),_r(r,t,null,wt(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,m=t=="undo"?r.undone:r.done,C=0;C<f.length&&!(s=f[C],i?s.ranges&&!s.equals(e.sel):!s.ranges);C++);if(C==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Zr(s,m),i&&!s.equals(e.sel)){qn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var Z=[];Zr(l,m),m.push({changes:Z,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var ae=Q(e,"beforeChange")||e.cm&&Q(e.cm,"beforeChange"),Ne=function(it){var ot=s.changes[it];if(ot.origin=t,ae&&!Za(e,ot,!1))return f.length=0,{};Z.push(Io(e,ot));var ct=it?No(e,ot):g(f);_r(e,ot,ct,Wa(e,ot)),!it&&e.cm&&e.cm.scrollIntoView({from:ot.from,to:Ni(ot)});var gt=[];Pi(e,function(dt,Ct){!Ct&&ve(gt,dt.history)==-1&&(ns(dt.history,ot),gt.push(dt.history)),_r(dt,ot,null,Wa(dt,ot))})},Oe=s.changes.length-1;Oe>=0;--Oe){var Ze=Ne(Oe);if(Ze)return Ze.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new vi(y(e.sel.ranges,function(r){return new Qt(tt(r.anchor.line+t,r.anchor.ch),tt(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){si(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Mi(e.cm,n,"gutter")}}function _r(e,t,i,n){if(e.cm&&!e.cm.curOp)return Wn(e.cm,_r)(e,t,i,n);if(t.to.line<e.first){qa(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);qa(e,r),t={from:tt(e.first,0),to:tt(t.to.line+r,t.to.ch),text:[g(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:tt(s,ft(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=an(e,t.from,t.to),i||(i=No(e,t)),e.cm?Cl(e.cm,t,n):jo(e,t,n),qr(e,i,we),e.cantEdit&&eo(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}function Cl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,m=s.line;e.options.lineWrapping||(m=It(fn(ft(n,s.line))),n.iter(m,l.line+1,function(Oe){if(Oe==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&se(e),jo(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(Oe){var Ze=Ji(Oe);Ze>r.maxLineLength&&(r.maxLine=Oe,r.maxLineLength=Ze,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Cn(n,s.line),Sr(e,400);var C=t.text.length-(l.line-s.line)-1;t.full?si(e):s.line==l.line&&t.text.length==1&&!ja(e.doc,t)?Mi(e,s.line,"text"):si(e,s.line,l.line+1,C);var Z=Q(e,"changes"),ae=Q(e,"change");if(ae||Z){var Ne={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};ae&&cn(e,"change",e,Ne),Z&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function ar(e,t,i,n,r){var s;n||(n=i),_t(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),or(e,{from:i,to:n,text:t,origin:r})}function es(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ts(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var f=0;f<s.ranges.length;f++)es(s.ranges[f].anchor,t,i,n),es(s.ranges[f].head,t,i,n);continue}for(var m=0;m<s.changes.length;++m){var C=s.changes[m];if(i<C.from.line)C.from=tt(C.from.line+n,C.from.ch),C.to=tt(C.to.line+n,C.to.ch);else if(t<=C.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ns(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ts(e.done,i,n,r),ts(e.undone,i,n,r)}function Or(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ft(e,d(e,t)):r=It(t),r==null?null:(n(s,r)&&e.cm&&Mi(e.cm,r,i),s)}function Ar(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ar.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,co(r),cn(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Lr(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}Lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ar))){var f=[];this.collapse(f),this.children=[new Ar(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,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,f=l;f<r.lines.length;){var m=new Ar(r.lines.slice(f,f+=25));r.height-=m.height,this.children.splice(++n,0,m),m.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Lr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=ve(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Lr(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Mr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Mr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=It(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=vr(this);En(i,Math.max(0,i.height-s)),e&&(pi(e,function(){is(e,i,-s),Mi(e,n,"widget")}),cn(e,"lineWidgetCleared",e,this,n))},Mr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=vr(this)-t;if(!r)return;Fn(this.doc,n)||En(n,n.height+r),i&&pi(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),cn(i,"lineWidgetChanged",i,e,It(n))})},le(Mr);function is(e,t,i){fi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Oo(e,i)}function xl(e,t,i,n){var r=new Mr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Or(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&&!Fn(e,l)){var m=fi(l)<e.scrollTop;En(l,l.height+vr(r)),m&&Oo(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&cn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:It(t)),r}var rs=0,ji=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};ji.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gi(e),Q(this,"clear")){var i=this.find();i&&cn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=yn(l.markedSpans,this);e&&!this.collapsed?Mi(e,It(l),"text"):e&&(f.to!=null&&(r=It(l)),f.from!=null&&(n=It(l))),l.markedSpans=oi(l.markedSpans,f),f.from==null&&this.collapsed&&!Fn(this.doc,l)&&e&&En(l,Qi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var C=fn(this.lines[m]),Z=Ji(C);Z>e.display.maxLineLength&&(e.display.maxLine=C,e.display.maxLineLength=Z,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&si(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&cn(e,"markerCleared",e,this,n,r),t&&Xi(e),this.parent&&this.parent.clear()},ji.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=yn(s.markedSpans,this);if(l.from!=null&&(i=tt(t?s:It(s),l.from),e==-1))return i;if(l.to!=null&&(n=tt(t?s:It(s),l.to),e==1))return n}return i&&{from:i,to:n}},ji.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;pi(n,function(){var r=t.line,s=It(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Fn(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var m=vr(i)-f;m&&En(r,r.height+m)}cn(n,"markerChanged",n,e)})},ji.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ve(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ji.prototype.detachLine=function(e){if(this.lines.splice(ve(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},le(ji);function sr(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return Wn(e.cm,sr)(e,t,i,n,r);var s=new ji(e,r),l=_t(t,i);if(n&&h(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ye("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(gn(e,t.line,t,i,s)||t.line!=i.line&&gn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");kn()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,C;if(e.iter(f,i.line+1,function(ae){m&&s.collapsed&&!m.options.lineWrapping&&fn(ae)==m.display.maxLine&&(C=!0),s.collapsed&&f!=t.line&&En(ae,0),hn(ae,new Zn(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(ae){Fn(e,ae)&&En(ae,0)}),s.clearOnEnter&&_e(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Vt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),m){if(C&&(m.curOp.updateMaxLine=!0),s.collapsed)si(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var Z=t.line;Z<=i.line;Z++)Mi(m,Z,"text");s.atomic&&Xa(m.doc),cn(m,"markerAdded",m,s)}return s}var Dr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Dr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")},Dr.prototype.find=function(e,t){return this.primary.find(e,t)},le(Dr);function wl(e,t,i,n,r){n=h(n),n.shared=!1;var s=[sr(e,t,i,n,r)],l=s[0],f=n.widgetNode;return Pi(e,function(m){f&&(n.widgetNode=f.cloneNode(!0)),s.push(sr(m,o(m,t),o(m,i),n,r));for(var C=0;C<m.linked.length;++C)if(m.linked[C].isParent)return;l=g(s)}),new Dr(s,l)}function os(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),function(t){return t.parent})}function El(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(_t(s,l)){var f=sr(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Pi(r.primary.doc,function(m){return s.push(m)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];ve(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,li=function(e,t,i,n,r){if(!(this instanceof li))return new li(e,t,i,n,r);i==null&&(i=0),Lr.call(this,[new Ar([new Li("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=tt(i,0);this.sel=Ri(s),this.history=new Jr(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),jo(this,{from:s,to:s,text:e}),qn(this,Ri(s),we)};li.prototype=ce(Lr.prototype,{constructor:li,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ln(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:zn(function(e){var t=tt(this.first,0),i=this.first+this.size-1;or(this,{from:t,to:tt(i,ft(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Cr(this.cm,0,0),qn(this,Ri(t),we)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ar(this,e,t,i,n)},getRange:function(e,t,i){var n=an(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(vn(this,e))return ft(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ft(this,e)),fn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:zn(function(e,t,i){Ka(this,o(this,typeof e=="number"?tt(e,t||0):e),null,i)}),setSelection:zn(function(e,t,i){Ka(this,o(this,e),o(this,t||e),i)}),extendSelection:zn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:zn(function(e,t){za(this,u(this,e),t)}),extendSelectionsBy:zn(function(e,t){var i=y(this.sel.ranges,e);za(this,u(this,i),t)}),setSelections:zn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Qt(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),qn(this,Ci(this.cm,n,t),i)}),addSelection:zn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Qt(o(this,e),o(this,t||e))),qn(this,Ci(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=an(this,t[n].from(),t[n].to());i=i?i.concat(r):r}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=an(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:zn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var f=t&&t!="end"&&hl(this,n,t),m=n.length-1;m>=0;m--)or(this,n[m]);f?Va(this,f):this.cm&&tr(this.cm)}),undo:zn(function(){to(this,"undo")}),redo:zn(function(){to(this,"redo")}),undoSelection:zn(function(){to(this,"undo",!0)}),redoSelection:zn(function(){to(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Pi(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:ir(this.history.done),undone:ir(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=ir(e.done.slice(0),null,!0),t.undone=ir(e.undone.slice(0),null,!0)},setGutterMarker:zn(function(e,t,i){return Or(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Fe(r)&&(n.gutterMarkers=null),!0})}),clearGutter:zn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Or(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Fe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!vn(this,e))return null;if(t=e,e=ft(this,e),!e)return null}else if(t=It(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:zn(function(e,t,i){return Or(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(me(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:zn(function(e,t,i){return Or(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(me(i));if(!l)return!1;var f=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:zn(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return sr(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),sr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=ft(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f<l.length;f++){var m=l[f];!(m.to!=null&&r==e.line&&e.ch>=m.to||m.from==null&&r!=e.line||m.from!=null&&r==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,tt(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new li(Ln(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new li(Ln(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],El(n,os(this)),n},unlinkDoc:function(e){if(e instanceof wn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(os(this));break}if(e.history==this.history){var n=[e.id];Pi(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=ir(this.history.done,n),e.history.undone=ir(this.history.undone,n)}},iterLinkedDocs:function(e){Pi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):mt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:zn(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 as=0;function Tl(e){var t=this;if(ss(t),We(t,e)||_i(t.display,e))return;E(e),D&&(as=+new Date);var i=Wi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,f=function(){++l==r&&Wn(t,function(){i=o(t.doc,i);var Oe={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ze){return Ze!=null}).join(t.doc.lineSeparator())),origin:"paste"};or(t.doc,Oe),Va(t.doc,Ri(o(t.doc,i),o(t.doc,Ni(Oe))))})()},m=function(Oe,Ze){if(t.options.allowDropFileTypes&&ve(t.options.allowDropFileTypes,Oe.type)==-1){f();return}var it=new FileReader;it.onerror=function(){return f()},it.onload=function(){var ot=it.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ot)){f();return}s[Ze]=ot,f()},it.readAsText(Oe)},C=0;C<n.length;C++)m(n[C],C);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Z=e.dataTransfer.getData("Text");if(Z){var ae;if(t.state.draggingText&&!t.state.draggingText.copy&&(ae=t.listSelections()),qr(t.doc,Ri(i,i)),ae)for(var Ne=0;Ne<ae.length;++Ne)ar(t.doc,"",ae[Ne].anchor,ae[Ne].head,"drag");t.replaceSelection(Z,"around","paste"),t.display.input.focus()}}catch(Oe){}}}function _l(e,t){if(D&&(!e.state.draggingText||+new Date-as<100)){X(t);return}if(We(e,t)||_i(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ue){var i=R("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",I&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),I&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Wi(e,t);if(!i)return;var n=document.createDocumentFragment();ya(e,i,n),e.display.dragCursor||(e.display.dragCursor=R("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ie(e.display.dragCursor,n)}function ss(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ls(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var us=!1;function Al(){if(us)return;Ll(),us=!0}function Ll(){var e;_e(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ml)},100))}),_e(window,"blur",function(){return ls(er)})}function Ml(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ii={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++)Ii[Rr+48]=Ii[Rr+96]=String(Rr);for(var no=65;no<=90;no++)Ii[no]=String.fromCharCode(no);for(var Nr=1;Nr<=12;Nr++)Ii[Nr+111]=Ii[Nr+63235]="F"+Nr;var Oi={};Oi.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"},Oi.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"},Oi.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"},Oi.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"]},Oi.default=fe?Oi.macDefault:Oi.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,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))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Rl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var r=y(i.split(" "),Dl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var m=t[f];if(!m)t[f]=l;else if(m!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var C in t)e[C]=t[C];return e}function lr(e,t,i,n){t=io(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return lr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=lr(e,t.fallthrough[s],i,n);if(l)return l}}}function cs(e){var t=typeof e=="string"?e:Ii[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ds(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ne?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ne?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function hs(e,t){if(I&&e.keyCode==34&&e.char)return!1;var i=Ii[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ds(i,e,t))}function io(e){return typeof e=="string"?Oi[e]:e}function ur(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&_t(s.from,g(n).to)<=0;){var l=n.pop();if(_t(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}pi(e,function(){for(var f=n.length-1;f>=0;f--)ar(e.doc,"",n[f].from,n[f].to,"+delete");tr(e)})}function Fo(e,t,i){var n=ze(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ho(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new tt(t.line,n,i<0?"after":"before")}function Wo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=$e(i,t.doc.direction);if(s){var l=r<0?g(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",C;if(l.level>0||t.doc.direction=="rtl"){var Z=Zi(t,i);C=r<0?i.text.length-1:0;var ae=Ei(t,Z,C).top;C=at(function(Ne){return Ei(t,Z,Ne).top==ae},r<0==(l.level==1)?l.from:l.to-1,C),m=="before"&&(C=Fo(i,C,1))}else C=r<0?l.to:l.from;return new tt(n,C,m)}}return new tt(n,r<0?i.text.length:0,r<0?"before":"after")}function Nl(e,t,i,n){var r=$e(t,e.doc.direction);if(!r)return Ho(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=Be(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Ho(t,i,n);var f=function(ct,gt){return Fo(t,ct instanceof tt?ct.ch:ct,gt)},m,C=function(ct){return e.options.lineWrapping?(m=m||Zi(e,t),ma(e,t,m,ct)):{begin:0,end:t.text.length}},Z=C(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var ae=l.level==1==n<0,Ne=f(i,ae?1:-1);if(Ne!=null&&(ae?Ne<=l.to&&Ne<=Z.end:Ne>=l.from&&Ne>=Z.begin)){var Oe=ae?"before":"after";return new tt(i.line,Ne,Oe)}}var Ze=function(ct,gt,dt){for(var Ct=function(pn,Kn){return Kn?new tt(i.line,f(pn,1),"before"):new tt(i.line,pn,"after")};ct>=0&&ct<r.length;ct+=gt){var Mt=r[ct],At=gt>0==(Mt.level!=1),Bt=At?dt.begin:f(dt.end,-1);if(Mt.from<=Bt&&Bt<Mt.to)return Ct(Bt,At);if(Bt=At?Mt.from:f(Mt.to,-1),dt.begin<=Bt&&Bt<dt.end)return Ct(Bt,At)}},it=Ze(s+n,n,Z);if(it)return it;var ot=n>0?Z.end:f(Z.begin,-1);return ot!=null&&!(n>0&&ot==t.text.length)&&(it=Ze(n>0?0:r.length-1,n,C(ot)),it)?it:null}var Pr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),we)},killLine:function(e){return ur(e,function(t){if(t.empty()){var i=ft(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ur(e,function(t){return{from:tt(t.from().line,0),to:o(e.doc,tt(t.to().line+1,0))}})},delLineLeft:function(e){return ur(e,function(t){return{from:tt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ur(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ur(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},x)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},x)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ps(e,t.head):n},x)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=N(e.getLine(s.line),s.ch,n);t.push(_(n-l%n))}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(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=ft(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new tt(r.line,r.ch-1)),r.ch>0)r=new tt(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),tt(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ft(e.doc,r.line-1).text;l&&(r=new tt(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),tt(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Qt(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return pi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);tr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=ft(e.doc,t),n=fn(i);return n!=i&&(t=It(n)),Wo(!0,e,n,t,1)}function Pl(e,t){var i=ft(e.doc,t),n=ai(i);return n!=i&&(t=It(n)),Wo(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=ft(e.doc,i.line),r=$e(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return tt(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=Ee}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function jl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=lr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&lr(t,e.options.extraKeys,i,e)||lr(t,e.options.keyMap,i,e)}var Il=new te;function jr(e,t,i,n){var r=e.state.keySeq;if(r){if(cs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Il.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=jl(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&cn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(E(i),ko(e)),!!r}function gs(e,t){var i=hs(t,!0);return i?t.shiftKey&&!e.state.keySeq?jr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||jr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):jr(e,i,t,function(n){return ro(e,n)}):!1}function Ul(e,t,i){return jr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var zo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=T(),We(t,e))return;D&&j<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);I&&(zo=n?i:null,!n&&i==88&&!Dt&&(fe?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ge&&!fe&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;K(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(G(t,"CodeMirror-crosshair"),Qe(document,"keyup",i),Qe(document,"mouseover",i))}_e(document,"keyup",i),_e(document,"mouseover",i)}function bs(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(_i(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||fe&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(I&&i==zo){zo=null,E(e);return}if(I&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Ul(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Ko=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ko.prototype.compare=function(e,t,i){return this.time+Fl>e&&_t(t,this.pos)==0&&i==this.button};var Ir,Ur;function Hl(e,t){var i=+new Date;return Ur&&Ur.compare(i,e,t)?(Ir=Ur=null,"triple"):Ir&&Ir.compare(i,e,t)?(Ur=new Ko(i,e,t),Ir=null,"double"):(Ir=new Ko(i,e,t),Ur=null,"single")}function Cs(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,_i(i,e)){A||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Wi(t,e),r=De(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,r,n,s,e))return;r==1?n?Kl(t,n,s,e):ke(e)==i.scroller&&E(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Se?t.display.input.onContextMenu(e):xa(t))}function Wl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,jr(e,ds(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Ee}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=je?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=fe?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(fe?i.altKey:i.ctrlKey)),r}function Kl(e,t,i,n){D?setTimeout(p(Ca,e),0):e.curOp.focus=T();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&et&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(_t((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(_t(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Gl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=Wn(e,function(C){A&&(r.scroller.draggable=!1),e.state.draggingText=!1,Qe(r.wrapper.ownerDocument,"mouseup",l),Qe(r.wrapper.ownerDocument,"mousemove",f),Qe(r.scroller,"dragstart",m),Qe(r.scroller,"drop",l),s||(E(C),n.addNew||Qr(e.doc,i,null,null,n.extend),A&&!ue||D&&j==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(C){s=s||Math.abs(t.clientX-C.clientX)+Math.abs(t.clientY-C.clientY)>=10},m=function(){return s=!0};A&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),_e(r.wrapper.ownerDocument,"mouseup",l),_e(r.wrapper.ownerDocument,"mousemove",f),_e(r.scroller,"dragstart",m),_e(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Qt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Qt(tt(t.line,0),o(e.doc,tt(t.line+1,0)));var n=i(e,t);return new Qt(n.from,n.to)}function Gl(e,t,i,n){var r=e.display,s=e.doc;E(t);var l,f,m=s.sel,C=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=C[f]:l=new Qt(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Qt(i,i)),i=Wi(e,t,!0,!0),f=-1;else{var Z=xs(e,i,n.unit);n.extend?l=Uo(l,Z.anchor,Z.head,n.extend):l=Z}n.addNew?f==-1?(f=C.length,qn(s,Ci(e,C.concat([l]),f),{scroll:!1,origin:"*mouse"})):C.length>1&&C[f].empty()&&n.unit=="char"&&!n.extend?(qn(s,Ci(e,C.slice(0,f).concat(C.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Bo(s,f,l,H):(f=0,qn(s,new vi([l],0),H),m=s.sel);var ae=i;function Ne(dt){if(_t(ae,dt)==0)return;if(ae=dt,n.unit=="rectangle"){for(var Ct=[],Mt=e.options.tabSize,At=N(ft(s,i.line).text,i.ch,Mt),Bt=N(ft(s,dt.line).text,dt.ch,Mt),pn=Math.min(At,Bt),Kn=Math.max(At,Bt),On=Math.min(i.line,dt.line),mi=Math.min(e.lastLine(),Math.max(i.line,dt.line));On<=mi;On++){var ui=ft(s,On).text,Rn=F(ui,pn,Mt);pn==Kn?Ct.push(new Qt(tt(On,Rn),tt(On,Rn))):ui.length>Rn&&Ct.push(new Qt(tt(On,Rn),tt(On,F(ui,Kn,Mt))))}Ct.length||Ct.push(new Qt(i,i)),qn(s,Ci(e,m.ranges.slice(0,f).concat(Ct),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(dt)}else{var ci=l,$n=xs(e,dt,n.unit),In=ci.anchor,Nn;_t($n.anchor,In)>0?(Nn=$n.head,In=Jn(ci.from(),$n.anchor)):(Nn=$n.anchor,In=Yn(ci.to(),$n.head));var An=m.ranges.slice(0);An[f]=Xl(e,new Qt(o(s,In),Nn)),qn(s,Ci(e,An,f),H)}}var Oe=r.wrapper.getBoundingClientRect(),Ze=0;function it(dt){var Ct=++Ze,Mt=Wi(e,dt,!0,n.unit=="rectangle");if(!Mt)return;if(_t(Mt,ae)!=0){e.curOp.focus=T(),Ne(Mt);var At=Gr(r,s);(Mt.line>=At.to||Mt.line<At.from)&&setTimeout(Wn(e,function(){Ze==Ct&&it(dt)}),150)}else{var Bt=dt.clientY<Oe.top?-20:dt.clientY>Oe.bottom?20:0;Bt&&setTimeout(Wn(e,function(){if(Ze!=Ct)return;r.scroller.scrollTop+=Bt,it(dt)}),50)}}function ot(dt){e.state.selectingText=!1,Ze=Infinity,dt&&(E(dt),r.input.focus()),Qe(r.wrapper.ownerDocument,"mousemove",ct),Qe(r.wrapper.ownerDocument,"mouseup",gt),s.history.lastSelOrigin=null}var ct=Wn(e,function(dt){dt.buttons===0||!De(dt)?ot(dt):it(dt)}),gt=Wn(e,ot);e.state.selectingText=gt,_e(r.wrapper.ownerDocument,"mousemove",ct),_e(r.wrapper.ownerDocument,"mouseup",gt)}function Xl(e,t){var i=t.anchor,n=t.head,r=ft(e.doc,i.line);if(_t(i,n)==0&&i.sticky==n.sticky)return t;var s=$e(r);if(!s)return t;var l=Be(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var C;if(n.line!=i.line)C=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Z=Be(s,n.ch,n.sticky),ae=Z-l||(n.ch-i.ch)*(f.level==1?-1:1);Z==m-1||Z==m?C=ae<0:C=ae>0}var Ne=s[m+(C?-1:0)],Oe=C==(Ne.level==1),Ze=Oe?Ne.from:Ne.to,it=Oe?"after":"before";return i.ch==Ze&&i.sticky==it?t:new Qt(new tt(i.line,Ze,it),n)}function ws(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(Ne){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&E(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!Q(e,i))return U(t);s-=f.top-l.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var C=l.gutters.childNodes[m];if(C&&C.getBoundingClientRect().right>=r){var Z=Sn(e.doc,s),ae=e.display.gutterSpecs[m];return Ae(e,i,e,Z,ae.className,t),U(t)}}}function Vo(e,t){return ws(e,t,"gutterClick",!0)}function Es(e,t){if(_i(e.display,t)||$l(e,t))return;if(We(e,t,"contextmenu"))return;Se||e.display.input.onContextMenu(t)}function $l(e,t){return Q(e,"gutterContextMenu")?ws(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),br(e)}var cr={toString:function(){return"CodeMirror.Init"}},ks={},oo={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,m,C){C!=cr&&s(f,m,C)}:s)}e.defineOption=i,e.Init=cr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Po(n)},!0),i("indentUnit",2,Po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Tr(n),br(n),si(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(m){for(var C=0;;){var Z=m.text.indexOf(r,C);if(Z==-1)break;C=Z+r.length,s.push(tt(l,Z))}l++});for(var f=s.length-1;f>=0;f--)ar(n.doc,r,s[f],tt(s[f].line,s[f].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=cr&&n.refresh()}),i("specialCharPlaceholder",Tt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",de?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!Ue),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Ss(n),kr(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),f=s!=cr&&io(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Ro(r,n.options.lineNumbers),kr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Eo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return nr(n)},!0),i("scrollbarStyle","native",function(n){_a(n),nr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Ro(n.options.gutters,r),kr(n)},!0),i("firstLineNumber",1,kr,!0),i("lineNumberFormatter",function(n){return n},kr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(er(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Tr,!0),i("addModeClass",!1,Tr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Tr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=cr;if(!t!=!n){var r=e.display.dragFunctions,s=t?_e:Qe;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?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(G(e.display.wrapper,"CodeMirror-wrap"),Ti(e)),So(e),si(e),br(e),setTimeout(function(){return nr(e)},100)}function wn(e,t){var i=this;if(!(this instanceof wn))return new wn(e,t);this.options=t=t?h(t):{},h(ks,t,!1);var n=t.value;typeof n=="string"?n=new li(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new wn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,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 te,keySeq:null,specialChars:null},t.autofocus&&!de&&s.input.focus(),D&&j<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Al(),Gi(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!de||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&To(i)},20):er(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],cr);La(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Go.length;++f)Go[f](this);Xi(this),A&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}wn.defaults=ks,wn.optionHandlers=oo;function Ql(e){var t=e.display;_e(t.scroller,"mousedown",Wn(e,Cs)),D&&j<11?_e(t.scroller,"dblclick",Wn(e,function(m){if(We(e,m))return;var C=Wi(e,m);if(!C||Vo(e,m)||_i(e.display,m))return;E(m);var Z=e.findWordAt(C);Qr(e.doc,Z.anchor,Z.head)})):_e(t.scroller,"dblclick",function(m){return We(e,m)||E(m)}),_e(t.scroller,"contextmenu",function(m){return Es(e,m)}),_e(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||Es(e,m)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(m){if(m.touches.length!=1)return!1;var C=m.touches[0];return C.radiusX<=1&&C.radiusY<=1}function l(m,C){if(C.left==null)return!0;var Z=C.left-m.left,ae=C.top-m.top;return Z*Z+ae*ae>20*20}_e(t.scroller,"touchstart",function(m){if(!We(e,m)&&!s(m)&&!Vo(e,m)){t.input.ensurePolled(),clearTimeout(i);var C=+new Date;t.activeTouch={start:C,moved:!1,prev:C-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),_e(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),_e(t.scroller,"touchend",function(m){var C=t.activeTouch;if(C&&!_i(t,m)&&C.left!=null&&!C.moved&&new Date-C.start<300){var Z=e.coordsChar(t.activeTouch,"page"),ae;!C.prev||l(C,C.prev)?ae=new Qt(Z,Z):!C.prev.prev||l(C,C.prev.prev)?ae=e.findWordAt(Z):ae=new Qt(tt(Z.line,0),o(e.doc,tt(Z.line+1,0))),e.setSelection(ae.anchor,ae.head),e.focus(),E(m)}r()}),_e(t.scroller,"touchcancel",r),_e(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Ki(e,t.scroller.scrollLeft,!0),Ae(e,"scroll",e))}),_e(t.scroller,"mousewheel",function(m){return Ra(e,m)}),_e(t.scroller,"DOMMouseScroll",function(m){return Ra(e,m)}),_e(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){We(e,m)||X(m)},over:function(m){We(e,m)||(Ol(e,m),X(m))},start:function(m){return _l(e,m)},drop:Wn(e,Tl),leave:function(m){We(e,m)||ss(e)}};var f=t.input.getField();_e(f,"keyup",function(m){return bs.call(e,m)}),_e(f,"keydown",Wn(e,vs)),_e(f,"keypress",Wn(e,ys)),_e(f,"focus",function(m){return To(e,m)}),_e(f,"blur",function(m){return er(e,m)})}var Go=[];wn.defineInitHook=function(e){return Go.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=Le(e,t).state:i="prev");var l=e.options.tabSize,f=ft(r,t),m=N(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var C=f.text.match(/^\s*/)[0],Z;if(!n&&!/\S/.test(f.text))Z=0,i="not";else if(i=="smart"&&(Z=r.mode.indent(s,f.text.slice(C.length),f.text),Z==Ee||Z>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?Z=N(ft(r,t-1).text,null,l):Z=0:i=="add"?Z=m+e.options.indentUnit:i=="subtract"?Z=m-e.options.indentUnit:typeof i=="number"&&(Z=m+i),Z=Math.max(0,Z);var ae="",Ne=0;if(e.options.indentWithTabs)for(var Oe=Math.floor(Z/l);Oe;--Oe)Ne+=l,ae+=" ";if(Ne<Z&&(ae+=_(Z-Ne)),ae!=C)return ar(r,ae,tt(t,0),tt(t,C.length),"+input"),f.stateAfter=null,!0;for(var Ze=0;Ze<r.sel.ranges.length;Ze++){var it=r.sel.ranges[Ze];if(it.head.line==t&&it.head.ch<C.length){var ot=tt(t,C.length);Bo(r,Ze,new Qt(ot,ot));break}}}var xi=null;function ao(e){xi=e}function Xo(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,f=r=="paste"||e.state.pasteIncoming>l,m=mt(t),C=null;if(f&&n.ranges.length>1)if(xi&&xi.text.join(`
|
|
`)==t){if(n.ranges.length%xi.text.length==0){C=[];for(var Z=0;Z<xi.text.length;Z++)C.push(s.splitLines(xi.text[Z]))}}else m.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(C=y(m,function(ct){return[ct]}));for(var ae=e.curOp.updateInput,Ne=n.ranges.length-1;Ne>=0;Ne--){var Oe=n.ranges[Ne],Ze=Oe.from(),it=Oe.to();Oe.empty()&&(i&&i>0?Ze=tt(Ze.line,Ze.ch-i):e.state.overwrite&&!f?it=tt(it.line,Math.min(ft(s,it.line).text.length,it.ch+g(m).length)):f&&xi&&xi.lineWise&&xi.text.join(`
|
|
`)==m.join(`
|
|
`)&&(Ze=it=tt(Ze.line,0)));var ot={from:Ze,to:it,text:C?C[Ne%C.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};or(e.doc,ot),cn(e,"inputRead",e,ot)}t&&!f&&_s(e,t),tr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ae),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&pi(t,function(){return Xo(t,i,0,null,"paste")}),!0}function _s(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ft(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&cn(e,"electricInput",e,r.head.line)}}function Os(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:tt(r,0),head:tt(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function As(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ls(){var e=R("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=R("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return A?e.style.width="1000px":e.setAttribute("wrap","off"),$&&(e.style.border="1px solid black"),As(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&Wn(this,t[n])(this,r,l),Ae(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](io(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:ni(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");S(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,si(this)}),removeOverlay:ni(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,si(this);return}}}),indentLine:ni(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),vn(this.doc,n)&&Br(this,n,r,s)}),indentSelection:ni(function(n){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&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&tr(this));else{var m=f.from(),C=f.to(),Z=Math.max(s,m.line);s=Math.min(this.lastLine(),C.line-(C.ch?0:1))+1;for(var ae=Z;ae<s;++ae)Br(this,ae,n);var Ne=this.doc.sel.ranges;m.ch==0&&r.length==Ne.length&&Ne[l].from().ch>0&&Bo(this.doc,l,new Qt(m,Ne[l].to()),we)}}}),getTokenAt:function(n,r){return Rt(this,n,r)},getLineTokens:function(n,r){return Rt(this,tt(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ye(this,ft(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var C=s+l>>1;if((C?r[C*2-1]:0)>=f)l=C;else if(r[C*2+1]<f)s=C+1;else{m=r[C*2+2];break}}var Z=m?m.indexOf("overlay "):-1;return Z<0?m:Z==0?null:m.slice(0,Z-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],f=this.getModeAt(n);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var m=0;m<f[r].length;m++){var C=l[f[r][m]];C&&s.push(C)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var Z=0;Z<l._global.length;Z++){var ae=l._global[Z];ae.pred(f,this)&&ve(s,ae.val)==-1&&s.push(ae.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=d(s,n==null?s.first+s.size-1:n),Le(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),yi(this,s,r||"page")},charCoords:function(n,r){return bo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=ha(this,n,r||"page"),Co(this,n.left,n.top)},lineAtHeight:function(n,r){return n=ha(this,{top:n,left:0},r||"page").top,Sn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var m=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>m&&(n=m,l=!0),f=ft(this.doc,n)}else f=n;return Wr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-fi(f):0)},defaultTextHeight:function(){return Qi(this.display)},defaultCharWidth:function(){return qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var m=this.display;n=yi(this,o(this.doc,n));var C=n.bottom,Z=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")C=n.top;else if(l=="above"||l=="near"){var ae=Math.max(m.wrapper.clientHeight,this.doc.height),Ne=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>ae)&&n.top>r.offsetHeight?C=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=ae&&(C=n.bottom),Z+r.offsetWidth>Ne&&(Z=Ne-r.offsetWidth)}r.style.top=C+"px",r.style.left=r.style.right="",f=="right"?(Z=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?Z=0:f=="middle"&&(Z=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=Z+"px"),s&&Js(this,{left:Z,top:C,right:Z+r.offsetWidth,bottom:C+r.offsetHeight})},triggerOnKeyDown:ni(vs),triggerOnKeyPress:ni(ys),triggerOnKeyUp:bs,triggerOnMouseDown:ni(Cs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:ni(function(n){_s(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),C=0;C<r&&!(m=$o(this.doc,m,f,s,l),m.hitSide);++C);return m},moveH:ni(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?$o(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},x)}),deleteH:ni(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ur(this,function(f){var m=$o(l,f.head,n,r,!1);return n<0?{from:m,to:f.head}:{from:f.head,to:m}})}),findPosV:function(n,r,s,l){var f=1,m=l;r<0&&(f=-1,r=-r);for(var C=o(this.doc,n),Z=0;Z<r;++Z){var ae=yi(this,C,"div");if(m==null?m=ae.left:ae.left=m,C=Ms(this,ae,f,s),C.hitSide)break}return C},moveV:ni(function(n,r){var s=this,l=this.doc,f=[],m=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(Z){if(m)return n<0?Z.from():Z.to();var ae=yi(s,Z.head,"div");Z.goalColumn!=null&&(ae.left=Z.goalColumn),f.push(ae.left);var Ne=Ms(s,ae,n,r);return r=="page"&&Z==l.sel.primary()&&Oo(s,bo(s,Ne,"div").top-ae.top),Ne},x),f.length)for(var C=0;C<l.sel.ranges.length;C++)l.sel.ranges[C].goalColumn=f[C]}),findWordAt:function(n){var r=this.doc,s=ft(r,n.line).text,l=n.ch,f=n.ch;if(s){var m=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var C=s.charAt(l),Z=Re(C,m)?function(ae){return Re(ae,m)}:/\s/.test(C)?function(ae){return/\s/.test(ae)}:function(ae){return!/\s/.test(ae)&&!Re(ae)};l>0&&Z(s.charAt(l-1));)--l;for(;f<s.length&&Z(s.charAt(f));)++f}return new Qt(tt(n.line,l),tt(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):G(this.display.cursorDiv,"CodeMirror-overwrite"),Ae(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==T()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ni(function(n,r){Cr(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-wi(this)-this.display.barHeight,width:n.scrollWidth-wi(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Fi(this)}},scrollIntoView:ni(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:tt(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Zs(this,n):Ea(this,n.from,n.to,n.margin)}),setSize:ni(function(n,r){var s=this,l=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(m){if(m.widgets){for(var C=0;C<m.widgets.length;C++)if(m.widgets[C].noHScroll){Mi(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Ae(this,"refresh",this)}),operation:function(n){return pi(this,n)},startOperation:function(){return Gi(this)},endOperation:function(){return Xi(this)},refresh:ni(function(){var n=this.display.cachedTextHeight;si(this),this.curOp.forceUpdate=!0,br(this),Cr(this,this.doc.scrollLeft,this.doc.scrollTop),Mo(this.display),(n==null||Math.abs(n-Qi(this.display))>.5||this.options.lineWrapping)&&So(this),Ae(this,"refresh",this)}),swapDoc:ni(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,n),br(this),this.display.input.reset(),Cr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},le(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function $o(e,t,i,n,r){var s=t,l=i,f=ft(e,t.line),m=r&&e.direction=="rtl"?-i:i;function C(){var gt=t.line+m;return gt<e.first||gt>=e.first+e.size?!1:(t=new tt(gt,t.ch,t.sticky),f=ft(e,gt))}function Z(gt){var dt;if(n=="codepoint"){var Ct=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Ct)?dt=null:dt=new tt(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(Ct>=55296&&Ct<56320?2:1))),-i)}else r?dt=Nl(e.cm,f,t,i):dt=Ho(f,t,i);if(dt==null)if(!gt&&C())t=Wo(r,e.cm,f,t.line,m);else return!1;else t=dt;return!0}if(n=="char"||n=="codepoint")Z();else if(n=="column")Z(!0);else if(n=="word"||n=="group")for(var ae=null,Ne=n=="group",Oe=e.cm&&e.cm.getHelper(t,"wordChars"),Ze=!0;!(i<0&&!Z(!Ze));Ze=!1){var it=f.text.charAt(t.ch)||`
|
|
`,ot=Re(it,Oe)?"w":Ne&&it==`
|
|
`?"n":!Ne||/\s/.test(it)?null:"p";if(Ne&&!Ze&&!ot&&(ot="s"),ae&&ae!=ot){i<0&&(i=1,Z(),t.sticky="after");break}if(ot&&(ae=ot),i>0&&!Z(!Ze))break}var ct=eo(e,t,s,l,!0);return Un(s,ct)&&(ct.hitSide=!0),ct}function Ms(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(f-.5*Qi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var C;!(C=Co(e,s,l),!C.outside);){if(i<0?l<=0:l>=r.height){C.hitSide=!0;break}l+=i*5}return C}var ln=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ln.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;As(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}_e(r,"paste",function(f){if(!s(f)||We(n,f)||Ts(f,n))return;j<=11&&setTimeout(Wn(n,function(){return t.updateFromDOM()}),20)}),_e(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),_e(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),_e(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),_e(r,"touchstart",function(){return i.forceCompositionEnd()}),_e(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||We(n,f))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=Os(n);ao({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,we),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var C=xi.text.join(`
|
|
`);if(f.clipboardData.setData("Text",C),f.clipboardData.getData("Text")==C){f.preventDefault();return}}var Z=Ls(),ae=Z.firstChild;n.display.lineSpace.insertBefore(Z,n.display.lineSpace.firstChild),ae.value=xi.text.join(`
|
|
`);var Ne=document.activeElement;V(ae),setTimeout(function(){n.display.lineSpace.removeChild(Z),Ne.focus(),Ne==r&&i.showPrimarySelection()},50)}_e(r,"copy",l),_e(r,"cut",l)},ln.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ln.prototype.prepareSelection=function(){var e=ba(this.cm,!1);return e.focus=document.activeElement==this.div,e},ln.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},ln.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ln.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=so(t,e.anchorNode,e.anchorOffset),l=so(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&_t(Jn(s,l),n)==0&&_t(Yn(s,l),r)==0)return;var f=t.display.view,m=n.line>=t.display.viewFrom&&Ds(t,n)||{node:f[0].measure.map[2],offset:0},C=r.line<t.display.viewTo&&Ds(t,r);if(!C){var Z=f[f.length-1].measure,ae=Z.maps?Z.maps[Z.maps.length-1]:Z.map;C={node:ae[ae.length-1],offset:ae[ae.length-2]-ae[ae.length-3]}}if(!m||!C){e.removeAllRanges();return}var Ne=e.rangeCount&&e.getRangeAt(0),Oe;try{Oe=re(m.node,m.offset,C.offset,C.node)}catch(Ze){}Oe&&(!ge&&t.state.focused?(e.collapse(m.node,m.offset),Oe.collapsed||(e.removeAllRanges(),e.addRange(Oe))):(e.removeAllRanges(),e.addRange(Oe)),Ne&&e.anchorNode==null?e.addRange(Ne):ge&&this.startGracePeriod()),this.rememberSelection()},ln.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)},ln.prototype.showMultipleSelections=function(e){ie(this.cm.display.cursorDiv,e.cursors),ie(this.cm.display.selectionDiv,e.selection)},ln.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ln.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return k(this.div,t)},ln.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ln.prototype.blur=function(){this.div.blur()},ln.prototype.getField=function(){return this.div},ln.prototype.supportsTouch=function(){return!0},ln.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)},ln.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ln.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(J&&O&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=so(t,e.anchorNode,e.anchorOffset),n=so(t,e.focusNode,e.focusOffset);i&&n&&pi(t,function(){qn(t.doc,Ri(i,n),we),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},ln.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=tt(n.line-1,ft(e.doc,n.line-1).length)),r.ch==ft(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=tt(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=zi(e,n.line))==0?(l=It(t.view[0].line),f=t.view[0].node):(l=It(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=zi(e,r.line),C,Z;if(m==t.view.length-1?(C=t.viewTo-1,Z=t.lineDiv.lastChild):(C=It(t.view[m+1].line)-1,Z=t.view[m+1].node.previousSibling),!f)return!1;for(var ae=e.doc.splitLines(tu(e,f,Z,l,C)),Ne=an(e.doc,tt(l,0),tt(C,ft(e.doc,C).text.length));ae.length>1&&Ne.length>1;)if(g(ae)==g(Ne))ae.pop(),Ne.pop(),C--;else if(ae[0]==Ne[0])ae.shift(),Ne.shift(),l++;else break;for(var Oe=0,Ze=0,it=ae[0],ot=Ne[0],ct=Math.min(it.length,ot.length);Oe<ct&&it.charCodeAt(Oe)==ot.charCodeAt(Oe);)++Oe;for(var gt=g(ae),dt=g(Ne),Ct=Math.min(gt.length-(ae.length==1?Oe:0),dt.length-(Ne.length==1?Oe:0));Ze<Ct&>.charCodeAt(gt.length-Ze-1)==dt.charCodeAt(dt.length-Ze-1);)++Ze;if(ae.length==1&&Ne.length==1&&l==n.line)for(;Oe&&Oe>n.ch&>.charCodeAt(gt.length-Ze-1)==dt.charCodeAt(dt.length-Ze-1);)Oe--,Ze++;ae[ae.length-1]=gt.slice(0,gt.length-Ze).replace(/^\u200b+/,""),ae[0]=ae[0].slice(Oe).replace(/\u200b+$/,"");var Mt=tt(l,Oe),At=tt(C,Ne.length?g(Ne).length-Ze:0);if(ae.length>1||ae[0]||_t(Mt,At))return ar(e.doc,ae,Mt,At,"+input"),!0},ln.prototype.ensurePolled=function(){this.forceCompositionEnd()},ln.prototype.reset=function(){this.forceCompositionEnd()},ln.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},ln.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)},ln.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&pi(this.cm,function(){return si(e.cm)})},ln.prototype.setUneditable=function(e){e.contentEditable="false"},ln.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Wn(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},ln.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ln.prototype.onContextMenu=function(){},ln.prototype.resetPosition=function(){},ln.prototype.needsContentAttribute=!0;function Ds(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=ft(e.doc,t.line),r=ra(i,n,t.line),s=$e(n,e.doc.direction),l="left";if(s){var f=Be(s,t.ch);l=f%2?"right":"left"}var m=sa(r.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function dr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function C(Oe){return function(Ze){return Ze.id==Oe}}function Z(){l&&(s+=f,m&&(s+=f),l=m=!1)}function ae(Oe){Oe&&(Z(),s+=Oe)}function Ne(Oe){if(Oe.nodeType==1){var Ze=Oe.getAttribute("cm-text");if(Ze){ae(Ze);return}var it=Oe.getAttribute("cm-marker"),ot;if(it){var ct=e.findMarks(tt(n,0),tt(r+1,0),C(+it));ct.length&&(ot=ct[0].find(0))&&ae(an(e.doc,ot.from,ot.to).join(f));return}if(Oe.getAttribute("contenteditable")=="false")return;var gt=/^(pre|div|p|li|table|br)$/i.test(Oe.nodeName);if(!/^br$/i.test(Oe.nodeName)&&Oe.textContent.length==0)return;gt&&Z();for(var dt=0;dt<Oe.childNodes.length;dt++)Ne(Oe.childNodes[dt]);/^(pre|p)$/i.test(Oe.nodeName)&&(m=!0),gt&&(l=!0)}else Oe.nodeType==3&&ae(Oe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ne(t),t==i);)t=t.nextSibling,m=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return dr(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!k(n,t))return dr(tt(It(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?g(e.rest):e.line;return dr(tt(It(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,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var m=e.measure,C=m.maps;function Z(ot,ct,gt){for(var dt=-1;dt<(C?C.length:0);dt++)for(var Ct=dt<0?m.map:C[dt],Mt=0;Mt<Ct.length;Mt+=3){var At=Ct[Mt+2];if(At==ot||At==ct){var Bt=It(dt<0?e.line:e.rest[dt]),pn=Ct[Mt]+gt;return(gt<0||At!=ot)&&(pn=Ct[Mt+(gt?1:0)]),tt(Bt,pn)}}}var ae=Z(l,f,i);if(ae)return dr(ae,r);for(var Ne=f.nextSibling,Oe=l?l.nodeValue.length-i:0;Ne;Ne=Ne.nextSibling){if(ae=Z(Ne,Ne.firstChild,0),ae)return dr(tt(ae.line,ae.ch-Oe),r);Oe+=Ne.textContent.length}for(var Ze=f.previousSibling,it=i;Ze;Ze=Ze.previousSibling){if(ae=Z(Ze,Ze.firstChild,-1),ae)return dr(tt(ae.line,ae.ch+it),r);it+=Ze.textContent.length}}var Dn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};Dn.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),$&&(r.style.width="0px"),_e(r,"input",function(){D&&j>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),_e(r,"paste",function(l){if(We(n,l)||Ts(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(We(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Os(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,we):(i.prevInput="",r.value=f.text.join(`
|
|
`),V(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}_e(r,"cut",s),_e(r,"copy",s),_e(e.scroller,"paste",function(l){if(_i(e,l)||We(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),_e(e.lineSpace,"selectstart",function(l){_i(e,l)||E(l)}),_e(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),_e(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Dn.prototype.createField=function(e){this.wrapper=Ls(),this.textarea=this.wrapper.firstChild},Dn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Dn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ba(e);if(e.options.moveInputWithCursor){var r=yi(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},Dn.prototype.showSelection=function(e){var t=this.cm,i=t.display;ie(i.cursorDiv,e.cursors),ie(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Dn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&V(this.textarea),D&&j>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",D&&j>=9&&(this.hasSelection=null))},Dn.prototype.getField=function(){return this.textarea},Dn.prototype.supportsTouch=function(){return!1},Dn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!de||T()!=this.textarea))try{this.textarea.focus()}catch(e){}},Dn.prototype.blur=function(){this.textarea.blur()},Dn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Dn.prototype.receivedFocus=function(){this.slowPoll()},Dn.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()})},Dn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Dn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||rt(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(D&&j>=9&&this.hasSelection===r||fe&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,f=Math.min(n.length,r.length);l<f&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return pi(t,function(){Xo(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Dn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Dn.prototype.onKeyPress=function(){D&&j>=9&&(this.hasSelection=null),this.fastPoll()},Dn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Wi(i,e),l=n.scroller.scrollTop;if(!s||I)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&Wn(i,qn)(i.doc,Ri(s),we);var m=r.style.cssText,C=t.wrapper.style.cssText,Z=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Z.top-5)+"px; left: "+(e.clientX-Z.left-5)+`px;
|
|
z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ae;A&&(ae=window.scrollY),n.input.focus(),A&&window.scrollTo(null,ae),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=Oe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ne(){if(r.selectionStart!=null){var it=i.somethingSelected(),ot="\u200B"+(it?r.value:"");r.value="\u21DA",r.value=ot,t.prevInput=it?"":"\u200B",r.selectionStart=1,r.selectionEnd=ot.length,n.selForContextMenu=i.doc.sel}}function Oe(){if(t.contextMenuPending!=Oe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=C,r.style.cssText=m,D&&j<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!D||D&&j<9)&&Ne();var it=0,ot=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?Wn(i,Ja)(i):it++<10?n.detectingSelectAll=setTimeout(ot,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ot,200)}}if(D&&j>=9&&Ne(),Se){X(e);var Ze=function(){Qe(window,"mouseup",Ze),setTimeout(Oe,20)};_e(window,"mouseup",Ze)}else setTimeout(Oe,50)},Dn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Dn.prototype.setUneditable=function(){},Dn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?h(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=T();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(_e(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(Qe(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=wn(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=Qe,e.on=_e,e.wheelEventPixels=dl,e.Doc=li,e.splitLines=mt,e.countColumn=N,e.findColumn=F,e.isWordChar=Ce,e.Pass=Ee,e.signal=Ae,e.Line=Li,e.changeEnd=Ni,e.scrollbarModel=Ta,e.Pos=tt,e.cmpPos=_t,e.modes=Et,e.mimeModes=xt,e.resolveMode=ht,e.getMode=rn,e.modeExtensions=Ut,e.extendMode=Zt,e.copyState=on,e.startState=mn,e.innerMode=qt,e.commands=Pr,e.keyMap=Oi,e.keyName=hs,e.isModifierKey=cs,e.lookupKey=lr,e.normalizeKeyMap=Rl,e.StringStream=jt,e.SharedTextMarker=Dr,e.TextMarker=ji,e.LineWidget=Mr,e.e_preventDefault=E,e.e_stopPropagation=M,e.e_stop=X,e.addClass=K,e.contains=k,e.rmClass=G,e.keyNames=Ii}Yl(wn),ql(wn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in li.prototype)li.prototype.hasOwnProperty(lo)&&ve(ou,lo)<0&&(wn.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(li.prototype[lo]));return le(li),wn.inputStyles={textarea:Dn,contenteditable:ln},wn.defineMode=function(e){!wn.defaults.mode&&e!="null"&&(wn.defaults.mode=e),Pt.apply(this,arguments)},wn.defineMIME=Ft,wn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),wn.defineMIME("text/plain","null"),wn.defineExtension=function(e,t){wn.prototype[e]=t},wn.defineDocExtension=function(e,t){li.prototype[e]=t},wn.fromTextArea=iu,ru(wn),wn.version="5.58.2",wn})},WaYH:function(lt,qe,v){"use strict";var z=v("rePB"),be=v("Ff2n"),ge=v("VTBJ"),Me=v("1OyB"),pe=v("vuIU"),q=v("JX7q"),D=v("Ji7U"),j=v("LK+K"),A=v("q1tI"),B=v("TSYQ"),O=v.n(B),I=v("sboe"),ue=v("OZM5"),ee=function(Se){var me=Se.prefixCls,G=Se.level,he=Se.isStart,ie=Se.isEnd;if(!G)return null;for(var R="".concat(me,"-indent-unit"),ye=[],re=0;re<G;re+=1){var k;ye.push(A.createElement("span",{key:re,className:O()(R,(k={},Object(z.a)(k,"".concat(R,"-start"),he[re+1]),Object(z.a)(k,"".concat(R,"-end"),ie[re+1]),Object(z.a)(k,"".concat(R,"-end-first-level"),!re&&ie[0]),k))}))}return A.createElement("span",{"aria-hidden":"true",className:"".concat(me,"-indent")},ye)},P=ee,$=v("815F"),J="open",de="close",fe="---",je=function(ne){Object(D.a)(me,ne);var Se=Object(j.a)(me);function me(){var G;return Object(Me.a)(this,me),G=Se.apply(this,arguments),G.state={dragNodeHighlight:!1},G.onSelectorClick=function(he){var ie=G.props.context.onNodeClick;ie(he,Object($.b)(G.props)),G.isSelectable()?G.onSelect(he):G.onCheck(he)},G.onSelectorDoubleClick=function(he){var ie=G.props.context.onNodeDoubleClick;ie(he,Object($.b)(G.props))},G.onSelect=function(he){if(G.isDisabled())return;var ie=G.props.context.onNodeSelect;he.preventDefault(),ie(he,Object($.b)(G.props))},G.onCheck=function(he){if(G.isDisabled())return;var ie=G.props,R=ie.disableCheckbox,ye=ie.checked,re=G.props.context.onNodeCheck;if(!G.isCheckable()||R)return;he.preventDefault();var k=!ye;re(he,Object($.b)(G.props),k)},G.onMouseEnter=function(he){var ie=G.props.context.onNodeMouseEnter;ie(he,Object($.b)(G.props))},G.onMouseLeave=function(he){var ie=G.props.context.onNodeMouseLeave;ie(he,Object($.b)(G.props))},G.onContextMenu=function(he){var ie=G.props.context.onNodeContextMenu;ie(he,Object($.b)(G.props))},G.onDragStart=function(he){var ie=G.props.context.onNodeDragStart;he.stopPropagation(),G.setState({dragNodeHighlight:!0}),ie(he,Object(q.a)(G));try{he.dataTransfer.setData("text/plain","")}catch(R){}},G.onDragEnter=function(he){var ie=G.props.context.onNodeDragEnter;he.preventDefault(),he.stopPropagation(),ie(he,Object(q.a)(G))},G.onDragOver=function(he){var ie=G.props.context.onNodeDragOver;he.preventDefault(),he.stopPropagation(),ie(he,Object(q.a)(G))},G.onDragLeave=function(he){var ie=G.props.context.onNodeDragLeave;he.stopPropagation(),ie(he,Object(q.a)(G))},G.onDragEnd=function(he){var ie=G.props.context.onNodeDragEnd;he.stopPropagation(),G.setState({dragNodeHighlight:!1}),ie(he,Object(q.a)(G))},G.onDrop=function(he){var ie=G.props.context.onNodeDrop;he.preventDefault(),he.stopPropagation(),G.setState({dragNodeHighlight:!1}),ie(he,Object(q.a)(G))},G.onExpand=function(he){var ie=G.props.context.onNodeExpand;ie(he,Object($.b)(G.props))},G.setSelectHandle=function(he){G.selectHandle=he},G.getNodeState=function(){var he=G.props.expanded;return G.isLeaf()?null:he?J:de},G.hasChildren=function(){var he=G.props.eventKey,ie=G.props.context.keyEntities,R=ie[he]||{},ye=R.children;return!!(ye||[]).length},G.isLeaf=function(){var he=G.props,ie=he.isLeaf,R=he.loaded,ye=G.props.context.loadData,re=G.hasChildren();return ie===!1?!1:ie||!ye&&!re||ye&&R&&!re},G.isDisabled=function(){var he=G.props.disabled,ie=G.props.context.disabled;return!!(ie||he)},G.isCheckable=function(){var he=G.props.checkable,ie=G.props.context.checkable;return!ie||he===!1?!1:ie},G.syncLoadData=function(he){var ie=he.expanded,R=he.loading,ye=he.loaded,re=G.props.context,k=re.loadData,T=re.onNodeLoad;if(R)return;k&&ie&&!G.isLeaf()&&(!G.hasChildren()&&!ye&&T(Object($.b)(G.props)))},G.renderSwitcher=function(){var he=G.props,ie=he.expanded,R=he.switcherIcon,ye=G.props.context,re=ye.prefixCls,k=ye.switcherIcon,T=R||k;if(G.isLeaf())return A.createElement("span",{className:O()("".concat(re,"-switcher"),"".concat(re,"-switcher-noop"))},typeof T=="function"?T(Object(ge.a)(Object(ge.a)({},G.props),{},{isLeaf:!0})):T);var K=O()("".concat(re,"-switcher"),"".concat(re,"-switcher_").concat(ie?J:de));return A.createElement("span",{onClick:G.onExpand,className:K},typeof T=="function"?T(Object(ge.a)(Object(ge.a)({},G.props),{},{isLeaf:!1})):T)},G.renderCheckbox=function(){var he=G.props,ie=he.checked,R=he.halfChecked,ye=he.disableCheckbox,re=G.props.context.prefixCls,k=G.isDisabled(),T=G.isCheckable();if(!T)return null;var K=typeof T!="boolean"?T:null;return A.createElement("span",{className:O()("".concat(re,"-checkbox"),ie&&"".concat(re,"-checkbox-checked"),!ie&&R&&"".concat(re,"-checkbox-indeterminate"),(k||ye)&&"".concat(re,"-checkbox-disabled")),onClick:G.onCheck},K)},G.renderIcon=function(){var he=G.props.loading,ie=G.props.context.prefixCls;return A.createElement("span",{className:O()("".concat(ie,"-iconEle"),"".concat(ie,"-icon__").concat(G.getNodeState()||"docu"),he&&"".concat(ie,"-icon_loading"))})},G.renderSelector=function(){var he=G.state.dragNodeHighlight,ie=G.props,R=ie.title,ye=ie.selected,re=ie.icon,k=ie.loading,T=ie.data,K=G.props.context,L=K.prefixCls,V=K.showIcon,p=K.icon,h=K.draggable,N=K.loadData,te=K.titleRender,ve=G.isDisabled(),Pe="".concat(L,"-node-content-wrapper"),Ee;if(V){var we=re||p;Ee=we?A.createElement("span",{className:O()("".concat(L,"-iconEle"),"".concat(L,"-icon__customize"))},typeof we=="function"?we(G.props):we):G.renderIcon()}else N&&k&&(Ee=G.renderIcon());var H;typeof R=="function"?H=R(T):te?H=te(T):H=R;var x=A.createElement("span",{className:"".concat(L,"-title")},H);return A.createElement("span",{ref:G.setSelectHandle,title:typeof R=="string"?R:"",className:O()("".concat(Pe),"".concat(Pe,"-").concat(G.getNodeState()||"normal"),!ve&&(ye||he)&&"".concat(L,"-node-selected"),!ve&&h&&"draggable"),draggable:!ve&&h||void 0,"aria-grabbed":!ve&&h||void 0,onMouseEnter:G.onMouseEnter,onMouseLeave:G.onMouseLeave,onContextMenu:G.onContextMenu,onClick:G.onSelectorClick,onDoubleClick:G.onSelectorDoubleClick,onDragStart:h?G.onDragStart:void 0},Ee,x)},G}return Object(pe.a)(me,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var he=this.props.selectable,ie=this.props.context.selectable;return typeof he=="boolean"?he:ie}},{key:"render",value:function(){var he,ie=this.props,R=ie.eventKey,ye=ie.className,re=ie.style,k=ie.dragOver,T=ie.dragOverGapTop,K=ie.dragOverGapBottom,L=ie.isLeaf,V=ie.isStart,p=ie.isEnd,h=ie.expanded,N=ie.selected,te=ie.checked,ve=ie.halfChecked,Pe=ie.loading,Ee=ie.domRef,we=ie.active,H=ie.onMouseMove,x=Object(be.a)(ie,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),F=this.props.context,w=F.prefixCls,_=F.filterTreeNode,g=F.draggable,y=F.keyEntities,S=this.isDisabled(),W=Object(ue.f)(x),ce=y[R]||{},Y=ce.level,Ce=p[p.length-1];return A.createElement("div",Object.assign({ref:Ee,className:O()(ye,"".concat(w,"-treenode"),(he={},Object(z.a)(he,"".concat(w,"-treenode-disabled"),S),Object(z.a)(he,"".concat(w,"-treenode-switcher-").concat(h?"open":"close"),!L),Object(z.a)(he,"".concat(w,"-treenode-checkbox-checked"),te),Object(z.a)(he,"".concat(w,"-treenode-checkbox-indeterminate"),ve),Object(z.a)(he,"".concat(w,"-treenode-selected"),N),Object(z.a)(he,"".concat(w,"-treenode-loading"),Pe),Object(z.a)(he,"".concat(w,"-treenode-active"),we),Object(z.a)(he,"".concat(w,"-treenode-leaf-last"),Ce),Object(z.a)(he,"drag-over",!S&&k),Object(z.a)(he,"drag-over-gap-top",!S&&T),Object(z.a)(he,"drag-over-gap-bottom",!S&&K),Object(z.a)(he,"filter-node",_&&_(Object($.b)(this.props))),he)),style:re,onDragEnter:g?this.onDragEnter:void 0,onDragOver:g?this.onDragOver:void 0,onDragLeave:g?this.onDragLeave:void 0,onDrop:g?this.onDrop:void 0,onDragEnd:g?this.onDragEnd:void 0,onMouseMove:H},W),A.createElement(P,{prefixCls:w,level:Y,isStart:V,isEnd:p}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),me}(A.Component),Ue=function(Se){return A.createElement(I.a.Consumer,null,function(me){return A.createElement(je,Object.assign({},Se,{context:me}))})};Ue.displayName="TreeNode",Ue.defaultProps={title:fe},Ue.isTreeNode=1;var Te=qe.a=Ue},X8EC:function(lt,qe,v){"use strict";v.r(qe);var z=v("DZo9"),be=v("8z0m"),ge=v("+L6B"),Me=v("2/Rp"),pe=v("oBTY"),q=v("sRBo"),D=v("kaz8"),j=v("7Kak"),A=v("9yH6"),B=v("BoS7"),O=v("Sdc0"),I=v("14J3"),ue=v("BMrR"),ee=v("jCWc"),P=v("kPKH"),$=v("O3gP"),J=v("lrIw"),de=v("k1fw"),fe=v("miYZ"),je=v("tsqr"),Ue=v("9og8"),Te=v("y8nQ"),ne=v("Vl3Y"),Se=v("tJVT"),me=v("PpiC"),G=v("nRaC"),he=v("5RzL"),ie=v("5NDa"),R=v("5rEg"),ye=v("WmNS"),re=v.n(ye),k=v("q1tI"),T=v.n(k),K=v("9kvl"),L=v("Ot1p"),V=v("hxT0"),p=v.n(V),h=v("1vsH"),N=v("m3rI"),te=v("ErOA"),ve=v("jrin"),Pe=v("R9oj"),Ee=v("ECub"),we=v("YNHc"),H=v.n(we),x=v("4i/N"),F=v("UESt"),w=Object(k.createRef)(),_=function(Qe){var Ae=Qe.dataSource,We=Qe.placeholder,se=Qe.defaultValue,Q=Qe.onChange,le=Object(k.useState)(!1),E=Object(Se.a)(le,2),M=E[0],U=E[1],X=Object(k.useState)({data:[],objData:{},ids:[]}),ke=Object(Se.a)(X,2),De=ke[0],et=ke[1],yt=Object(k.useState)({}),St=Object(Se.a)(yt,2),Je=St[0],bt=St[1];Object(k.useEffect)(function(){window.addEventListener("click",function(){U(!1),bt({})})},[]),Object(k.useEffect)(function(){if(se){var kt={},Et=[];se.forEach(function(xt){var Pt=xt.sub_discipline,Ft=Object(me.a)(xt,["sub_discipline"]);Pt&&(kt[Pt.id]=Object(de.a)(Object(de.a)({},Ft),{},{sub_disciplines:[Pt]}),Et.push(Pt.id))}),et({ids:Et,data:Object.values(kt),objData:kt}),Q(Et)}},[se]);var mt=function(){return T.a.createElement("div",{className:H.a.emptyWrap},T.a.createElement(Ee.a,{image:Ee.a.PRESENTED_IMAGE_SIMPLE}))},rt=function(Et){if(De.ids.includes(Et.id))return!1;var xt=Je.sub_disciplines,Pt=Object(me.a)(Je,["sub_disciplines"]),Ft=Object(de.a)(Object(de.a)({},De.objData),{},Object(ve.a)({},Et.id,Object(de.a)(Object(de.a)({},Pt),{},{sub_disciplines:[Et]})));et({ids:[].concat(Object(pe.a)(De.ids),[Et.id]),data:Object.values(Ft),objData:Ft}),Q([].concat(Object(pe.a)(De.ids),[Et.id]))},Dt=function(Et){var xt=De.objData;delete xt[Et];var Pt=De.ids.filter(function(Ft){return Ft!==Et});et({data:Object.values(xt),objData:xt,ids:Pt}),Q(Pt)},Ot=45;return w&&w.current&&w.current.clientHeight>45&&(Ot=w.current.clientHeight+5),T.a.createElement("div",{className:H.a.cascaderContainer,onClick:function(Et){Et.stopPropagation()}},T.a.createElement("div",{ref:w,className:H.a.valueWrap,onClick:function(){return U(!M)}},De.data.length===0&&T.a.createElement("span",{className:H.a.placeholder},We||"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B"),De.data.map(function(kt){return T.a.createElement("div",{className:H.a.valueItem,key:kt.id},T.a.createElement("span",null,kt.name),T.a.createElement("span",null,"/"),T.a.createElement("span",null,kt.sub_disciplines[0].name),T.a.createElement("span",{onClick:function(xt){xt.stopPropagation(),xt.preventDefault(),Dt(kt.sub_disciplines[0].id)}},T.a.createElement(x.a,null)))})),M&&T.a.createElement("div",{className:H.a.modalWrap,style:{top:Ot}},T.a.createElement("div",{className:H.a.left},Ae.length===0&&mt(),Ae.length>0&&Ae.map(function(kt){return T.a.createElement("div",{key:kt.id,onClick:function(){return bt(kt)}},T.a.createElement("span",null,kt.name),T.a.createElement("span",null,T.a.createElement(F.a,null)))})),Je.sub_disciplines&&T.a.createElement("div",{className:H.a.right},Je.sub_disciplines.length===0&&mt(),Je.sub_disciplines.length>0&&Je.sub_disciplines.map(function(kt){var Et=De.ids.includes(kt.id);return T.a.createElement("div",{key:kt.id,className:Et?H.a.disabled:"",onClick:function(){return rt(kt)}},kt.name)}))))},g=_,y=v("2qtc"),S=v("kLXV"),W=v("6UJt"),ce=v("DFOY"),Y=v("wd/R"),Ce=v.n(Y),Re=v("jO45"),Fe=v("jN4g"),Ve=v("gJ3r"),He=v("8pgt"),ze=v.n(He),at=function(Qe,Ae){return Ae.some(function(We){return We.label.toLowerCase().indexOf(Qe.toLowerCase())>-1})},xe=R.a.TextArea,Ie=function(Qe){var Ae=Qe.newCourse,We=Qe.globalSetting,se=Qe.loading,Q=Qe.dispatch,le=Qe.schoolName,E=Qe.onSuccess,M=E===void 0?function(){}:E,U=Object(me.a)(Qe,["newCourse","globalSetting","loading","dispatch","schoolName","onSuccess"]),X=ne.a.useForm(),ke=Object(Se.a)(X,1),De=ke[0];Object(k.useEffect)(function(){De.setFieldsValue({name:le})},[le]);var et=function(){var yt=Object(Ue.a)(re.a.mark(function St(Je){var bt,mt,rt,Dt,Ot,kt,Et;return re.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return bt=Je||{},mt=bt.name,rt=bt.city,Dt=rt===void 0?[]:rt,Ot=bt.address,kt=bt.remarks,Pt.next=3,Q({type:"newCourse/appplySchool",payload:{name:mt,province:Dt[0],city:Dt[1],address:Ot,remarks:kt}});case 3:Et=Pt.sent,Q({type:"newCourse/setActionTabs",payload:{}}),Et&&(je.b.success("\u65B0\u589E\u53D1\u5E03\u5355\u4F4D\u6210\u529F\uFF01"),M(mt));case 6:case"end":return Pt.stop()}},St)}));return function(Je){return yt.apply(this,arguments)}}();return T.a.createElement(S.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Ae.actionTabs.key==="NewCourse-AppplySchool",title:"\u7533\u8BF7\u53D1\u5E03\u5355\u4F4D",width:"600px",footer:null},T.a.createElement(ne.a,{className:ze.a.formWrap,form:De,labelCol:{span:4},wrapperCol:{span:20},onFinish:et},T.a.createElement(ne.a.Item,{label:"\u53D1\u5E03\u5355\u4F4D\uFF1A",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B66\u6821\u6216\u5DE5\u4F5C\u5355\u4F4D"}]},T.a.createElement(R.a,{placeholder:"\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D"})),T.a.createElement("div",{className:"".concat(ze.a.flexRow," ").concat(ze.a.example)},T.a.createElement("div",null,"\u793A\u4F8B\uFF1A"),T.a.createElement("div",{className:ze.a.flexColumn},T.a.createElement("div",null,T.a.createElement(Re.a,{style:{color:"rgb(82, 196, 26)"}}),T.a.createElement("span",{className:"font14 ml5"},"\u6B63\u786E\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784")),T.a.createElement("div",null,T.a.createElement(Fe.a,{style:{color:"red"}}),T.a.createElement("span",{className:"font14 ml5"},"\u9519\u8BEF\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784",Ce()().format("YYYY"),"\u6625")))),T.a.createElement(ne.a.Item,{label:"\u5730\u533A\uFF1A",name:"city"},T.a.createElement(ce.a,{allowClear:!0,size:"large",options:Ve.a,placeholder:"\u8BF7\u9009\u62E9\u6240\u5728\u5730",showSearch:{matchInputWidth:!0,filter:at}})),T.a.createElement(ne.a.Item,{label:"\u8BE6\u7EC6\u5730\u5740\uFF1A",name:"address"},T.a.createElement(R.a,{placeholder:"\u8BF7\u586B\u5199\u5B8C\u6574\u7684\u5730\u5740\u4FE1\u606F"})),T.a.createElement(ne.a.Item,{label:"\u8BF4\u660E\uFF1A",name:"remarks"},T.a.createElement(xe,{placeholder:"\u518D\u6B21\u8BF4\u660E\u7279\u522B\u60C5\u51B5\uFF08\u9009\u586B\uFF09"})),T.a.createElement("div",{className:ze.a.footerWrap},T.a.createElement(ne.a.Item,null,T.a.createElement(Me.a,{className:"mr5",size:"large",onClick:function(){Q({type:"newCourse/setActionTabs",payload:{}})}},"\u53D6\u6D88"),T.a.createElement(Me.a,{size:"large",type:"primary",htmlType:"submit",loading:se["newCourse/appplySchool"]},"\u4FDD\u5B58")))))},Be=Object(K.a)(function(nt){var Qe=nt.newCourse,Ae=nt.loading,We=nt.globalSetting;return{newCourse:Qe,globalSetting:We,loading:Ae.effects}})(Ie),Ke=R.a.TextArea,$e=he.a.TreeNode,Ge=function(Qe){var Ae,We,se=Qe.user,Q=Qe.newCourse,le=Qe.globalSetting,E=Qe.loading,M=Qe.dispatch,U=Object(me.a)(Qe,["user","newCourse","globalSetting","loading","dispatch"]),X=ne.a.useForm(),ke=Object(Se.a)(X,1),De=ke[0],et=Object(k.useState)({}),yt=Object(Se.a)(et,2),St=yt[0],Je=yt[1],bt=Object(k.useState)(),mt=Object(Se.a)(bt,2),rt=mt[0],Dt=mt[1],Ot=Object(k.useRef)(),kt=Object(k.useState)(!0),Et=Object(Se.a)(kt,2),xt=Et[0],Pt=Et[1],Ft=Object(k.useState)(!1),ht=Object(Se.a)(Ft,2),rn=ht[0],Ut=ht[1],Zt=Object(k.useState)(),on=Object(Se.a)(Zt,2),qt=on[0],mn=on[1],jt=Object(k.useState)(!0),ft=Object(Se.a)(jt,2),an=ft[0],Ln=ft[1],En=Object(k.useState)(!1),It=Object(Se.a)(En,2),Sn=It[0],vn=It[1],ri=Object(k.useState)(!1),tt=Object(Se.a)(ri,2),_t=tt[0],Un=tt[1],Pn=Object(k.useState)(-1),Yn=Object(Se.a)(Pn,2),Jn=Yn[0],d=Yn[1],o=Object(k.useState)(!0),a=Object(Se.a)(o,2),u=a[0],b=a[1],c=Object(k.useState)([]),oe=Object(Se.a)(c,2),Ye=oe[0],Le=oe[1],ut=Object(k.useState)([]),Xe=Object(Se.a)(ut,2),vt=Xe[0],pt=Xe[1],Rt=Object(k.useState)([]),dn=Object(Se.a)(Rt,2),en=dn[0],Jt=dn[1],Cn=Object(k.useState)([]),Gn=Object(Se.a)(Cn,2),bn=Gn[0],Vt=Gn[1];Object(k.useEffect)(function(){var Xt,wt;kn(),Zn(),Ot.current=(Xt=U.match.params)===null||Xt===void 0?void 0:Xt.pathId,Dt(!!Ot.current),Object(h.V)(le==null||((wt=le.setting)===null||wt===void 0)?void 0:wt.name),De.setFieldsValue({learning_notes_title:"\u8BFE\u7A0B\u987B\u77E5"}),Ot.current&&yn()},[]);var kn=function(){var Xt=Object(Ue.a)(re.a.mark(function wt(){var st;return re.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(te.a)("/api/disciplines.json",{method:"get",params:{source:"subject"}});case 2:st=tn.sent,Jt(st.disciplines);case 4:case"end":return tn.stop()}},wt)}));return function(){return Xt.apply(this,arguments)}}(),Zn=function(){var Xt=Object(Ue.a)(re.a.mark(function wt(){var st;return re.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return b(!0),tn.next=3,M({type:"newCourse/getSchoolOption"});case 3:st=tn.sent,b(!1),Le(st==null?void 0:st.schools),pt(st==null?void 0:st.schools);case 7:case"end":return tn.stop()}},wt)}));return function(){return Xt.apply(this,arguments)}}(),yn=function(){var Xt=Object(Ue.a)(re.a.mark(function wt(){var st,Mn,tn,jn,un,Ht,Tn,Wt,xn,$t,ti,gn,fn;return re.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,M({type:"newCourse/getEditCourseData",payload:{id:Ot.current}});case 2:st=Qn.sent,st&&(Tn={name:st.name,name_en:st.name_en,intro:st.description,content:st==null||((Mn=st.toast)===null||Mn===void 0)?void 0:Mn.content,notice:st.learning_notes,school_id:st==null?void 0:st.school,learning_notes_title:st.learning_notes_title||"\u8BFE\u7A0B\u987B\u77E5"},st.disciplines&&st.disciplines.length>0&&Vt(st.disciplines),De.setFieldsValue(Tn),Un(st==null||((tn=st.toast)===null||tn===void 0)?void 0:tn.is_open),d(st==null||((jn=st.toast)===null||jn===void 0)?void 0:jn.open_num),Pt(st==null?void 0:st.cust_seq),Ut(st==null?void 0:st.show_spoc),vn(st==null?void 0:st.show_history),Ln(st==null?void 0:st.show_tag),(st==null||((un=st.attachments)===null||un===void 0)?void 0:un.length)>0&&mn([{uid:st==null||((Wt=st.attachments)===null||Wt===void 0||((xn=Wt[0])===null||xn===void 0))?void 0:xn.id,name:st==null||(($t=st.attachments)===null||$t===void 0||((ti=$t[0])===null||ti===void 0))?void 0:ti.title,response:{id:st==null||((gn=st.attachments)===null||gn===void 0||((fn=gn[0])===null||fn===void 0))?void 0:fn.id}}]),Je({name:st.name,intro:st.description,notice:st.learning_notes,content:st==null||((Ht=st.toast)===null||Ht===void 0)?void 0:Ht.content}));case 4:case"end":return Qn.stop()}},wt)}));return function(){return Xt.apply(this,arguments)}}(),oi=function(){var Xt=Object(Ue.a)(re.a.mark(function wt(st){var Mn,tn,jn,un,Ht,Tn,Wt,xn,$t,ti,gn,fn,ai,Qn,hi;return re.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:if(jn=st||{},un=jn.name,Ht=jn.intro,Tn=jn.notice,Wt=jn.name_en,xn=jn.learning_notes_title,$t=jn.sub_discipline_ids,ti=jn.school_id,gn=rt?"newCourse/editCourse":"newCourse/submitCourse",fn=!1,ai=null,Ye.map(function(ki){ti===ki.name&&(fn=!0,ai=ki.id)}),fn){Fn.next=7;break}return Fn.abrupt("return",je.b.error("\u672A\u627E\u5230\u5305\u542B'".concat(ti,"'\u7684\u53D1\u5E03\u5355\u4F4D")));case 7:return Qn={id:Ot.current,name:un,name_en:Wt,description:Ht,learning_notes:Tn,cust_seq:xt,show_spoc:rn,school_id:ai,show_tag:an,show_history:Sn,learning_notes_title:xn,attachment_ids:[qt==null||((Mn=qt[0])===null||Mn===void 0||((tn=Mn.response)===null||tn===void 0))?void 0:tn.id],sub_discipline_ids:$t,subject_toast_attributes:{is_open:_t,open_num:Jn,content:st.content}},Fn.next=10,M({type:gn,payload:Object(de.a)({},Qn)});case 10:hi=Fn.sent,(hi==null?void 0:hi.subject_id)&&K.d.push("/paths/".concat(hi.subject_id));case 12:case"end":return Fn.stop()}},wt)}));return function(st){return Xt.apply(this,arguments)}}(),hn=function(){M({type:"newCourse/setActionTabs",payload:{key:"NewCourse-AppplySchool"}})},Bn=function(wt){Zn(),Je(Object(de.a)({},De.getFieldsValue()))};return T.a.createElement("section",{className:p.a.bg},T.a.createElement("div",{className:p.a.titleWrap},T.a.createElement("span",null,rt?"\u7F16\u8F91":"\u521B\u5EFA","\u5B9E\u8DF5\u8BFE\u7A0B")),T.a.createElement(ne.a,{form:De,className:p.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){var wt=De.getFieldsValue();"school_id"in wt&&pt(Ye.filter(function(st){return st.name.includes(wt.school_id)})),Je(Object(de.a)({},wt))},onFinish:oi},T.a.createElement("div",{className:p.a.fieldWrap},T.a.createElement(ne.a.Item,{extra:T.a.createElement("div",{className:"tr c-grey-333 font12 mt3"},"".concat(((Ae=St.name)===null||Ae===void 0?void 0:Ae.length)||0,"/60")),name:"name",label:"\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0"}]},T.a.createElement(Ke,{maxLength:60,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"})),T.a.createElement(ne.a.Item,{name:"name_en",label:"\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0:",rules:[{message:"\u8BF7\u8F93\u5165\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0"}]},T.a.createElement(R.a,{maxLength:200,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A",addonAfter:"".concat(((We=St.name_en)===null||We===void 0?void 0:We.length)||0,"/200")})),T.a.createElement(ne.a.Item,{name:"sub_discipline_ids",label:"\u65B9\u5411&\u8BFE\u7A0B:"},T.a.createElement(g,{defaultValue:bn,dataSource:en,onChange:function(wt){return De.setFieldsValue({sub_discipline_ids:wt})}})),T.a.createElement(ne.a.Item,{label:"\u53D1\u5E03\u5355\u4F4D",name:"school_id",wrapperCol:{span:24},extra:!u&&St.school_id&&!(Ye!=null&&Ye.find(function(Xt){return Xt.name===St.school_id}))&&T.a.createElement("div",{className:p.a.schoolHintWrap},T.a.createElement("span",{className:p.a.colorCDCDCD},"\u672A\u627E\u5230\u5305\u542B\u201C",St.school_id,"\u201D\u7684\u53D1\u5E03\u5355\u4F4D\uFF0C"),T.a.createElement("span",{className:"".concat(p.a.color0152d9),onClick:hn},"\u7533\u8BF7\u65B0\u589E")),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D"}]},T.a.createElement(J.a,{placeholder:"\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D",showSearch:!0,options:vt==null?void 0:vt.map(function(Xt){return{value:Xt.name}})}))),T.a.createElement("div",{className:p.a.mdWrap},T.a.createElement(ne.a.Item,{name:"intro",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u7B80\u4ECB"},{max:8e3,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u7B80\u4ECB\u6700\u5927\u9650\u52368000\u4E2A\u5B57\u7B26"}]},T.a.createElement(L.a,{watch:!0,defaultValue:St.intro}))),T.a.createElement("div",{className:p.a.mdWrap},T.a.createElement(ue.a,{align:"middle",className:"mb10 mt10"},T.a.createElement(P.a,null,T.a.createElement("span",{className:"c-red mr10"},"*")),T.a.createElement(P.a,{flex:"1"},T.a.createElement(ne.a.Item,{name:"learning_notes_title",label:"",style:{marginBottom:0},rules:[{required:!0,message:"\u8BF7\u8F93\u8BFE\u7A0B\u987B\u77E5\u6807\u9898"},{max:15,message:"\u8BF7\u8F93\u8BFE\u7A0B\u987B\u77E5\u6807\u9898\u6700\u5927\u9650\u523615\u4E2A\u5B57\u7B26"}]},T.a.createElement(R.a,{placeholder:"\u8BF7\u8F93\u5165"})))),T.a.createElement(ne.a.Item,{name:"notice",label:"",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u987B\u77E5"},{max:1e4,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u987B\u77E5\u6700\u5927\u9650\u523610000\u4E2A\u5B57\u7B26"}]},T.a.createElement(L.a,{insertTemp:"1",watch:!0,defaultValue:St.notice}))),T.a.createElement("div",{className:p.a.mdWrap},T.a.createElement("div",{style:{display:"flex",alignItems:"center"}},T.a.createElement(O.a,{checked:_t,style:{marginRight:11},onChange:function(wt){Un(wt)}}),"\u8BFE\u7A0B\u63D0\u793A\uFF08\u8FDB\u5165\u8BFE\u7A0B\u8BE6\u60C5\u9875\uFF0C\u63D0\u793A\u5185\u5BB9\u4EE5\u5F39\u7A97\u7684\u5F62\u5F0F\u8FDB\u884C\u5C55\u793A\uFF09"),_t&&T.a.createElement(ne.a.Item,{style:{marginTop:10},name:"content",label:"",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u63D0\u793A"},{max:1e4,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u63D0\u793A\u6700\u5927\u9650\u523610000\u4E2A\u5B57\u7B26"}]},T.a.createElement(L.a,{insertTemp:"1",watch:!0,defaultValue:St.content})),_t&&T.a.createElement("div",{style:{marginTop:20}},T.a.createElement("label",null,"\u63D0\u793A\u6B21\u6570\uFF1A"),T.a.createElement(A.a.Group,{value:Jn,onChange:function(wt){d(wt.target.value)}},T.a.createElement(A.a,{value:-1},"\u6BCF\u6B21"),T.a.createElement(A.a,{value:1},"\u4E00\u6B21")))),T.a.createElement("div",{className:p.a.mdWrap},T.a.createElement(D.a,{checked:xt,onChange:function(wt){Pt(wt==null?void 0:wt.target.checked)}},"\u5C55\u793A\u9ED8\u8BA4\u7AE0\u8282\u5E8F\u53F7\uFF08\u9009\u4E2D\u5219\u6309\u5E8F\u5C55\u793A\u6240\u7AE0\u8282\u5E8F\u53F7\uFF0C\u4E0D\u9009\u4E2D\u5219\u9690\u85CF\u9ED8\u8BA4\u6392\u5E8F\uFF09"),T.a.createElement("br",null),T.a.createElement(D.a,{style:{marginTop:"10px"},checked:rn,onChange:function(wt){return Ut(wt==null?void 0:wt.target.checked)}},"\u81EA\u9009\u5E76\u5C55\u793ASPOC\u8BFE\u5802\uFF08\u9009\u4E2D\u5219\u7ED9\u51FASPOC\u8BFE\u5802\u5C55\u793A\u533A\u57DF\uFF0C\u8BFE\u7A0B\u521B\u5EFA\u8005/\u5408\u4F5C\u8005\u53EF\u4EE5\u81EA\u4E3B\u6DFB\u52A0\u9700\u8981\u5C55\u793A\u7684\u8BFE\u5802\uFF09"),T.a.createElement("br",null),T.a.createElement(D.a,{style:{marginTop:"10px"},checked:an,onChange:function(wt){return Ln(wt==null?void 0:wt.target.checked)}},"\u5C55\u793A\u6280\u672F\u6807\u7B7E\u6A21\u5757\uFF08\u9009\u4E2D\u540E\uFF0C\u5C55\u793A\u8BFE\u7A0B\u7684\u6280\u80FD\u6807\u7B7E\uFF0C\u4E0D\u9009\u4E2D\u5219\u4E0D\u5C55\u793A\u8BE5\u6A21\u5757\uFF09"),T.a.createElement("br",null),T.a.createElement(D.a,{style:{marginTop:"10px"},checked:Sn,onChange:function(wt){return vn(wt==null?void 0:wt.target.checked)}},"\u5C55\u793A\u5386\u53F2\u8BFE\u5802\u6A21\u5757\uFF08\u9009\u4E2D\u540E\uFF0C\u5C55\u793A\u8BFE\u7A0B\u7684\u5386\u53F2\u8BFE\u5802\uFF0C\u4E0D\u9009\u4E2D\u5219\u4E0D\u5C55\u793A\u8BE5\u6A21\u5757\uFF09"),T.a.createElement("br",null),T.a.createElement("div",{style:{display:"flex",marginTop:"10px"}},"\u81EA\u5B9A\u4E49\u9876\u90E8\u80CC\u666F\u56FE\uFF1A",T.a.createElement(be.a,{action:N.a.API_SERVER+"/api/attachments.json",withCredentials:!0,fileList:qt,onChange:function(wt){var st,Mn=(wt==null?void 0:wt.file.size)/1024/1024<2;if(!((st=wt.fileList)!==null&&st!==void 0&&st.length))return!1;if(!Mn)mn(Object(pe.a)(qt));else{var tn;mn(wt==null||((tn=wt.fileList)===null||tn===void 0)?void 0:tn.slice(-1))}},beforeUpload:function(wt){var st=wt.type==="image/jpeg"||wt.type==="image/png";if(!st)return je.b.error("\u53EA\u80FD\u4E0A\u4F20jpg \u6216\u8005png\u56FE\u7247"),!1;var Mn=wt.size/1024/1024<2;return Mn?st&&Mn:(je.b.error("\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u5927\u4E8E2m"),!1)},onRemove:function(wt){mn([])}},T.a.createElement(Me.a,null,"\u4E0A\u4F20\u56FE\u7247"),"\uFF08 \u672C\u9879\u975E\u5FC5\u9700\u3002\u5982\u4E0D\u4E0A\u4F20\uFF0C\u5219\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u56FE\u7247\uFF1B\u5982\u4E0A\u4F20\uFF0C\u8BF7\u9009\u62E9jpg\u3001png\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC72M\uFF0C\u5EFA\u8BAE\u5C3A\u5BF81920*240\u50CF\u7D20\uFF09"))),T.a.createElement("div",{className:p.a.backgroundFa},T.a.createElement("div",{className:"pt40 mb30"},T.a.createElement(ne.a.Item,null,T.a.createElement(Me.a,{size:"large",type:"primary",className:"".concat(p.a.button," mr20"),htmlType:"submit",loading:E["newCourse/editCourse"]||E["newCourse/submitCourse"]},"\u63D0\u4EA4"),T.a.createElement(Me.a,{size:"large",type:"primary",ghost:!0,className:p.a.button,onClick:function(){return K.d.push(rt?"/paths/".concat(Ot.current):"/paths")}},"\u53D6\u6D88"))))),T.a.createElement(Be,{schoolName:St.school_id,onSuccess:Bn}))},_e=qe.default=Object(K.a)(function(nt){var Qe=nt.user,Ae=nt.newCourse,We=nt.loading,se=nt.globalSetting;return{user:Qe,newCourse:Ae,globalSetting:se,loading:We.effects}})(Ge)},XIdC:function(lt,qe,v){"use strict";var z=v("rePB"),be=v("ODXe"),ge=v("Ff2n"),Me=v("q1tI"),pe=v.n(Me),q=v("TSYQ"),D=v.n(q),j=v("6cGi"),A=v("4IlW"),B=Me.forwardRef(function(O,I){var ue,ee=O.prefixCls,P=ee===void 0?"rc-switch":ee,$=O.className,J=O.checked,de=O.defaultChecked,fe=O.disabled,je=O.loadingIcon,Ue=O.checkedChildren,Te=O.unCheckedChildren,ne=O.onClick,Se=O.onChange,me=O.onKeyDown,G=Object(ge.a)(O,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),he=Object(j.a)(!1,{value:J,defaultValue:de}),ie=Object(be.a)(he,2),R=ie[0],ye=ie[1];function re(L,V){var p=R;return fe||(p=L,ye(p),Se==null||Se(p,V)),p}function k(L){L.which===A.a.LEFT?re(!1,L):L.which===A.a.RIGHT&&re(!0,L),me==null||me(L)}function T(L){var V=re(!R,L);ne==null||ne(V,L)}var K=D()(P,$,(ue={},Object(z.a)(ue,"".concat(P,"-checked"),R),Object(z.a)(ue,"".concat(P,"-disabled"),fe),ue));return Me.createElement("button",Object.assign({},G,{type:"button",role:"switch","aria-checked":R,disabled:fe,className:K,ref:I,onKeyDown:k,onClick:T}),je,Me.createElement("span",{className:"".concat(P,"-inner")},R?Ue:Te))});B.displayName="Switch",qe.a=B},Y1PL:function(lt,qe,v){"use strict";v.r(qe),v.d(qe,"ResizableTextArea",function(){return ve});var z=v("wx14"),be=v("1OyB"),ge=v("vuIU"),Me=v("Ji7U"),pe=v("LK+K"),q=v("q1tI"),D=v("VTBJ"),j=v("rePB"),A=v("Zm9Q"),B=v("Kwbf"),O=v("c+Xe"),I=v("m+aA"),ue=v("bdgK"),ee=new Map;function P(we){we.forEach(function(H){var x,F=H.target;(x=ee.get(F))===null||x===void 0||x.forEach(function(w){return w(F)})})}var $=new ue.default(P),J=null,de=null;function fe(we,H){ee.has(we)||(ee.set(we,new Set),$.observe(we)),ee.get(we).add(H)}function je(we,H){ee.has(we)&&(ee.get(we).delete(H),ee.get(we).size||($.unobserve(we),ee.delete(we)))}var Ue=function(we){Object(Me.a)(x,we);var H=Object(pe.a)(x);function x(){return Object(be.a)(this,x),H.apply(this,arguments)}return Object(ge.a)(x,[{key:"render",value:function(){return this.props.children}}]),x}(q.Component),Te=q.createContext(null);function ne(we){var H=we.children,x=we.onBatchResize,F=q.useRef(0),w=q.useRef([]),_=q.useContext(Te),g=q.useCallback(function(y,S,W){F.current+=1;var ce=F.current;w.current.push({size:y,element:S,data:W}),Promise.resolve().then(function(){ce===F.current&&(x==null||x(w.current),w.current=[])}),_==null||_(y,S,W)},[x,_]);return q.createElement(Te.Provider,{value:g},H)}function Se(we){var H=we.children,x=we.disabled,F=q.useRef(null),w=q.useRef(null),_=q.useContext(Te),g=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),y=q.isValidElement(H)&&Object(O.c)(H),S=y?H.ref:null,W=q.useMemo(function(){return Object(O.a)(S,F)},[S,F]),ce=q.useRef(we);ce.current=we;var Y=q.useCallback(function(Ce){var Re=ce.current,Fe=Re.onResize,Ve=Re.data,He=Ce.getBoundingClientRect(),ze=He.width,at=He.height,xe=Ce.offsetWidth,Ie=Ce.offsetHeight,Be=Math.floor(ze),Ke=Math.floor(at);if(g.current.width!==Be||g.current.height!==Ke||g.current.offsetWidth!==xe||g.current.offsetHeight!==Ie){var $e={width:Be,height:Ke,offsetWidth:xe,offsetHeight:Ie};g.current=$e;var Ge=xe===Math.round(ze)?ze:xe,_e=Ie===Math.round(at)?at:Ie,nt=Object(D.a)(Object(D.a)({},$e),{},{offsetWidth:Ge,offsetHeight:_e});_==null||_(nt,Ce,Ve),Fe&&Promise.resolve().then(function(){Fe(nt,Ce)})}},[]);return q.useEffect(function(){var Ce=Object(I.a)(F.current)||Object(I.a)(w.current);return Ce&&!x&&fe(Ce,Y),function(){return je(Ce,Y)}},[F.current,x]),q.createElement(Ue,{ref:w},y?q.cloneElement(H,{ref:W}):H)}var me="rc-observer-key";function G(we){var H=we.children,x=Object(A.a)(H);return x.map(function(F,w){var _=(F==null?void 0:F.key)||"".concat(me,"-").concat(w);return q.createElement(Se,Object(z.a)({},we,{key:_}),F)})}G.Collection=ne;var he=G,ie=v("bT9E"),R=v("TSYQ"),ye=v.n(R),re=`
|
|
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"],T={},K;function L(we){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x=we.getAttribute("id")||we.getAttribute("data-reactid")||we.getAttribute("name");if(H&&T[x])return T[x];var F=window.getComputedStyle(we),w=F.getPropertyValue("box-sizing")||F.getPropertyValue("-moz-box-sizing")||F.getPropertyValue("-webkit-box-sizing"),_=parseFloat(F.getPropertyValue("padding-bottom"))+parseFloat(F.getPropertyValue("padding-top")),g=parseFloat(F.getPropertyValue("border-bottom-width"))+parseFloat(F.getPropertyValue("border-top-width")),y=k.map(function(W){return"".concat(W,":").concat(F.getPropertyValue(W))}).join(";"),S={sizingStyle:y,paddingSize:_,borderSize:g,boxSizing:w};return H&&x&&(T[x]=S),S}function V(we){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;K||(K=document.createElement("textarea"),K.setAttribute("tab-index","-1"),K.setAttribute("aria-hidden","true"),document.body.appendChild(K)),we.getAttribute("wrap")?K.setAttribute("wrap",we.getAttribute("wrap")):K.removeAttribute("wrap");var w=L(we,H),_=w.paddingSize,g=w.borderSize,y=w.boxSizing,S=w.sizingStyle;K.setAttribute("style","".concat(S,";").concat(re)),K.value=we.value||we.placeholder||"";var W=Number.MIN_SAFE_INTEGER,ce=Number.MAX_SAFE_INTEGER,Y=K.scrollHeight,Ce;if(y==="border-box"?Y+=g:y==="content-box"&&(Y-=_),x!==null||F!==null){K.value=" ";var Re=K.scrollHeight-_;x!==null&&(W=Re*x,y==="border-box"&&(W=W+_+g),Y=Math.max(W,Y)),F!==null&&(ce=Re*F,y==="border-box"&&(ce=ce+_+g),Ce=Y>ce?"":"hidden",Y=Math.min(ce,Y))}return{height:Y,minHeight:W,maxHeight:ce,overflowY:Ce,resize:"none"}}var p=v("Gytx"),h=v.n(p),N;(function(we){we[we.NONE=0]="NONE",we[we.RESIZING=1]="RESIZING",we[we.RESIZED=2]="RESIZED"})(N||(N={}));var te=function(we){Object(Me.a)(x,we);var H=Object(pe.a)(x);function x(F){var w;return Object(be.a)(this,x),w=H.call(this,F),w.nextFrameActionId=void 0,w.resizeFrameId=void 0,w.textArea=void 0,w.saveTextArea=function(_){w.textArea=_},w.handleResize=function(_){var g=w.state.resizeStatus,y=w.props,S=y.autoSize,W=y.onResize;if(g!==N.NONE)return;typeof W=="function"&&W(_),S&&w.resizeOnNextFrame()},w.resizeOnNextFrame=function(){cancelAnimationFrame(w.nextFrameActionId),w.nextFrameActionId=requestAnimationFrame(w.resizeTextarea)},w.resizeTextarea=function(){var _=w.props.autoSize;if(!_||!w.textArea)return;var g=_.minRows,y=_.maxRows,S=V(w.textArea,!1,g,y);w.setState({textareaStyles:S,resizeStatus:N.RESIZING},function(){cancelAnimationFrame(w.resizeFrameId),w.resizeFrameId=requestAnimationFrame(function(){w.setState({resizeStatus:N.RESIZED},function(){w.resizeFrameId=requestAnimationFrame(function(){w.setState({resizeStatus:N.NONE}),w.fixFirefoxAutoScroll()})})})})},w.renderTextArea=function(){var _=w.props,g=_.prefixCls,y=g===void 0?"rc-textarea":g,S=_.autoSize,W=_.onResize,ce=_.className,Y=_.disabled,Ce=w.state,Re=Ce.textareaStyles,Fe=Ce.resizeStatus,Ve=Object(ie.a)(w.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),He=ye()(y,ce,Object(j.a)({},"".concat(y,"-disabled"),Y));"value"in Ve&&(Ve.value=Ve.value||"");var ze=Object(D.a)(Object(D.a)(Object(D.a)({},w.props.style),Re),Fe===N.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return q.createElement(he,{onResize:w.handleResize,disabled:!(S||W)},q.createElement("textarea",Object(z.a)({},Ve,{className:He,style:ze,ref:w.saveTextArea})))},w.state={textareaStyles:{},resizeStatus:N.NONE},w}return Object(ge.a)(x,[{key:"componentDidUpdate",value:function(w){(w.value!==this.props.value||!h()(w.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 w=this.textArea.selectionStart,_=this.textArea.selectionEnd;this.textArea.setSelectionRange(w,_)}}catch(g){}}},{key:"render",value:function(){return this.renderTextArea()}}]),x}(q.Component),ve=te,Pe=function(we){Object(Me.a)(x,we);var H=Object(pe.a)(x);function x(F){var w;Object(be.a)(this,x),w=H.call(this,F),w.resizableTextArea=void 0,w.focus=function(){w.resizableTextArea.textArea.focus()},w.saveTextArea=function(g){w.resizableTextArea=g},w.handleChange=function(g){var y=w.props.onChange;w.setValue(g.target.value,function(){w.resizableTextArea.resizeTextarea()}),y&&y(g)},w.handleKeyDown=function(g){var y=w.props,S=y.onPressEnter,W=y.onKeyDown;g.keyCode===13&&S&&S(g),W&&W(g)};var _=typeof F.value=="undefined"||F.value===null?F.defaultValue:F.value;return w.state={value:_},w}return Object(ge.a)(x,[{key:"setValue",value:function(w,_){"value"in this.props||this.setState({value:w},_)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return q.createElement(ve,Object(z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(w){return"value"in w?{value:w.value}:null}}]),x}(q.Component),Ee=qe.default=Pe},YNHc:function(lt,qe,v){lt.exports={cascaderContainer:"cascaderContainer___3XtEo",valueWrap:"valueWrap___3ID8a",valueItem:"valueItem___yKIZs",placeholder:"placeholder___MxiA7",modalWrap:"modalWrap___1ge9B",left:"left___10iyZ",right:"right___KVnmg",disabled:"disabled___2c8qt",emptyWrap:"emptyWrap___dYSJ0"}},ZW9T:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return Ue});var z=v("k1fw"),be=v("miYZ"),ge=v("tsqr"),Me=v("rAM+"),pe=v("tJVT"),q=v("PpiC"),D=v("q1tI"),j=v.n(D),A=v("bdgK");function B(Te,ne,Se,me,G){var he=ne.getWordUntilPosition(Se),ie={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},R=me.map(function(ye){return{label:ye,kind:Te.languages.CompletionItemKind.Keyword,insertText:ye,insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}});return G.map(function(ye){R.push(Object(z.a)(Object(z.a)({},ye),{},{range:ie}))}),R}var O=function(Te){var ne={label:"ifelse",kind:Te.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet},Se=["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"];Te.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ie,R){var ye=B(Te,ie,R,Se,[ne]);return{suggestions:ye}}});var me=["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"];Te.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ie,R){var ye=[{label:"print",kind:Te.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet}],re=B(Te,ie,R,me,ye);return{suggestions:re}}});var G=["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"];Te.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ie,R){var ye=[ne,{label:"main",kind:Te.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:Te.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet}],re=B(Te,ie,R,G,ye);return{suggestions:re}}})},I="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ue=v("LvDl");function ee(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}function P(){}var $=!1,J={"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 de(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ne=Te;if(Array.isArray(Te)){for(var Se=0;Se<Te.length;Se++){var me=J[Te[Se]];if(me)return me}return ne[0]}return J[ne]||ne}var fe=null,je=qe.b=function(Te){var ne=Te.width,Se=ne===void 0?"100%":ne,me=Te.height,G=me===void 0?"100%":me,he=Te.value,ie=Te.language,R=ie===void 0?"javascript":ie,ye=Te.style,re=ye===void 0?{}:ye,k=Te.options,T=k===void 0?{}:k,K=Te.overrideServices,L=K===void 0?{}:K,V=Te.theme,p=V===void 0?"vs-dark":V,h=Te.onEditBlur,N=Te.onSave,te=Te.autoHeight,ve=te===void 0?!1:te,Pe=Te.forbidCopy,Ee=Pe===void 0?!1:Pe,we=Te.onChange,H=we===void 0?P:we,x=Te.editorDidMount,F=x===void 0?P:x,w=Te.onFocus,_=w===void 0?P:w,g=Te.filename,y=g===void 0?"educoder.txt":g,S=Object(q.a)(Te,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),W=Object(D.useRef)(),ce=Object(D.useRef)({}),Y=Object(D.useRef)(),Ce=Object(D.useRef)(!1),Re=Object(D.useRef)(),Fe=Object(D.useState)(!1),Ve=Object(pe.a)(Fe,2),He=Ve[0],ze=Ve[1];function at(){var U;return W.current&&(U=new A.default(function(X){var ke=Object(Me.a)(X),De;try{for(ke.s();!(De=ke.n()).done;){var et=De.value;(et.target.offsetHeight>0||et.target.offsetWidth>0)&&ce.current.instance.layout()}}catch(yt){ke.e(yt)}finally{ke.f()}}),U.observe(W.current)),U}function xe(){ge.b.warn(decodeURIComponent(I))}var Ie=function(){var X=ce.current.instance;if(he!=null&&X&&He){var ke=X.getModel();ke&&he!==ke.getValue()&&($=!0,ke.setValue(he),X.layout(),$=!1)}};Object(D.useEffect)(function(){Y.current&&clearTimeout(Y.current),Y.current=setTimeout(function(){Ie()},500)},[he,He,ce.current]);function Be(){var U=ce.current.instance;if(U){var X=U.getSelection(),ke=ce.current.pastePos||{},De=new fe.Range(ke.startLineNumber||X.endLineNumber,ke.startColumn||X.endColumn,ke.endLineNumber||X.endLineNumber,ke.endColumn||X.endColumn);setTimeout(function(){U.executeEdits("",[{range:De,text:""}])},300)}}function Ke(U){(window.navigator.platform.match("Mac")?U.metaKey:U.ctrlKey)&&U.keyCode==83&&(U.preventDefault(),N())}var $e=function(){if(ve&&ce.current.instance){var X=ce.current.instance.getContentHeight();E(X<G?G:X)}else E(G)};function Ge(U){var X=document.createEvent("MouseEvents");X.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),U.dispatchEvent(X)}function _e(U,X){var ke=window.URL||window.webkitURL||window,De=new Blob([X]),et=document.createElementNS("http://www.w3.org/1999/xhtml","a");et.href=ke.createObjectURL(De),et.download=U,Ge(et)}Object(D.useEffect)(function(){$e()},[$e]),Object(D.useEffect)(function(){W.current&&!He&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(U){try{fe=U,ce.current.instance=fe.editor.create(W.current,{value:he,language:de(R),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},L);var X=ce.current.instance;if(F(X,fe),setTimeout(function(){$e(),ce.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){_e(y||"educoder.txt",X.getValue())}})},500),ce.current.subscription=X.onDidChangeModelContent(function(De){Ce.current?clearTimeout(Re.current):($e(),H(X.getValue(),De)),Re.current=setTimeout(function(){Ce.current=!1},500)}),window.Monaco||O(fe),Ee&&(X.addCommand(fe.KeyMod.CtrlCmd|fe.KeyMod.Shift|fe.KeyCode.KEY_V,function(){return xe(),null}),X.addCommand(fe.KeyMod.CtrlCmd|fe.KeyCode.KEY_C,function(){return xe(),null})),window.Monaco=fe,h&&X.onDidBlurEditorWidget(function(){h(X.getValue())}),_&&X.onDidFocusEditorText(function(){_(X.getValue())}),Ee){X.addCommand(fe.KeyMod.CtrlCmd|fe.KeyCode.KEY_V,function(){return xe(),null}),X.onDidPaste(function(De){ce.current.pastePos=De});try{window.addEventListener("paste",Be)}catch(De){}}var ke=at();return ze(!0),function(){var De=ce.current.instance;De.dispose();var et=De.getModel();et&&et.dispose(),ce.current.subscription&&ce.current.subscription.dispose(),Ee&&window.removeEventListener("paste",Be),ke.unobserve(W.current)}}catch(De){}})},[]),Object(D.useEffect)(function(){var U=ce.current.instance;if(U&&He)return document.addEventListener("keydown",Ke,!1),function(){document.removeEventListener("keydown",Ke)}},[N,He]),Object(D.useEffect)(function(){var U=ce.current.instance;if(U&&He){var X=de(R);fe.editor.setModelLanguage(U.getModel(),X),console.log("language:",R,U.getModel(),X)}},[R,He]),Object(D.useEffect)(function(){var U=ce.current.instance;U&&He&&fe.editor.setTheme(p)},[p,He]),Object(D.useEffect)(function(){var U=ce.current.instance;U&&He&&(U.updateOptions(Object(z.a)({},T)),setTimeout(function(){U.getModel().updateOptions(Object(z.a)({},T))},200))},[JSON.stringify(T),He]),Object(D.useEffect)(function(){var U=ce.current.instance;U&&He&&U.layout()},[Se,G,He]);var nt=Object(D.useState)(ee(Se)),Qe=Object(pe.a)(nt,2),Ae=Qe[0],We=Qe[1],se=Object(D.useState)(ee(G)),Q=Object(pe.a)(se,2),le=Q[0],E=Q[1],M=Object(z.a)(Object(z.a)({},re),{},{width:Ae,height:le});return j.a.createElement("div",{className:"my-monaco-editor",ref:W,style:M})};function Ue(Te){var ne=Te.width,Se=ne===void 0?"100%":ne,me=Te.height,G=me===void 0?"100%":me,he=Te.original,ie=Te.modified,R=Te.language,ye=Te.options,re=ye===void 0?{}:ye,k=Object(D.useRef)(),T=Object(D.useState)(null),K=Object(pe.a)(T,2),L=K[0],V=K[1];function p(ve){var Pe;return k.current&&(Pe=new A.default(function(Ee){var we=Object(Me.a)(Ee),H;try{for(we.s();!(H=we.n()).done;){var x=H.value;(x.target.offsetHeight>0||x.target.offsetWidth>0)&&ve.layout()}}catch(F){we.e(F)}finally{we.f()}}),Pe.observe(k.current)),Pe}Object(D.useEffect)(function(){k.current&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(ve){fe=ve;var Pe=fe.editor.createDiffEditor(k.current,Object(z.a)(Object(z.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},re),{},{wordWrap:!0}));V(Pe);var Ee=p(Pe);return function(){Pe.dispose();var we=Pe.getModel();we&&we.dispose(),Ee.unobserve(k.current)}})},[]),Object(D.useEffect)(function(){L&&L.setModel({original:fe.editor.createModel(he,R),modified:fe.editor.createModel(ie,R)})},[he,ie,R,L]);var h=ee(Se),N=ee(G),te={width:h,height:N};return j.a.createElement("div",{className:"my-diff-editor",ref:k,style:te})}},ZpRC:function(lt,qe,v){"use strict";function z(O){return typeof O=="object"&&O!=null&&O.nodeType===1}function be(O,I){return(!I||O!=="hidden")&&O!=="visible"&&O!=="clip"}function ge(O,I){if(O.clientHeight<O.scrollHeight||O.clientWidth<O.scrollWidth){var ue=getComputedStyle(O,null);return be(ue.overflowY,I)||be(ue.overflowX,I)||function(ee){var P=function($){if(!$.ownerDocument||!$.ownerDocument.defaultView)return null;try{return $.ownerDocument.defaultView.frameElement}catch(J){return null}}(ee);return!!P&&(P.clientHeight<ee.scrollHeight||P.clientWidth<ee.scrollWidth)}(O)}return!1}function Me(O,I,ue,ee,P,$,J,de){return $<O&&J>I||$>O&&J<I?0:$<=O&&de<=ue||J>=I&&de>=ue?$-O-ee:J>I&&de<ue||$<O&&de>ue?J-I+P:0}var pe=function(O,I){var ue=window,ee=I.scrollMode,P=I.block,$=I.inline,J=I.boundary,de=I.skipOverflowHiddenElements,fe=typeof J=="function"?J:function(Re){return Re!==J};if(!z(O))throw new TypeError("Invalid target");for(var je=document.scrollingElement||document.documentElement,Ue=[],Te=O;z(Te)&&fe(Te);){if((Te=Te.parentElement)===je){Ue.push(Te);break}Te!=null&&Te===document.body&&ge(Te)&&!ge(document.documentElement)||Te!=null&&ge(Te,de)&&Ue.push(Te)}for(var ne=ue.visualViewport?ue.visualViewport.width:innerWidth,Se=ue.visualViewport?ue.visualViewport.height:innerHeight,me=window.scrollX||pageXOffset,G=window.scrollY||pageYOffset,he=O.getBoundingClientRect(),ie=he.height,R=he.width,ye=he.top,re=he.right,k=he.bottom,T=he.left,K=P==="start"||P==="nearest"?ye:P==="end"?k:ye+ie/2,L=$==="center"?T+R/2:$==="end"?re:T,V=[],p=0;p<Ue.length;p++){var h=Ue[p],N=h.getBoundingClientRect(),te=N.height,ve=N.width,Pe=N.top,Ee=N.right,we=N.bottom,H=N.left;if(ee==="if-needed"&&ye>=0&&T>=0&&k<=Se&&re<=ne&&ye>=Pe&&k<=we&&T>=H&&re<=Ee)return V;var x=getComputedStyle(h),F=parseInt(x.borderLeftWidth,10),w=parseInt(x.borderTopWidth,10),_=parseInt(x.borderRightWidth,10),g=parseInt(x.borderBottomWidth,10),y=0,S=0,W="offsetWidth"in h?h.offsetWidth-h.clientWidth-F-_:0,ce="offsetHeight"in h?h.offsetHeight-h.clientHeight-w-g:0;if(je===h)y=P==="start"?K:P==="end"?K-Se:P==="nearest"?Me(G,G+Se,Se,w,g,G+K,G+K+ie,ie):K-Se/2,S=$==="start"?L:$==="center"?L-ne/2:$==="end"?L-ne:Me(me,me+ne,ne,F,_,me+L,me+L+R,R),y=Math.max(0,y+G),S=Math.max(0,S+me);else{y=P==="start"?K-Pe-w:P==="end"?K-we+g+ce:P==="nearest"?Me(Pe,we,te,w,g+ce,K,K+ie,ie):K-(Pe+te/2)+ce/2,S=$==="start"?L-H-F:$==="center"?L-(H+ve/2)+W/2:$==="end"?L-Ee+_+W:Me(H,Ee,ve,F,_+W,L,L+R,R);var Y=h.scrollLeft,Ce=h.scrollTop;K+=Ce-(y=Math.max(0,Math.min(Ce+y,h.scrollHeight-te+ce))),L+=Y-(S=Math.max(0,Math.min(Y+S,h.scrollWidth-ve+W)))}V.push({el:h,top:y,left:S})}return V};function q(O){return O===Object(O)&&Object.keys(O).length!==0}function D(O,I){I===void 0&&(I="auto");var ue="scrollBehavior"in document.body.style;O.forEach(function(ee){var P=ee.el,$=ee.top,J=ee.left;P.scroll&&ue?P.scroll({top:$,left:J,behavior:I}):(P.scrollTop=$,P.scrollLeft=J)})}function j(O){return O===!1?{block:"end",inline:"nearest"}:q(O)?O:{block:"start",inline:"nearest"}}function A(O,I){var ue=!O.ownerDocument.documentElement.contains(O);if(q(I)&&typeof I.behavior=="function")return I.behavior(ue?[]:pe(O,I));if(ue)return;var ee=j(I);return D(pe(O,ee),ee.behavior)}var B=qe.a=A},Zss7:function(lt,qe,v){var z;(function(be){var ge=/^\s+/,Me=/\s+$/,pe=0,q=be.round,D=be.min,j=be.max,A=be.random;function B(g,y){if(g=g||"",y=y||{},g instanceof B)return g;if(!(this instanceof B))return new B(g,y);var S=O(g);this._originalInput=g,this._r=S.r,this._g=S.g,this._b=S.b,this._a=S.a,this._roundA=q(100*this._a)/100,this._format=y.format||S.format,this._gradientType=y.gradientType,this._r<1&&(this._r=q(this._r)),this._g<1&&(this._g=q(this._g)),this._b<1&&(this._b=q(this._b)),this._ok=S.ok,this._tc_id=pe++}B.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var g=this.toRgb();return(g.r*299+g.g*587+g.b*114)/1e3},getLuminance:function(){var g=this.toRgb(),y,S,W,ce,Y,Ce;return y=g.r/255,S=g.g/255,W=g.b/255,y<=.03928?ce=y/12.92:ce=be.pow((y+.055)/1.055,2.4),S<=.03928?Y=S/12.92:Y=be.pow((S+.055)/1.055,2.4),W<=.03928?Ce=W/12.92:Ce=be.pow((W+.055)/1.055,2.4),.2126*ce+.7152*Y+.0722*Ce},setAlpha:function(g){return this._a=V(g),this._roundA=q(100*this._a)/100,this},toHsv:function(){var g=P(this._r,this._g,this._b);return{h:g.h*360,s:g.s,v:g.v,a:this._a}},toHsvString:function(){var g=P(this._r,this._g,this._b),y=q(g.h*360),S=q(g.s*100),W=q(g.v*100);return this._a==1?"hsv("+y+", "+S+"%, "+W+"%)":"hsva("+y+", "+S+"%, "+W+"%, "+this._roundA+")"},toHsl:function(){var g=ue(this._r,this._g,this._b);return{h:g.h*360,s:g.s,l:g.l,a:this._a}},toHslString:function(){var g=ue(this._r,this._g,this._b),y=q(g.h*360),S=q(g.s*100),W=q(g.l*100);return this._a==1?"hsl("+y+", "+S+"%, "+W+"%)":"hsla("+y+", "+S+"%, "+W+"%, "+this._roundA+")"},toHex:function(g){return J(this._r,this._g,this._b,g)},toHexString:function(g){return"#"+this.toHex(g)},toHex8:function(g){return de(this._r,this._g,this._b,this._a,g)},toHex8String:function(g){return"#"+this.toHex8(g)},toRgb:function(){return{r:q(this._r),g:q(this._g),b:q(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+q(this._r)+", "+q(this._g)+", "+q(this._b)+")":"rgba("+q(this._r)+", "+q(this._g)+", "+q(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:q(p(this._r,255)*100)+"%",g:q(p(this._g,255)*100)+"%",b:q(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+q(p(this._r,255)*100)+"%, "+q(p(this._g,255)*100)+"%, "+q(p(this._b,255)*100)+"%)":"rgba("+q(p(this._r,255)*100)+"%, "+q(p(this._g,255)*100)+"%, "+q(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K[J(this._r,this._g,this._b,!0)]||!1},toFilter:function(g){var y="#"+fe(this._r,this._g,this._b,this._a),S=y,W=this._gradientType?"GradientType = 1, ":"";if(g){var ce=B(g);S="#"+fe(ce._r,ce._g,ce._b,ce._a)}return"progid:DXImageTransform.Microsoft.gradient("+W+"startColorstr="+y+",endColorstr="+S+")"},toString:function(g){var y=!!g;g=g||this._format;var S=!1,W=this._a<1&&this._a>=0,ce=!y&&W&&(g==="hex"||g==="hex6"||g==="hex3"||g==="hex4"||g==="hex8"||g==="name");return ce?g==="name"&&this._a===0?this.toName():this.toRgbString():(g==="rgb"&&(S=this.toRgbString()),g==="prgb"&&(S=this.toPercentageRgbString()),(g==="hex"||g==="hex6")&&(S=this.toHexString()),g==="hex3"&&(S=this.toHexString(!0)),g==="hex4"&&(S=this.toHex8String(!0)),g==="hex8"&&(S=this.toHex8String()),g==="name"&&(S=this.toName()),g==="hsl"&&(S=this.toHslString()),g==="hsv"&&(S=this.toHsvString()),S||this.toHexString())},clone:function(){return B(this.toString())},_applyModification:function(g,y){var S=g.apply(null,[this].concat([].slice.call(y)));return this._r=S._r,this._g=S._g,this._b=S._b,this.setAlpha(S._a),this},lighten:function(){return this._applyModification(ne,arguments)},brighten:function(){return this._applyModification(Se,arguments)},darken:function(){return this._applyModification(me,arguments)},desaturate:function(){return this._applyModification(je,arguments)},saturate:function(){return this._applyModification(Ue,arguments)},greyscale:function(){return this._applyModification(Te,arguments)},spin:function(){return this._applyModification(G,arguments)},_applyCombination:function(g,y){return g.apply(null,[this].concat([].slice.call(y)))},analogous:function(){return this._applyCombination(re,arguments)},complement:function(){return this._applyCombination(he,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(ye,arguments)},triad:function(){return this._applyCombination(ie,arguments)},tetrad:function(){return this._applyCombination(R,arguments)}},B.fromRatio=function(g,y){if(typeof g=="object"){var S={};for(var W in g)g.hasOwnProperty(W)&&(W==="a"?S[W]=g[W]:S[W]=Ee(g[W]));g=S}return B(g,y)};function O(g){var y={r:0,g:0,b:0},S=1,W=null,ce=null,Y=null,Ce=!1,Re=!1;return typeof g=="string"&&(g=w(g)),typeof g=="object"&&(F(g.r)&&F(g.g)&&F(g.b)?(y=I(g.r,g.g,g.b),Ce=!0,Re=String(g.r).substr(-1)==="%"?"prgb":"rgb"):F(g.h)&&F(g.s)&&F(g.v)?(W=Ee(g.s),ce=Ee(g.v),y=$(g.h,W,ce),Ce=!0,Re="hsv"):F(g.h)&&F(g.s)&&F(g.l)&&(W=Ee(g.s),Y=Ee(g.l),y=ee(g.h,W,Y),Ce=!0,Re="hsl"),g.hasOwnProperty("a")&&(S=g.a)),S=V(S),{ok:Ce,format:g.format||Re,r:D(255,j(y.r,0)),g:D(255,j(y.g,0)),b:D(255,j(y.b,0)),a:S}}function I(g,y,S){return{r:p(g,255)*255,g:p(y,255)*255,b:p(S,255)*255}}function ue(g,y,S){g=p(g,255),y=p(y,255),S=p(S,255);var W=j(g,y,S),ce=D(g,y,S),Y,Ce,Re=(W+ce)/2;if(W==ce)Y=Ce=0;else{var Fe=W-ce;Ce=Re>.5?Fe/(2-W-ce):Fe/(W+ce);switch(W){case g:Y=(y-S)/Fe+(y<S?6:0);break;case y:Y=(S-g)/Fe+2;break;case S:Y=(g-y)/Fe+4;break}Y/=6}return{h:Y,s:Ce,l:Re}}function ee(g,y,S){var W,ce,Y;g=p(g,360),y=p(y,100),S=p(S,100);function Ce(Ve,He,ze){return ze<0&&(ze+=1),ze>1&&(ze-=1),ze<1/6?Ve+(He-Ve)*6*ze:ze<1/2?He:ze<2/3?Ve+(He-Ve)*(2/3-ze)*6:Ve}if(y===0)W=ce=Y=S;else{var Re=S<.5?S*(1+y):S+y-S*y,Fe=2*S-Re;W=Ce(Fe,Re,g+1/3),ce=Ce(Fe,Re,g),Y=Ce(Fe,Re,g-1/3)}return{r:W*255,g:ce*255,b:Y*255}}function P(g,y,S){g=p(g,255),y=p(y,255),S=p(S,255);var W=j(g,y,S),ce=D(g,y,S),Y,Ce,Re=W,Fe=W-ce;if(Ce=W===0?0:Fe/W,W==ce)Y=0;else{switch(W){case g:Y=(y-S)/Fe+(y<S?6:0);break;case y:Y=(S-g)/Fe+2;break;case S:Y=(g-y)/Fe+4;break}Y/=6}return{h:Y,s:Ce,v:Re}}function $(g,y,S){g=p(g,360)*6,y=p(y,100),S=p(S,100);var W=be.floor(g),ce=g-W,Y=S*(1-y),Ce=S*(1-ce*y),Re=S*(1-(1-ce)*y),Fe=W%6,Ve=[S,Ce,Y,Y,Re,S][Fe],He=[Re,S,S,Ce,Y,Y][Fe],ze=[Y,Y,Re,S,S,Ce][Fe];return{r:Ve*255,g:He*255,b:ze*255}}function J(g,y,S,W){var ce=[Pe(q(g).toString(16)),Pe(q(y).toString(16)),Pe(q(S).toString(16))];return W&&ce[0].charAt(0)==ce[0].charAt(1)&&ce[1].charAt(0)==ce[1].charAt(1)&&ce[2].charAt(0)==ce[2].charAt(1)?ce[0].charAt(0)+ce[1].charAt(0)+ce[2].charAt(0):ce.join("")}function de(g,y,S,W,ce){var Y=[Pe(q(g).toString(16)),Pe(q(y).toString(16)),Pe(q(S).toString(16)),Pe(we(W))];return ce&&Y[0].charAt(0)==Y[0].charAt(1)&&Y[1].charAt(0)==Y[1].charAt(1)&&Y[2].charAt(0)==Y[2].charAt(1)&&Y[3].charAt(0)==Y[3].charAt(1)?Y[0].charAt(0)+Y[1].charAt(0)+Y[2].charAt(0)+Y[3].charAt(0):Y.join("")}function fe(g,y,S,W){var ce=[Pe(we(W)),Pe(q(g).toString(16)),Pe(q(y).toString(16)),Pe(q(S).toString(16))];return ce.join("")}B.equals=function(g,y){return!g||!y?!1:B(g).toRgbString()==B(y).toRgbString()},B.random=function(){return B.fromRatio({r:A(),g:A(),b:A()})};function je(g,y){y=y===0?0:y||10;var S=B(g).toHsl();return S.s-=y/100,S.s=h(S.s),B(S)}function Ue(g,y){y=y===0?0:y||10;var S=B(g).toHsl();return S.s+=y/100,S.s=h(S.s),B(S)}function Te(g){return B(g).desaturate(100)}function ne(g,y){y=y===0?0:y||10;var S=B(g).toHsl();return S.l+=y/100,S.l=h(S.l),B(S)}function Se(g,y){y=y===0?0:y||10;var S=B(g).toRgb();return S.r=j(0,D(255,S.r-q(255*-(y/100)))),S.g=j(0,D(255,S.g-q(255*-(y/100)))),S.b=j(0,D(255,S.b-q(255*-(y/100)))),B(S)}function me(g,y){y=y===0?0:y||10;var S=B(g).toHsl();return S.l-=y/100,S.l=h(S.l),B(S)}function G(g,y){var S=B(g).toHsl(),W=(S.h+y)%360;return S.h=W<0?360+W:W,B(S)}function he(g){var y=B(g).toHsl();return y.h=(y.h+180)%360,B(y)}function ie(g){var y=B(g).toHsl(),S=y.h;return[B(g),B({h:(S+120)%360,s:y.s,l:y.l}),B({h:(S+240)%360,s:y.s,l:y.l})]}function R(g){var y=B(g).toHsl(),S=y.h;return[B(g),B({h:(S+90)%360,s:y.s,l:y.l}),B({h:(S+180)%360,s:y.s,l:y.l}),B({h:(S+270)%360,s:y.s,l:y.l})]}function ye(g){var y=B(g).toHsl(),S=y.h;return[B(g),B({h:(S+72)%360,s:y.s,l:y.l}),B({h:(S+216)%360,s:y.s,l:y.l})]}function re(g,y,S){y=y||6,S=S||30;var W=B(g).toHsl(),ce=360/S,Y=[B(g)];for(W.h=(W.h-(ce*y>>1)+720)%360;--y;)W.h=(W.h+ce)%360,Y.push(B(W));return Y}function k(g,y){y=y||6;for(var S=B(g).toHsv(),W=S.h,ce=S.s,Y=S.v,Ce=[],Re=1/y;y--;)Ce.push(B({h:W,s:ce,v:Y})),Y=(Y+Re)%1;return Ce}B.mix=function(g,y,S){S=S===0?0:S||50;var W=B(g).toRgb(),ce=B(y).toRgb(),Y=S/100,Ce={r:(ce.r-W.r)*Y+W.r,g:(ce.g-W.g)*Y+W.g,b:(ce.b-W.b)*Y+W.b,a:(ce.a-W.a)*Y+W.a};return B(Ce)},B.readability=function(g,y){var S=B(g),W=B(y);return(be.max(S.getLuminance(),W.getLuminance())+.05)/(be.min(S.getLuminance(),W.getLuminance())+.05)},B.isReadable=function(g,y,S){var W=B.readability(g,y),ce,Y;Y=!1,ce=_(S);switch(ce.level+ce.size){case"AAsmall":case"AAAlarge":Y=W>=4.5;break;case"AAlarge":Y=W>=3;break;case"AAAsmall":Y=W>=7;break}return Y},B.mostReadable=function(g,y,S){var W=null,ce=0,Y,Ce,Re,Fe;S=S||{},Ce=S.includeFallbackColors,Re=S.level,Fe=S.size;for(var Ve=0;Ve<y.length;Ve++)Y=B.readability(g,y[Ve]),Y>ce&&(ce=Y,W=B(y[Ve]));return B.isReadable(g,W,{level:Re,size:Fe})||!Ce?W:(S.includeFallbackColors=!1,B.mostReadable(g,["#fff","#000"],S))};var T=B.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},K=B.hexNames=L(T);function L(g){var y={};for(var S in g)g.hasOwnProperty(S)&&(y[g[S]]=S);return y}function V(g){return g=parseFloat(g),(isNaN(g)||g<0||g>1)&&(g=1),g}function p(g,y){te(g)&&(g="100%");var S=ve(g);return g=D(y,j(0,parseFloat(g))),S&&(g=parseInt(g*y,10)/100),be.abs(g-y)<1e-6?1:g%y/parseFloat(y)}function h(g){return D(1,j(0,g))}function N(g){return parseInt(g,16)}function te(g){return typeof g=="string"&&g.indexOf(".")!=-1&&parseFloat(g)===1}function ve(g){return typeof g=="string"&&g.indexOf("%")!=-1}function Pe(g){return g.length==1?"0"+g:""+g}function Ee(g){return g<=1&&(g=g*100+"%"),g}function we(g){return be.round(parseFloat(g)*255).toString(16)}function H(g){return N(g)/255}var x=function(){var g="[-\\+]?\\d+%?",y="[-\\+]?\\d*\\.\\d+%?",S="(?:"+y+")|(?:"+g+")",W="[\\s|\\(]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")\\s*\\)?",ce="[\\s|\\(]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")\\s*\\)?";return{CSS_UNIT:new RegExp(S),rgb:new RegExp("rgb"+W),rgba:new RegExp("rgba"+ce),hsl:new RegExp("hsl"+W),hsla:new RegExp("hsla"+ce),hsv:new RegExp("hsv"+W),hsva:new RegExp("hsva"+ce),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function F(g){return!!x.CSS_UNIT.exec(g)}function w(g){g=g.replace(ge,"").replace(Me,"").toLowerCase();var y=!1;if(T[g])g=T[g],y=!0;else if(g=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var S;return(S=x.rgb.exec(g))?{r:S[1],g:S[2],b:S[3]}:(S=x.rgba.exec(g))?{r:S[1],g:S[2],b:S[3],a:S[4]}:(S=x.hsl.exec(g))?{h:S[1],s:S[2],l:S[3]}:(S=x.hsla.exec(g))?{h:S[1],s:S[2],l:S[3],a:S[4]}:(S=x.hsv.exec(g))?{h:S[1],s:S[2],v:S[3]}:(S=x.hsva.exec(g))?{h:S[1],s:S[2],v:S[3],a:S[4]}:(S=x.hex8.exec(g))?{r:N(S[1]),g:N(S[2]),b:N(S[3]),a:H(S[4]),format:y?"name":"hex8"}:(S=x.hex6.exec(g))?{r:N(S[1]),g:N(S[2]),b:N(S[3]),format:y?"name":"hex"}:(S=x.hex4.exec(g))?{r:N(S[1]+""+S[1]),g:N(S[2]+""+S[2]),b:N(S[3]+""+S[3]),a:H(S[4]+""+S[4]),format:y?"name":"hex8"}:(S=x.hex3.exec(g))?{r:N(S[1]+""+S[1]),g:N(S[2]+""+S[2]),b:N(S[3]+""+S[3]),format:y?"name":"hex"}:!1}function _(g){var y,S;return g=g||{level:"AA",size:"small"},y=(g.level||"AA").toUpperCase(),S=(g.size||"small").toLowerCase(),y!=="AA"&&y!=="AAA"&&(y="AA"),S!=="small"&&S!=="large"&&(S="small"),{level:y,size:S}}lt.exports?lt.exports=B:!(z=function(){return B}.call(qe,v,qe,lt),z!==void 0&&(lt.exports=z))})(Math)},aRTE:function(lt,qe){lt.exports={L:1,M:0,Q:3,H:2}},bT9E:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return be});var z=v("VTBJ");function be(ge,Me){var pe=Object(z.a)({},ge);return Array.isArray(Me)&&Me.forEach(function(q){delete pe[q]}),pe}},c5Ni:function(lt,qe,v){},dQei:function(lt,qe){for(var v={glog:function(be){if(be<1)throw new Error("glog("+be+")");return v.LOG_TABLE[be]},gexp:function(be){for(;be<0;)be+=255;for(;be>=256;)be-=255;return v.EXP_TABLE[be]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},z=0;z<8;z++)v.EXP_TABLE[z]=1<<z;for(var z=8;z<256;z++)v.EXP_TABLE[z]=v.EXP_TABLE[z-4]^v.EXP_TABLE[z-5]^v.EXP_TABLE[z-6]^v.EXP_TABLE[z-8];for(var z=0;z<255;z++)v.LOG_TABLE[v.EXP_TABLE[z]]=z;lt.exports=v},dWSS:function(lt,qe,v){var z=v("dQei");function be(ge,Me){if(ge.length==null)throw new Error(ge.length+"/"+Me);for(var pe=0;pe<ge.length&&ge[pe]==0;)pe++;this.num=new Array(ge.length-pe+Me);for(var q=0;q<ge.length-pe;q++)this.num[q]=ge[q+pe]}be.prototype={get:function(ge){return this.num[ge]},getLength:function(){return this.num.length},multiply:function(ge){for(var Me=new Array(this.getLength()+ge.getLength()-1),pe=0;pe<this.getLength();pe++)for(var q=0;q<ge.getLength();q++)Me[pe+q]^=z.gexp(z.glog(this.get(pe))+z.glog(ge.get(q)));return new be(Me,0)},mod:function(ge){if(this.getLength()-ge.getLength()<0)return this;for(var Me=z.glog(this.get(0))-z.glog(ge.get(0)),pe=new Array(this.getLength()),q=0;q<this.getLength();q++)pe[q]=this.get(q);for(var q=0;q<ge.getLength();q++)pe[q]^=z.gexp(z.glog(ge.get(q))+Me);return new be(pe,0).mod(ge)}},lt.exports=be},dejd:function(lt,qe,v){},dmUQ:function(lt,qe,v){"use strict";var z=v("Ff2n"),be=v("rePB"),ge=v("1OyB"),Me=v("vuIU"),pe=v("Ji7U"),q=v("md7G"),D=v("foSv"),j=v("q1tI"),A=v.n(j),B=v("TSYQ"),O=v.n(B),I=v("4IlW");function ue(ie,R){var ye=Object.keys(ie);if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(ie);R&&(re=re.filter(function(k){return Object.getOwnPropertyDescriptor(ie,k).enumerable})),ye.push.apply(ye,re)}return ye}function ee(ie){for(var R=1;R<arguments.length;R++){var ye=arguments[R]!=null?arguments[R]:{};R%2?ue(Object(ye),!0).forEach(function(re){Object(be.a)(ie,re,ye[re])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(ye)):ue(Object(ye)).forEach(function(re){Object.defineProperty(ie,re,Object.getOwnPropertyDescriptor(ye,re))})}return ie}function P(ie){var R=$();return function(){var re=Object(D.a)(ie),k;if(R){var T=Object(D.a)(this).constructor;k=Reflect.construct(re,arguments,T)}else k=re.apply(this,arguments);return Object(q.a)(this,k)}}function $(){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(ie){return!1}}function J(){}function de(ie){ie.preventDefault()}var fe=function(R){return R.replace(/[^\w.-]+/g,"")},je=200,Ue=600,Te=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ne=function(R){return R!=null},Se=function(R,ye){return ye===R||typeof ye=="number"&&typeof R=="number"&&isNaN(ye)&&isNaN(R)},me=function(ie){Object(pe.a)(ye,ie);var R=P(ye);function ye(re){var k;Object(ge.a)(this,ye),k=R.call(this,re),k.onKeyDown=function(L){var V=k.props,p=V.onKeyDown,h=V.onPressEnter;if(L.keyCode===I.a.UP){var N=k.getRatio(L);k.up(L,N,null),k.stop()}else if(L.keyCode===I.a.DOWN){var te=k.getRatio(L);k.down(L,te,null),k.stop()}else L.keyCode===I.a.ENTER&&h&&h(L);if(k.recordCursorPosition(),k.lastKeyCode=L.keyCode,p){for(var ve=arguments.length,Pe=new Array(ve>1?ve-1:0),Ee=1;Ee<ve;Ee++)Pe[Ee-1]=arguments[Ee];p.apply(void 0,[L].concat(Pe))}},k.onKeyUp=function(L){var V=k.props.onKeyUp;if(k.stop(),k.recordCursorPosition(),V){for(var p=arguments.length,h=new Array(p>1?p-1:0),N=1;N<p;N++)h[N-1]=arguments[N];V.apply(void 0,[L].concat(h))}},k.onChange=function(L){var V=k.props.onChange;k.state.focused&&(k.inputting=!0),k.rawInput=k.props.parser(k.getValueFromEvent(L)),k.setState({inputValue:k.rawInput}),V(k.toNumber(k.rawInput))},k.onMouseUp=function(){var L=k.props.onMouseUp;k.recordCursorPosition(),L&&L.apply(void 0,arguments)},k.onFocus=function(){var L;k.setState({focused:!0}),(L=k.props).onFocus.apply(L,arguments)},k.onBlur=function(){var L=k.props.onBlur;k.inputting=!1,k.setState({focused:!1});var V=k.getCurrentValidValue(k.state.inputValue),p=k.setValue(V,J);if(L){var h=k.input.value,N=k.getInputDisplayValue({focus:!1,value:p});k.input.value=N&&Number(N),L.apply(void 0,arguments),k.input.value=h}},k.getRatio=function(L){var V=1;return L.metaKey||L.ctrlKey?V=.1:L.shiftKey&&(V=10),V},k.getFullNum=function(L){return isNaN(L)?L:/e/i.test(String(L))?Number(L).toFixed(18).replace(/\.?0+$/,""):L},k.getPrecision=function(L){if(ne(k.props.precision))return k.props.precision;var V=String(L);if(V.indexOf("e-")>=0)return parseInt(V.slice(V.indexOf("e-")+2),10);var p=0;return V.indexOf(".")>=0&&(p=V.length-V.indexOf(".")-1),p},k.getInputDisplayValue=function(L){var V=L||k.state,p=V.focused,h=V.inputValue,N=V.value,te;p?te=h:te=k.toPrecisionAsStep(N),te==null&&(te="");var ve=k.formatWrapper(te);return ne(k.props.decimalSeparator)&&(ve=ve.toString().replace(".",k.props.decimalSeparator)),ve},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(L){}},k.restoreByAfter=function(L){if(L===void 0)return!1;var V=k.input.value,p=V.lastIndexOf(L);if(p===-1)return!1;var h=k.cursorBefore.length;return k.lastKeyCode===I.a.DELETE&&k.cursorBefore.charAt(h-1)===L[0]?(k.fixCaret(h,h),!0):p+L.length===V.length?(k.fixCaret(p,p),!0):!1},k.partRestoreByAfter=function(L){return L===void 0?!1:Array.prototype.some.call(L,function(V,p){var h=L.substring(p);return k.restoreByAfter(h)})},k.isNotCompleteNumber=function(L){return isNaN(L)||L===""||L===null||L&&L.toString().indexOf(".")===L.toString().length-1},k.stop=function(){k.autoStepTimer&&clearTimeout(k.autoStepTimer)},k.down=function(L,V,p){k.pressingUpOrDown=!0,k.step("down",L,V,p)},k.up=function(L,V,p){k.pressingUpOrDown=!0,k.step("up",L,V,p)},k.saveInput=function(L){k.input=L};var T=re.value;T===void 0&&(T=re.defaultValue),k.state={focused:re.autoFocus};var K=k.getValidValue(k.toNumber(T));return k.state=ee(ee({},k.state),{},{inputValue:k.toPrecisionAsStep(K),value:K}),k}return Object(Me.a)(ye,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(k){var T=this.props,K=T.value,L=T.onChange,V=T.max,p=T.min,h=this.state.focused;if(k){if(!Se(k.value,K)||!Se(k.max,V)||!Se(k.min,p)){var N=h?K:this.getValidValue(K),te;this.pressingUpOrDown?te=N:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(N),this.setState({value:N,inputValue:te})}var ve="value"in this.props?K:this.state.value;"max"in this.props&&k.max!==V&&typeof ve=="number"&&ve>V&&L&&L(V),"min"in this.props&&k.min!==p&&typeof ve=="number"&&ve<p&&L&&L(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Pe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===I.a.BACKSPACE?Pe=this.cursorStart-1:this.lastKeyCode===I.a.DELETE&&(Pe=this.cursorStart):Pe=this.input.value.length,this.fixCaret(Pe,Pe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case I.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case I.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ee){}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 T=k;return T===""?T="":this.isNotCompleteNumber(parseFloat(T))?T=this.state.value:T=this.getValidValue(T),this.toNumber(T)}},{key:"getValueFromEvent",value:function(k){var T=k.target.value.trim().replace(/。/g,".");return ne(this.props.decimalSeparator)&&(T=T.replace(this.props.decimalSeparator,".")),T}},{key:"getValidValue",value:function(k){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,L=parseFloat(k);return isNaN(L)?k:(L<T&&(L=T),L>K&&(L=K),L)}},{key:"setValue",value:function(k,T){var K=this.props.precision,L=this.isNotCompleteNumber(parseFloat(k))?null:parseFloat(k),V=this.state.value,p=V===void 0?null:V,h=this.state.inputValue,N=h===void 0?null:h,te=typeof L=="number"?L.toFixed(K):"".concat(L),ve=L!==p||te!=="".concat(N);return"value"in this.props?(N=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:N},T)):this.setState({value:L,inputValue:this.toPrecisionAsStep(k)},T),ve&&this.props.onChange(L),L}},{key:"getMaxPrecision",value:function(k){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.props,L=K.precision,V=K.step;if(ne(L))return L;var p=this.getPrecision(T),h=this.getPrecision(V),N=this.getPrecision(k);return k?Math.max(N,p+h):p+h}},{key:"getPrecisionFactor",value:function(k){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.getMaxPrecision(k,T);return Math.pow(10,K)}},{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 T=Math.abs(this.getMaxPrecision(k));return isNaN(T)?k.toString():Number(k).toFixed(T)}},{key:"toNumber",value:function(k){var T=this.props.precision,K=this.state.focused,L=k&&k.length>16&&K;return this.isNotCompleteNumber(k)||L?k:ne(T)?Math.round(k*Math.pow(10,T))/Math.pow(10,T):Number(k)}},{key:"upStep",value:function(k,T){var K=this.props.step,L=this.getPrecisionFactor(k,T),V=Math.abs(this.getMaxPrecision(k,T)),p=((L*k+L*K*T)/L).toFixed(V);return this.toNumber(p)}},{key:"downStep",value:function(k,T){var K=this.props.step,L=this.getPrecisionFactor(k,T),V=Math.abs(this.getMaxPrecision(k,T)),p=((L*k-L*K*T)/L).toFixed(V);return this.toNumber(p)}},{key:"step",value:function(k,T){var K=this,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,V=arguments.length>3?arguments[3]:void 0;this.stop(),T&&(T.persist(),T.preventDefault());var p=this.props;if(p.disabled)return;var h=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(h))return;var N=this["".concat(k,"Step")](h,L),te=N>p.max||N<p.min;if(N>p.max?N=p.max:N<p.min&&(N=p.min),this.setValue(N,null),this.setState({focused:!0},function(){K.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){K[k](T,L,!0)},V?je:Ue)}},{key:"fixCaret",value:function(k,T){if(k===void 0||T===void 0||!this.input||!this.input.value)return;try{var K=this.input.selectionStart,L=this.input.selectionEnd;(k!==K||T!==L)&&this.input.setSelectionRange(k,T)}catch(V){}}},{key:"render",value:function(){var k,T=this.props,K=T.prefixCls,L=T.disabled,V=T.readOnly,p=T.useTouch,h=T.autoComplete,N=T.upHandler,te=T.downHandler,ve=T.className,Pe=T.max,Ee=T.min,we=T.style,H=T.title,x=T.onMouseEnter,F=T.onMouseLeave,w=T.onMouseOver,_=T.onMouseOut,g=T.required,y=T.onClick,S=T.tabIndex,W=T.type,ce=T.placeholder,Y=T.id,Ce=T.inputMode,Re=T.pattern,Fe=T.step,Ve=T.maxLength,He=T.autoFocus,ze=T.name,at=T.onPaste,xe=T.onInput,Ie=Object(z.a)(T,["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"]),Be=this.state,Ke=Be.value,$e=Be.focused,Ge=O()(K,(k={},Object(be.a)(k,ve,!!ve),Object(be.a)(k,"".concat(K,"-disabled"),L),Object(be.a)(k,"".concat(K,"-focused"),$e),k)),_e={};Object.keys(Ie).forEach(function(X){(X.substr(0,5)==="data-"||X.substr(0,5)==="aria-"||X==="role")&&(_e[X]=Ie[X])});var nt=!V&&!L,Qe=this.getInputDisplayValue(null),Ae=(Ke||Ke===0)&&(isNaN(Ke)||Number(Ke)>=Pe),We=(Ke||Ke===0)&&(isNaN(Ke)||Number(Ke)<=Ee),se=Ae||L||V,Q=We||L||V,le=O()("".concat(K,"-handler"),"".concat(K,"-handler-up"),Object(be.a)({},"".concat(K,"-handler-up-disabled"),se)),E=O()("".concat(K,"-handler"),"".concat(K,"-handler-down"),Object(be.a)({},"".concat(K,"-handler-down-disabled"),Q)),M=p?{onTouchStart:se?J:this.up,onTouchEnd:this.stop}:{onMouseDown:se?J:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},U=p?{onTouchStart:Q?J:this.down,onTouchEnd:this.stop}:{onMouseDown:Q?J:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:Ge,style:we,title:H,onMouseEnter:x,onMouseLeave:F,onMouseOver:w,onMouseOut:_,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(K,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},M,{role:"button","aria-label":"Increase Value","aria-disabled":se,className:le}),N||A.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-up-inner"),onClick:de})),A.a.createElement("span",Object.assign({unselectable:"on"},U,{role:"button","aria-label":"Decrease Value","aria-disabled":Q,className:E}),te||A.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-down-inner"),onClick:de}))),A.a.createElement("div",{className:"".concat(K,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ee,"aria-valuemax":Pe,"aria-valuenow":Ke,required:g,type:W,placeholder:ce,onPaste:at,onClick:y,onMouseUp:this.onMouseUp,className:"".concat(K,"-input"),tabIndex:S,autoComplete:h,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:J,onKeyUp:nt?this.onKeyUp:J,autoFocus:He,maxLength:Ve,readOnly:V,disabled:L,max:Pe,min:Ee,step:Fe,name:ze,title:H,id:Y,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Qe),pattern:Re,inputMode:Ce,onInput:xe},_e))))}}]),ye}(A.a.Component);me.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:Te,min:-Te,step:1,style:{},onChange:J,onKeyDown:J,onPressEnter:J,onFocus:J,onBlur:J,parser:fe,required:!1,autoComplete:"off"};var G=me,he=qe.a=G},f4xo:function(lt,qe,v){var z=v("nVVt");function be(ge){this.mode=z.MODE_8BIT_BYTE,this.data=ge}be.prototype={getLength:function(ge){return this.data.length},write:function(ge){for(var Me=0;Me<this.data.length;Me++)ge.put(this.data.charCodeAt(Me),8)}},lt.exports=be},fAei:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return je.a});var z=v("rePB"),be=v("VTBJ"),ge=v("KQm4"),Me=v("1OyB"),pe=v("vuIU"),q=v("Ji7U"),D=v("LK+K"),j=v("q1tI"),A=v("4IlW"),B=v("Kwbf"),O=v("TSYQ"),I=v.n(O),ue=v("sboe"),ee=v("OZM5"),P=v("815F"),$=v("ODXe"),J=v("Ff2n"),de=v("+nKL"),fe=v("8XRh"),je=v("WaYH"),Ue=function(Ee,we){var H=Ee.className,x=Ee.style,F=Ee.motion,w=Ee.motionNodes,_=Ee.motionType,g=Ee.onMotionStart,y=Ee.onMotionEnd,S=Ee.active,W=Ee.treeNodeRequiredProps,ce=Object(J.a)(Ee,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Y=j.useState(!0),Ce=Object($.a)(Y,2),Re=Ce[0],Fe=Ce[1],Ve=j.useContext(ue.a),He=Ve.prefixCls,ze=j.useRef(!1),at=function(){ze.current||y(),ze.current=!0};return Object(j.useEffect)(function(){w&&_==="hide"&&Re&&Fe(!1)},[w]),Object(j.useEffect)(function(){return w&&g(),function(){w&&at()}},[]),w?j.createElement(fe.default,Object.assign({ref:we,visible:Re},F,{motionAppear:_==="show",onAppearEnd:at,onLeaveEnd:at}),function(xe,Ie){var Be=xe.className,Ke=xe.style;return j.createElement("div",{ref:Ie,className:I()("".concat(He,"-treenode-motion"),Be),style:Ke},w.map(function($e){var Ge=$e.data,_e=Ge.key,nt=Object(J.a)(Ge,["key"]),Qe=$e.isStart,Ae=$e.isEnd;delete nt.children;var We=Object(P.f)(_e,W);return j.createElement(je.a,Object.assign({},nt,We,{active:S,data:$e.data,key:_e,isStart:Qe,isEnd:Ae}))}))}):j.createElement(je.a,Object.assign({domRef:we,className:H,style:x},ce,{active:S}))};Ue.displayName="MotionTreeNode";var Te=j.forwardRef(Ue),ne=Te;function Se(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=Pe.length,H=Ee.length;if(Math.abs(we-H)!==1)return{add:!1,key:null};function x(F,w){var _=new Map;F.forEach(function(y){_.set(y,!0)});var g=w.filter(function(y){return!_.has(y)});return g.length===1?g[0]:null}return we<H?{add:!0,key:x(Pe,Ee)}:{add:!1,key:x(Ee,Pe)}}function me(Pe,Ee,we){var H=Pe.findIndex(function(_){var g=_.data;return g.key===we}),x=Pe[H+1],F=Ee.findIndex(function(_){var g=_.data;return g.key===we});if(x){var w=Ee.findIndex(function(_){var g=_.data;return g.key===x.data.key});return Ee.slice(F+1,w)}return Ee.slice(F+1)}var G={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},he=function(){},ie="RC_TREE_MOTION_".concat(Math.random()),R={key:ie},ye={key:ie,level:0,index:0,pos:"0",node:R},re={parent:null,children:[],pos:ye.pos,data:R,isStart:[],isEnd:[]};function k(Pe,Ee,we,H){return Ee===!1||!we?Pe:Pe.slice(0,Math.ceil(we/H)+1)}function T(Pe){var Ee=Pe.data.key,we=Pe.pos;return Object(P.e)(Ee,we)}function K(Pe){for(var Ee=String(Pe.data.key),we=Pe;we.parent;)we=we.parent,Ee="".concat(we.data.key," > ").concat(Ee);return Ee}var L=function(Ee,we){var H=Ee.prefixCls,x=Ee.data,F=Ee.selectable,w=Ee.checkable,_=Ee.expandedKeys,g=Ee.selectedKeys,y=Ee.checkedKeys,S=Ee.loadedKeys,W=Ee.loadingKeys,ce=Ee.halfCheckedKeys,Y=Ee.keyEntities,Ce=Ee.disabled,Re=Ee.dragging,Fe=Ee.dragOverNodeKey,Ve=Ee.dropPosition,He=Ee.motion,ze=Ee.height,at=Ee.itemHeight,xe=Ee.virtual,Ie=Ee.focusable,Be=Ee.activeItem,Ke=Ee.focused,$e=Ee.tabIndex,Ge=Ee.onKeyDown,_e=Ee.onFocus,nt=Ee.onBlur,Qe=Ee.onActiveChange,Ae=Ee.onListChangeStart,We=Ee.onListChangeEnd,se=Object(J.a)(Ee,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),Q=j.useRef(null);j.useImperativeHandle(we,function(){return{scrollTo:function(Zt){Q.current.scrollTo(Zt)}}});var le=j.useState(_),E=Object($.a)(le,2),M=E[0],U=E[1],X=j.useState(x),ke=Object($.a)(X,2),De=ke[0],et=ke[1],yt=j.useState(x),St=Object($.a)(yt,2),Je=St[0],bt=St[1],mt=j.useState([]),rt=Object($.a)(mt,2),Dt=rt[0],Ot=rt[1],kt=j.useState(null),Et=Object($.a)(kt,2),xt=Et[0],Pt=Et[1];function Ft(){et(x),bt(x),Ot([]),Pt(null),We()}j.useEffect(function(){U(_);var Ut=Se(M,_);if(Ut.key!==null)if(Ut.add){var Zt=De.findIndex(function(an){var Ln=an.data.key;return Ln===Ut.key}),on=k(me(De,x,Ut.key),xe,ze,at),qt=De.slice();qt.splice(Zt+1,0,re),bt(qt),Ot(on),Pt("show")}else{var mn=x.findIndex(function(an){var Ln=an.data.key;return Ln===Ut.key}),jt=k(me(x,De,Ut.key),xe,ze,at),ft=x.slice();ft.splice(mn+1,0,re),bt(ft),Ot(jt),Pt("hide")}else De!==x&&(et(x),bt(x))},[_,x]),j.useEffect(function(){Re||Ft()},[Re]);var ht=He?Je:x,rn={expandedKeys:_,selectedKeys:g,loadedKeys:S,loadingKeys:W,checkedKeys:y,halfCheckedKeys:ce,dragOverNodeKey:Fe,dropPosition:Ve,keyEntities:Y};return j.createElement(j.Fragment,null,Ke&&Be&&j.createElement("span",{style:G,"aria-live":"assertive"},K(Be)),j.createElement("div",{role:"tree"},j.createElement("input",{style:G,disabled:Ie===!1||Ce,tabIndex:Ie!==!1?$e:null,onKeyDown:Ge,onFocus:_e,onBlur:nt,value:"",onChange:he})),j.createElement(de.a,Object.assign({},se,{data:ht,itemKey:T,height:ze,fullHeight:!1,virtual:xe,itemHeight:at,prefixCls:"".concat(H,"-list"),ref:Q}),function(Ut){var Zt=Ut.pos,on=Ut.data,qt=on.key,mn=Object(J.a)(on,["key"]),jt=Ut.isStart,ft=Ut.isEnd,an=Object(P.e)(qt,Zt);delete mn.children;var Ln=Object(P.f)(an,rn);return j.createElement(ne,Object.assign({},mn,Ln,{active:Be&&qt===Be.data.key,pos:Zt,data:Ut.data,isStart:jt,isEnd:ft,motion:He,motionNodes:qt===ie?Dt:null,motionType:xt,onMotionStart:Ae,onMotionEnd:Ft,treeNodeRequiredProps:rn,onMouseMove:function(){Qe(null)}}))}))},V=j.forwardRef(L);V.displayName="NodeList";var p=V,h=v("NvD2"),N=function(Pe){Object(q.a)(we,Pe);var Ee=Object(D.a)(we);function we(){var H;return Object(Me.a)(this,we),H=Ee.apply(this,arguments),H.destroyed=!1,H.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},H.listRef=j.createRef(),H.onNodeDragStart=function(x,F){var w=H.state,_=w.expandedKeys,g=w.keyEntities,y=H.props.onDragStart,S=F.props.eventKey;H.dragNode=F;var W=Object(ee.b)(_,S);H.setState({dragging:!0,dragNodesKeys:Object(ee.g)(S,g)}),H.setExpandedKeys(W),y&&y({event:x,node:Object(P.b)(F.props)})},H.onNodeDragEnter=function(x,F){var w=H.state,_=w.expandedKeys,g=w.keyEntities,y=w.dragNodesKeys,S=H.props.onDragEnter,W=F.props,ce=W.pos,Y=W.eventKey;if(!H.dragNode||y.indexOf(Y)!==-1)return;var Ce=Object(ee.c)(x,F);if(H.dragNode.props.eventKey===Y&&Ce===0){H.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){H.setState({dragOverNodeKey:Y,dropPosition:Ce}),H.delayedDragEnterLogic||(H.delayedDragEnterLogic={}),Object.keys(H.delayedDragEnterLogic).forEach(function(Re){clearTimeout(H.delayedDragEnterLogic[Re])}),H.delayedDragEnterLogic[ce]=window.setTimeout(function(){if(!H.state.dragging)return;var Re=Object(ge.a)(_),Fe=g[Y];Fe&&(Fe.children||[]).length&&(Re=Object(ee.a)(_,Y)),"expandedKeys"in H.props||H.setExpandedKeys(Re),S&&S({event:x,node:Object(P.b)(F.props),expandedKeys:Re})},400)},0)},H.onNodeDragOver=function(x,F){var w=H.state.dragNodesKeys,_=H.props.onDragOver,g=F.props.eventKey;if(w.indexOf(g)!==-1)return;if(H.dragNode&&g===H.state.dragOverNodeKey){var y=Object(ee.c)(x,F);if(y===H.state.dropPosition)return;H.setState({dropPosition:y})}_&&_({event:x,node:Object(P.b)(F.props)})},H.onNodeDragLeave=function(x,F){var w=H.props.onDragLeave;H.setState({dragOverNodeKey:""}),w&&w({event:x,node:Object(P.b)(F.props)})},H.onNodeDragEnd=function(x,F){var w=H.props.onDragEnd;H.setState({dragOverNodeKey:""}),H.cleanDragState(),w&&w({event:x,node:Object(P.b)(F.props)}),H.dragNode=null},H.onNodeDrop=function(x,F){var w=H.state,_=w.dragNodesKeys,g=_===void 0?[]:_,y=w.dropPosition,S=H.props.onDrop,W=F.props,ce=W.eventKey,Y=W.pos;if(H.setState({dragOverNodeKey:""}),H.cleanDragState(),g.indexOf(ce)!==-1){Object(B.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ce=Object(ee.k)(Y),Re={event:x,node:Object(P.b)(F.props),dragNode:H.dragNode?Object(P.b)(H.dragNode.props):null,dragNodesKeys:g.slice(),dropPosition:y+Number(Ce[Ce.length-1]),dropToGap:!1};y!==0&&(Re.dropToGap=!0),S&&S(Re),H.dragNode=null},H.cleanDragState=function(){var x=H.state.dragging;x&&H.setState({dragging:!1})},H.onNodeClick=function(x,F){var w=H.props.onClick;w&&w(x,F)},H.onNodeDoubleClick=function(x,F){var w=H.props.onDoubleClick;w&&w(x,F)},H.onNodeSelect=function(x,F){var w=H.state.selectedKeys,_=H.state.keyEntities,g=H.props,y=g.onSelect,S=g.multiple,W=F.selected,ce=F.key,Y=!W;Y?S?w=Object(ee.a)(w,ce):w=[ce]:w=Object(ee.b)(w,ce);var Ce=w.map(function(Re){var Fe=_[Re];return Fe?Fe.node:null}).filter(function(Re){return Re});H.setUncontrolledState({selectedKeys:w}),y&&y(w,{event:"select",selected:Y,node:F,selectedNodes:Ce,nativeEvent:x.nativeEvent})},H.onNodeCheck=function(x,F,w){var _=H.state,g=_.keyEntities,y=_.checkedKeys,S=_.halfCheckedKeys,W=H.props,ce=W.checkStrictly,Y=W.onCheck,Ce=F.key,Re,Fe={event:"check",node:F,checked:w,nativeEvent:x.nativeEvent};if(ce){var Ve=w?Object(ee.a)(y,Ce):Object(ee.b)(y,Ce),He=Object(ee.b)(S,Ce);Re={checked:Ve,halfChecked:He},Fe.checkedNodes=Ve.map(function(Ke){return g[Ke]}).filter(function(Ke){return Ke}).map(function(Ke){return Ke.node}),H.setUncontrolledState({checkedKeys:Ve})}else{var ze=Object(h.a)([].concat(Object(ge.a)(y),[Ce]),!0,g),at=ze.checkedKeys,xe=ze.halfCheckedKeys;if(!w){var Ie=new Set(at);Ie.delete(Ce);var Be=Object(h.a)(Array.from(Ie),{checked:!1,halfCheckedKeys:xe},g);at=Be.checkedKeys,xe=Be.halfCheckedKeys}Re=at,Fe.checkedNodes=[],Fe.checkedNodesPositions=[],Fe.halfCheckedKeys=xe,at.forEach(function(Ke){var $e=g[Ke];if(!$e)return;var Ge=$e.node,_e=$e.pos;Fe.checkedNodes.push(Ge),Fe.checkedNodesPositions.push({node:Ge,pos:_e})}),H.setUncontrolledState({checkedKeys:at},!1,{halfCheckedKeys:xe})}Y&&Y(Re,Fe)},H.onNodeLoad=function(x){return new Promise(function(F){H.setState(function(w){var _=w.loadedKeys,g=_===void 0?[]:_,y=w.loadingKeys,S=y===void 0?[]:y,W=H.props,ce=W.loadData,Y=W.onLoad,Ce=x.key;if(!ce||g.indexOf(Ce)!==-1||S.indexOf(Ce)!==-1)return{};var Re=ce(x);return Re.then(function(){var Fe=H.state,Ve=Fe.loadedKeys,He=Fe.loadingKeys,ze=Object(ee.a)(Ve,Ce),at=Object(ee.b)(He,Ce);Y&&Y(ze,{event:"load",node:x}),H.setUncontrolledState({loadedKeys:ze}),H.setState({loadingKeys:at}),F()}),{loadingKeys:Object(ee.a)(S,Ce)}})})},H.onNodeMouseEnter=function(x,F){var w=H.props.onMouseEnter;w&&w({event:x,node:F})},H.onNodeMouseLeave=function(x,F){var w=H.props.onMouseLeave;w&&w({event:x,node:F})},H.onNodeContextMenu=function(x,F){var w=H.props.onRightClick;w&&(x.preventDefault(),w({event:x,node:F}))},H.onFocus=function(){var x=H.props.onFocus;H.setState({focused:!0}),x&&x.apply(void 0,arguments)},H.onBlur=function(){var x=H.props.onBlur;H.setState({focused:!1}),H.onActiveChange(null),x&&x.apply(void 0,arguments)},H.getTreeNodeRequiredProps=function(){var x=H.state,F=x.expandedKeys,w=x.selectedKeys,_=x.loadedKeys,g=x.loadingKeys,y=x.checkedKeys,S=x.halfCheckedKeys,W=x.dragOverNodeKey,ce=x.dropPosition,Y=x.keyEntities;return{expandedKeys:F||[],selectedKeys:w||[],loadedKeys:_||[],loadingKeys:g||[],checkedKeys:y||[],halfCheckedKeys:S||[],dragOverNodeKey:W,dropPosition:ce,keyEntities:Y}},H.setExpandedKeys=function(x){var F=H.state.treeData,w=Object(P.d)(F,x);H.setUncontrolledState({expandedKeys:x,flattenNodes:w},!0)},H.onNodeExpand=function(x,F){var w=H.state.expandedKeys,_=H.state.listChanging,g=H.props,y=g.onExpand,S=g.loadData,W=F.key,ce=F.expanded;if(_)return;var Y=w.indexOf(W),Ce=!ce;if(Object(B.a)(ce&&Y!==-1||!ce&&Y===-1,"Expand state not sync with index check"),Ce?w=Object(ee.a)(w,W):w=Object(ee.b)(w,W),H.setExpandedKeys(w),y&&y(w,{node:F,expanded:Ce,nativeEvent:x.nativeEvent}),Ce&&S){var Re=H.onNodeLoad(F);Re&&Re.then(function(){var Fe=Object(P.d)(H.state.treeData,w);H.setUncontrolledState({flattenNodes:Fe})})}},H.onListChangeStart=function(){H.setUncontrolledState({listChanging:!0})},H.onListChangeEnd=function(){setTimeout(function(){H.setUncontrolledState({listChanging:!1})})},H.onActiveChange=function(x){var F=H.state.activeKey,w=H.props.onActiveChange;if(F===x)return;H.setState({activeKey:x}),x!==null&&H.scrollTo({key:x}),w&&w(x)},H.getActiveItem=function(){var x=H.state,F=x.activeKey,w=x.flattenNodes;return F===null?null:w.find(function(_){var g=_.data.key;return g===F})||null},H.offsetActiveKey=function(x){var F=H.state,w=F.flattenNodes,_=F.activeKey,g=w.findIndex(function(W){var ce=W.data.key;return ce===_});g===-1&&x<0&&(g=w.length),g=(g+x+w.length)%w.length;var y=w[g];if(y){var S=y.data.key;H.onActiveChange(S)}else H.onActiveChange(null)},H.onKeyDown=function(x){var F=H.state,w=F.activeKey,_=F.expandedKeys,g=F.checkedKeys,y=H.props,S=y.onKeyDown,W=y.checkable,ce=y.selectable;switch(x.which){case A.a.UP:{H.offsetActiveKey(-1),x.preventDefault();break}case A.a.DOWN:{H.offsetActiveKey(1),x.preventDefault();break}}var Y=H.getActiveItem();if(Y&&Y.data){var Ce=H.getTreeNodeRequiredProps(),Re=Y.data.isLeaf===!1||!!(Y.data.children||[]).length,Fe=Object(P.b)(Object(be.a)(Object(be.a)({},Object(P.f)(w,Ce)),{},{data:Y.data,active:!0}));switch(x.which){case A.a.LEFT:{Re&&_.includes(w)?H.onNodeExpand({},Fe):Y.parent&&H.onActiveChange(Y.parent.data.key),x.preventDefault();break}case A.a.RIGHT:{Re&&!_.includes(w)?H.onNodeExpand({},Fe):Y.children&&Y.children.length&&H.onActiveChange(Y.children[0].data.key),x.preventDefault();break}case A.a.ENTER:case A.a.SPACE:{W&&!Fe.disabled&&Fe.checkable!==!1&&!Fe.disableCheckbox?H.onNodeCheck({},Fe,!g.includes(w)):!W&&ce&&!Fe.disabled&&Fe.selectable!==!1&&H.onNodeSelect({},Fe);break}}}S&&S(x)},H.setUncontrolledState=function(x){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(H.destroyed)return;var _=!1,g=!0,y={};Object.keys(x).forEach(function(S){if(S in H.props){g=!1;return}_=!0,y[S]=x[S]}),_&&(!F||g)&&H.setState(Object(be.a)(Object(be.a)({},y),w))},H.scrollTo=function(x){H.listRef.current.scrollTo(x)},H}return Object(pe.a)(we,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var x,F=this.state,w=F.focused,_=F.flattenNodes,g=F.keyEntities,y=F.dragging,S=F.activeKey,W=this.props,ce=W.prefixCls,Y=W.className,Ce=W.style,Re=W.showLine,Fe=W.focusable,Ve=W.tabIndex,He=Ve===void 0?0:Ve,ze=W.selectable,at=W.showIcon,xe=W.icon,Ie=W.switcherIcon,Be=W.draggable,Ke=W.checkable,$e=W.checkStrictly,Ge=W.disabled,_e=W.motion,nt=W.loadData,Qe=W.filterTreeNode,Ae=W.height,We=W.itemHeight,se=W.virtual,Q=W.titleRender,le=W.onContextMenu,E=Object(ee.f)(this.props);return j.createElement(ue.a.Provider,{value:{prefixCls:ce,selectable:ze,showIcon:at,icon:xe,switcherIcon:Ie,draggable:Be,checkable:Ke,checkStrictly:$e,disabled:Ge,keyEntities:g,loadData:nt,filterTreeNode:Qe,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},j.createElement("div",{className:I()(ce,Y,(x={},Object(z.a)(x,"".concat(ce,"-show-line"),Re),Object(z.a)(x,"".concat(ce,"-focused"),w),Object(z.a)(x,"".concat(ce,"-active-focused"),S!==null),x))},j.createElement(p,Object.assign({ref:this.listRef,prefixCls:ce,style:Ce,data:_,disabled:Ge,selectable:ze,checkable:!!Ke,motion:_e,dragging:y,height:Ae,itemHeight:We,virtual:se,focusable:Fe,focused:w,tabIndex:He,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:le},this.getTreeNodeRequiredProps(),E))))}}],[{key:"getDerivedStateFromProps",value:function(x,F){var w=F.prevProps,_={prevProps:x};function g(xe){return!w&&xe in x||w&&w[xe]!==x[xe]}var y;if(g("treeData")?y=x.treeData:g("children")&&(Object(B.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),y=Object(P.c)(x.children)),y){_.treeData=y;var S=Object(P.a)(y);_.keyEntities=Object(be.a)(Object(z.a)({},ie,ye),S.keyEntities)}var W=_.keyEntities||F.keyEntities;if(g("expandedKeys")||w&&g("autoExpandParent"))_.expandedKeys=x.autoExpandParent||!w&&x.defaultExpandParent?Object(ee.e)(x.expandedKeys,W):x.expandedKeys;else if(!w&&x.defaultExpandAll){var ce=Object(be.a)({},W);delete ce[ie],_.expandedKeys=Object.keys(ce).map(function(xe){return ce[xe].key})}else!w&&x.defaultExpandedKeys&&(_.expandedKeys=x.autoExpandParent||x.defaultExpandParent?Object(ee.e)(x.defaultExpandedKeys,W):x.defaultExpandedKeys);if(_.expandedKeys||delete _.expandedKeys,y||_.expandedKeys){var Y=Object(P.d)(y||F.treeData,_.expandedKeys||F.expandedKeys);_.flattenNodes=Y}if(x.selectable&&(g("selectedKeys")?_.selectedKeys=Object(ee.d)(x.selectedKeys,x):!w&&x.defaultSelectedKeys&&(_.selectedKeys=Object(ee.d)(x.defaultSelectedKeys,x))),x.checkable){var Ce;if(g("checkedKeys")?Ce=Object(ee.j)(x.checkedKeys)||{}:!w&&x.defaultCheckedKeys?Ce=Object(ee.j)(x.defaultCheckedKeys)||{}:y&&(Ce=Object(ee.j)(x.checkedKeys)||{checkedKeys:F.checkedKeys,halfCheckedKeys:F.halfCheckedKeys}),Ce){var Re=Ce,Fe=Re.checkedKeys,Ve=Fe===void 0?[]:Fe,He=Re.halfCheckedKeys,ze=He===void 0?[]:He;if(!x.checkStrictly){var at=Object(h.a)(Ve,!0,W);Ve=at.checkedKeys,ze=at.halfCheckedKeys}_.checkedKeys=Ve,_.halfCheckedKeys=ze}}return g("loadedKeys")&&(_.loadedKeys=x.loadedKeys),_}}]),we}(j.Component);N.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},N.TreeNode=je.a;var te=N,ve=qe.b=te},gJ3r:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return z});var z=[{value:"\u5317\u4EAC",label:"\u5317\u4EAC",children:[{value:"\u4E1C\u57CE",label:"\u4E1C\u57CE"},{value:"\u897F\u57CE",label:"\u897F\u57CE"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u4E30\u53F0",label:"\u4E30\u53F0"},{value:"\u77F3\u666F\u5C71",label:"\u77F3\u666F\u5C71"},{value:"\u6D77\u6DC0",label:"\u6D77\u6DC0"},{value:"\u95E8\u5934\u6C9F",label:"\u95E8\u5934\u6C9F"},{value:"\u623F\u5C71",label:"\u623F\u5C71"},{value:"\u901A\u5DDE",label:"\u901A\u5DDE"},{value:"\u987A\u4E49",label:"\u987A\u4E49"},{value:"\u660C\u5E73",label:"\u660C\u5E73"},{value:"\u5927\u5174",label:"\u5927\u5174"},{value:"\u5E73\u8C37",label:"\u5E73\u8C37"},{value:"\u6000\u67D4",label:"\u6000\u67D4"},{value:"\u5BC6\u4E91",label:"\u5BC6\u4E91"},{value:"\u5EF6\u5E86",label:"\u5EF6\u5E86"}]},{value:"\u4E0A\u6D77",label:"\u4E0A\u6D77",children:[{value:"\u5D07\u660E",label:"\u5D07\u660E"},{value:"\u9EC4\u6D66",label:"\u9EC4\u6D66"},{value:"\u5362\u6E7E",label:"\u5362\u6E7E"},{value:"\u5F90\u6C47",label:"\u5F90\u6C47"},{value:"\u957F\u5B81",label:"\u957F\u5B81"},{value:"\u9759\u5B89",label:"\u9759\u5B89"},{value:"\u666E\u9640",label:"\u666E\u9640"},{value:"\u95F8\u5317",label:"\u95F8\u5317"},{value:"\u8679\u53E3",label:"\u8679\u53E3"},{value:"\u6768\u6D66",label:"\u6768\u6D66"},{value:"\u95F5\u884C",label:"\u95F5\u884C"},{value:"\u5B9D\u5C71",label:"\u5B9D\u5C71"},{value:"\u5609\u5B9A",label:"\u5609\u5B9A"},{value:"\u6D66\u4E1C",label:"\u6D66\u4E1C"},{value:"\u91D1\u5C71",label:"\u91D1\u5C71"},{value:"\u677E\u6C5F",label:"\u677E\u6C5F"},{value:"\u9752\u6D66",label:"\u9752\u6D66"},{value:"\u5357\u6C47",label:"\u5357\u6C47"},{value:"\u5949\u8D24",label:"\u5949\u8D24"}]},{value:"\u5E7F\u4E1C",label:"\u5E7F\u4E1C",children:[{value:"\u5E7F\u5DDE",label:"\u5E7F\u5DDE"},{value:"\u6DF1\u5733",label:"\u6DF1\u5733"},{value:"\u73E0\u6D77",label:"\u73E0\u6D77"},{value:"\u4E1C\u839E",label:"\u4E1C\u839E"},{value:"\u4E2D\u5C71",label:"\u4E2D\u5C71"},{value:"\u4F5B\u5C71",label:"\u4F5B\u5C71"},{value:"\u60E0\u5DDE",label:"\u60E0\u5DDE"},{value:"\u6CB3\u6E90",label:"\u6CB3\u6E90"},{value:"\u6F6E\u5DDE",label:"\u6F6E\u5DDE"},{value:"\u6C5F\u95E8",label:"\u6C5F\u95E8"},{value:"\u63ED\u9633",label:"\u63ED\u9633"},{value:"\u8302\u540D",label:"\u8302\u540D"},{value:"\u6885\u5DDE",label:"\u6885\u5DDE"},{value:"\u6E05\u8FDC",label:"\u6E05\u8FDC"},{value:"\u6C55\u5934",label:"\u6C55\u5934"},{value:"\u6C55\u5C3E",label:"\u6C55\u5C3E"},{value:"\u97F6\u5173",label:"\u97F6\u5173"},{value:"\u987A\u5FB7",label:"\u987A\u5FB7"},{value:"\u9633\u6C5F",label:"\u9633\u6C5F"},{value:"\u4E91\u6D6E",label:"\u4E91\u6D6E"},{value:"\u6E5B\u6C5F",label:"\u6E5B\u6C5F"},{value:"\u8087\u5E86",label:"\u8087\u5E86"}]},{value:"\u6C5F\u82CF",label:"\u6C5F\u82CF",children:[{value:"\u5357\u4EAC",label:"\u5357\u4EAC"},{value:"\u5E38\u719F",label:"\u5E38\u719F"},{value:"\u5E38\u5DDE",label:"\u5E38\u5DDE"},{value:"\u6D77\u95E8",label:"\u6D77\u95E8"},{value:"\u6DEE\u5B89",label:"\u6DEE\u5B89"},{value:"\u6C5F\u90FD",label:"\u6C5F\u90FD"},{value:"\u6C5F\u9634",label:"\u6C5F\u9634"},{value:"\u6606\u5C71",label:"\u6606\u5C71"},{value:"\u8FDE\u4E91\u6E2F",label:"\u8FDE\u4E91\u6E2F"},{value:"\u5357\u901A",label:"\u5357\u901A"},{value:"\u542F\u4E1C",label:"\u542F\u4E1C"},{value:"\u6CAD\u9633",label:"\u6CAD\u9633"},{value:"\u5BBF\u8FC1",label:"\u5BBF\u8FC1"},{value:"\u82CF\u5DDE",label:"\u82CF\u5DDE"},{value:"\u592A\u4ED3",label:"\u592A\u4ED3"},{value:"\u6CF0\u5DDE",label:"\u6CF0\u5DDE"},{value:"\u540C\u91CC",label:"\u540C\u91CC"},{value:"\u65E0\u9521",label:"\u65E0\u9521"},{value:"\u5F90\u5DDE",label:"\u5F90\u5DDE"},{value:"\u76D0\u57CE",label:"\u76D0\u57CE"},{value:"\u626C\u5DDE",label:"\u626C\u5DDE"},{value:"\u5B9C\u5174",label:"\u5B9C\u5174"},{value:"\u4EEA\u5F81",label:"\u4EEA\u5F81"},{value:"\u5F20\u5BB6\u6E2F",label:"\u5F20\u5BB6\u6E2F"},{value:"\u9547\u6C5F",label:"\u9547\u6C5F"}]},{value:"\u91CD\u5E86",label:"\u91CD\u5E86",children:[{value:"\u4E07\u5DDE",label:"\u4E07\u5DDE"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u6E1D\u4E2D",label:"\u6E1D\u4E2D"},{value:"\u5927\u6E21\u53E3",label:"\u5927\u6E21\u53E3"},{value:"\u6C5F\u5317",label:"\u6C5F\u5317"},{value:"\u6C99\u576A\u575D",label:"\u6C99\u576A\u575D"},{value:"\u4E5D\u9F99\u5761",label:"\u4E5D\u9F99\u5761"},{value:"\u5357\u5CB8",label:"\u5357\u5CB8"},{value:"\u5317\u789A",label:"\u5317\u789A"},{value:"\u4E07\u76DB",label:"\u4E07\u76DB"},{value:"\u53CC\u6322",label:"\u53CC\u6322"},{value:"\u6E1D\u5317",label:"\u6E1D\u5317"},{value:"\u5DF4\u5357",label:"\u5DF4\u5357"},{value:"\u9ED4\u6C5F",label:"\u9ED4\u6C5F"},{value:"\u957F\u5BFF",label:"\u957F\u5BFF"},{value:"\u7DA6\u6C5F",label:"\u7DA6\u6C5F"},{value:"\u6F7C\u5357",label:"\u6F7C\u5357"},{value:"\u94DC\u6881",label:"\u94DC\u6881"},{value:"\u5927\u8DB3",label:"\u5927\u8DB3"},{value:"\u8363\u660C",label:"\u8363\u660C"},{value:"\u58C1\u5C71",label:"\u58C1\u5C71"},{value:"\u6881\u5E73",label:"\u6881\u5E73"},{value:"\u57CE\u53E3",label:"\u57CE\u53E3"},{value:"\u4E30\u90FD",label:"\u4E30\u90FD"},{value:"\u57AB\u6C5F",label:"\u57AB\u6C5F"},{value:"\u6B66\u9686",label:"\u6B66\u9686"},{value:"\u5FE0\u53BF",label:"\u5FE0\u53BF"},{value:"\u5F00\u53BF",label:"\u5F00\u53BF"},{value:"\u4E91\u9633",label:"\u4E91\u9633"},{value:"\u5949\u8282",label:"\u5949\u8282"},{value:"\u5DEB\u5C71",label:"\u5DEB\u5C71"},{value:"\u5DEB\u6EAA",label:"\u5DEB\u6EAA"},{value:"\u77F3\u67F1",label:"\u77F3\u67F1"},{value:"\u79C0\u5C71",label:"\u79C0\u5C71"},{value:"\u9149\u9633",label:"\u9149\u9633"},{value:"\u5F6D\u6C34",label:"\u5F6D\u6C34"},{value:"\u6C5F\u6D25",label:"\u6C5F\u6D25"},{value:"\u5408\u5DDD",label:"\u5408\u5DDD"},{value:"\u6C38\u5DDD",label:"\u6C38\u5DDD"},{value:"\u5357\u5DDD",label:"\u5357\u5DDD"}]},{value:"\u5B89\u5FBD",label:"\u5B89\u5FBD",children:[{value:"\u5408\u80A5",label:"\u5408\u80A5"},{value:"\u5B89\u5E86",label:"\u5B89\u5E86"},{value:"\u868C\u57E0",label:"\u868C\u57E0"},{value:"\u4EB3\u5DDE",label:"\u4EB3\u5DDE"},{value:"\u5DE2\u6E56",label:"\u5DE2\u6E56"},{value:"\u6EC1\u5DDE",label:"\u6EC1\u5DDE"},{value:"\u961C\u9633",label:"\u961C\u9633"},{value:"\u8D35\u6C60",label:"\u8D35\u6C60"},{value:"\u6DEE\u5317",label:"\u6DEE\u5317"},{value:"\u6DEE\u5316",label:"\u6DEE\u5316"},{value:"\u6DEE\u5357",label:"\u6DEE\u5357"},{value:"\u9EC4\u5C71",label:"\u9EC4\u5C71"},{value:"\u4E5D\u534E\u5C71",label:"\u4E5D\u534E\u5C71"},{value:"\u516D\u5B89",label:"\u516D\u5B89"},{value:"\u9A6C\u978D\u5C71",label:"\u9A6C\u978D\u5C71"},{value:"\u5BBF\u5DDE",label:"\u5BBF\u5DDE"},{value:"\u94DC\u9675",label:"\u94DC\u9675"},{value:"\u5C6F\u6EAA",label:"\u5C6F\u6EAA"},{value:"\u829C\u6E56",label:"\u829C\u6E56"},{value:"\u5BA3\u57CE",label:"\u5BA3\u57CE"}]},{value:"\u798F\u5EFA",label:"\u798F\u5EFA",children:[{value:"\u798F\u5DDE",label:"\u798F\u5DDE"},{value:"\u53A6\u95E8",label:"\u53A6\u95E8"},{value:"\u6CC9\u5DDE",label:"\u6CC9\u5DDE"},{value:"\u6F33\u5DDE",label:"\u6F33\u5DDE"},{value:"\u9F99\u5CA9",label:"\u9F99\u5CA9"},{value:"\u5357\u5E73",label:"\u5357\u5E73"},{value:"\u5B81\u5FB7",label:"\u5B81\u5FB7"},{value:"\u8386\u7530",label:"\u8386\u7530"},{value:"\u4E09\u660E",label:"\u4E09\u660E"}]},{value:"\u7518\u8083",label:"\u7518\u8083",children:[{value:"\u5170\u5DDE",label:"\u5170\u5DDE"},{value:"\u5609\u5CEA\u5173",label:"\u5609\u5CEA\u5173"},{value:"\u767D\u94F6",label:"\u767D\u94F6"},{value:"\u5B9A\u897F",label:"\u5B9A\u897F"},{value:"\u6566\u714C",label:"\u6566\u714C"},{value:"\u7518\u5357",label:"\u7518\u5357"},{value:"\u91D1\u660C",label:"\u91D1\u660C"},{value:"\u9152\u6CC9",label:"\u9152\u6CC9"},{value:"\u4E34\u590F",label:"\u4E34\u590F"},{value:"\u5E73\u51C9",label:"\u5E73\u51C9"},{value:"\u5929\u6C34",label:"\u5929\u6C34"},{value:"\u9647\u5357",label:"\u9647\u5357"},{value:"\u6B66\u5A01",label:"\u6B66\u5A01"},{value:"\u897F\u5CF0",label:"\u897F\u5CF0"},{value:"\u5F20\u6396",label:"\u5F20\u6396"}]},{value:"\u5E7F\u897F",label:"\u5E7F\u897F",children:[{value:"\u5357\u5B81",label:"\u5357\u5B81"},{value:"\u6765\u5BBE",label:"\u6765\u5BBE"},{value:"\u767E\u8272",label:"\u767E\u8272"},{value:"\u5317\u6D77",label:"\u5317\u6D77"},{value:"\u6842\u6797",label:"\u6842\u6797"},{value:"\u9632\u57CE\u6E2F",label:"\u9632\u57CE\u6E2F"},{value:"\u8D35\u6E2F",label:"\u8D35\u6E2F"},{value:"\u6CB3\u6C60",label:"\u6CB3\u6C60"},{value:"\u8D3A\u5DDE",label:"\u8D3A\u5DDE"},{value:"\u67F3\u5DDE",label:"\u67F3\u5DDE"},{value:"\u94A6\u5DDE",label:"\u94A6\u5DDE"},{value:"\u68A7\u5DDE",label:"\u68A7\u5DDE"},{value:"\u7389\u6797",label:"\u7389\u6797"}]},{value:"\u8D35\u5DDE",label:"\u8D35\u5DDE",children:[{value:"\u8D35\u9633",label:"\u8D35\u9633"},{value:"\u5B89\u987A",label:"\u5B89\u987A"},{value:"\u6BD5\u8282",label:"\u6BD5\u8282"},{value:"\u90FD\u5300",label:"\u90FD\u5300"},{value:"\u51EF\u91CC",label:"\u51EF\u91CC"},{value:"\u516D\u76D8\u6C34",label:"\u516D\u76D8\u6C34"},{value:"\u94DC\u4EC1",label:"\u94DC\u4EC1"},{value:"\u5174\u4E49",label:"\u5174\u4E49"},{value:"\u7389\u5C4F",label:"\u7389\u5C4F"},{value:"\u9075\u4E49",label:"\u9075\u4E49"}]},{value:"\u6D77\u5357",label:"\u6D77\u5357",children:[{value:"\u6D77\u53E3",label:"\u6D77\u53E3"},{value:"\u510B\u53BF",label:"\u510B\u53BF"},{value:"\u9675\u6C34",label:"\u9675\u6C34"},{value:"\u743C\u6D77",label:"\u743C\u6D77"},{value:"\u4E09\u4E9A",label:"\u4E09\u4E9A"},{value:"\u901A\u4EC0",label:"\u901A\u4EC0"},{value:"\u4E07\u5B81",label:"\u4E07\u5B81"}]},{value:"\u6CB3\u5317",label:"\u6CB3\u5317",children:[{value:"\u77F3\u5BB6\u5E84",label:"\u77F3\u5BB6\u5E84"},{value:"\u4FDD\u5B9A",label:"\u4FDD\u5B9A"},{value:"\u5317\u6234\u6CB3",label:"\u5317\u6234\u6CB3"},{value:"\u6CA7\u5DDE",label:"\u6CA7\u5DDE"},{value:"\u627F\u5FB7",label:"\u627F\u5FB7"},{value:"\u4E30\u6DA6",label:"\u4E30\u6DA6"},{value:"\u90AF\u90F8",label:"\u90AF\u90F8"},{value:"\u8861\u6C34",label:"\u8861\u6C34"},{value:"\u5ECA\u574A",label:"\u5ECA\u574A"},{value:"\u5357\u6234\u6CB3",label:"\u5357\u6234\u6CB3"},{value:"\u79E6\u7687\u5C9B",label:"\u79E6\u7687\u5C9B"},{value:"\u5510\u5C71",label:"\u5510\u5C71"},{value:"\u65B0\u57CE",label:"\u65B0\u57CE"},{value:"\u90A2\u53F0",label:"\u90A2\u53F0"},{value:"\u5F20\u5BB6\u53E3",label:"\u5F20\u5BB6\u53E3"}]},{value:"\u9ED1\u9F99\u6C5F",label:"\u9ED1\u9F99\u6C5F",children:[{value:"\u54C8\u5C14\u6EE8",label:"\u54C8\u5C14\u6EE8"},{value:"\u5317\u5B89",label:"\u5317\u5B89"},{value:"\u5927\u5E86",label:"\u5927\u5E86"},{value:"\u5927\u5174\u5B89\u5CAD",label:"\u5927\u5174\u5B89\u5CAD"},{value:"\u9E64\u5C97",label:"\u9E64\u5C97"},{value:"\u9ED1\u6CB3",label:"\u9ED1\u6CB3"},{value:"\u4F73\u6728\u65AF",label:"\u4F73\u6728\u65AF"},{value:"\u9E21\u897F",label:"\u9E21\u897F"},{value:"\u7261\u4E39\u6C5F",label:"\u7261\u4E39\u6C5F"},{value:"\u9F50\u9F50\u54C8\u5C14",label:"\u9F50\u9F50\u54C8\u5C14"},{value:"\u4E03\u53F0\u6CB3",label:"\u4E03\u53F0\u6CB3"},{value:"\u53CC\u9E2D\u5C71",label:"\u53CC\u9E2D\u5C71"},{value:"\u7EE5\u5316",label:"\u7EE5\u5316"},{value:"\u4F0A\u6625",label:"\u4F0A\u6625"}]},{value:"\u6CB3\u5357",label:"\u6CB3\u5357",children:[{value:"\u90D1\u5DDE",label:"\u90D1\u5DDE"},{value:"\u5B89\u9633",label:"\u5B89\u9633"},{value:"\u9E64\u58C1",label:"\u9E64\u58C1"},{value:"\u6F62\u5DDD",label:"\u6F62\u5DDD"},{value:"\u7126\u4F5C",label:"\u7126\u4F5C"},{value:"\u6D4E\u6E90",label:"\u6D4E\u6E90"},{value:"\u5F00\u5C01",label:"\u5F00\u5C01"},{value:"\u6F2F\u6CB3",label:"\u6F2F\u6CB3"},{value:"\u6D1B\u9633",label:"\u6D1B\u9633"},{value:"\u5357\u9633",label:"\u5357\u9633"},{value:"\u5E73\u9876\u5C71",label:"\u5E73\u9876\u5C71"},{value:"\u6FEE\u9633",label:"\u6FEE\u9633"},{value:"\u4E09\u95E8\u5CE1",label:"\u4E09\u95E8\u5CE1"},{value:"\u5546\u4E18",label:"\u5546\u4E18"},{value:"\u65B0\u4E61",label:"\u65B0\u4E61"},{value:"\u4FE1\u9633",label:"\u4FE1\u9633"},{value:"\u8BB8\u660C",label:"\u8BB8\u660C"},{value:"\u5468\u53E3",label:"\u5468\u53E3"},{value:"\u9A7B\u9A6C\u5E97",label:"\u9A7B\u9A6C\u5E97"}]},{value:"\u9999\u6E2F",label:"\u9999\u6E2F",children:[{value:"\u9999\u6E2F",label:"\u9999\u6E2F"},{value:"\u4E5D\u9F99",label:"\u4E5D\u9F99"},{value:"\u65B0\u754C",label:"\u65B0\u754C"}]},{value:"\u6E56\u5317",label:"\u6E56\u5317",children:[{value:"\u6B66\u6C49",label:"\u6B66\u6C49"},{value:"\u5929\u95E8",label:"\u5929\u95E8"},{value:"\u6069\u65BD",label:"\u6069\u65BD"},{value:"\u9102\u5DDE",label:"\u9102\u5DDE"},{value:"\u9EC4\u5188",label:"\u9EC4\u5188"},{value:"\u9EC4\u77F3",label:"\u9EC4\u77F3"},{value:"\u8346\u95E8",label:"\u8346\u95E8"},{value:"\u8346\u5DDE",label:"\u8346\u5DDE"},{value:"\u6F5C\u6C5F",label:"\u6F5C\u6C5F"},{value:"\u5341\u5830",label:"\u5341\u5830"},{value:"\u968F\u5DDE",label:"\u968F\u5DDE"},{value:"\u6B66\u7A74",label:"\u6B66\u7A74"},{value:"\u4ED9\u6843",label:"\u4ED9\u6843"},{value:"\u54B8\u5B81",label:"\u54B8\u5B81"},{value:"\u8944\u9633",label:"\u8944\u9633"},{value:"\u8944\u6A0A",label:"\u8944\u6A0A"},{value:"\u5B5D\u611F",label:"\u5B5D\u611F"},{value:"\u5B9C\u660C",label:"\u5B9C\u660C"}]},{value:"\u6E56\u5357",label:"\u6E56\u5357",children:[{value:"\u957F\u6C99",label:"\u957F\u6C99"},{value:"\u5E38\u5FB7",label:"\u5E38\u5FB7"},{value:"\u90F4\u5DDE",label:"\u90F4\u5DDE"},{value:"\u8861\u9633",label:"\u8861\u9633"},{value:"\u6000\u5316",label:"\u6000\u5316"},{value:"\u5409\u9996",label:"\u5409\u9996"},{value:"\u5A04\u5E95",label:"\u5A04\u5E95"},{value:"\u90B5\u9633",label:"\u90B5\u9633"},{value:"\u6E58\u6F6D",label:"\u6E58\u6F6D"},{value:"\u76CA\u9633",label:"\u76CA\u9633"},{value:"\u5CB3\u9633",label:"\u5CB3\u9633"},{value:"\u6C38\u5DDE",label:"\u6C38\u5DDE"},{value:"\u5F20\u5BB6\u754C",label:"\u5F20\u5BB6\u754C"},{value:"\u682A\u6D32",label:"\u682A\u6D32"}]},{value:"\u6C5F\u897F",label:"\u6C5F\u897F",children:[{value:"\u5357\u660C",label:"\u5357\u660C"},{value:"\u629A\u5DDE",label:"\u629A\u5DDE"},{value:"\u8D63\u5DDE",label:"\u8D63\u5DDE"},{value:"\u5409\u5B89",label:"\u5409\u5B89"},{value:"\u666F\u5FB7\u9547",label:"\u666F\u5FB7\u9547"},{value:"\u4E95\u5188\u5C71",label:"\u4E95\u5188\u5C71"},{value:"\u4E5D\u6C5F",label:"\u4E5D\u6C5F"},{value:"\u5E90\u5C71",label:"\u5E90\u5C71"},{value:"\u840D\u4E61",label:"\u840D\u4E61"},{value:"\u4E0A\u9976",label:"\u4E0A\u9976"},{value:"\u65B0\u4F59",label:"\u65B0\u4F59"},{value:"\u5B9C\u6625",label:"\u5B9C\u6625"},{value:"\u9E70\u6F6D",label:"\u9E70\u6F6D"}]},{value:"\u5409\u6797",label:"\u5409\u6797",children:[{value:"\u957F\u6625",label:"\u957F\u6625"},{value:"\u5409\u6797",label:"\u5409\u6797"},{value:"\u767D\u57CE",label:"\u767D\u57CE"},{value:"\u767D\u5C71",label:"\u767D\u5C71"},{value:"\u73F2\u6625",label:"\u73F2\u6625"},{value:"\u8FBD\u6E90",label:"\u8FBD\u6E90"},{value:"\u6885\u6CB3",label:"\u6885\u6CB3"},{value:"\u56DB\u5E73",label:"\u56DB\u5E73"},{value:"\u677E\u539F",label:"\u677E\u539F"},{value:"\u901A\u5316",label:"\u901A\u5316"},{value:"\u5EF6\u5409",label:"\u5EF6\u5409"}]},{value:"\u8FBD\u5B81",label:"\u8FBD\u5B81",children:[{value:"\u6C88\u9633",label:"\u6C88\u9633"},{value:"\u978D\u5C71",label:"\u978D\u5C71"},{value:"\u672C\u6EAA",label:"\u672C\u6EAA"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u5927\u8FDE",label:"\u5927\u8FDE"},{value:"\u4E39\u4E1C",label:"\u4E39\u4E1C"},{value:"\u629A\u987A",label:"\u629A\u987A"},{value:"\u961C\u65B0",label:"\u961C\u65B0"},{value:"\u846B\u82A6\u5C9B",label:"\u846B\u82A6\u5C9B"},{value:"\u9526\u5DDE",label:"\u9526\u5DDE"},{value:"\u8FBD\u9633",label:"\u8FBD\u9633"},{value:"\u76D8\u9526",label:"\u76D8\u9526"},{value:"\u94C1\u5CAD",label:"\u94C1\u5CAD"},{value:"\u8425\u53E3",label:"\u8425\u53E3"}]},{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8",children:[{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8"}]},{value:"\u5185\u8499\u53E4",label:"\u5185\u8499\u53E4",children:[{value:"\u547C\u548C\u6D69\u7279",label:"\u547C\u548C\u6D69\u7279"},{value:"\u963F\u62C9\u5584\u76DF",label:"\u963F\u62C9\u5584\u76DF"},{value:"\u5305\u5934",label:"\u5305\u5934"},{value:"\u8D64\u5CF0",label:"\u8D64\u5CF0"},{value:"\u4E1C\u80DC",label:"\u4E1C\u80DC"},{value:"\u6D77\u62C9\u5C14",label:"\u6D77\u62C9\u5C14"},{value:"\u96C6\u5B81",label:"\u96C6\u5B81"},{value:"\u4E34\u6CB3",label:"\u4E34\u6CB3"},{value:"\u901A\u8FBD",label:"\u901A\u8FBD"},{value:"\u4E4C\u6D77",label:"\u4E4C\u6D77"},{value:"\u4E4C\u5170\u6D69\u7279",label:"\u4E4C\u5170\u6D69\u7279"},{value:"\u9521\u6797\u6D69\u7279",label:"\u9521\u6797\u6D69\u7279"}]},{value:"\u5B81\u590F",label:"\u5B81\u590F",children:[{value:"\u94F6\u5DDD",label:"\u94F6\u5DDD"},{value:"\u56FA\u6E90",label:"\u56FA\u6E90"},{value:"\u77F3\u5634\u5C71",label:"\u77F3\u5634\u5C71"},{value:"\u5434\u5FE0",label:"\u5434\u5FE0"}]},{value:"\u9752\u6D77",label:"\u9752\u6D77",children:[{value:"\u897F\u5B81",label:"\u897F\u5B81"},{value:"\u5FB7\u4EE4\u54C8",label:"\u5FB7\u4EE4\u54C8"},{value:"\u683C\u5C14\u6728",label:"\u683C\u5C14\u6728"},{value:"\u5171\u548C",label:"\u5171\u548C"},{value:"\u6D77\u4E1C",label:"\u6D77\u4E1C"},{value:"\u6D77\u664F",label:"\u6D77\u664F"},{value:"\u739B\u6C81",label:"\u739B\u6C81"},{value:"\u540C\u4EC1",label:"\u540C\u4EC1"},{value:"\u7389\u6811",label:"\u7389\u6811"}]},{value:"\u5C71\u4E1C",label:"\u5C71\u4E1C",children:[{value:"\u6D4E\u5357",label:"\u6D4E\u5357"},{value:"\u6EE8\u5DDE",label:"\u6EE8\u5DDE"},{value:"\u5156\u5DDE",label:"\u5156\u5DDE"},{value:"\u5FB7\u5DDE",label:"\u5FB7\u5DDE"},{value:"\u4E1C\u8425",label:"\u4E1C\u8425"},{value:"\u83CF\u6CFD",label:"\u83CF\u6CFD"},{value:"\u6D4E\u5B81",label:"\u6D4E\u5B81"},{value:"\u83B1\u829C",label:"\u83B1\u829C"},{value:"\u804A\u57CE",label:"\u804A\u57CE"},{value:"\u4E34\u6C82",label:"\u4E34\u6C82"},{value:"\u84EC\u83B1",label:"\u84EC\u83B1"},{value:"\u9752\u5C9B",label:"\u9752\u5C9B"},{value:"\u66F2\u961C",label:"\u66F2\u961C"},{value:"\u65E5\u7167",label:"\u65E5\u7167"},{value:"\u6CF0\u5B89",label:"\u6CF0\u5B89"},{value:"\u6F4D\u574A",label:"\u6F4D\u574A"},{value:"\u5A01\u6D77",label:"\u5A01\u6D77"},{value:"\u70DF\u53F0",label:"\u70DF\u53F0"},{value:"\u67A3\u5E84",label:"\u67A3\u5E84"},{value:"\u6DC4\u535A",label:"\u6DC4\u535A"}]},{value:"\u5C71\u897F",label:"\u5C71\u897F",children:[{value:"\u592A\u539F",label:"\u592A\u539F"},{value:"\u5415\u6881",label:"\u5415\u6881"},{value:"\u957F\u6CBB",label:"\u957F\u6CBB"},{value:"\u5927\u540C",label:"\u5927\u540C"},{value:"\u5019\u9A6C",label:"\u5019\u9A6C"},{value:"\u664B\u57CE",label:"\u664B\u57CE"},{value:"\u79BB\u77F3",label:"\u79BB\u77F3"},{value:"\u4E34\u6C7E",label:"\u4E34\u6C7E"},{value:"\u5B81\u6B66",label:"\u5B81\u6B66"},{value:"\u6714\u5DDE",label:"\u6714\u5DDE"},{value:"\u5FFB\u5DDE",label:"\u5FFB\u5DDE"},{value:"\u9633\u6CC9",label:"\u9633\u6CC9"},{value:"\u6986\u6B21",label:"\u6986\u6B21"},{value:"\u664B\u4E2D",label:"\u664B\u4E2D"},{value:"\u8FD0\u57CE",label:"\u8FD0\u57CE"}]},{value:"\u9655\u897F",label:"\u9655\u897F",children:[{value:"\u897F\u5B89",label:"\u897F\u5B89"},{value:"\u5B89\u5EB7",label:"\u5B89\u5EB7"},{value:"\u5B9D\u9E21",label:"\u5B9D\u9E21"},{value:"\u6C49\u4E2D",label:"\u6C49\u4E2D"},{value:"\u6E2D\u5357",label:"\u6E2D\u5357"},{value:"\u5546\u5DDE",label:"\u5546\u5DDE"},{value:"\u7EE5\u5FB7",label:"\u7EE5\u5FB7"},{value:"\u94DC\u5DDD",label:"\u94DC\u5DDD"},{value:"\u54B8\u9633",label:"\u54B8\u9633"},{value:"\u5EF6\u5B89",label:"\u5EF6\u5B89"},{value:"\u6986\u6797",label:"\u6986\u6797"}]},{value:"\u56DB\u5DDD",label:"\u56DB\u5DDD",children:[{value:"\u6210\u90FD",label:"\u6210\u90FD"},{value:"\u5DF4\u4E2D",label:"\u5DF4\u4E2D"},{value:"\u8FBE\u5DDD",label:"\u8FBE\u5DDD"},{value:"\u5FB7\u9633",label:"\u5FB7\u9633"},{value:"\u90FD\u6C5F\u5830",label:"\u90FD\u6C5F\u5830"},{value:"\u5CE8\u7709\u5C71",label:"\u5CE8\u7709\u5C71"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u5E7F\u5B89",label:"\u5E7F\u5B89"},{value:"\u5E7F\u5143",label:"\u5E7F\u5143"},{value:"\u4E5D\u5BE8\u6C9F",label:"\u4E5D\u5BE8\u6C9F"},{value:"\u5EB7\u5B9A",label:"\u5EB7\u5B9A"},{value:"\u4E50\u5C71",label:"\u4E50\u5C71"},{value:"\u6CF8\u5DDE",label:"\u6CF8\u5DDE"},{value:"\u9A6C\u5C14\u5EB7",label:"\u9A6C\u5C14\u5EB7"},{value:"\u7EF5\u9633",label:"\u7EF5\u9633"},{value:"\u7709\u5C71",label:"\u7709\u5C71"},{value:"\u5357\u5145",label:"\u5357\u5145"},{value:"\u5185\u6C5F",label:"\u5185\u6C5F"},{value:"\u6500\u679D\u82B1",label:"\u6500\u679D\u82B1"},{value:"\u9042\u5B81",label:"\u9042\u5B81"},{value:"\u6C76\u5DDD",label:"\u6C76\u5DDD"},{value:"\u897F\u660C",label:"\u897F\u660C"},{value:"\u96C5\u5B89",label:"\u96C5\u5B89"},{value:"\u5B9C\u5BBE",label:"\u5B9C\u5BBE"},{value:"\u81EA\u8D21",label:"\u81EA\u8D21"},{value:"\u8D44\u9633",label:"\u8D44\u9633"}]},{value:"\u53F0\u6E7E",label:"\u53F0\u6E7E",children:[{value:"\u53F0\u5317",label:"\u53F0\u5317"},{value:"\u57FA\u9686",label:"\u57FA\u9686"},{value:"\u53F0\u5357",label:"\u53F0\u5357"},{value:"\u53F0\u4E2D",label:"\u53F0\u4E2D"},{value:"\u9AD8\u96C4",label:"\u9AD8\u96C4"},{value:"\u5C4F\u4E1C",label:"\u5C4F\u4E1C"},{value:"\u5357\u6295",label:"\u5357\u6295"},{value:"\u4E91\u6797",label:"\u4E91\u6797"},{value:"\u65B0\u7AF9",label:"\u65B0\u7AF9"},{value:"\u5F70\u5316",label:"\u5F70\u5316"},{value:"\u82D7\u6817",label:"\u82D7\u6817"},{value:"\u5609\u4E49",label:"\u5609\u4E49"},{value:"\u6843\u56ED",label:"\u6843\u56ED"},{value:"\u5B9C\u5170",label:"\u5B9C\u5170"},{value:"\u53F0\u4E1C",label:"\u53F0\u4E1C"},{value:"\u91D1\u95E8",label:"\u91D1\u95E8"},{value:"\u9A6C\u7956",label:"\u9A6C\u7956"},{value:"\u6F8E\u6E56",label:"\u6F8E\u6E56"}]},{value:"\u5929\u6D25",label:"\u5929\u6D25",children:[{value:"\u5929\u6D25",label:"\u5929\u6D25"},{value:"\u548C\u5E73",label:"\u548C\u5E73"},{value:"\u4E1C\u4E3D",label:"\u4E1C\u4E3D"},{value:"\u6CB3\u4E1C",label:"\u6CB3\u4E1C"},{value:"\u897F\u9752",label:"\u897F\u9752"},{value:"\u6CB3\u897F",label:"\u6CB3\u897F"},{value:"\u6D25\u5357",label:"\u6D25\u5357"},{value:"\u5357\u5F00",label:"\u5357\u5F00"},{value:"\u5317\u8FB0",label:"\u5317\u8FB0"},{value:"\u6CB3\u5317",label:"\u6CB3\u5317"},{value:"\u6B66\u6E05",label:"\u6B66\u6E05"},{value:"\u7EA2\u6322",label:"\u7EA2\u6322"},{value:"\u5858\u6CBD",label:"\u5858\u6CBD"},{value:"\u6C49\u6CBD",label:"\u6C49\u6CBD"},{value:"\u5927\u6E2F",label:"\u5927\u6E2F"},{value:"\u5B81\u6CB3",label:"\u5B81\u6CB3"},{value:"\u9759\u6D77",label:"\u9759\u6D77"},{value:"\u5B9D\u577B",label:"\u5B9D\u577B"},{value:"\u84DF\u53BF",label:"\u84DF\u53BF"}]},{value:"\u65B0\u7586",label:"\u65B0\u7586",children:[{value:"\u4E4C\u9C81\u6728\u9F50",label:"\u4E4C\u9C81\u6728\u9F50"},{value:"\u963F\u514B\u82CF",label:"\u963F\u514B\u82CF"},{value:"\u963F\u52D2\u6CF0",label:"\u963F\u52D2\u6CF0"},{value:"\u963F\u56FE\u4EC0",label:"\u963F\u56FE\u4EC0"},{value:"\u535A\u4E50",label:"\u535A\u4E50"},{value:"\u660C\u5409",label:"\u660C\u5409"},{value:"\u4E1C\u5C71",label:"\u4E1C\u5C71"},{value:"\u54C8\u5BC6",label:"\u54C8\u5BC6"},{value:"\u548C\u7530",label:"\u548C\u7530"},{value:"\u5580\u4EC0",label:"\u5580\u4EC0"},{value:"\u514B\u62C9\u739B\u4F9D",label:"\u514B\u62C9\u739B\u4F9D"},{value:"\u5E93\u8F66",label:"\u5E93\u8F66"},{value:"\u5E93\u5C14\u52D2",label:"\u5E93\u5C14\u52D2"},{value:"\u594E\u5C6F",label:"\u594E\u5C6F"},{value:"\u77F3\u6CB3\u5B50",label:"\u77F3\u6CB3\u5B50"},{value:"\u5854\u57CE",label:"\u5854\u57CE"},{value:"\u5410\u9C81\u756A",label:"\u5410\u9C81\u756A"},{value:"\u4F0A\u5B81",label:"\u4F0A\u5B81"}]},{value:"\u897F\u85CF",label:"\u897F\u85CF",children:[{value:"\u62C9\u8428",label:"\u62C9\u8428"},{value:"\u963F\u91CC",label:"\u963F\u91CC"},{value:"\u660C\u90FD",label:"\u660C\u90FD"},{value:"\u6797\u829D",label:"\u6797\u829D"},{value:"\u90A3\u66F2",label:"\u90A3\u66F2"},{value:"\u65E5\u5580\u5219",label:"\u65E5\u5580\u5219"},{value:"\u5C71\u5357",label:"\u5C71\u5357"}]},{value:"\u4E91\u5357",label:"\u4E91\u5357",children:[{value:"\u6606\u660E",label:"\u6606\u660E"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4FDD\u5C71",label:"\u4FDD\u5C71"},{value:"\u695A\u96C4",label:"\u695A\u96C4"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4E1C\u5DDD",label:"\u4E1C\u5DDD"},{value:"\u4E2A\u65E7",label:"\u4E2A\u65E7"},{value:"\u666F\u6D2A",label:"\u666F\u6D2A"},{value:"\u5F00\u8FDC",label:"\u5F00\u8FDC"},{value:"\u4E34\u6CA7",label:"\u4E34\u6CA7"},{value:"\u4E3D\u6C5F",label:"\u4E3D\u6C5F"},{value:"\u516D\u5E93",label:"\u516D\u5E93"},{value:"\u6F5E\u897F",label:"\u6F5E\u897F"},{value:"\u66F2\u9756",label:"\u66F2\u9756"},{value:"\u601D\u8305",label:"\u601D\u8305"},{value:"\u6587\u5C71",label:"\u6587\u5C71"},{value:"\u897F\u53CC\u7248\u7EB3",label:"\u897F\u53CC\u7248\u7EB3"},{value:"\u7389\u6EAA",label:"\u7389\u6EAA"},{value:"\u4E2D\u7538",label:"\u4E2D\u7538"},{value:"\u662D\u901A",label:"\u662D\u901A"}]},{value:"\u6D59\u6C5F",label:"\u6D59\u6C5F",children:[{value:"\u676D\u5DDE",label:"\u676D\u5DDE"},{value:"\u6E29\u5DDE",label:"\u6E29\u5DDE"},{value:"\u5B89\u5409",label:"\u5B89\u5409"},{value:"\u6148\u6EAA",label:"\u6148\u6EAA"},{value:"\u5B9A\u6D77",label:"\u5B9A\u6D77"},{value:"\u5949\u5316",label:"\u5949\u5316"},{value:"\u6D77\u76D0",label:"\u6D77\u76D0"},{value:"\u9EC4\u5CA9",label:"\u9EC4\u5CA9"},{value:"\u6E56\u5DDE",label:"\u6E56\u5DDE"},{value:"\u5609\u5174",label:"\u5609\u5174"},{value:"\u91D1\u534E",label:"\u91D1\u534E"},{value:"\u4E34\u5B89",label:"\u4E34\u5B89"},{value:"\u4E34\u6D77",label:"\u4E34\u6D77"},{value:"\u4E3D\u6C34",label:"\u4E3D\u6C34"},{value:"\u5B81\u6CE2",label:"\u5B81\u6CE2"},{value:"\u74EF\u6D77",label:"\u74EF\u6D77"},{value:"\u5E73\u6E56",label:"\u5E73\u6E56"},{value:"\u5343\u5C9B\u6E56",label:"\u5343\u5C9B\u6E56"},{value:"\u8862\u5DDE",label:"\u8862\u5DDE"},{value:"\u6C5F\u5C71",label:"\u6C5F\u5C71"},{value:"\u745E\u5B89",label:"\u745E\u5B89"},{value:"\u7ECD\u5174",label:"\u7ECD\u5174"},{value:"\u5D4A\u5DDE",label:"\u5D4A\u5DDE"},{value:"\u53F0\u5DDE",label:"\u53F0\u5DDE"},{value:"\u6E29\u5CAD",label:"\u6E29\u5CAD"},{value:"\u4F59\u59DA",label:"\u4F59\u59DA"},{value:"\u821F\u5C71",label:"\u821F\u5C71"}]},{value:"\u6D77\u5916",label:"\u6D77\u5916",children:[{value:"\u7F8E\u56FD",label:"\u7F8E\u56FD"},{value:"\u65E5\u672C",label:"\u65E5\u672C"},{value:"\u82F1\u56FD",label:"\u82F1\u56FD"},{value:"\u6CD5\u56FD",label:"\u6CD5\u56FD"},{value:"\u5FB7\u56FD",label:"\u5FB7\u56FD"},{value:"\u5176\u4ED6",label:"\u5176\u4ED6"}]}]},h78n:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return k});var z=v("q1tI"),be=v.n(z),ge=v("TSYQ"),Me=v.n(ge),pe={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},q=function(L){var V=L.map(function(){return Object(z.useRef)()}),p=Object(z.useRef)();return Object(z.useEffect)(function(){var h=Date.now(),N=!1;Object.keys(V).forEach(function(te){var ve=V[te].current;if(!ve)return;N=!0;var Pe=ve.style;Pe.transitionDuration=".3s, .3s, .3s, .06s",p.current&&h-p.current<100&&(Pe.transitionDuration="0s, 0s")}),N&&(p.current=Date.now())}),[V]};function D(){return D=Object.assign||function(K){for(var L=1;L<arguments.length;L++){var V=arguments[L];for(var p in V)Object.prototype.hasOwnProperty.call(V,p)&&(K[p]=V[p])}return K},D.apply(this,arguments)}function j(K,L){return ue(K)||I(K,L)||B(K,L)||A()}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(K,L){if(!K)return;if(typeof K=="string")return O(K,L);var V=Object.prototype.toString.call(K).slice(8,-1);if(V==="Object"&&K.constructor&&(V=K.constructor.name),V==="Map"||V==="Set")return Array.from(K);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return O(K,L)}function O(K,L){(L==null||L>K.length)&&(L=K.length);for(var V=0,p=new Array(L);V<L;V++)p[V]=K[V];return p}function I(K,L){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(K)))return;var V=[],p=!0,h=!1,N=void 0;try{for(var te=K[Symbol.iterator](),ve;!(p=(ve=te.next()).done)&&!(V.push(ve.value),L&&V.length===L);p=!0);}catch(Pe){h=!0,N=Pe}finally{try{!p&&te.return!=null&&te.return()}finally{if(h)throw N}}return V}function ue(K){if(Array.isArray(K))return K}function ee(K,L){if(K==null)return{};var V=P(K,L),p,h;if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(K);for(h=0;h<N.length;h++){if(p=N[h],L.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,p))continue;V[p]=K[p]}}return V}function P(K,L){if(K==null)return{};var V={},p=Object.keys(K),h,N;for(N=0;N<p.length;N++){if(h=p[N],L.indexOf(h)>=0)continue;V[h]=K[h]}return V}var $=function(L){var V=L.className,p=L.percent,h=L.prefixCls,N=L.strokeColor,te=L.strokeLinecap,ve=L.strokeWidth,Pe=L.style,Ee=L.trailColor,we=L.trailWidth,H=L.transition,x=ee(L,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete x.gapPosition;var F=Array.isArray(p)?p:[p],w=Array.isArray(N)?N:[N],_=q(F),g=j(_,1),y=g[0],S=ve/2,W=100-ve/2,ce="M ".concat(te==="round"?S:0,",").concat(S,`
|
|
L `).concat(te==="round"?W:100,",").concat(S),Y="0 0 100 ".concat(ve),Ce=0;return be.a.createElement("svg",D({className:Me()("".concat(h,"-line"),V),viewBox:Y,preserveAspectRatio:"none",style:Pe},x),be.a.createElement("path",{className:"".concat(h,"-line-trail"),d:ce,strokeLinecap:te,stroke:Ee,strokeWidth:we||ve,fillOpacity:"0"}),F.map(function(Re,Fe){var Ve={strokeDasharray:"".concat(Re,"px, 100px"),strokeDashoffset:"-".concat(Ce,"px"),transition:H||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},He=w[Fe]||w[w.length-1];return Ce+=Re,be.a.createElement("path",{key:Fe,className:"".concat(h,"-line-path"),d:ce,strokeLinecap:te,stroke:He,strokeWidth:ve,fillOpacity:"0",ref:y[Fe],style:Ve})}))};$.defaultProps=pe;var J=$;function de(){return de=Object.assign||function(K){for(var L=1;L<arguments.length;L++){var V=arguments[L];for(var p in V)Object.prototype.hasOwnProperty.call(V,p)&&(K[p]=V[p])}return K},de.apply(this,arguments)}function fe(K,L){return Se(K)||ne(K,L)||Ue(K,L)||je()}function je(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ue(K,L){if(!K)return;if(typeof K=="string")return Te(K,L);var V=Object.prototype.toString.call(K).slice(8,-1);if(V==="Object"&&K.constructor&&(V=K.constructor.name),V==="Map"||V==="Set")return Array.from(K);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return Te(K,L)}function Te(K,L){(L==null||L>K.length)&&(L=K.length);for(var V=0,p=new Array(L);V<L;V++)p[V]=K[V];return p}function ne(K,L){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(K)))return;var V=[],p=!0,h=!1,N=void 0;try{for(var te=K[Symbol.iterator](),ve;!(p=(ve=te.next()).done)&&!(V.push(ve.value),L&&V.length===L);p=!0);}catch(Pe){h=!0,N=Pe}finally{try{!p&&te.return!=null&&te.return()}finally{if(h)throw N}}return V}function Se(K){if(Array.isArray(K))return K}function me(K,L){if(K==null)return{};var V=G(K,L),p,h;if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(K);for(h=0;h<N.length;h++){if(p=N[h],L.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,p))continue;V[p]=K[p]}}return V}function G(K,L){if(K==null)return{};var V={},p=Object.keys(K),h,N;for(N=0;N<p.length;N++){if(h=p[N],L.indexOf(h)>=0)continue;V[h]=K[h]}return V}var he=0;function ie(K){return+K.replace("%","")}function R(K){return Array.isArray(K)?K:[K]}function ye(K,L,V,p){var h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,N=arguments.length>5?arguments[5]:void 0,te=50-p/2,ve=0,Pe=-te,Ee=0,we=-2*te;switch(N){case"left":ve=-te,Pe=0,Ee=2*te,we=0;break;case"right":ve=te,Pe=0,Ee=-2*te,we=0;break;case"bottom":Pe=te,we=2*te;break;default:}var H="M 50,50 m ".concat(ve,",").concat(Pe,`
|
|
a `).concat(te,",").concat(te," 0 1 1 ").concat(Ee,",").concat(-we,`
|
|
a `).concat(te,",").concat(te," 0 1 1 ").concat(-Ee,",").concat(we),x=Math.PI*2*te,F={stroke:V,strokeDasharray:"".concat(L/100*(x-h),"px ").concat(x,"px"),strokeDashoffset:"-".concat(h/2+K/100*(x-h),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:H,pathStyle:F}}var re=function(L){var V=L.prefixCls,p=L.strokeWidth,h=L.trailWidth,N=L.gapDegree,te=L.gapPosition,ve=L.trailColor,Pe=L.strokeLinecap,Ee=L.style,we=L.className,H=L.strokeColor,x=L.percent,F=me(L,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),w=Object(z.useMemo)(function(){return he+=1,he},[]),_=ye(0,100,ve,p,N,te),g=_.pathString,y=_.pathStyle,S=R(x),W=R(H),ce=W.find(function(Ve){return Object.prototype.toString.call(Ve)==="[object Object]"}),Y=q(S),Ce=fe(Y,1),Re=Ce[0],Fe=function(){var He=0;return S.map(function(ze,at){var xe=W[at]||W[W.length-1],Ie=Object.prototype.toString.call(xe)==="[object Object]"?"url(#".concat(V,"-gradient-").concat(w,")"):"",Be=ye(He,ze,xe,p,N,te);return He+=ze,be.a.createElement("path",{key:at,className:"".concat(V,"-circle-path"),d:Be.pathString,stroke:Ie,strokeLinecap:Pe,strokeWidth:p,opacity:ze===0?0:1,fillOpacity:"0",style:Be.pathStyle,ref:Re[at]})})};return be.a.createElement("svg",de({className:Me()("".concat(V,"-circle"),we),viewBox:"0 0 100 100",style:Ee},F),ce&&be.a.createElement("defs",null,be.a.createElement("linearGradient",{id:"".concat(V,"-gradient-").concat(w),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ce).sort(function(Ve,He){return ie(Ve)-ie(He)}).map(function(Ve,He){return be.a.createElement("stop",{key:He,offset:Ve,stopColor:ce[Ve]})}))),be.a.createElement("path",{className:"".concat(V,"-circle-trail"),d:g,stroke:ve,strokeLinecap:Pe,strokeWidth:h||p,fillOpacity:"0",style:y}),Fe().reverse())};re.defaultProps=pe;var k=re,T={Line:J,Circle:k}},hxT0:function(lt,qe,v){lt.exports={bg:"bg___2samk",flexRow:"flexRow___2Ocys",flexJustifyCenter:"flexJustifyCenter___14s6l",flexAlignEnd:"flexAlignEnd___1lHt8",flexAlignCenter:"flexAlignCenter___2PtCV",flexColumn:"flexColumn___2Ssa4",formWrap:"formWrap___3Fcg8",titleWrap:"titleWrap___3U2TN",fieldWrap:"fieldWrap___3K6pg",mdWrap:"mdWrap___3o_rf",backgroundFa:"backgroundFa___3dwFi",button:"button___1vOOT",cascaderWrap:"cascaderWrap___ETHsj",listItem:"listItem___C62yl",right:"right___1iif8",one:"one___2Qd4F",schoolHintWrap:"schoolHintWrap___34WkA",colorCDCDCD:"colorCDCDCD___HqcpR",color0152d9:"color0152d9___cQ4G4"}},kSUc:function(lt,qe,v){},lZu9:function(lt,qe,v){(function(z){z(v("VrN/"),v("1eCo"),v("8EBN"))})(function(z){"use strict";z.defineMode("markdown",function(be,ge){var Me=z.getMode(be,"text/html"),pe=Me.name=="null";function q(p){if(z.findModeByName){var h=z.findModeByName(p);h&&(p=h.mime||h.mimes[0])}var N=z.getMode(be,p);return N.name=="null"?null:N}ge.highlightFormatting===void 0&&(ge.highlightFormatting=!1),ge.maxBlockquoteDepth===void 0&&(ge.maxBlockquoteDepth=0),ge.taskLists===void 0&&(ge.taskLists=!1),ge.strikethrough===void 0&&(ge.strikethrough=!1),ge.emoji===void 0&&(ge.emoji=!1),ge.fencedCodeBlockHighlighting===void 0&&(ge.fencedCodeBlockHighlighting=!0),ge.fencedCodeBlockDefaultMode===void 0&&(ge.fencedCodeBlockDefaultMode="text/plain"),ge.xml===void 0&&(ge.xml=!0),ge.tokenTypeOverrides===void 0&&(ge.tokenTypeOverrides={});var D={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 j in D)D.hasOwnProperty(j)&&ge.tokenTypeOverrides[j]&&(D[j]=ge.tokenTypeOverrides[j]);var A=/^([*\-_])(?:\s*\1){2,}\s*$/,B=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,O=/^\[(x| )\](?=\s)/i,I=ge.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ue=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ee=/^[^#!\[\]*_\\<>` "'(~:]+/,P=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,$=/^\s*\[[^\]]+?\]:.*$/,J=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,de=" ";function fe(p,h,N){return h.f=h.inline=N,N(p,h)}function je(p,h,N){return h.f=h.block=N,N(p,h)}function Ue(p){return!p||!/\S/.test(p.string)}function Te(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==Se){var h=pe;if(!h){var N=z.innerMode(Me,p.htmlState);h=N.mode.name=="xml"&&N.state.tagStart===null&&!N.state.context&&N.state.tokenize.isInText}h&&(p.f=ie,p.block=ne,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function ne(p,h){var N=p.column()===h.indentation,te=Ue(h.prevLine.stream),ve=h.indentedCode,Pe=h.prevLine.hr,Ee=h.list!==!1,we=(h.listStack[h.listStack.length-1]||0)+3;h.indentedCode=!1;var H=h.indentation;if(h.indentationDiff===null&&(h.indentationDiff=h.indentation,Ee)){for(h.list=null;H<h.listStack[h.listStack.length-1];)h.listStack.pop(),h.listStack.length?h.indentation=h.listStack[h.listStack.length-1]:h.list=!1;h.list!==!1&&(h.indentationDiff=H-h.listStack[h.listStack.length-1])}var x=!te&&!Pe&&!h.prevLine.header&&(!Ee||!ve)&&!h.prevLine.fencedCodeEnd,F=(h.list===!1||Pe||te)&&h.indentation<=we&&p.match(A),w=null;if(h.indentationDiff>=4&&(ve||h.prevLine.fencedCodeEnd||h.prevLine.header||te))return p.skipToEnd(),h.indentedCode=!0,D.code;if(p.eatSpace())return null;if(N&&h.indentation<=we&&(w=p.match(I))&&w[1].length<=6)return h.quote=0,h.header=w[1].length,h.thisLine.header=!0,ge.highlightFormatting&&(h.formatting="header"),h.f=h.inline,G(h);if(h.indentation<=we&&p.eat(">"))return h.quote=N?1:h.quote+1,ge.highlightFormatting&&(h.formatting="quote"),p.eatSpace(),G(h);if(!F&&!h.setext&&N&&h.indentation<=we&&(w=p.match(B))){var _=w[1]?"ol":"ul";return h.indentation=H+p.current().length,h.list=!0,h.quote=0,h.listStack.push(h.indentation),h.em=!1,h.strong=!1,h.code=!1,h.strikethrough=!1,ge.taskLists&&p.match(O,!1)&&(h.taskList=!0),h.f=h.inline,ge.highlightFormatting&&(h.formatting=["list","list-"+_]),G(h)}else{if(N&&h.indentation<=we&&(w=p.match(P,!0)))return h.quote=0,h.fencedEndRE=new RegExp(w[1]+"+ *$"),h.localMode=ge.fencedCodeBlockHighlighting&&q(w[2]||ge.fencedCodeBlockDefaultMode),h.localMode&&(h.localState=z.startState(h.localMode)),h.f=h.block=me,ge.highlightFormatting&&(h.formatting="code-block"),h.code=-1,G(h);if(h.setext||(!x||!Ee)&&!h.quote&&h.list===!1&&!h.code&&!F&&!$.test(p.string)&&(w=p.lookAhead(1))&&(w=w.match(ue)))return h.setext?(h.header=h.setext,h.setext=0,p.skipToEnd(),ge.highlightFormatting&&(h.formatting="header")):(h.header=w[0].charAt(0)=="="?1:2,h.setext=h.header),h.thisLine.header=!0,h.f=h.inline,G(h);if(F)return p.skipToEnd(),h.hr=!0,h.thisLine.hr=!0,D.hr;if(p.peek()==="[")return fe(p,h,T)}return fe(p,h,h.inline)}function Se(p,h){var N=Me.token(p,h.htmlState);if(!pe){var te=z.innerMode(Me,h.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||h.md_inside&&p.current().indexOf(">")>-1)&&(h.f=ie,h.block=ne,h.htmlState=null)}return N}function me(p,h){var N=h.listStack[h.listStack.length-1]||0,te=h.indentation<N,ve=N+3;if(h.fencedEndRE&&h.indentation<=ve&&(te||p.match(h.fencedEndRE))){ge.highlightFormatting&&(h.formatting="code-block");var Pe;return te||(Pe=G(h)),h.localMode=h.localState=null,h.block=ne,h.f=ie,h.fencedEndRE=null,h.code=0,h.thisLine.fencedCodeEnd=!0,te?je(p,h,h.block):Pe}else return h.localMode?h.localMode.token(p,h.localState):(p.skipToEnd(),D.code)}function G(p){var h=[];if(p.formatting){h.push(D.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var N=0;N<p.formatting.length;N++)h.push(D.formatting+"-"+p.formatting[N]),p.formatting[N]==="header"&&h.push(D.formatting+"-"+p.formatting[N]+"-"+p.header),p.formatting[N]==="quote"&&(!ge.maxBlockquoteDepth||ge.maxBlockquoteDepth>=p.quote?h.push(D.formatting+"-"+p.formatting[N]+"-"+p.quote):h.push("error"))}if(p.taskOpen)return h.push("meta"),h.length?h.join(" "):null;if(p.taskClosed)return h.push("property"),h.length?h.join(" "):null;if(p.linkHref?h.push(D.linkHref,"url"):(p.strong&&h.push(D.strong),p.em&&h.push(D.em),p.strikethrough&&h.push(D.strikethrough),p.emoji&&h.push(D.emoji),p.linkText&&h.push(D.linkText),p.code&&h.push(D.code),p.image&&h.push(D.image),p.imageAltText&&h.push(D.imageAltText,"link"),p.imageMarker&&h.push(D.imageMarker)),p.header&&h.push(D.header,D.header+"-"+p.header),p.quote&&(h.push(D.quote),!ge.maxBlockquoteDepth||ge.maxBlockquoteDepth>=p.quote?h.push(D.quote+"-"+p.quote):h.push(D.quote+"-"+ge.maxBlockquoteDepth)),p.list!==!1){var te=(p.listStack.length-1)%3;te?te===1?h.push(D.list2):h.push(D.list3):h.push(D.list1)}return p.trailingSpaceNewLine?h.push("trailing-space-new-line"):p.trailingSpace&&h.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),h.length?h.join(" "):null}function he(p,h){return p.match(ee,!0)?G(h):void 0}function ie(p,h){var N=h.text(p,h);if(typeof N!="undefined")return N;if(h.list)return h.list=null,G(h);if(h.taskList){var te=p.match(O,!0)[1]===" ";return te?h.taskOpen=!0:h.taskClosed=!0,ge.highlightFormatting&&(h.formatting="task"),h.taskList=!1,G(h)}if(h.taskOpen=!1,h.taskClosed=!1,h.header&&p.match(/^#+$/,!0))return ge.highlightFormatting&&(h.formatting="header"),G(h);var ve=p.next();if(h.linkTitle){h.linkTitle=!1;var Pe=ve;ve==="("&&(Pe=")"),Pe=(Pe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ee="^\\s*(?:[^"+Pe+"\\\\]+|\\\\\\\\|\\\\.)"+Pe;if(p.match(new RegExp(Ee),!0))return D.linkHref}if(ve==="`"){var we=h.formatting;ge.highlightFormatting&&(h.formatting="code"),p.eatWhile("`");var H=p.current().length;if(h.code==0&&(!h.quote||H==1))return h.code=H,G(h);if(H==h.code){var x=G(h);return h.code=0,x}else return h.formatting=we,G(h)}else if(h.code)return G(h);if(ve==="\\"&&(p.next(),ge.highlightFormatting)){var F=G(h),w=D.formatting+"-escape";return F?F+" "+w:w}if(ve==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return h.imageMarker=!0,h.image=!0,ge.highlightFormatting&&(h.formatting="image"),G(h);if(ve==="["&&h.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return h.imageMarker=!1,h.imageAltText=!0,ge.highlightFormatting&&(h.formatting="image"),G(h);if(ve==="]"&&h.imageAltText){ge.highlightFormatting&&(h.formatting="image");var F=G(h);return h.imageAltText=!1,h.image=!1,h.inline=h.f=ye,F}if(ve==="["&&!h.image)return h.linkText&&p.match(/^.*?\]/)||(h.linkText=!0,ge.highlightFormatting&&(h.formatting="link")),G(h);if(ve==="]"&&h.linkText){ge.highlightFormatting&&(h.formatting="link");var F=G(h);return h.linkText=!1,h.inline=h.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?ye:ie,F}if(ve==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){h.f=h.inline=R,ge.highlightFormatting&&(h.formatting="link");var F=G(h);return F?F+=" ":F="",F+D.linkInline}if(ve==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){h.f=h.inline=R,ge.highlightFormatting&&(h.formatting="link");var F=G(h);return F?F+=" ":F="",F+D.linkEmail}if(ge.xml&&ve==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=p.string.indexOf(">",p.pos);if(_!=-1){var g=p.string.substring(p.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(g)&&(h.md_inside=!0)}return p.backUp(1),h.htmlState=z.startState(Me),je(p,h,Se)}if(ge.xml&&ve==="<"&&p.match(/^\/\w*?>/))return h.md_inside=!1,"tag";if(ve==="*"||ve==="_"){for(var y=1,S=p.pos==1?" ":p.string.charAt(p.pos-2);y<3&&p.eat(ve);)y++;var W=p.peek()||" ",ce=!/\s/.test(W)&&(!J.test(W)||/\s/.test(S)||J.test(S)),Y=!/\s/.test(S)&&(!J.test(S)||/\s/.test(W)||J.test(W)),Ce=null,Re=null;if(y%2&&(!h.em&&ce&&(ve==="*"||!Y||J.test(S))?Ce=!0:h.em==ve&&Y&&(ve==="*"||!ce||J.test(W))&&(Ce=!1)),y>1&&(!h.strong&&ce&&(ve==="*"||!Y||J.test(S))?Re=!0:h.strong==ve&&Y&&(ve==="*"||!ce||J.test(W))&&(Re=!1)),Re!=null||Ce!=null){ge.highlightFormatting&&(h.formatting=Ce==null?"strong":Re==null?"em":"strong em"),Ce===!0&&(h.em=ve),Re===!0&&(h.strong=ve);var x=G(h);return Ce===!1&&(h.em=!1),Re===!1&&(h.strong=!1),x}}else if(ve===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return G(h);p.backUp(1)}if(ge.strikethrough){if(ve==="~"&&p.eatWhile(ve)){if(h.strikethrough){ge.highlightFormatting&&(h.formatting="strikethrough");var x=G(h);return h.strikethrough=!1,x}else if(p.match(/^[^\s]/,!1))return h.strikethrough=!0,ge.highlightFormatting&&(h.formatting="strikethrough"),G(h)}else if(ve===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return G(h);p.backUp(2)}}if(ge.emoji&&ve===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){h.emoji=!0,ge.highlightFormatting&&(h.formatting="emoji");var Fe=G(h);return h.emoji=!1,Fe}return ve===" "&&(p.match(/^ +$/,!1)?h.trailingSpace++:h.trailingSpace&&(h.trailingSpaceNewLine=!0)),G(h)}function R(p,h){var N=p.next();if(N===">"){h.f=h.inline=ie,ge.highlightFormatting&&(h.formatting="link");var te=G(h);return te?te+=" ":te="",te+D.linkInline}return p.match(/^[^>]+/,!0),D.linkInline}function ye(p,h){if(p.eatSpace())return null;var N=p.next();return N==="("||N==="["?(h.f=h.inline=k(N==="("?")":"]"),ge.highlightFormatting&&(h.formatting="link-string"),h.linkHref=!0,G(h)):"error"}var re={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function k(p){return function(h,N){var te=h.next();if(te===p){N.f=N.inline=ie,ge.highlightFormatting&&(N.formatting="link-string");var ve=G(N);return N.linkHref=!1,ve}return h.match(re[p]),N.linkHref=!0,G(N)}}function T(p,h){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(h.f=K,p.next(),ge.highlightFormatting&&(h.formatting="link"),h.linkText=!0,G(h)):fe(p,h,ie)}function K(p,h){if(p.match(/^\]:/,!0)){h.f=h.inline=L,ge.highlightFormatting&&(h.formatting="link");var N=G(h);return h.linkText=!1,N}return p.match(/^([^\]\\]|\\.)+/,!0),D.linkText}function L(p,h){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?h.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),h.f=h.inline=ie,D.linkHref+" url")}var V={startState:function(){return{f:ne,prevLine:{stream:null},thisLine:{stream:null},block:ne,htmlState:null,indentation:0,inline:ie,text:he,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(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&z.copyState(Me,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?z.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,h){if(h.formatting=!1,p!=h.thisLine.stream){if(h.header=0,h.hr=!1,p.match(/^\s*$/,!0))return Te(h),null;if(h.prevLine=h.thisLine,h.thisLine={stream:p},h.taskList=!1,h.trailingSpace=0,h.trailingSpaceNewLine=!1,!h.localState&&(h.f=h.block,h.f!=Se)){var N=p.match(/^\s*/,!0)[0].replace(/\t/g,de).length;if(h.indentation=N,h.indentationDiff=null,N>0)return null}}return h.f(p,h)},innerMode:function(p){return p.block==Se?{state:p.htmlState,mode:Me}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:V}},indent:function(p,h,N){return p.block==Se&&Me.indent?Me.indent(p.htmlState,h,N):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,h,N):z.Pass},blankLine:Te,getType:G,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return V},"xml"),z.defineMIME("text/markdown","markdown"),z.defineMIME("text/x-markdown","markdown")})},nVVt:function(lt,qe){lt.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(lt,qe,v){(function(z){z(v("VrN/"))})(function(z){"use strict";var be=z.Pos;function ge(J,de){return J.line-de.line||J.ch-de.ch}var Me="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",pe=Me+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",q=new RegExp("<(/?)(["+Me+"]["+pe+"]*)","g");function D(J,de,fe,je){this.line=de,this.ch=fe,this.cm=J,this.text=J.getLine(de),this.min=je?Math.max(je.from,J.firstLine()):J.firstLine(),this.max=je?Math.min(je.to-1,J.lastLine()):J.lastLine()}function j(J,de){var fe=J.cm.getTokenTypeAt(be(J.line,de));return fe&&/\btag\b/.test(fe)}function A(J){return J.line>=J.max?void 0:(J.ch=0,J.text=J.cm.getLine(++J.line),!0)}function B(J){return J.line<=J.min?void 0:(J.text=J.cm.getLine(--J.line),J.ch=J.text.length,!0)}function O(J){for(;;){var de=J.text.indexOf(">",J.ch);if(de==-1){if(A(J))continue;return}if(!j(J,de+1)){J.ch=de+1;continue}var fe=J.text.lastIndexOf("/",de),je=fe>-1&&!/\S/.test(J.text.slice(fe+1,de));return J.ch=de+1,je?"selfClose":"regular"}}function I(J){for(;;){var de=J.ch?J.text.lastIndexOf("<",J.ch-1):-1;if(de==-1){if(B(J))continue;return}if(!j(J,de+1)){J.ch=de;continue}q.lastIndex=de,J.ch=de;var fe=q.exec(J.text);if(fe&&fe.index==de)return fe}}function ue(J){for(;;){q.lastIndex=J.ch;var de=q.exec(J.text);if(!de){if(A(J))continue;return}if(!j(J,de.index+1)){J.ch=de.index+1;continue}return J.ch=de.index+de[0].length,de}}function ee(J){for(;;){var de=J.ch?J.text.lastIndexOf(">",J.ch-1):-1;if(de==-1){if(B(J))continue;return}if(!j(J,de+1)){J.ch=de;continue}var fe=J.text.lastIndexOf("/",de),je=fe>-1&&!/\S/.test(J.text.slice(fe+1,de));return J.ch=de+1,je?"selfClose":"regular"}}function P(J,de){for(var fe=[];;){var je=ue(J),Ue,Te=J.line,ne=J.ch-(je?je[0].length:0);if(!je||!(Ue=O(J)))return;if(Ue=="selfClose")continue;if(je[1]){for(var Se=fe.length-1;Se>=0;--Se)if(fe[Se]==je[2]){fe.length=Se;break}if(Se<0&&(!de||de==je[2]))return{tag:je[2],from:be(Te,ne),to:be(J.line,J.ch)}}else fe.push(je[2])}}function $(J,de){for(var fe=[];;){var je=ee(J);if(!je)return;if(je=="selfClose"){I(J);continue}var Ue=J.line,Te=J.ch,ne=I(J);if(!ne)return;if(ne[1])fe.push(ne[2]);else{for(var Se=fe.length-1;Se>=0;--Se)if(fe[Se]==ne[2]){fe.length=Se;break}if(Se<0&&(!de||de==ne[2]))return{tag:ne[2],from:be(J.line,J.ch),to:be(Ue,Te)}}}}z.registerHelper("fold","xml",function(J,de){for(var fe=new D(J,de.line,0);;){var je=ue(fe);if(!je||fe.line!=de.line)return;var Ue=O(fe);if(!Ue)return;if(!je[1]&&Ue!="selfClose"){var Te=be(fe.line,fe.ch),ne=P(fe,je[2]);return ne&&ge(ne.from,Te)>0?{from:Te,to:ne.from}:null}}}),z.findMatchingTag=function(J,de,fe){var je=new D(J,de.line,de.ch,fe);if(je.text.indexOf(">")==-1&&je.text.indexOf("<")==-1)return;var Ue=O(je),Te=Ue&&be(je.line,je.ch),ne=Ue&&I(je);if(!Ue||!ne||ge(je,de)>0)return;var Se={from:be(je.line,je.ch),to:Te,tag:ne[2]};return Ue=="selfClose"?{open:Se,close:null,at:"open"}:ne[1]?{open:$(je,ne[2]),close:Se,at:"close"}:(je=new D(J,Te.line,Te.ch,fe),{open:Se,close:P(je,ne[2]),at:"open"})},z.findEnclosingTag=function(J,de,fe,je){for(var Ue=new D(J,de.line,de.ch,fe);;){var Te=$(Ue,je);if(!Te)break;var ne=new D(J,de.line,de.ch,fe),Se=P(ne,Te.tag);if(Se)return{open:Te,close:Se}}},z.scanForClosingTag=function(J,de,fe,je){var Ue=new D(J,de.line,de.ch,je?{from:0,to:je}:null);return P(Ue,fe)}})},p5ED:function(lt,qe,v){"use strict";var z=v("+L6B"),be=v("2/Rp"),ge=v("5Dmo"),Me=v("3S7+"),pe=v("k1fw"),q=v("9og8"),D=v("tJVT"),j=v("WmNS"),A=v.n(j),B=v("q1tI"),O=v.n(B),I=v("vHTk"),ue=v.n(I),ee=v("yEEn"),P=v("ZW9T"),$=v("1vsH"),J=v("V0Rq"),de=v("m3rI"),fe=function(Ue){var Te=Ue.name,ne=Ue.data,Se=Ue.theme,me=Ue.type,G=Ue.filename,he=Ue.monacoEditor,ie=Ue.className,R=Ue.style,ye=Ue.close,re=Ue.onClose,k=Ue.hasMask,T=Ue.otherData,K=T===void 0?{}:T,L=Object(B.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),V=Object(D.a)(L,2),p=V[0],h=V[1],N=Object(B.useState)(""),te=Object(D.a)(N,2),ve=te[0],Pe=te[1],Ee=Object(B.useState)(),we=Object(D.a)(Ee,2),H=we[0],x=we[1],F,w=1024*1024,_=10*w,g=Object(B.useRef)();me==="office"&&(me="other",F=Object($.R)(ne).filesize,F>_&&(me="other")),G&&(he.filename=G),Object(B.useEffect)(function(){var ce,Y,Ce=(ce=document.cookie)===null||ce===void 0||((Y=ce.replace(/\s/g,""))===null||Y===void 0)?void 0:Y.split(";");Ce==null||Ce.map(function(Re){var Fe=Re.split("=");Fe[0]==="_educoder_session"&&Pe(Fe[1])})},[]),Object(B.useEffect)(function(){me==="office"&&y()},[me]);var y=function(){var ce=Object(q.a)(A.a.mark(function Y(){var Ce,Re,Fe;return A.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return console.log("data:",ne),Ce=ne,ne.startsWith("http")||(Ce=location.origin+Ce),Re=new URL(Ce).pathname.split("/").pop(),He.next=6,Object(J.U)({attachment_id:Re});case 6:Fe=He.sent,x(Fe);case 8:case"end":return He.stop()}},Y)}));return function(){return ce.apply(this,arguments)}}(),S=function(){if(ne.startsWith("http")||ne.startsWith("blob:")){W();return}Object($.x)(G||"educoder",ne,G)},W=function(){Object($.v)(G||"educoder",decodeURIComponent(ne))};return O.a.createElement("div",{style:Object(pe.a)({},R||{}),className:"".concat(k&&ue.a.bgBlack," ").concat(me?ue.a.wrp:"hide")},ye&&O.a.createElement("div",{className:ue.a.close,ref:g},O.a.createElement(Me.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return g.current}},O.a.createElement("span",{onClick:W},O.a.createElement("i",{className:"icon-quxiaozhiding"}))),O.a.createElement(Me.a,{title:"\u5173\u95ED",getPopupContainer:function(){return g.current}},O.a.createElement("span",{className:"",onClick:function(){re(),x(null)}},O.a.createElement("i",{className:"icon-guanbi1"})))),O.a.createElement("div",{className:"".concat(ue.a[ie]," ").concat(ie," ").concat(ue.a.monaco," ").concat(me==="txt"?"show":"hide")},me==="txt"&&O.a.createElement(P.b,he)),me==="audio"&&O.a.createElement("audio",{src:"".concat((ne==null?void 0:ne.indexOf("http://"))>-1||(ne==null?void 0:ne.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(ne),autoPlay:!0}),me==="video"&&O.a.createElement(O.a.Fragment,null,(ne==null?void 0:ne.indexOf("http"))>-1?O.a.createElement("video",{controls:!0,src:"".concat(ne),autoPlay:!0}):O.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(ne),autoPlay:!0})),me==="office"&&H&&O.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(H.key,"&url=").concat(de.a.API_SERVER+H.url,"&callbackUrl=").concat(de.a.API_SERVER+H.callbackUrl,"&fileType=").concat(H.fileType,"&title=").concat(H.title,"&model=view")}),(me==="xlsx"||me==="doc"||me==="pptx"||me==="docx")&&O.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(K.key,"&url=").concat(de.a.API_SERVER+K.url,"&callbackUrl=").concat(de.a.API_SERVER+K.callbackUrl,"&fileType=").concat(K.fileType,"&title=").concat(K.title,"&model=").concat(K.model)}),me==="html"&&O.a.createElement("iframe",{src:ne+"&disposition=inline"}),me==="pdf"&&O.a.createElement("embed",{className:ue.a.embed,src:ne,type:"application/pdf"}),me==="image"&&O.a.createElement("img",{src:"".concat((ne==null?void 0:ne.indexOf("http://"))>-1||(ne==null?void 0:ne.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(ne)}),me==="other"&&O.a.createElement("div",null,O.a.createElement(be.a,{type:"primary",size:"large",onClick:S},O.a.createElement(ee.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),me==="download"&&O.a.createElement(be.a,{type:"primary",size:"large",onClick:S},O.a.createElement(ee.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};qe.a=fe},"p77/":function(lt,qe,v){},"rAM+":function(lt,qe,v){"use strict";v.d(qe,"a",function(){return be});var z=v("Qw5x");function be(ge,Me){var pe;if(typeof Symbol=="undefined"||ge[Symbol.iterator]==null){if(Array.isArray(ge)||(pe=Object(z.a)(ge))||Me&&ge&&typeof ge.length=="number"){pe&&(ge=pe);var q=0,D=function(){};return{s:D,n:function(){return q>=ge.length?{done:!0}:{done:!1,value:ge[q++]}},e:function(I){throw I},f:D}}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 j=!0,A=!1,B;return{s:function(){pe=ge[Symbol.iterator]()},n:function(){var I=pe.next();return j=I.done,I},e:function(I){A=!0,B=I},f:function(){try{!j&&pe.return!=null&&pe.return()}finally{if(A)throw B}}}}},rUJ1:function(lt,qe){const v=/[&<>"']/,z=/[&<>"']/g,be=/[<>"']|&(?!#?\w+;)/,ge=/[<>"']|&(?!#?\w+;)/g,Me={"&":"&","<":"<",">":">",'"':""","'":"'"},pe=me=>Me[me];function q(me,G){if(G){if(v.test(me))return me.replace(z,pe)}else if(be.test(me))return me.replace(ge,pe);return me}const D=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function j(me){return me.replace(D,(G,he)=>(he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""))}const A=/(^|[^\[])\^/g;function B(me,G){me=me.source||me,G=G||"";const he={replace:(ie,R)=>(R=R.source||R,R=R.replace(A,"$1"),me=me.replace(ie,R),he),getRegex:()=>new RegExp(me,G)};return he}const O=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ue(me,G,he){if(me){let ie;try{ie=decodeURIComponent(j(he)).replace(O,"").toLowerCase()}catch(R){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}G&&!I.test(he)&&(he=de(G,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch(ie){return null}return he}const ee={},P=/^[^:]+:\/*[^/]*$/,$=/^([^:]+:)[\s\S]*$/,J=/^([^:]+:\/*[^/]*)[\s\S]*$/;function de(me,G){ee[" "+me]||(P.test(me)?ee[" "+me]=me+"/":ee[" "+me]=Te(me,"/",!0)),me=ee[" "+me];const he=me.indexOf(":")===-1;return G.substring(0,2)==="//"?he?G:me.replace($,"$1")+G:G.charAt(0)==="/"?he?G:me.replace(J,"$1")+G:me+G}const fe={exec:function(){}};function je(me){let G=1,he,ie;for(;G<arguments.length;G++){he=arguments[G];for(ie in he)Object.prototype.hasOwnProperty.call(he,ie)&&(me[ie]=he[ie])}return me}function Ue(me,G){const he=me.replace(/\|/g,(ye,re,k)=>{let T=!1,K=re;for(;--K>=0&&k[K]==="\\";)T=!T;return T?"|":" |"}),ie=he.split(/ \|/);let R=0;if(ie.length>G)ie.splice(G);else for(;ie.length<G;)ie.push("");for(;R<ie.length;R++)ie[R]=ie[R].trim().replace(/\\\|/g,"|");return ie}function Te(me,G,he){const ie=me.length;if(ie===0)return"";let R=0;for(;R<ie;){const ye=me.charAt(ie-R-1);if(ye===G&&!he)R++;else if(ye!==G&&he)R++;else break}return me.substr(0,ie-R)}function ne(me,G){if(me.indexOf(G[1])===-1)return-1;const he=me.length;let ie=0,R=0;for(;R<he;R++)if(me[R]==="\\")R++;else if(me[R]===G[0])ie++;else if(me[R]===G[1]&&(ie--,ie<0))return R;return-1}function Se(me){me&&me.sanitize&&!me.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")}lt.exports={escape:q,unescape:j,edit:B,cleanUrl:ue,resolveUrl:de,noopTest:fe,merge:je,splitCells:Ue,rtrim:Te,findClosingBracket:ne,checkSanitizeDeprecation:Se}},rcnY:function(lt,qe,v){var z=v("aRTE");function be(ge,Me){this.totalCount=ge,this.dataCount=Me}be.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],be.getRSBlocks=function(ge,Me){var pe=be.getRsBlockTable(ge,Me);if(pe==null)throw new Error("bad rs block @ typeNumber:"+ge+"/errorCorrectLevel:"+Me);for(var q=pe.length/3,D=new Array,j=0;j<q;j++)for(var A=pe[j*3+0],B=pe[j*3+1],O=pe[j*3+2],I=0;I<A;I++)D.push(new be(B,O));return D},be.getRsBlockTable=function(ge,Me){switch(Me){case z.L:return be.RS_BLOCK_TABLE[(ge-1)*4+0];case z.M:return be.RS_BLOCK_TABLE[(ge-1)*4+1];case z.Q:return be.RS_BLOCK_TABLE[(ge-1)*4+2];case z.H:return be.RS_BLOCK_TABLE[(ge-1)*4+3];default:return}},lt.exports=be},sboe:function(lt,qe,v){"use strict";v.d(qe,"a",function(){return ge});var z=v("q1tI"),be=v.n(z),ge=z.createContext(null)},uK0f:function(lt,qe,v){(function(z,be){lt.exports=be()})(this,function(){"use strict";function z(be,ge,Me){Me=Me||{},Me.childrenKeyName=Me.childrenKeyName||"children";var pe=be||[],q=[],D=0;do{var j=pe.filter(function(A){return ge(A,D)})[0];if(!j)break;q.push(j),pe=j[Me.childrenKeyName]||[],D+=1}while(pe.length>0);return q}return z})},vHTk:function(lt,qe,v){lt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(lt,qe){function v(){this.buffer=new Array,this.length=0}v.prototype={get:function(z){var be=Math.floor(z/8);return(this.buffer[be]>>>7-z%8&1)==1},put:function(z,be){for(var ge=0;ge<be;ge++)this.putBit((z>>>be-ge-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(z){var be=Math.floor(this.length/8);this.buffer.length<=be&&this.buffer.push(0),z&&(this.buffer[be]|=128>>>this.length%8),this.length++}},lt.exports=v}}]);
|