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

    ".concat(c,"

    "):'
    ').concat(a?c:Object(S.escape)(c,!0),`
    `):'
    '+(a?c:Object(S.escape)(c,!0))+"
    "},L.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return v.push({anchor:u,level:o,text:c}),"'+c+""},E.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),E.a.use({tokenizer:Ee,renderer:L});var I=E.a,m=y("SJMd"),d=y("ulZh"),M=y.n(d),V=y("m3rI"),oe=y("Oy/b"),Le=y("p5ED"),Be=y("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 _e=function(c,o){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(a[f]=u[f])})(c,o)};function Ne(c,o){function a(){this.constructor=c}_e(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ke(c,o,a,u){return new(a||(a=Promise))(function(f,h){function ee(ut){try{Qe(u.next(ut))}catch(Ge){h(Ge)}}function ze(ut){try{Qe(u.throw(ut))}catch(Ge){h(Ge)}}function Qe(ut){var Ge;ut.done?f(ut.value):(Ge=ut.value,Ge instanceof a?Ge:new a(function(kt){kt(Ge)})).then(ee,ze)}Qe((u=u.apply(c,o||[])).next())})}function Te(c,o){var a,u,f,h,ee={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function ze(Qe){return function(ut){return function(Ge){if(a)throw new TypeError("Generator is already executing.");for(;ee;)try{if(a=1,u&&(f=2&Ge[0]?u.return:Ge[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,Ge[1])).done)return f;switch(u=0,f&&(Ge=[2&Ge[0],f.value]),Ge[0]){case 0:case 1:f=Ge;break;case 4:return ee.label++,{value:Ge[1],done:!1};case 5:ee.label++,u=Ge[1],Ge=[0];continue;case 7:Ge=ee.ops.pop(),ee.trys.pop();continue;default:if(!(f=ee.trys,(f=f.length>0&&f[f.length-1])||Ge[0]!==6&&Ge[0]!==2)){ee=0;continue}if(Ge[0]===3&&(!f||Ge[1]>f[0]&&Ge[1]',"select"),this.addActionButton(u,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(h){var ee=document.createElement("div");ee.className=""+a.toolbarButtonStyleClass.name,ee.setAttribute("data-type-name",h.typeName),ee.innerHTML=h.icon,ee.addEventListener("click",function(){a.markerToolbarButtonClicked(ee,h)}),a.buttons.push(ee),a.markerButtons.push(ee)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var f=document.createElement("div");f.className=this.toolbarBlockStyleClass.name,f.style.whiteSpace="nowrap",f.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(f),this.addActionButton(f,'',"render"),this.addActionButton(f,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),Ce=function(){function c(o,a,u,f){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=f,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new _("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 _("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new _("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new _("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new _("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 _("toolbox-panel-row_colors",` background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new _("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 _("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new _("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new D("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new D("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},c.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var a,u,f=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(h){var ee;h.uiStyleSettings=f.uiStyleSettings;var ze=document.createElement("div");ze.className=f.toolboxButtonStyleClass.name+" "+((ee=f.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ee!==void 0?ee:f.toolboxButtonStyleColorsClass.name),ze.innerHTML=h.icon,ze.title=h.title,ze.addEventListener("click",function(){f.panelButtonClick(h)}),f.panelButtons.push(ze),f.buttonRow.appendChild(ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var f=o.getUi();f.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(f),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(h,ee){var ze,Qe;h.className=a.toolboxButtonStyleClass.name+" "+(ee===u?""+((ze=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ze!==void 0?ze:a.toolboxActiveButtonStyleColorsClass.name):""+((Qe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Qe!==void 0?Qe:a.toolboxButtonStyleColorsClass.name))})},c}(),Re=function(c,o){this.title=c,this.icon=o},Me=function(c){function o(a,u,f,h){var ee=c.call(this,a,h||'')||this;return ee.colors=[],ee.addTransparent=!1,ee.colorBoxes=[],ee.colors=u,ee.currentColor=f,ee.setCurrentColor=ee.setCurrentColor.bind(ee),ee.getColorBox=ee.getColorBox.bind(ee),ee}return Ne(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(f){var h=a.getColorBox(f);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,f=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-f,ee=document.createElement("div");ee.style.display="inline-block",ee.style.boxSizing="content-box",ee.style.width=h-2+"px",ee.style.height=h-2+"px",ee.style.padding="1px",ee.style.marginRight="2px",ee.style.marginBottom="2px",ee.style.borderWidth="2px",ee.style.borderStyle="solid",ee.style.borderRadius=(h+2)/2+"px",ee.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ee.addEventListener("click",function(){u.setCurrentColor(a,ee)});var ze=document.createElement("div");return ze.style.display="inline-block",ze.style.width=h-2+"px",ze.style.height=h-2+"px",ze.style.backgroundColor=a,ze.style.borderRadius=h/2+"px",a==="transparent"&&(ze.style.fill=this.uiStyleSettings.toolboxAccentColor,ze.innerHTML=` `),ee.appendChild(ze),ee},o.prototype.setCurrentColor=function(a,u){var f=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Re),je=function(){function c(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},c.typeName="MarkerBase",c}(),He=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},c}(),Ye=function(){function c(){this.GRIP_SIZE=10,this.visual=Z.createGroup(),this.visual.appendChild(Z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Z.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),qe=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},c}(),Je=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(Z.createTransform()),h.setupControlBox(),h}return Ne(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=Z.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var f=this.unrotatePoint(a);if(this.manipulationStartX=f.x,this.manipulationStartY=f.y,this.offsetX=f.x-this.left,this.offsetY=f.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ee=this.container.transform.baseVal.getItem(0);ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,f=this.manipulationStartWidth,h=this.manipulationStartTop,ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,f=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:f=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,ee=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ee=this.manipulationStartHeight+a.y-this.manipulationStartY}f>=0?(this.left=u,this.width=f):(this.left=u+f,this.width=-f),ee>=0?(this.top=h,this.height=ee):(this.top=h+ee,this.height=-ee),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(),f=Z.createPoint(a.x,a.y);return{x:(f=f.matrixTransform(u)).x,y:f.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var f=Z.createPoint(a.x,a.y);return{x:(f=f.matrixTransform(u)).x,y:f.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=Z.createGroup();var a=Z.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=Z.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=Z.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 He,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var a=new Ye;return a.visual.transform.baseVal.appendItem(Z.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,f=u,h=(this.width+this.CB_DISTANCE)/2-a/2,ee=(this.height+this.CB_DISTANCE)/2-a/2,ze=this.height+this.CB_DISTANCE-a/2,Qe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,f),this.positionGrip(this.controlGrips.topCenter.visual,h,f),this.positionGrip(this.controlGrips.topRight.visual,Qe,f),this.positionGrip(this.controlGrips.centerLeft.visual,u,ee),this.positionGrip(this.controlGrips.centerRight.visual,Qe,ee),this.positionGrip(this.controlGrips.bottomLeft.visual,u,ze),this.positionGrip(this.controlGrips.bottomCenter.visual,h,ze),this.positionGrip(this.controlGrips.bottomRight.visual,Qe,ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,f-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,f){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,f),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:qe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:qe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(qe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(qe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var f=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:f.x*a,y:f.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(je),Ze=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return Ne(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=Z.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&Z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&Z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&Z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&Z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(Je),yt=function(c){function o(a,u,f,h){var ee=c.call(this,a,h||'')||this;return ee.widths=[],ee.widthBoxes=[],ee.widths=u,ee.currentWidth=f,ee.setCurrentWidth=ee.setCurrentWidth.bind(ee),ee}return Ne(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(f){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=f===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(f,h)}),u.appendChild(h);var ee=document.createElement("div");ee.innerText=f.toString(),ee.style.marginRight="5px",h.appendChild(ee);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.display="flex",ze.style.alignItems="center";var Qe=document.createElement("hr");Qe.style.minWidth="20px",Qe.style.border="0px",Qe.style.borderTop=f+"px solid "+a.uiStyleSettings.toolboxColor,Qe.style.flexGrow="2",ze.appendChild(Qe),h.appendChild(ze),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var f=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Re),gt=function(c){function o(a,u,f,h){var ee=c.call(this,a,h||'')||this;return ee.styles=[],ee.styleBoxes=[],ee.styles=u,ee.currentStyle=f,ee.setCurrentStyle=ee.setCurrentStyle.bind(ee),ee}return Ne(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(f){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=f===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(f,h)}),u.appendChild(h);var ee=document.createElement("div");ee.style.minHeight="20px",ee.style.flexGrow="2",ee.style.overflow="hidden";var ze=` `;ee.innerHTML=ze,h.appendChild(ee),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var f=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Re),st=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.strokeColor=f.defaultColor,h.strokeWidth=f.defaultStrokeWidth,h.strokeDasharray=f.defaultStrokeDasharray,h.strokePanel=new Me("Line color",f.defaultColorSet,f.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new gt("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Ne(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='',o}(Ze),Oe=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(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return Ne(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=Z.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new Ye;return a.visual.transform.baseVal.appendItem(Z.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,f){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,f),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(je),dt=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=f.defaultColor,h.strokeWidth=f.defaultStrokeWidth,h.strokeDasharray=f.defaultStrokeDasharray,h.strokePanel=new Me("Line color",f.defaultColorSet,f.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new gt("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Ne(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=Z.createGroup(),this.selectorLine=Z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Z.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='',o}(nt),Ue=function(c){function o(a,u,f,h){var ee=c.call(this,a,h||'')||this;return ee.fonts=[],ee.fontBoxes=[],ee.fonts=u,ee.currentFont=f,ee.setCurrentFont=ee.setCurrentFont.bind(ee),ee}return Ne(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(f){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=f===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(f,h)}),u.appendChild(h);var ee=document.createElement("div");ee.style.display="flex",ee.style.minHeight="20px",ee.style.flexGrow="2",ee.style.fontFamily=f,ee.style.overflow="hidden";var ze=document.createElement("div");ze.style.whiteSpace="nowrap",ze.style.overflow="hidden",ze.style.textOverflow="ellipsis",ze.innerHTML="The quick brown fox jumps over the lazy dog",ee.appendChild(ze),h.appendChild(ee),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var f=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Re),Ke=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=f.defaultColor,h.fontFamily=f.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new Me("Color",f.defaultColorSet,f.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Ue("Font",f.defaultFontFamilies,f.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return Ne(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(f){f===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=Z.createGroup(),this.bgRectangle=Z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Z.createTransform()),this.textElement.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(Z.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 f=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(f,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),f=0,h=0;return u.width>0&&u.height>0&&(f=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:f,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),f=this.getTextPosition(u);f.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+f.x+"px, "+f.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(f.x,f.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var f=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(f)),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}),f=this.textElement.getBBox(),h={x:f.width*a,y:f.height*a};u.x-=h.x/2,u.y-=h.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&Z.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&&Z.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='',o}(Je),ue=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=f.defaultColor,h.lineWidth=f.defaultStrokeWidth,h.pixelRatio=f.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new Me("Color",f.defaultColorSet,f.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return Ne(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=Z.createGroup(),this.drawingImage=Z.createImage(),this.visual.appendChild(this.drawingImage);var a=Z.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],f=u[0],h=u[1],ee=u[2],ze=u[3],Qe=!1,ut=0;ut0&&(Qe=!0,utze&&(ze=ut),Ge>ee&&(ee=Ge));if(Qe){this.left=f/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(ee-f)/this.pixelRatio,this.height=(ze-h)/this.pixelRatio;var kt=document.createElement("canvas");kt.width=ee-f,kt.height=ze-h,kt.getContext("2d").putImageData(this.canvasContext.getImageData(f,h,ee-f,ze-h),0,0),this.drawingImgUrl=kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){Z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='',o}(Je),ie=function(c){function o(a,u,f){var h=c.call(this,a,f||'')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return Ne(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var f=function(ze){var Qe="both";switch(ze){case 0:Qe="both";break;case 1:Qe="start";break;case 2:Qe="end";break;case 3:Qe="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=Qe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ut.addEventListener("click",function(){a.setCurrentType(Qe,ut)}),u.appendChild(ut),Qe==="both"||Qe==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=` `,Ge.style.marginLeft="5px",ut.appendChild(Ge)}var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.style.flexGrow="2";var Nt=document.createElement("hr");if(Nt.style.minWidth="20px",Nt.style.border="0px",Nt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Nt.style.flexGrow="2",kt.appendChild(Nt),ut.appendChild(kt),Qe==="both"||Qe==="end"){var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.innerHTML=` `,en.style.marginRight="5px",ut.appendChild(en)}h.typeBoxes.push(ut)},h=this,ee=0;ee<4;ee++)f(ee);return u},o.prototype.setCurrentType=function(a,u){var f=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?f.uiStyleSettings!==void 0?f.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Re),se=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new ie("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return Ne(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var f=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-f/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+f/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=Z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Z.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 f=this.arrow2.transform.baseVal.getItem(0);f.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(f,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='',o}(dt),A=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.fillColor=f.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Me("Color",f.defaultColorSet,f.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return Ne(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='',o}(Ze),R=function(c){function o(a,u,f,h){var ee=c.call(this,a,h||'')||this;return ee.opacities=[],ee.opacityBoxes=[],ee.opacities=u,ee.currentOpacity=f,ee.setCurrentOpacity=ee.setCurrentOpacity.bind(ee),ee}return Ne(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(f){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=f===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(f,h)}),u.appendChild(h);var ee=document.createElement("div");ee.innerText=100*f+"%",h.appendChild(ee),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var f=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Re),X=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=f.defaultHighlightColor,h.strokeWidth=0,h.opacity=f.defaultHighlightOpacity,h.fillPanel=new Me("Color",f.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new R("Opacity",f.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Ne(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&Z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='',o}(A),Q='',Ae=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=f.defaultStrokeColor,h.bgColor=f.defaultFillColor,h.fontFamily=f.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new Me("Text color",f.defaultColorSet,h.color,''),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new Me("Fill color",f.defaultColorSet,h.bgColor,Q),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Ue("Font",f.defaultFontFamilies,f.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new Ye,h.tipGrip.visual.transform.baseVal.appendItem(Z.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return Ne(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){Z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Z.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(Z.setAttributes(this.bgRectangle,[["fill",a]]),Z.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),f=this.height/5;a&&(this.tipPosition={x:u+f/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?h.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var f=this.tip2.transform.baseVal.getItem(0);f.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(f,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='',o}(dt),it=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.strokePanel.colors=f.defaultColorSet,h.fillColor="transparent",h}return Ne(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='',o}(ge),ft=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),lt=function(c){function o(a,u,f){var h=c.call(this,a,u,f)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=f.defaultColor,h.strokeWidth=f.defaultStrokeWidth,h.strokeDasharray=f.defaultStrokeDasharray,h.strokePanel=new Me("Line color",f.defaultColorSet,f.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new gt("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Ne(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=Z.createGroup(),this.selectorCurve=Z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Z.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=Z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Z.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,c.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='',o}(nt),Lt=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),At=function(c){function o(a,u,f){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=f,h}return Ne(o,c),o}(Lt),pt=function(c){function o(a,u,f){f===void 0&&(f=!1);var h=c.call(this,a,f)||this;return h.marker=u,h}return Ne(o,c),o}(Lt),$t=function(){function c(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),jt=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Oe,this._isOpen=!1,this.undoRedoManager=new ft,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 $t,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new Se(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[st,ue,se,Ke,it,ge,X,Ae,Ve,A,dt,lt]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[st,ue,se,Ke,ge,X,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[st,ue,se,Ke,X]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var f=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});f!==void 0&&a._availableMarkerTypes.push(f)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),T.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&F.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=F.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Lt(o))})},c.prototype.render=function(){return ke(this,void 0,void 0,function(){var o;return Te(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new K).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(f){var h=new Lt(a,!0);f(h),h.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(f){return f(new Lt(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ne(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},c.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(f){var h=new pt(o,o._currentMarker,!0);f(h),h.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(f){return f(new pt(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ee){var ze=new pt(o,void 0,!0);ee(ze),ze.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(ee){var ze=f.markers[ee];f.setCurrentMarker(f.markers[ee]),f._currentMarker.dispose(),f.markerImage.removeChild(f._currentMarker.container),f.markers.splice(f.markers.indexOf(f._currentMarker),1),f.eventListeners.markerdelete.forEach(function(Qe){return Qe(new pt(o,ze))})},f=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var f=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),f1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},c.prototype.addLicenseKey=function(o){T.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new Lt(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new Lt(o))}))},c.instanceCounter=0,c}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Jt=function(c,o){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(a[f]=u[f])})(c,o)};function Wt(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=c}Jt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Mt(c,o,a,u){return new(a||(a=Promise))(function(f,h){function ee(ut){try{Qe(u.next(ut))}catch(Ge){h(Ge)}}function ze(ut){try{Qe(u.throw(ut))}catch(Ge){h(Ge)}}function Qe(ut){var Ge;ut.done?f(ut.value):(Ge=ut.value,Ge instanceof a?Ge:new a(function(kt){kt(Ge)})).then(ee,ze)}Qe((u=u.apply(c,o||[])).next())})}function Un(c,o){var a,u,f,h,ee={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function ze(Qe){return function(ut){return function(Ge){if(a)throw new TypeError("Generator is already executing.");for(;ee;)try{if(a=1,u&&(f=2&Ge[0]?u.return:Ge[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,Ge[1])).done)return f;switch(u=0,f&&(Ge=[2&Ge[0],f.value]),Ge[0]){case 0:case 1:f=Ge;break;case 4:return ee.label++,{value:Ge[1],done:!1};case 5:ee.label++,u=Ge[1],Ge=[0];continue;case 7:Ge=ee.ops.pop(),ee.trys.pop();continue;default:if(!(f=ee.trys,(f=f.length>0&&f[f.length-1])||Ge[0]!==6&&Ge[0]!==2)){ee=0;continue}if(Ge[0]===3&&(!f||Ge[1]>f[0]&&Ge[1]0&&a>0){var u=new On(o,a),f=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),ee=document.createElementNS("http://www.w3.org/2000/svg","svg");ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ee);var ze=bt.createDefs();ee.appendChild(ze);var Qe=bt.createElement("clipPath",[["id","text-bg-clip"]]);ze.appendChild(Qe);var ut=bt.createPath(bt.getHollowRectanglePath((24-f)/2,(24-h)/2,f,h,(24-f)/2+2,(24-h)/2+2,f-4,h-4));ee.appendChild(ut);var Ge=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(bt.createTSpan(o+":"+a)),ee.appendChild(Ge);var kt=Ge.getBBox();bt.setAttributes(Ge,[["x",((24-kt.width)/2).toString()],["y",((24-kt.height)/2-kt.y).toString()]]);var Nt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(kt.width))/2,(24-Math.ceil(kt.height))/2,Math.ceil(kt.width),Math.ceil(kt.height)));return Qe.appendChild(Nt),bt.setAttributes(ut,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ee),ee.outerHTML}return''},c}(),kn=function(c){function o(a,u,f){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=f,h}return Wt(o,c),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Rt),Ot=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return bt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Ln=function(){function c(o,a,u,f){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=f,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;athis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),bt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,ee){var ze=a.y+u*(ee+1);bt.setAttributes(h,[["x1",""+a.x],["y1",""+ze],["x2",""+(a.x+a.width)],["y2",""+ze]])});var f=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,ee){var ze=a.x+f*(ee+1);bt.setAttributes(h,[["x1",""+ze],["y1",""+a.y],["x2",""+ze],["y2",""+(a.y+a.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,f=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+uthis.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=f,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+=f}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),f=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},c.prototype.getRescaledRect=function(o,a,u,f,h,ee){var ze=u/o,Qe=f/a;return{x:(h.x-ee)*ze+ee,y:(h.y-ee)*Qe+ee,width:h.width*ze,height:h.height*Qe}},c.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),Vn=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var f=u%5==0?this.height/3:this.height/6;a+="h4v"+-f+"h1v"+f}a+="v1H0Z",this.scaleShape=bt.createPath(a);var h=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ee=bt.createTSpan("");return ee.innerHTML="°",this.angleLabelElement.appendChild(ee),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),ii=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,f,h,ee,ze){var Qe=this;return new Promise(function(ut){var Ge=document.createElement("canvas");Ge.width=o.width.baseVal.value-2*f,Ge.height=o.height.baseVal.value-2*f;var kt=1,Nt=1;Qe.naturalSize===!0?(kt=a.naturalWidth/(o.width.baseVal.value-2*f)/ee,Nt=a.naturalHeight/(o.height.baseVal.value-2*f)/ze,Ge.width=a.naturalWidth/ee,Ge.height=a.naturalHeight/ze):Qe.width!==void 0&&Qe.height!==void 0&&(kt=Qe.width/u.width,Nt=Qe.height/u.height,Ge.width*=kt,Ge.height*=Nt);var en=Ge.getContext("2d");en.translate(Ge.width/2,Ge.height/2),en.rotate(h*Math.PI/180),en.scale(ee,ze),en.translate(-Ge.width/2,-Ge.height/2),en.drawImage(a,0,0,Ge.width,Ge.height);var Xn=document.createElement("canvas");Xn.width=u.width*kt,Xn.height=u.height*Nt,Xn.getContext("2d").putImageData(en.getImageData((u.x-f)*kt,(u.y-f)*Nt,u.width*kt,u.height*Nt),0,0),ut(Xn.toDataURL(Qe.imageType,Qe.imageQuality))})},c}(),We=function(){function c(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=c.instanceCounter++,this.styles=new wt(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGINo+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Zt,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 nn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Nt){var en=new Rt(ni.getIcon(Nt.horizontal,Nt.vertical),Nt.horizontal===0&&Nt.vertical===0?"FREE":Nt.horizontal+":"+Nt.vertical);en.onClick=function(){return o.ratioButtonClicked(Nt)},u.push(en)}),this.aspectRatioButton=new kn(ni.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 f=new Rt('',"Toggle grid");f.isActive=this.isGridVisible,f.onClick=function(){o.isGridVisible=!o.isGridVisible,f.isActive=o.isGridVisible},a.addButton(f);var h=new Rt('',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!Qn.isLicensed){var ee=new mt;this.topToolbar.addElementBlock(ee);var ze=document.createElement("div");ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Qe=document.createElement("a");Qe.style.color="currentColor",Qe.href="https://markerjs.com/products/cropro",Qe.target="_blank",Qe.innerHTML='',ze.appendChild(Qe),ee.addElement(ze)}var ut=new nn;ut.minWidth=3*this.toolbarHeight+"px",ut.contentAlign="end",this.topToolbar.addButtonBlock(ut);var Ge=new Rt('',"OK");Ge.onClick=this.startRenderAndClose,ut.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var kt=new Rt('',"Close");kt.onClick=this.close,ut.addButton(kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Zt,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 nn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Rt('',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var f=new Rt('',"Rotate right");f.onClick=this.rotateRightButtonClicked,a.addButton(f);var h=new mt;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),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},h.addElement(this.straightener.getUI());var ee=new nn;ee.minWidth=2*this.toolbarHeight+"px",ee.contentAlign="end",this.bottomToolbar.addButtonBlock(ee);var ze=new Rt('',"Flip horizontal");ze.onClick=this.flipHorizontallyButtonClicked,ee.addButton(ze);var Qe=new Rt('',"Flip vertical");Qe.onClick=this.flipVerticallyButtonClicked,ee.addButton(Qe)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ni.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new On(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return Mt(this,void 0,void 0,function(){var o,a;return Un(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(f){return f(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return Mt(this,void 0,void 0,function(){var o;return Un(this,function(a){switch(a.label){case 0:return(o=new ii).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("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 xt("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("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 xt("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new rt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new rt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("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 xt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},c.instanceCounter=0,c}(),ot=y("8hTe"),_t=y.n(ot),Gt=/]*>/g;function Kt(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var qt=de.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,f=u===void 0?!1:u,h=c.className,ee=c.showTextOnly,ze=c.showLines,Qe=c.replaces,ut=c.zoomImg,Ge=c.hasMask,kt=c.style,Nt=kt===void 0?{}:kt,en=c.stylesPrev,Xn=en===void 0?{}:en,Kn=String(a),mn=Object(P.useRef)(),qn=Object(P.useRef)(),zi=Object(P.useState)(""),Dn=Object(z.a)(zi,2),Yn=Dn[0],Hn=Dn[1],bi=Object(P.useState)("office"),ri=Object(z.a)(bi,2),mi=ri[0],ci=ri[1],hr=function(){var Ut=new We(qn.current);Ut.displayMode="popup",Ut.addRenderEventListener(function(){var wn=Object(q.a)(N.a.mark(function Bt(hn){var Vt;return N.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return mn.current.style.display="none",un.next=3,Object(Be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn}});case 3:Vt=un.sent,Vt!=null&&Vt.id&&Qe(qn.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return un.stop()}},Bt)}));return function(Bt){return wn.apply(this,arguments)}}()),Ut.show()},Gi=function(){var Ut=new jt(qn.current);Ut.settings.displayMode="popup",Ut.addEventListener("render",function(){var wn=Object(q.a)(N.a.mark(function Bt(hn){var Vt;return N.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(mn.current.style.display="none",!qn.current){un.next=6;break}return un.next=4,Object(Be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn.dataUrl}});case 4:Vt=un.sent,Vt!=null&&Vt.id&&Qe(qn.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return un.stop()}},Bt)}));return function(Bt){return wn.apply(this,arguments)}}()),Ut.show(),window.markerArea=Ut},oi=Object(P.useMemo)(function(){try{var sn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kn=Kn.replace(sn,"("+V.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+V.a.API_SERVER+"/api/attachments/").replace(wn,'"'+V.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,` `),Kn=Kn.replace(new RegExp("(?[TOC]

    ",Ie()),ve()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(hi,un){var _n=hn[un],Vi=_n.type,Xi=_n.expression;return Object(oe.renderToString)(Kt(Xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),re(),ee){var Vt=document.createElement("div");return Vt.innerHTML=Bt,Vt.innerText}return setTimeout(function(){return Oi()},500),Bt},[Kn]),$n=Object(P.useRef)();he.WebkitLineClamp=ze,ze&&(Nt=Object(fe.a)(Object(fe.a)({},Nt),he));function Mi(sn){var Ut=sn.target;if(Ut.tagName.toUpperCase()==="IMG"){if(ut){var wn=Ut.getAttribute("src");Hn(wn),ci("image")}}else if(Ut.tagName.toUpperCase()==="A"){var Bt=Ut.getAttribute("href");if(Bt.indexOf("office")>-1)sn.preventDefault(),Hn(Bt),ci("office");else if(Bt.indexOf("application/pdf")>-1)sn.preventDefault(),Hn(Bt),ci("pdf");else if(Bt.indexOf("type=text")>-1)sn.preventDefault(),Hn(Bt),ci("html");else if(Bt.startsWith("#")){sn.preventDefault();var hn=document.getElementById(Bt.replace("#",""));hn&&hn.scrollIntoView(!0)}}}var Oi=function(){var Ut,wn=(Ut=$n.current)===null||Ut===void 0?void 0:Ut.querySelectorAll("video");wn==null||wn.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if(M.a.isSupported()){var hn=new M.a;hn.loadSource(Bt.src),hn.attachMedia(Bt)}}})};Object(P.useEffect)(function(){if($n.current&&oi&&(oi.match(Gt)&&window.PR.prettyPrint()),$n.current)return $n.current.addEventListener("click",Mi),function(){$n.current.removeEventListener("click",Mi),re(),ve()}},[oi,$n.current,Mi]);var dr=function(Ut){if(!f)return;Ut.target.nodeName==="IMG"?(mn.current.style.display="flex",mn.current.style.width=Ut.target.clientWidth+"px",mn.current.style.height=Ut.target.clientHeight+"px",mn.current.style.top=Ut.target.offsetTop+"px",mn.current.style.left=Ut.target.offsetLeft+"px",qn.current.src=Ut.target.getAttribute("src")):mn.current.style.display="none"};return x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:$n,style:Object(fe.a)({},Nt),className:"".concat(h||""," markdown-body ").concat(_t.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:oi}}),x.a.createElement("div",{ref:mn,className:_t.a.button},x.a.createElement(pe.a,null,x.a.createElement(be.a,{onClick:function(){return hr()}},"\u88C1\u526A"),x.a.createElement(be.a,{onClick:function(){return Gi()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:qn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),x.a.createElement(Le.a,{close:!0,data:Yn,hasMask:Ge,type:Yn!=null&&Yn.length?mi:"",style:Object(fe.a)({},Xn),onClose:function(){return Hn("")}}))}},"9VGf":function(ht,de,y){"use strict";y.d(de,"a",function(){return ce});var Y=y("q1tI"),pe=y.n(Y);function ce(be,fe){var q=Object(Y.useRef)();Object(Y.useEffect)(function(){q.current=be}),Object(Y.useEffect)(function(){function z(){q.current()}if(fe!==null){var $=setInterval(z,fe);return function(){return clearInterval($)}}},[fe])}},Bd2K:function(ht,de,y){(function(Y){Y(y("VrN/"),y("osHv"))})(function(Y){Y.defineOption("autoCloseTags",!1,function(N,P,x){if(x!=Y.Init&&x&&N.removeKeyMap("autoCloseTags"),!P)return;var C={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(C["'/'"]=function(k){return q(k)}),(typeof P!="object"||P.whenOpening!==!1)&&(C["'>'"]=function(k){return be(k)}),N.addKeyMap(C)});var pe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ce=["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 be(N){if(N.getOption("disableInput"))return Y.Pass;for(var P=N.listSelections(),x=[],C=N.getOption("autoCloseTags"),k=0;kE.ch&&(L=L.slice(0,L.length-S.end+E.ch));var xe=L.toLowerCase();if(!L||S.type=="string"&&(S.end!=E.ch||!/[\"\']/.test(S.string.charAt(S.string.length-1))||S.string.length==1)||S.type=="tag"&&b.close||S.string.indexOf("/")==E.ch-S.start-1||ve&&z(ve,xe)>-1||$(N,j.mode.xmlCurrentContext&&j.mode.xmlCurrentContext(v)||[],L,E,!0))return Y.Pass;var Ie=typeof C=="object"&&C.emptyTags;if(Ie&&z(Ie,L)>-1){x[k]={text:"/>",newPos:Y.Pos(E.line,E.ch+2)};continue}var Ee=he&&z(he,xe)>-1;x[k]={indent:Ee,text:">"+(Ee?` `:"")+"",newPos:Ee?Y.Pos(E.line+1,0):Y.Pos(E.line,E.ch+1)}}for(var Pe=typeof C=="object"&&C.dontIndentOnAutoClose,k=P.length-1;k>=0;k--){var De=x[k];N.replaceRange(De.text,P[k].head,P[k].anchor,"+insert");var ae=N.listSelections().slice(0);ae[k]={head:De.newPos,anchor:De.newPos},N.setSelections(ae),!Pe&&De.indent&&(N.indentLine(De.newPos.line,null,!0),N.indentLine(De.newPos.line+1,null,!0))}}function fe(N,P){for(var x=N.listSelections(),C=[],k=P?"/":""&&(ve+=">"),C[j]=ve}if(N.replaceSelections(C),x=N.listSelections(),!S)for(var j=0;j=0&&P[v]==x;v--)++j;C=S.to;for(var v=1;v0){for(var P=0;P<$.length;P++)if($[P].compile_success==0||!$[P].compile_success){N=!1;break}}else N=!1;return N}function ce($){for(var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],x=0;x<$.length;x++){var C=$[x],k=N?"".concat(N,"/").concat(C.name):"".concat(C.name);P.push({title:C.name,isLeaf:!(C.type==="tree"),key:k})}return P}function be($,N,P){for(var x=0;x<$.length;x++){var C=$[x];if(C.key===N){C.children=P;break}C.children&&be(C.children,N,P)}return $}function fe($,N,P){var x;return function(){var C=this,k=arguments,E=function(){x=null,P||$.apply(C,k)},S=P&&!x;clearTimeout(x),x=setTimeout(E,N),S&&$.apply(C,k)}}var q=!0,z=Y.a.API_SERVER},"C+DQ":function(ht,de,y){},"C/vA":function(ht,de,y){"use strict";y.d(de,"a",function(){return Y});function Y(pe){var ce=this,be=!1,fe;return function(){return be||(be=!0,fe=pe.apply(ce,arguments)),fe}}},"Cg/j":function(ht,de,y){"use strict";y.d(de,"b",function(){return Y}),y.d(de,"a",function(){return pe}),y.d(de,"c",function(){return be}),y.d(de,"d",function(){return fe});var Y;(function(q){q.serviceIds=new Map,q.DI_TARGET="$di$target",q.DI_DEPENDENCIES="$di$dependencies";function z($){return $[q.DI_DEPENDENCIES]||[]}q.getServiceDependencies=z})(Y||(Y={}));var pe=be("instantiationService");function ce(q,z,$,N){z[Y.DI_TARGET]===z?z[Y.DI_DEPENDENCIES].push({id:q,index:$,optional:N}):(z[Y.DI_DEPENDENCIES]=[{id:q,index:$,optional:N}],z[Y.DI_TARGET]=z)}function be(q){if(Y.serviceIds.has(q))return Y.serviceIds.get(q);var z=function($,N,P){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ce(z,$,P,!1)};return z.toString=function(){return q},Y.serviceIds.set(q,z),z}function fe(q){return function(z,$,N){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ce(q,z,N,!0)}}},DlQD:function(ht,de,y){(function(Y,pe){ht.exports=pe()})(this,function(){"use strict";function Y(ue,ie){for(var se=0;seue.length)&&(ie=ue.length);for(var se=0,A=new Array(ie);se=ue.length?{done:!0}:{done:!1,value:ue[A++]}}}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 se=ue[Symbol.iterator](),se.next.bind(se)}function q(ue,ie){return ie={exports:{}},ue(ie,ie.exports),ie.exports}var z=q(function(ue){function ie(){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 se(A){ue.exports.defaults=A}ue.exports={defaults:ie(),getDefaults:ie,changeDefaults:se}}),$=z.defaults,N=z.getDefaults,P=z.changeDefaults,x=/[&<>"']/,C=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,E=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},j=function(ie){return S[ie]};function v(ue,ie){if(ie){if(x.test(ue))return ue.replace(C,j)}else if(k.test(ue))return ue.replace(E,j);return ue}var b=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function L(ue){return ue.replace(b,function(ie,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var U=/(^|[^\[])\^/g;function ve(ue,ie){ue=ue.source||ue,ie=ie||"";var se={replace:function(R,X){return X=X.source||X,X=X.replace(U,"$1"),ue=ue.replace(R,X),se},getRegex:function(){return new RegExp(ue,ie)}};return se}var he=/[^\w:]/g,xe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ie(ue,ie,se){if(ue){var A;try{A=decodeURIComponent(L(se)).replace(he,"").toLowerCase()}catch(R){return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}ie&&!xe.test(se)&&(se=O(ie,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch(R){return null}return se}var Ee={},Pe=/^[^:]+:\/*[^/]*$/,De=/^([^:]+:)[\s\S]*$/,ae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(ue,ie){Ee[" "+ue]||(Pe.test(ue)?Ee[" "+ue]=ue+"/":Ee[" "+ue]=te(ue,"/",!0)),ue=Ee[" "+ue];var se=ue.indexOf(":")===-1;return ie.substring(0,2)==="//"?se?ie:ue.replace(De,"$1")+ie:ie.charAt(0)==="/"?se?ie:ue.replace(ae,"$1")+ie:ue+ie}var me={exec:function(){}};function re(ue){for(var ie=1,se,A;ie=0&&Ae[Ve]==="\\";)ge=!ge;return ge?"|":" |"}),A=se.split(/ \|/),R=0;if(A.length>ie)A.splice(ie);else for(;A.length=A.length?R.slice(A.length):R}).join(` `)}var _e=function(){function ue(se){this.options=se||m}var ie=ue.prototype;return ie.space=function(A){var R=this.rules.block.newline.exec(A);if(R)return R[0].length>1?{type:"space",raw:R[0]}:{raw:` `}},ie.code=function(A,R){var X=this.rules.block.code.exec(A);if(X){var Q=R[R.length-1];if(Q&&Q.type==="paragraph")return{raw:X[0],text:X[0].trimRight()};var Ae=X[0].replace(/^ {4}/gm,"");return{type:"code",raw:X[0],codeBlockStyle:"indented",text:this.options.pedantic?Ae:d(Ae,` `)}}},ie.fences=function(A){var R=this.rules.block.fences.exec(A);if(R){var X=R[0],Q=Be(X,R[3]||"");return{type:"code",raw:X,lang:R[2]?R[2].trim():R[2],text:Q}}},ie.heading=function(A){var R=this.rules.block.heading.exec(A);if(R)return{type:"heading",raw:R[0],depth:R[1].length,text:R[2]}},ie.nptable=function(A){var R=this.rules.block.nptable.exec(A);if(R){var X={type:"table",header:M(R[1].replace(/^ *| *\| *$/g,"")),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:R[3]?R[3].replace(/\n$/,"").split(` `):[],raw:R[0]};if(X.header.length===X.align.length){var Q=X.align.length,Ae;for(Ae=0;Ae ?/gm,"");return{type:"blockquote",raw:R[0],text:X}}},ie.list=function(A){var R=this.rules.block.list.exec(A);if(R){for(var X=R[0],Q=R[2],Ae=Q.length>1,ge=Q[Q.length-1]===")",Ve={type:"list",raw:X,ordered:Ae,start:Ae?+Q.slice(0,-1):"",loose:!1,items:[]},it=R[0].match(this.rules.block.item),ft=!1,lt,Lt,At,pt,$t,jt,Jt,Wt=it.length,Mt=0;Mt1||this.options.smartLists&&At!==Q)&&(pt=it.slice(Mt+1).join(` `),Ve.raw=Ve.raw.substring(0,Ve.raw.length-pt.length),Mt=Wt-1)),$t=ft||/\n\n(?!\s*$)/.test(lt),Mt!==Wt-1&&(ft=lt.charAt(lt.length-1)===` `,$t||($t=ft)),$t&&(Ve.loose=!0),jt=/^\[[ xX]\] /.test(lt),Jt=void 0,jt&&(Jt=lt[1]!==" ",lt=lt.replace(/^\[[ xX]\] +/,"")),Ve.items.push({type:"list_item",raw:X,task:jt,checked:Jt,loose:$t,text:lt});return Ve}},ie.html=function(A){var R=this.rules.block.html.exec(A);if(R)return{type:this.options.sanitize?"paragraph":"html",raw:R[0],pre:!this.options.sanitizer&&(R[1]==="pre"||R[1]==="script"||R[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):V(R[0]):R[0]}},ie.def=function(A){var R=this.rules.block.def.exec(A);if(R){R[3]&&(R[3]=R[3].substring(1,R[3].length-1));var X=R[1].toLowerCase().replace(/\s+/g," ");return{tag:X,raw:R[0],href:R[2],title:R[3]}}},ie.table=function(A){var R=this.rules.block.table.exec(A);if(R){var X={type:"table",header:M(R[1].replace(/^ *| *\| *$/g,"")),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:R[3]?R[3].replace(/\n$/,"").split(` `):[]};if(X.header.length===X.align.length){X.raw=R[0];var Q=X.align.length,Ae;for(Ae=0;Ae/i.test(Q[0])&&(R=!1),!X&&/^<(pre|code|kbd|script)(\s|>)/i.test(Q[0])?X=!0:X&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Q[0])&&(X=!1),{type:this.options.sanitize?"text":"html",raw:Q[0],inLink:R,inRawBlock:X,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):V(Q[0]):Q[0]}},ie.link=function(A){var R=this.rules.inline.link.exec(A);if(R){var X=oe(R[2],"()");if(X>-1){var Q=R[0].indexOf("!")===0?5:4,Ae=Q+R[1].length+X;R[2]=R[2].substring(0,X),R[0]=R[0].substring(0,Ae).trim(),R[3]=""}var ge=R[2],Ve="";if(this.options.pedantic){var it=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);it?(ge=it[1],Ve=it[3]):Ve=""}else Ve=R[3]?R[3].slice(1,-1):"";ge=ge.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=Le(R,{href:ge&&ge.replace(this.rules.inline._escapes,"$1"),title:Ve&&Ve.replace(this.rules.inline._escapes,"$1")},R[0]);return ft}},ie.reflink=function(A,R){var X;if((X=this.rules.inline.reflink.exec(A))||(X=this.rules.inline.nolink.exec(A))){var Q=(X[2]||X[1]).replace(/\s+/g," ");if(Q=R[Q.toLowerCase()],!Q||!Q.href){var Ae=X[0].charAt(0);return{type:"text",raw:Ae,text:Ae}}var ge=Le(X,Q,X[0]);return ge}},ie.strong=function(A,R,X){X===void 0&&(X="");var Q=this.rules.inline.strong.start.exec(A);if(Q&&(!Q[1]||Q[1]&&(X===""||this.rules.inline.punctuation.exec(X)))){R=R.slice(-1*A.length);var Ae=Q[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ae.lastIndex=0;for(var ge;(Q=Ae.exec(R))!=null;)if(ge=this.rules.inline.strong.middle.exec(R.slice(0,Q.index+3)),ge)return{type:"strong",raw:A.slice(0,ge[0].length),text:A.slice(2,ge[0].length-2)}}},ie.em=function(A,R,X){X===void 0&&(X="");var Q=this.rules.inline.em.start.exec(A);if(Q&&(!Q[1]||Q[1]&&(X===""||this.rules.inline.punctuation.exec(X)))){R=R.slice(-1*A.length);var Ae=Q[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ae.lastIndex=0;for(var ge;(Q=Ae.exec(R))!=null;)if(ge=this.rules.inline.em.middle.exec(R.slice(0,Q.index+2)),ge)return{type:"em",raw:A.slice(0,ge[0].length),text:A.slice(1,ge[0].length-1)}}},ie.codespan=function(A){var R=this.rules.inline.code.exec(A);if(R){var X=R[2].replace(/\n/g," "),Q=/[^ ]/.test(X),Ae=X.startsWith(" ")&&X.endsWith(" ");return Q&&Ae&&(X=X.substring(1,X.length-1)),X=V(X,!0),{type:"codespan",raw:R[0],text:X}}},ie.br=function(A){var R=this.rules.inline.br.exec(A);if(R)return{type:"br",raw:R[0]}},ie.del=function(A){var R=this.rules.inline.del.exec(A);if(R)return{type:"del",raw:R[0],text:R[1]}},ie.autolink=function(A,R){var X=this.rules.inline.autolink.exec(A);if(X){var Q,Ae;return X[2]==="@"?(Q=V(this.options.mangle?R(X[1]):X[1]),Ae="mailto:"+Q):(Q=V(X[1]),Ae=Q),{type:"link",raw:X[0],text:Q,href:Ae,tokens:[{type:"text",raw:Q,text:Q}]}}},ie.url=function(A,R){var X;if(X=this.rules.inline.url.exec(A)){var Q,Ae;if(X[2]==="@")Q=V(this.options.mangle?R(X[0]):X[0]),Ae="mailto:"+Q;else{var ge;do ge=X[0],X[0]=this.rules.inline._backpedal.exec(X[0])[0];while(ge!==X[0]);Q=V(X[0]),X[1]==="www."?Ae="http://"+Q:Ae=Q}return{type:"link",raw:X[0],text:Q,href:Ae,tokens:[{type:"text",raw:Q,text:Q}]}}},ie.inlineText=function(A,R,X){var Q=this.rules.inline.text.exec(A);if(Q){var Ae;return R?Ae=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):V(Q[0]):Q[0]:Ae=V(this.options.smartypants?X(Q[0]):Q[0]),{type:"text",raw:Q[0],text:Ae}}},ue}(),Ne=I.noopTest,ke=I.edit,Te=I.merge,le={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ne,table:Ne,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};le._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,le._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,le.def=ke(le.def).replace("label",le._label).replace("title",le._title).getRegex(),le.bullet=/(?:[*+-]|\d{1,9}[.)])/,le.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,le.item=ke(le.item,"gm").replace(/bull/g,le.bullet).getRegex(),le.list=ke(le.list).replace(/bull/g,le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+le.def.source+")").getRegex(),le._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",le._comment=//,le.html=ke(le.html,"i").replace("comment",le._comment).replace("tag",le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),le.paragraph=ke(le._paragraph).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.blockquote=ke(le.blockquote).replace("paragraph",le.paragraph).getRegex(),le.normal=Te({},le),le.gfm=Te({},le.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*|$)"}),le.gfm.nptable=ke(le.gfm.nptable).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.gfm.table=ke(le.gfm.table).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.pedantic=Te({},le.normal,{html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ne,paragraph:ke(le.normal._paragraph).replace("hr",le.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ne,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ne,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",Z.punctuation=ke(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=ke(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=ke(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=ke(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=ke(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=ke(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=ke(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=ke(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=ke(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=ke(Z._blockSkip,"g").getRegex(),Z.overlapSkip=ke(Z._overlapSkip,"g").getRegex(),Z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Z._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])?)+(?![-_])/,Z.autolink=ke(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex(),Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Z.tag=ke(Z.tag).replace("comment",le._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=ke(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=ke(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=ke(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=Te({},Z),Z.pedantic=Te({},Z.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:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=Te({},Z.normal,{escape:ke(Z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(A="x"+A.toString(16)),ie+="&#"+A+";";return ie}var ne=function(){function ue(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||K,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var A={block:F.normal,inline:Se.normal};this.options.pedantic?(A.block=F.pedantic,A.inline=Se.pedantic):this.options.gfm&&(A.block=F.gfm,this.options.breaks?A.inline=Se.breaks:A.inline=Se.gfm),this.tokenizer.rules=A}ue.lex=function(A,R){var X=new ue(R);return X.lex(A)};var ie=ue.prototype;return ie.lex=function(A){return A=A.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(A,this.tokens,!0),this.inline(this.tokens),this.tokens},ie.blockTokens=function(A,R,X){R===void 0&&(R=[]),X===void 0&&(X=!0),A=A.replace(/^ +$/gm,"");for(var Q,Ae,ge,Ve;A;){if(Q=this.tokenizer.space(A)){A=A.substring(Q.raw.length),Q.type&&R.push(Q);continue}if(Q=this.tokenizer.code(A,R)){A=A.substring(Q.raw.length),Q.type?R.push(Q):(Ve=R[R.length-1],Ve.raw+=` `+Q.raw,Ve.text+=` `+Q.text);continue}if(Q=this.tokenizer.fences(A)){A=A.substring(Q.raw.length),R.push(Q);continue}if(Q=this.tokenizer.heading(A)){A=A.substring(Q.raw.length),R.push(Q);continue}if(Q=this.tokenizer.nptable(A)){A=A.substring(Q.raw.length),R.push(Q);continue}if(Q=this.tokenizer.hr(A)){A=A.substring(Q.raw.length),R.push(Q);continue}if(Q=this.tokenizer.blockquote(A)){A=A.substring(Q.raw.length),Q.tokens=this.blockTokens(Q.text,[],X),R.push(Q);continue}if(Q=this.tokenizer.list(A)){for(A=A.substring(Q.raw.length),ge=Q.items.length,Ae=0;Ae0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(Ve))!=null;)ft.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(Ve=Ve.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(Ve))!=null;)Ve=Ve.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;A;){if(ge=this.tokenizer.escape(A)){A=A.substring(ge.raw.length),R.push(ge);continue}if(ge=this.tokenizer.tag(A,X,Q)){A=A.substring(ge.raw.length),X=ge.inLink,Q=ge.inRawBlock,R.push(ge);continue}if(ge=this.tokenizer.link(A)){A=A.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,Q)),R.push(ge);continue}if(ge=this.tokenizer.reflink(A,this.tokens.links)){A=A.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,Q)),R.push(ge);continue}if(ge=this.tokenizer.strong(A,Ve,Ae)){A=A.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],X,Q),R.push(ge);continue}if(ge=this.tokenizer.em(A,Ve,Ae)){A=A.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],X,Q),R.push(ge);continue}if(ge=this.tokenizer.codespan(A)){A=A.substring(ge.raw.length),R.push(ge);continue}if(ge=this.tokenizer.br(A)){A=A.substring(ge.raw.length),R.push(ge);continue}if(ge=this.tokenizer.del(A)){A=A.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],X,Q),R.push(ge);continue}if(ge=this.tokenizer.autolink(A,_)){A=A.substring(ge.raw.length),R.push(ge);continue}if(!X&&(ge=this.tokenizer.url(A,_))){A=A.substring(ge.raw.length),R.push(ge);continue}if(ge=this.tokenizer.inlineText(A,Q,D)){A=A.substring(ge.raw.length),Ae=ge.raw.slice(-1),R.push(ge);continue}if(A){var lt="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return R},pe(ue,null,[{key:"rules",get:function(){return{block:F,inline:Se}}}]),ue}(),Ce=z.defaults,Re=I.cleanUrl,Me=I.escape,je=function(){function ue(se){this.options=se||Ce}var ie=ue.prototype;return ie.code=function(A,R,X){var Q=(R||"").match(/\S*/)[0];if(this.options.highlight){var Ae=this.options.highlight(A,Q);Ae!=null&&Ae!==A&&(X=!0,A=Ae)}return Q?'
    '+(X?A:Me(A,!0))+`
    `:"
    "+(X?A:Me(A,!0))+`
    `},ie.blockquote=function(A){return`
    `+A+`
    `},ie.html=function(A){return A},ie.heading=function(A,R,X,Q){return this.options.headerIds?"'+A+" `:""+A+" `},ie.hr=function(){return this.options.xhtml?`
    `:`
    `},ie.list=function(A,R,X){var Q=R?"ol":"ul",Ae=R&&X!==1?' start="'+X+'"':"";return"<"+Q+Ae+`> `+A+" `},ie.listitem=function(A){return"
  • "+A+`
  • `},ie.checkbox=function(A){return" "},ie.paragraph=function(A){return"

    "+A+`

    `},ie.table=function(A,R){return R&&(R=""+R+""),` `+A+` `+R+`
    `},ie.tablerow=function(A){return` `+A+` `},ie.tablecell=function(A,R){var X=R.header?"th":"td",Q=R.align?"<"+X+' align="'+R.align+'">':"<"+X+">";return Q+A+" `},ie.strong=function(A){return""+A+""},ie.em=function(A){return""+A+""},ie.codespan=function(A){return""+A+""},ie.br=function(){return this.options.xhtml?"
    ":"
    "},ie.del=function(A){return""+A+""},ie.link=function(A,R,X){if(A=Re(this.options.sanitize,this.options.baseUrl,A),A===null)return X;var Q='",Q},ie.image=function(A,R,X){if(A=Re(this.options.sanitize,this.options.baseUrl,A),A===null)return X;var Q=''+X+'":">",Q},ie.text=function(A){return A},ue}(),He=function(){function ue(){}var ie=ue.prototype;return ie.strong=function(A){return A},ie.em=function(A){return A},ie.codespan=function(A){return A},ie.del=function(A){return A},ie.html=function(A){return A},ie.text=function(A){return A},ie.link=function(A,R,X){return""+X},ie.image=function(A,R,X){return""+X},ie.br=function(){return""},ue}(),Ye=function(){function ue(){this.seen={}}var ie=ue.prototype;return ie.slug=function(A){var R=A.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(R)){var X=R;do this.seen[X]++,R=X+"-"+this.seen[X];while(this.seen.hasOwnProperty(R))}return this.seen[R]=0,R},ue}(),qe=z.defaults,Je=I.unescape,Ze=function(){function ue(se){this.options=se||qe,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new Ye}ue.parse=function(A,R){var X=new ue(R);return X.parse(A)};var ie=ue.prototype;return ie.parse=function(A,R){R===void 0&&(R=!0);var X="",Q,Ae,ge,Ve,it,ft,lt,Lt,At,pt,$t,jt,Jt,Wt,Mt,Un,Qn,bt,wt=A.length;for(Q=0;Q0&&Mt.tokens[0].type==="text"?(Mt.tokens[0].text=bt+" "+Mt.tokens[0].text,Mt.tokens[0].tokens&&Mt.tokens[0].tokens.length>0&&Mt.tokens[0].tokens[0].type==="text"&&(Mt.tokens[0].tokens[0].text=bt+" "+Mt.tokens[0].tokens[0].text)):Mt.tokens.unshift({type:"text",text:bt}):Wt+=bt),Wt+=this.parse(Mt.tokens,Jt),At+=this.renderer.listitem(Wt,Qn,Un);X+=this.renderer.list(At,$t,jt);continue}case"html":{X+=this.renderer.html(pt.text);continue}case"paragraph":{X+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(At=pt.tokens?this.parseInline(pt.tokens):pt.text;Q+1An error occurred:

    "+st(ge.message+"",!0)+"
    ";throw ge}}Ue.options=Ue.setOptions=function(ue){return yt(Ue.defaults,ue),nt(Ue.defaults),Ue},Ue.getDefaults=Oe,Ue.defaults=dt,Ue.use=function(ue){var ie=yt({},ue);if(ue.renderer&&function(){var A=Ue.defaults.renderer||new je,R=function(Ae){var ge=A[Ae];A[Ae]=function(){for(var Ve=arguments.length,it=new Array(Ve),ft=0;ft`,triples:"",explode:"[]{}"},ce=Y.Pos;Y.defineOption("autoCloseBrackets",!1,function(S,j,v){v&&v!=Y.Init&&(S.removeKeyMap(fe),S.state.closeBrackets=null),j&&(q(be(j,"pairs")),S.state.closeBrackets=j,S.addKeyMap(fe))});function be(S,j){return j=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[j]!=null?S[j]:pe[j]}var fe={Backspace:N,Enter:P};function q(S){for(var j=0;j=0;L--){var ve=b[L].head;S.replaceRange("",ce(ve.line,ve.ch-1),ce(ve.line,ve.ch+1),"+delete")}}function P(S){var j=$(S),v=j&&be(j,"explode");if(!v||S.getOption("disableInput"))return Y.Pass;for(var b=S.listSelections(),L=0;L0;return{anchor:new ce(S.anchor.line,S.anchor.ch+(j?-1:1)),head:new ce(S.head.line,S.head.ch+(j?1:-1))}}function C(S,j){var v=$(S);if(!v||S.getOption("disableInput"))return Y.Pass;var b=be(v,"pairs"),L=b.indexOf(j);if(L==-1)return Y.Pass;for(var U=be(v,"closeBefore"),ve=be(v,"triples"),he=b.charAt(L+1)==j,xe=S.listSelections(),Ie=L%2==0,Ee,Pe=0;Pe=0&&S.getRange(ae,ce(ae.line,ae.ch+3))==j+j+j?O="skipThree":O="skip";else if(he&&ae.ch>1&&ve.indexOf(j)>=0&&S.getRange(ce(ae.line,ae.ch-2),ae)==j+j){if(ae.ch>2&&/\bstring/.test(S.getTokenTypeAt(ce(ae.line,ae.ch-2))))return Y.Pass;O="addFour"}else if(he){var re=ae.ch==0?" ":S.getRange(ce(ae.line,ae.ch-1),ae);if(!Y.isWordChar(me)&&re!=j&&!Y.isWordChar(re))O="both";else return Y.Pass}else if(Ie&&(me.length===0||/\s/.test(me)||U.indexOf(me)>-1))O="both";else return Y.Pass;if(!Ee)Ee=O;else if(Ee!=O)return Y.Pass}var H=L%2?b.charAt(L-1):j,te=L%2?j:b.charAt(L+1);S.operation(function(){if(Ee=="skip")S.execCommand("goCharRight");else if(Ee=="skipThree")for(var W=0;W<3;W++)S.execCommand("goCharRight");else if(Ee=="surround"){for(var B=S.getSelections(),W=0;W0&&(oe.percent=oe.loaded/oe.total*100),I.onProgress(oe)});var d=new FormData;I.data&&Object.keys(I.data).forEach(function(V){var oe=I.data[V];if(Array.isArray(oe)){oe.forEach(function(Le){d.append(V+"[]",Le)});return}d.append(V,I.data[V])}),I.file instanceof Blob?d.append(I.filename,I.file,I.file.name):d.append(I.filename,I.file),m.onerror=function(oe){I.onError(oe)},m.onload=function(){return m.status<200||m.status>=300?I.onError(fe(I,m),q(m)):I.onSuccess(q(m),m)},m.open(I.method,I.action,!0),I.withCredentials&&"withCredentials"in m&&(m.withCredentials=!0);var M=I.headers||{};return M["X-Requested-With"]!==null&&m.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(M).forEach(function(V){M[V]!==null&&m.setRequestHeader(V,M[V])}),m.send(d),{abort:function(){m.abort()}}}var $=+new Date,N=0;function P(){return"rc-upload-"+$+"-"+ ++N}function x(I,m){return I.indexOf(m,I.length-m.length)!==-1}var C=function(I,m){if(I&&m){var d=Array.isArray(m)?m:m.split(","),M=I.name||"",V=I.type||"",oe=V.replace(/\/.*$/,"");return d.some(function(Le){var Be=Le.trim();return Be.charAt(0)==="."?x(M.toLowerCase(),Be.toLowerCase()):/\/\*$/.test(Be)?oe===Be.replace(/\/.*$/,""):V===Be})}return!0};function k(I,m){var d=I.createReader(),M=[];function V(){d.readEntries(function(oe){var Le=Array.prototype.slice.apply(oe);M=M.concat(Le);var Be=!Le.length;Be?m(M):V()})}V()}var E=function(m,d,M){var V=function oe(Le,Be){Be=Be||"",Le.isFile?Le.file(function(_e){M(_e)&&(Le.fullPath&&!_e.webkitRelativePath&&(Object.defineProperties(_e,{webkitRelativePath:{writable:!0}}),_e.webkitRelativePath=Le.fullPath.replace(/^\//,""),Object.defineProperties(_e,{webkitRelativePath:{writable:!1}})),d([_e]))}):Le.isDirectory&&k(Le,function(_e){_e.forEach(function(Ne){oe(Ne,""+Be+Le.name+"/")})})};m.forEach(function(oe){V(oe.webkitGetAsEntry())})},S=E,j=Object.assign||function(I){for(var m=1;m=0)continue;if(!Object.prototype.hasOwnProperty.call(I,M))continue;d[M]=I[M]}return d}function ve(I,m){if(!(I instanceof m))throw new TypeError("Cannot call a class as a function")}function he(I,m){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:I}function xe(I,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);I.prototype=Object.create(m&&m.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(I,m):I.__proto__=m)}var Ie=function(m){return Object.keys(m).reduce(function(d,M){return(M.substr(0,5)==="data-"||M.substr(0,5)==="aria-"||M==="role")&&(d[M]=m[M]),d},{})},Ee=function(I){xe(m,I);function m(){var d,M,V,oe;ve(this,m);for(var Le=arguments.length,Be=Array(Le),_e=0;_e=Ie?pe:{done:!1,value:he[xe++]}}}}N.fromArray=k;function E(he){return{next:function(){var xe=he.next();return xe.done?pe:{done:!1,value:xe.value}}}}N.fromNativeIterator=E;function S(he){return he?Array.isArray(he)?N.fromArray(he):he:N.empty()}N.from=S;function j(he,xe){return{next:function(){var Ie=he.next();return Ie.done?pe:{done:!1,value:xe(Ie.value)}}}}N.map=j;function v(he,xe){return{next:function(){for(;;){var Ie=he.next();if(Ie.done)return pe;if(xe(Ie.value))return{done:!1,value:Ie.value}}}}}N.filter=v;function b(he,xe){for(var Ie=he.next();!Ie.done;Ie=he.next())xe(Ie.value)}N.forEach=b;function L(he,xe){xe===void 0&&(xe=Number.POSITIVE_INFINITY);var Ie=[];if(xe===0)return Ie;for(var Ee=0,Pe=he.next();!Pe.done&&!(Ie.push(Pe.value),++Ee>=xe);Pe=he.next());return Ie}N.collect=L;function U(){for(var he=[],xe=0;xe=he.length)return pe;var Ee=he[Ie],Pe=Ee.next();return Pe.done?(Ie++,this.next()):Pe}}}N.concat=U;function ve(he){return new be(he)}N.chain=ve})(ce||(ce={}));var be=function(){function N(P){this.it=P}return N.prototype.next=function(){return this.it.next()},N}();function fe(N){return Array.isArray(N)?ce.fromArray(N):N||ce.empty()}var q=function(){function N(P,x,C,k){x===void 0&&(x=0),C===void 0&&(C=P.length),k===void 0&&(k=x-1),this.items=P,this.start=x,this.end=C,this.index=k}return N.prototype.first=function(){return this.index=this.start,this.current()},N.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},N.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},N}(),z=function(N){Y(P,N);function P(x,C,k,E){return C===void 0&&(C=0),k===void 0&&(k=x.length),E===void 0&&(E=C-1),N.call(this,x,C,k,E)||this}return P.prototype.current=function(){return N.prototype.current.call(this)},P.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},P.prototype.first=function(){return this.index=this.start,this.current()},P.prototype.last=function(){return this.index=this.end-1,this.current()},P.prototype.parent=function(){return null},P}(q),$=function(){function N(P,x){this.iterator=P,this.fn=x}return N.prototype.next=function(){return this.fn(this.iterator.next())},N}()},LdHM:function(ht,de,y){"use strict";y.d(de,"b",function(){return U}),y.d(de,"a",function(){return he});var Y=y("1OyB"),pe=y("vuIU"),ce=y("Ji7U"),be=y("LK+K"),fe=y("q1tI"),q=y("rePB"),z=y("Ff2n"),$=y("ODXe"),N=y("4IlW"),P=y("bX4T"),x=y("YrtM"),C=y("TSYQ"),k=y.n(C),E=y("+nKL"),S=y("8OUc"),j=function(M,V){var oe=M.prefixCls,Le=M.id,Be=M.flattenOptions,_e=M.childrenAsData,Ne=M.values,ke=M.searchValue,Te=M.multiple,le=M.defaultActiveFirstOption,Z=M.height,T=M.itemHeight,K=M.notFoundContent,F=M.open,Se=M.menuItemSelectedIcon,D=M.virtual,_=M.onSelect,ne=M.onToggleOpen,Ce=M.onActiveValue,Re=M.onScroll,Me=M.onMouseEnter,je="".concat(oe,"-item"),He=Object(x.a)(function(){return Be},[F,Be],function(Ke,ue){return ue[0]&&Ke[1]!==ue[1]}),Ye=fe.useRef(null),qe=function(ue){ue.preventDefault()},Je=function(ue){Ye.current&&Ye.current.scrollTo({index:ue})},Ze=function(ue){for(var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,se=He.length,A=0;A1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ie.a)(d).map(function(V,oe){if(!fe.isValidElement(V)||!V.type)return null;var Le=V.type.isSelectOptGroup,Be=V.key,_e=V.props,Ne=_e.children,ke=Object(z.a)(_e,["children"]);return M||!Le?Ee(V):Object(xe.a)(Object(xe.a)({key:"__RC_SELECT_GRP__".concat(Be===null?oe:Be,"__"),label:Be},ke),{},{options:Pe(Ne)})}).filter(function(V){return V})}var De=y("2Qr1"),ae=y("qNPg"),O=y("U8pU"),me=y("Kwbf"),re=y("WKfj");function H(d){var M=d.mode,V=d.options,oe=d.children,Le=d.backfill,Be=d.allowClear,_e=d.placeholder,Ne=d.getInputElement,ke=d.showSearch,Te=d.onSearch,le=d.defaultOpen,Z=d.autoFocus,T=d.labelInValue,K=d.value,F=d.inputValue,Se=d.optionLabelProp,D=M==="multiple"||M==="tags",_=ke!==void 0?ke:D||M==="combobox",ne=V||Pe(oe);if(Object(me.a)(M!=="tags"||ne.every(function(je){return!je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),M==="tags"||M==="combobox"){var Ce=ne.some(function(je){return je.options?je.options.some(function(He){return typeof("value"in He?He.value:He.key)=="number"}):typeof("value"in je?je.value:je.key)=="number"});Object(me.a)(!Ce,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(me.a)(M!=="combobox"||!Se,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(me.a)(M==="combobox"||!Le,"`backfill` only works with `combobox` mode."),Object(me.a)(M==="combobox"||!Ne,"`getInputElement` only work with `combobox` mode."),Object(me.b)(M!=="combobox"||!Ne||!Be||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!_&&M!=="combobox"&&M!=="tags"&&Object(me.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(me.b)(!le||Z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),K!=null){var Re=Object(re.d)(K);Object(me.a)(!T||Re.every(function(je){return Object(O.a)(je)==="object"&&("key"in je||"value"in je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(me.a)(!D||Array.isArray(K),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Me=null;Object(Ie.a)(oe).some(function(je){if(!fe.isValidElement(je)||!je.type)return!1;var He=je.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var Ye=Object(Ie.a)(je.props.children).every(function(qe){return!fe.isValidElement(qe)||!je.type||qe.type.isSelectOption?!0:(Me=qe.type,!1)});return!Ye}return Me=He,!0}),Me&&Object(me.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Me.displayName||Me.name||Me,"`.")),Object(me.a)(F===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var te=H,W=Object(ae.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:Pe,flattenOptions:De.d,getLabeledValue:De.e,filterOptions:De.b,isValueDisabled:De.g,findValueOption:De.c,warningProps:te,fillOptionsWithMissingValue:De.a}),B=function(d){Object(ce.a)(V,d);var M=Object(be.a)(V);function V(){var oe;return Object(Y.a)(this,V),oe=M.apply(this,arguments),oe.selectRef=fe.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(pe.a)(V,[{key:"render",value:function(){return fe.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),V}(fe.Component);B.Option=U,B.OptGroup=he;var I=B,m=de.c=I},M8RZ:function(ht,de,y){"use strict";y.d(de,"a",function(){return N});var Y=y("fWQN"),pe=y("mtLc"),ce=y("yKVA"),be=y("879j"),fe=y("q1tI"),q=y.n(fe),z=y("i8i4"),$=y.n(z),N=function(P){Object(ce.a)(C,P);var x=Object(be.a)(C);function C(k){var E;Object(Y.a)(this,C),E=x.call(this,k);var S=window.document;return E.node=S.createElement("div"),S.body.appendChild(E.node),E}return Object(pe.a)(C,[{key:"render",value:function(){var E=this.props.children;return Object(z.createPortal)(E,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(q.a.Component)},MI8n:function(ht,de,y){"use strict";y.d(de,"b",function(){return q}),y.d(de,"a",function(){return N}),y.d(de,"e",function(){return P}),y.d(de,"d",function(){return x}),y.d(de,"c",function(){return C}),y.d(de,"f",function(){return k});var Y=y("/cxE"),pe=y("C/vA"),ce=y("pmY6"),be=y("24hK"),fe=function(){var E=function(S,j){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,b){v.__proto__=b}||function(v,b){for(var L in b)b.hasOwnProperty(L)&&(v[L]=b[L])},E(S,j)};return function(S,j){E(S,j);function v(){this.constructor=S}S.prototype=j===null?Object.create(j):(v.prototype=j.prototype,new v)}}(),q;(function(E){E.None=function(){return ce.a.None};function S(te){return function(W,B,I){B===void 0&&(B=null);var m=!1,d;return d=te(function(M){return m?void 0:(d?d.dispose():m=!0,W.call(B,M))},null,I),m&&d.dispose(),d}}E.once=S;function j(te,W){return he(function(B,I,m){return I===void 0&&(I=null),te(function(d){return B.call(I,W(d))},null,m)})}E.map=j;function v(te,W){return he(function(B,I,m){return I===void 0&&(I=null),te(function(d){W(d),B.call(I,d)},null,m)})}E.forEach=v;function b(te,W){return he(function(B,I,m){return I===void 0&&(I=null),te(function(d){return W(d)&&B.call(I,d)},null,m)})}E.filter=b;function L(te){return te}E.signal=L;function U(){for(var te=[],W=0;W1)&&Le.fire(_e),oe=0},B)})},onLastListenerRemove:function(){d.dispose()}});return Le.event}E.debounce=xe;function Ie(te){var W=new Date().getTime();return j(S(te),function(B){return new Date().getTime()-W})}E.stopwatch=Ie;function Ee(te){var W=!0,B;return b(te,function(I){var m=W||I!==B;return W=!1,B=I,m})}E.latch=Ee;function Pe(te,W,B){W===void 0&&(W=!1),B===void 0&&(B=[]);var I=B.slice(),m=te(function(V){I?I.push(V):M.fire(V)}),d=function(){I&&I.forEach(function(V){return M.fire(V)}),I=null},M=new N({onFirstListenerAdd:function(){m||(m=te(function(V){return M.fire(V)}))},onFirstListenerDidAdd:function(){I&&(W?setTimeout(d):d())},onLastListenerRemove:function(){m&&m.dispose(),m=null}});return M.event}E.buffer=Pe;var De=function(){function te(W){this.event=W}return te.prototype.map=function(W){return new te(j(this.event,W))},te.prototype.forEach=function(W){return new te(v(this.event,W))},te.prototype.filter=function(W){return new te(b(this.event,W))},te.prototype.reduce=function(W,B){return new te(ve(this.event,W,B))},te.prototype.latch=function(){return new te(Ee(this.event))},te.prototype.debounce=function(W,B,I,m){return B===void 0&&(B=100),I===void 0&&(I=!1),new te(xe(this.event,W,B,I,m))},te.prototype.on=function(W,B,I){return this.event(W,B,I)},te.prototype.once=function(W,B,I){return S(this.event)(W,B,I)},te}();function ae(te){return new De(te)}E.chain=ae;function O(te,W,B){B===void 0&&(B=function(V){return V});var I=function(){for(var V=[],oe=0;oe0?new $(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(E.prototype,"event",{get:function(){var S=this;return this._event||(this._event=function(j,v,b){S._listeners||(S._listeners=new be.a);var L=S._listeners.isEmpty();L&&S._options&&S._options.onFirstListenerAdd&&S._options.onFirstListenerAdd(S);var U=S._listeners.push(v?[j,v]:j);L&&S._options&&S._options.onFirstListenerDidAdd&&S._options.onFirstListenerDidAdd(S),S._options&&S._options.onListenerDidAdd&&S._options.onListenerDidAdd(S,j,v);var ve;S._leakageMon&&(ve=S._leakageMon.check(S._listeners.size));var he;return he={dispose:function(){if(ve&&ve(),he.dispose=E._noop,!S._disposed&&(U(),S._options&&S._options.onLastListenerRemove)){var xe=S._listeners&&!S._listeners.isEmpty();xe||S._options.onLastListenerRemove(S)}}},b instanceof ce.b?b.add(he):Array.isArray(b)&&b.push(he),he}),this._event},enumerable:!0,configurable:!0}),E.prototype.fire=function(S){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new be.a);for(var j=this._listeners.iterator(),v=j.next();!v.done;v=j.next())this._deliveryQueue.push([v.value,S]);for(;this._deliveryQueue.size>0;){var b=this._deliveryQueue.shift(),L=b[0],U=b[1];try{typeof L=="function"?L.call(void 0,U):L[0].call(L[1],U)}catch(ve){Object(Y.e)(ve)}}}},E.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},E._noop=function(){},E}(),P=function(E){fe(S,E);function S(j){var v=E.call(this,j)||this;return v._isPaused=0,v._eventQueue=new be.a,v._mergeFn=j&&j.merge,v}return S.prototype.pause=function(){this._isPaused++},S.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var j=this._eventQueue.toArray();this._eventQueue.clear(),E.prototype.fire.call(this,this._mergeFn(j))}else for(;!this._isPaused&&this._eventQueue.size!==0;)E.prototype.fire.call(this,this._eventQueue.shift())},S.prototype.fire=function(j){this._listeners&&(this._isPaused!==0?this._eventQueue.push(j):E.prototype.fire.call(this,j))},S}(N),x=function(){function E(){var S=this;this.hasListeners=!1,this.events=[],this.emitter=new N({onFirstListenerAdd:function(){return S.onFirstListenerAdd()},onLastListenerRemove:function(){return S.onLastListenerRemove()}})}return Object.defineProperty(E.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),E.prototype.add=function(S){var j=this,v={event:S,listener:null};this.events.push(v),this.hasListeners&&this.hook(v);var b=function(){j.hasListeners&&j.unhook(v);var L=j.events.indexOf(v);j.events.splice(L,1)};return Object(ce.h)(Object(pe.a)(b))},E.prototype.onFirstListenerAdd=function(){var S=this;this.hasListeners=!0,this.events.forEach(function(j){return S.hook(j)})},E.prototype.onLastListenerRemove=function(){var S=this;this.hasListeners=!1,this.events.forEach(function(j){return S.unhook(j)})},E.prototype.hook=function(S){var j=this;S.listener=S.event(function(v){return j.emitter.fire(v)})},E.prototype.unhook=function(S){S.listener&&S.listener.dispose(),S.listener=null},E.prototype.dispose=function(){this.emitter.dispose()},E}(),C=function(){function E(){this.buffers=[]}return E.prototype.wrapEvent=function(S){var j=this;return function(v,b,L){return S(function(U){var ve=j.buffers[j.buffers.length-1];ve?ve.push(function(){return v.call(b,U)}):v.call(b,U)},void 0,L)}},E.prototype.bufferEvents=function(S){var j=[];this.buffers.push(j);var v=S();return this.buffers.pop(),j.forEach(function(b){return b()}),v},E}(),k=function(){function E(){var S=this;this.listening=!1,this.inputEvent=q.None,this.inputEventListener=ce.a.None,this.emitter=new N({onFirstListenerDidAdd:function(){S.listening=!0,S.inputEventListener=S.inputEvent(S.emitter.fire,S.emitter)},onLastListenerRemove:function(){S.listening=!1,S.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(E.prototype,"input",{set:function(S){this.inputEvent=S,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=S(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),E.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},E}()},N0LK:function(ht,de,y){"use strict";y.d(de,"x",function(){return Y}),y.d(de,"F",function(){return pe}),y.d(de,"r",function(){return be}),y.d(de,"o",function(){return fe}),y.d(de,"p",function(){return q}),y.d(de,"Q",function(){return z}),y.d(de,"K",function(){return N}),y.d(de,"k",function(){return P}),y.d(de,"N",function(){return x}),y.d(de,"m",function(){return C}),y.d(de,"l",function(){return k}),y.d(de,"I",function(){return E}),y.d(de,"H",function(){return S}),y.d(de,"q",function(){return j}),y.d(de,"t",function(){return v}),y.d(de,"D",function(){return b}),y.d(de,"e",function(){return L}),y.d(de,"f",function(){return U}),y.d(de,"B",function(){return ve}),y.d(de,"C",function(){return he}),y.d(de,"n",function(){return Ie}),y.d(de,"O",function(){return Pe}),y.d(de,"c",function(){return De}),y.d(de,"d",function(){return ae}),y.d(de,"z",function(){return O}),y.d(de,"A",function(){return me}),y.d(de,"u",function(){return re}),y.d(de,"E",function(){return te}),y.d(de,"G",function(){return W}),y.d(de,"i",function(){return I}),y.d(de,"g",function(){return d}),y.d(de,"v",function(){return V}),y.d(de,"h",function(){return oe}),y.d(de,"y",function(){return Le}),y.d(de,"w",function(){return Be}),y.d(de,"a",function(){return _e}),y.d(de,"P",function(){return Ne}),y.d(de,"L",function(){return ke}),y.d(de,"J",function(){return Te}),y.d(de,"j",function(){return le}),y.d(de,"M",function(){return Z}),y.d(de,"s",function(){return T}),y.d(de,"b",function(){return K});function Y(D){return!D||typeof D!="string"?!0:D.trim().length===0}function pe(D,_,ne){ne===void 0&&(ne="0");for(var Ce=""+D,Re=[Ce],Me=Ce.length;Me<_;Me++)Re.push(ne);return Re.reverse().join("")}var ce=/{(\d+)}/g;function be(D){for(var _=[],ne=1;ne=_.length?Ce:_[Me]})}function fe(D){return D.replace(/[<>&]/g,function(_){switch(_){case"<":return"<";case">":return">";case"&":return"&";default:return _}})}function q(D){return D.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function z(D,_){_===void 0&&(_=" ");var ne=$(D,_);return N(ne,_)}function $(D,_){if(!D||!_)return D;var ne=_.length;if(ne===0||D.length===0)return D;for(var Ce=0;D.indexOf(_,Ce)===Ce;)Ce=Ce+ne;return D.substring(Ce)}function N(D,_){if(!D||!_)return D;var ne=_.length,Ce=D.length;if(ne===0||Ce===0)return D;for(var Re=Ce,Me=-1;!(Me=D.lastIndexOf(_,Re-1),Me===-1||Me+ne!==Re);){if(Me===0)return"";Re=Me}return D.substring(0,Re)}function P(D){return D.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function x(D,_){if(D.length<_.length)return!1;if(D===_)return!0;for(var ne=0;ne<_.length;ne++)if(D[ne]!==_[ne])return!1;return!0}function C(D,_){var ne=D.length-_.length;return ne>0?D.indexOf(_,ne)===ne:ne===0?D===_:!1}function k(D,_,ne){if(ne===void 0&&(ne={}),!D)throw new Error("Cannot create regex from empty string");_||(D=q(D)),ne.wholeWord&&(/\B/.test(D.charAt(0))||(D="\\b"+D),/\B/.test(D.charAt(D.length-1))||(D=D+"\\b"));var Ce="";return ne.global&&(Ce+="g"),ne.matchCase||(Ce+="i"),ne.multiline&&(Ce+="m"),ne.unicode&&(Ce+="u"),new RegExp(D,Ce)}function E(D){if(D.source==="^"||D.source==="^$"||D.source==="$"||D.source==="^\\s*$")return!1;var _=D.exec("");return!!(_&&D.lastIndex===0)}function S(D){return(D.global?"g":"")+(D.ignoreCase?"i":"")+(D.multiline?"m":"")+(D.unicode?"u":"")}function j(D){for(var _=0,ne=D.length;_=0;ne--){var Ce=D.charCodeAt(ne);if(Ce!==32&&Ce!==9)return ne}return-1}function L(D,_){return D<_?-1:D>_?1:0}function U(D,_){for(var ne=Math.min(D.length,_.length),Ce=0;Ce_.length?1:0}function ve(D){return D>=97&&D<=122}function he(D){return D>=65&&D<=90}function xe(D){return ve(D)||he(D)}function Ie(D,_){return D.length===_.length&&Ee(D,_)}function Ee(D,_,ne){ne===void 0&&(ne=D.length);for(var Ce=0;CeD.length?!1:Ee(D,_,ne)}function De(D,_){var ne,Ce=Math.min(D.length,_.length);for(ne=0;ne1){var Ce=D.charCodeAt(_-2);if(O(Ce))return(Ce-55296<<10)+(ne-56320)+65536}return ne}function te(D,_){var ne=F.getInstance(),Ce=_,Re=D.length,Me=re(D,Re,_);_+=Me>=65536?2:1;for(var je=ne.getGraphemeBreakType(Me);_=65536?2:1,je=Ye}return _-Ce}function W(D,_){var ne=F.getInstance(),Ce=_,Re=H(D,_);_-=Re>=65536?2:1;for(var Me=ne.getGraphemeBreakType(Re);_>0;){var je=H(D,_),He=ne.getGraphemeBreakType(je);if(K(He,Me))break;_-=je>=65536?2:1,Me=He}return Ce-_}var B=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function I(D){return B.test(D)}var m=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function d(D){return m.test(D)}var M=/^[\t\n\r\x20-\x7E]*$/;function V(D){return M.test(D)}function oe(D){for(var _=0,ne=D.length;_=11904&&D<=55215||D>=63744&&D<=64255||D>=65281&&D<=65374}function Be(D){return D>=127462&&D<=127487||D>=9728&&D<=10175||D>=127744&&D<=128591||D>=128640&&D<=128764||D>=128992&&D<=129003||D>=129280&&D<=129535||D>=129648&&D<=129651||D>=129656&&D<=129666||D>=129680&&D<=129685}var _e=String.fromCharCode(65279);function Ne(D){return!!(D&&D.length>0&&D.charCodeAt(0)===65279)}function ke(D){return btoa(encodeURIComponent(D))}function Te(D,_){for(var ne="",Ce=0;Ce<_;Ce++)ne+=D;return ne}function le(D,_){return _===void 0&&(_=!1),D?(_&&(D=D.replace(/\\./g,"")),D.toLowerCase()!==D):!1}function Z(D){var _=90-65+1;return D=D%(2*_),D<_?String.fromCharCode(97+D):String.fromCharCode(65+D-_)}function T(D){var _=F.getInstance();return _.getGraphemeBreakType(D)}function K(D,_){return D===0?_!==5&&_!==7:D===2&&_===3?!1:D===4||D===2||D===3||(_===4||_===2||_===3)?!0:D===8&&(_===8||_===9||_===11||_===12)||((D===11||D===9)&&(_===9||_===10)||((D===12||D===10)&&_===10||(_===5||_===13||(_===7||(D===1||D===13&&_===14)))))?!1:!(D===6&&_===6)}var F=function(){function D(){this._data=Se()}return D.getInstance=function(){return D._INSTANCE||(D._INSTANCE=new D),D._INSTANCE},D.prototype.getGraphemeBreakType=function(_){if(_<32)return _===10?3:_===13?2:4;if(_<127)return 0;for(var ne=this._data,Ce=ne.length/3,Re=1;Re<=Ce;)if(_ne[3*Re+1])Re=2*Re+1;else return ne[3*Re+2];return 0},D._INSTANCE=null,D}();function Se(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},OLES:function(ht,de,y){"use strict";var Y=y("U8pU"),pe=y("VTBJ"),ce=y("Ff2n"),be=y("q1tI"),fe=y("uciX"),q=y("7ixt"),z=function(k){var E=k.overlay,S=k.prefixCls,j=k.id,v=k.overlayInnerStyle;return be.createElement("div",{className:"".concat(S,"-inner"),id:j,role:"tooltip",style:v},typeof E=="function"?E():E)},$=z,N=function(k,E){var S=k.overlayClassName,j=k.trigger,v=j===void 0?["hover"]:j,b=k.mouseEnterDelay,L=b===void 0?0:b,U=k.mouseLeaveDelay,ve=U===void 0?.1:U,he=k.overlayStyle,xe=k.prefixCls,Ie=xe===void 0?"rc-tooltip":xe,Ee=k.children,Pe=k.onVisibleChange,De=k.afterVisibleChange,ae=k.transitionName,O=k.animation,me=k.placement,re=me===void 0?"right":me,H=k.align,te=H===void 0?{}:H,W=k.destroyTooltipOnHide,B=W===void 0?!1:W,I=k.defaultVisible,m=k.getTooltipContainer,d=k.overlayInnerStyle,M=Object(ce.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),V=Object(be.useRef)(null);Object(be.useImperativeHandle)(E,function(){return V.current});var oe=Object(pe.a)({},M);"visible"in k&&(oe.popupVisible=k.visible);var Le=function(){var Te=k.arrowContent,le=Te===void 0?null:Te,Z=k.overlay,T=k.id;return[be.createElement("div",{className:"".concat(Ie,"-arrow"),key:"arrow"},le),be.createElement($,{key:"content",prefixCls:Ie,id:T,overlay:Z,overlayInnerStyle:d})]},Be=!1,_e=!1;if(typeof B=="boolean")Be=B;else if(B&&Object(Y.a)(B)==="object"){var Ne=B.keepParent;Be=Ne===!0,_e=Ne===!1}return be.createElement(fe.a,Object.assign({popupClassName:S,prefixCls:Ie,popup:Le,action:v,builtinPlacements:q.a,popupPlacement:re,ref:V,popupAlign:te,getPopupContainer:m,onPopupVisibleChange:Pe,afterPopupVisibleChange:De,popupTransitionName:ae,popupAnimation:O,defaultPopupVisible:I,destroyPopupOnHide:Be,autoDestroy:_e,mouseLeaveDelay:ve,popupStyle:he,mouseEnterDelay:L},oe),Ee)},P=Object(be.forwardRef)(N),x=de.a=P},Ot1p:function(ht,de,y){"use strict";var Y=y("2qtc"),pe=y("kLXV"),ce=y("rAM+"),be=y("miYZ"),fe=y("tsqr"),q=y("9og8"),z=y("tJVT"),$=y("jrin"),N=y("WmNS"),P=y.n(N),x=y("q1tI"),C=y.n(x),k=y("VrN/"),E=y.n(k),S=y("bdgK"),j=y("p77/"),v=y("Bd2K"),b=y("ELLl"),L=y("19Vz"),U=y("lZu9"),ve=y("+NIl"),he=y("kSUc"),xe=y("9Bee"),Ie=function(ge){var Ve=ge.value,it=Ve===void 0?"":Ve,ft=ge.className,lt=ge.showTextOnly,Lt=ge.showLines,At=ge.style,pt=At===void 0?{}:At,$t=Object(x.useMemo)(function(){return""},[it]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:$t}}))},Ee=y("0Owb"),Pe=y("dejd"),De=y("C+DQ"),ae=y("1vsH"),O=y("m3rI"),me=[{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 re(ge){var Ve=ge.onActionCallback,it=ge.title,ft=ge.icon,lt=ge.actionName,Lt=ge.className,At=Lt===void 0?"":Lt,pt=ge.children;function $t(){Ve(lt)}return C.a.createElement("a",{title:it,className:At,onClick:$t},C.a.createElement("i",{className:"md-iconfont ".concat(ft)}),pt)}var H=function(ge){var Ve=ge.watch,it=ge.showNullButton,ft=ge.onActionCallback,lt=ge.fullScreen,Lt=ge.insertTemp,At=ge.hidetoolBar,pt=ge.uuid,$t=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(ae.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(ae.D)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(O.a.PROXY_SERVER)));var jt=[].concat(me,[{title:"".concat(Ve?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ve?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&jt.map(function(Jt,Wt){return C.a.createElement("li",{key:Wt},Jt.actionName?C.a.createElement(re,Object(Ee.a)({},Jt,{onActionCallback:ft})):C.a.createElement("span",{className:"v-line"}))}),it?C.a.createElement("li",null,C.a.createElement(re,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ft},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Lt&&C.a.createElement("li",null,C.a.createElement(re,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Lt),onActionCallback:ft},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(re,{icon:"".concat(lt?"icon-shrink":"icon-enlarge"),title:lt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ft})))},te=y("M8RZ"),W=y("+L6B"),B=y("2/Rp"),I=y("y8nQ"),m=y("Vl3Y"),d=y("5NDa"),M=y("5rEg"),V={labelCol:{span:4},wrapperCol:{span:20}},oe=function(ge){var Ve=ge.callback,it=ge.onCancel;function ft(lt){Ve(lt)}return C.a.createElement(m.a,Object(Ee.a)({},V,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ft}),C.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(M.a,null)),C.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(M.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(B.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},Le=y("7ahc"),Be=y("k1fw"),_e=y("HmJG"),Ne=y("BjJ7"),ke=m.a.useForm,Te={width:280,marginRight:10},le={labelCol:{span:5},wrapperCol:{span:19}},Z=function(ge){var Ve=ge.callback,it=ge.onCancel,ft=ke(),lt=Object(z.a)(ft,1),Lt=lt[0],At=Object(x.useRef)();function pt(Jt){Ve(Object(Be.a)(Object(Be.a)({},Jt),{},{name:At.current}))}function $t(Jt,Wt){Lt.setFieldsValue({src:"/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type),type:Wt.type})}function jt(Jt){var Wt=Jt.target.files[0];At.current=Wt.name,K(Wt,$t)}return C.a.createElement(m.a,Object(Ee.a)({form:Lt},le,{className:"upload-image-panel",onFinish:pt}),C.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},C.a.createElement(M.a,{style:Te})),C.a.createElement(T,{onFileChange:jt}))),C.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},C.a.createElement(M.a,{style:{width:264}})),C.a.createElement(m.a.Item,{style:{textAlign:"right"}},C.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(B.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))};function T(ge){var Ve=ge.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Ve}))}function K(ge,Ve){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var it=new FormData;it.append("editormd-image-file",ge),it.append("file_param_name","editormd-image-file"),it.append("byxhr","true");var ft=new window.XMLHttpRequest;ft.withCredentials=!0,ft.addEventListener("load",function(lt){Ve(JSON.parse(lt.target.responseText),ge)},!1),ft.addEventListener("error",function(lt){console.error(lt)},!1),ft.open("POST","".concat(Ne.a,"/api/attachments.json")),ft.send(it)}var F=y("giR+"),Se=y("fyUT"),D=y("7Kak"),_=y("9yH6"),ne=_.a.Group,Ce={margin:"0 8px"},Re=function(ge){var Ve=ge.callback,it=ge.onCancel;function ft(lt){Ve(lt)}return C.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ft},C.a.createElement("div",{className:"flex-container"},C.a.createElement("span",{style:Ce},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Ce},"\u884C\u6570"),C.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(Se.a,null)),C.a.createElement("span",{style:Ce},"\u5217\u6570"),C.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(Se.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12}},C.a.createElement("span",{style:Ce},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(m.a.Item,{name:"align"},C.a.createElement(ne,null,C.a.createElement(_.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(_.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(_.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(_.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(B.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},Me=y("ErOA"),je=y("7Cbv"),He="link",Ye="upload-image",qe="code-block",Je="add-table",Ze="------------",yt={default:Ze,left:":".concat(Ze),center:":".concat(Ze,":"),right:"".concat(Ze,":")},gt=y("9VGf"),st,Oe;function nt(){}var dt=0,Ue=1e4,Ke="\u2581",ue=` **\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 ie(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,A=se?"Cmd":"Ctrl",R=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],X=(st={},Object($.a)(st,A+"-B","bold"),Object($.a)(st,A+"-I","italic"),st),Q=(Oe={},Object($.a)(Oe,He,"\u6DFB\u52A0\u94FE\u63A5"),Object($.a)(Oe,qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object($.a)(Oe,Ye,"\u6DFB\u52A0\u6587\u4EF6"),Object($.a)(Oe,Je,"\u6DFB\u52A0\u8868\u683C"),Oe),Ae=de.a=function(ge){var Ve=ge.defaultValue,it=Ve===void 0?"":Ve,ft=ge.onChange,lt=ge.width,Lt=lt===void 0?"100%":lt,At=ge.height,pt=At===void 0?400:At,$t=ge.miniToolbar,jt=$t===void 0?!1:$t,Jt=ge.isFocus,Wt=Jt===void 0?!1:Jt,Mt=ge.watch,Un=ge.insertTemp,Qn=ge.mode,bt=Qn===void 0?"markdown":Qn,wt=ge.id,rt=wt===void 0?"markdown-editor-id":wt,xt=ge.showResizeBar,Zt=xt===void 0?!1:xt,rn=ge.noStorage,nn=rn===void 0?!1:rn,Rt=ge.showNullButton,mt=Rt===void 0?!1:Rt,On=ge.hidetoolBar,ni=On===void 0?!1:On,kn=ge.fullScreen,Ot=kn===void 0?!1:kn,Ln=ge.onBlur,Vn=ge.onCMBeforeChange,ii=ge.onFullScreen,We=ge.className,ot=We===void 0?"":We,_t=ge.disablePaste,Gt=_t===void 0?!1:_t,Kt=ge.placeholder,qt=Kt===void 0?"":Kt,c=ge.values,o=c===void 0?"":c,a=Object(x.useState)(null),u=Object(z.a)(a,2),f=u[0],h=u[1],ee=Object(x.useState)(it),ze=Object(z.a)(ee,2),Qe=ze[0],ut=ze[1],Ge=Object(x.useState)(Mt),kt=Object(z.a)(Ge,2),Nt=kt[0],en=kt[1],Xn=Object(x.useState)(Ot),Kn=Object(z.a)(Xn,2),mn=Kn[0],qn=Kn[1],zi=Object(x.useState)(""),Dn=Object(z.a)(zi,2),Yn=Dn[0],Hn=Dn[1],bi=Object(x.useState)(0),ri=Object(z.a)(bi,2),mi=ri[0],ci=ri[1],hr=Object(x.useState)(pt),Gi=Object(z.a)(hr,2),oi=Gi[0],$n=Gi[1],Mi=Object(x.useState)(!1),Oi=Object(z.a)(Mi,2),dr=Oi[0],sn=Oi[1],Ut=Object(x.useRef)(Object(je.a)()),wn=Object(x.useRef)(!1),Bt=Object(x.useRef)(),hn=Object(x.useRef)(),Vt=Object(x.useRef)(),hi=Object(x.useRef)(),un=Object(x.useRef)(),_n=function(){var vt=Object(q.a)(P.a.mark(function Tt(){var Et,Pt;return P.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(Me.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ut.current}});case 2:Pt=Yt.sent,Pt!=null&&(Et=Pt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",f,hn),Pt.attachments.map(function(Ft){Ft.content_type.indexOf("image")>-1?f.replaceSelection("![,](/api/attachments/".concat(Ft.id,"?type=").concat(Ft.content_type,")")):Ft.content_type.indexOf("video")>-1?f.replaceSelection('')):Ft.content_type.indexOf("pdf")>-1?f.replaceSelection('
    ').concat(Ft.name,"")):f.replaceSelection("[".concat(Ft.name,"](").concat(O.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}));case 4:case"end":return Yt.stop()}},Tt)}));return function(){return vt.apply(this,arguments)}}();Object(x.useEffect)(function(){ut(o),f==null||f.setValue(o)},[o]),Object(x.useEffect)(function(){ii==null||ii(mn)},[mn]),Object(x.useEffect)(function(){if(hn.current){var vt=E.a.fromTextArea(hn.current,{mode:bt,lineNumbers:!jt,lineWrapping:!0,value:it,autoCloseTags:!0,autoCloseBrackets:!0});Wt&&vt.focus();function Tt(Et,Pt){if(Gt){Pt.preventDefault();return}var Ht=Pt.clipboardData;if(Ht){var Yt=Ht.types.toString(),Ft=Ht.items;if(Yt==="Files"||Ht.types.indexOf("Files")>-1){if(Pt.preventDefault(),bt=="stex")return;try{var dn,Pn=Ft[1];((dn=Ft[0])===null||dn===void 0?void 0:dn.kind)==="file"&&(Pn=Ft[0]);var It=Pn.getAsFile(),Ci=It.name.split(".").pop();K(It,function(zt){if(zt.id){var vn,ei,ti;(It==null||((vn=It.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?vt.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(It==null||((ei=It.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?vt.replaceSelection('')):(It==null||((ti=It.type)===null||ti===void 0)?void 0:ti.indexOf("pdf"))>-1?vt.replaceSelection('').concat(It.name,"")):R.includes(Ci)?vt.replaceSelection('').concat(It.name,"")):vt.replaceSelection("[".concat(It.name,"](").concat(O.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){fe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Tt),vt.on("dragleave",function(Et,Pt){Vt.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(Et,Pt){Vt.current.classList.add("mouse-hover-md")}),vt.on("drop",function(Et,Pt){Vt.current.classList.add("mouse-hover-md");var Ht;if(Ht=Pt.dataTransfer.files,Ht.length>0){Pt.preventDefault(),Pt.stopPropagation();for(var Yt=function(Pn){var It=Ht[Pn],Ci=It.name.split(".").pop();K(It,function(zt){if(zt.id){var vn,ei,ti;(It==null||((vn=It.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?vt.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(It==null||((ei=It.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?vt.replaceSelection('')):(It==null||((ti=It.type)===null||ti===void 0)?void 0:ti.indexOf("pdf"))>-1?vt.replaceSelection('').concat(It.name,"")):R.includes(Ci)?vt.replaceSelection('').concat(It.name,"")):vt.replaceSelection("[".concat(It.name,"](").concat(O.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},Ft=0;Ft0||Ft.target.offsetWidth>0)&&(Vi(),f.setSize("100%","100%"),f.refresh())}}catch(dn){Ht.e(dn)}finally{Ht.f()}});return Et.observe(hn.current.parentElement),Et}if(f){var Tt=vt();return function(){Tt.unobserve(hn.current.parentElement)}}},[f,Vi]),Object(x.useEffect)(function(){if(f){for(var vt=[],Tt=function(){var Ft=Pt[Et];Ht=Object(z.a)(Ft,2);var dn=Ht[0],Pn=Ht[1],It=Object($.a)({},dn,function(){Xi(Pn)});vt.push(It),f.addKeyMap(It)},Et=0,Pt=Object.entries(X);Et0){var vt=new Date().getTime(),Tt=window.sessionStorage.getItem(rt);vt>=mi+Ue&&(!Tt||Tt!==Qe)&&(window.sessionStorage.setItem(rt,Qe),sn(!0))}},Ue),Object(x.useEffect)(function(){en(Mt)},[f,Mt]),Object(x.useEffect)(function(){f&&(Wt&&f.focus())},[f,Wt]),Object(x.useEffect)(function(){if(Nt&&f){var vt=f.getScrollerElement();function Tt(Et){var Pt=Et.target;if(un.current){var Ht=Pt.scrollTop/Pt.scrollHeight;un.current.scrollTop=un.current.scrollHeight*Ht}}return vt.addEventListener("scroll",Tt),function(){vt.removeEventListener("scroll",Tt)}}},[f,Nt]),Object(x.useEffect)(function(){if(f&&Vn){function vt(Tt,Et){Vn(Tt,Et)}return f.on("beforeChange",vt),function(){f.off("beforeChange",vt)}}},[f,Vn]),Object(x.useEffect)(function(){if(f&&Ln){function vt(){Ln(f.getValue())}return f.on("blur",vt),function(){f.off("blur",vt)}}},[f,Ln]),Object(x.useEffect)(function(){if(f){function vt(Tt){var Et=Tt.getValue();ut(Et),ci(new Date().getTime()),Tt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ft&&ft(Et)}return f.on("change",vt),function(){f.off("change",vt)}}},[f,ft]),Object(x.useEffect)(function(){f&&(it==null?(f.setValue(""),ut("")):it!==f.getValue()&&(f.setValue(it),ut(it),f.setCursor(f.lineCount(),0)))},[f,it]);var Xi=Object(x.useCallback)(function(vt){var Tt=f.getCursor(),Et=f.getSelection(),Pt=Et.split(` `);switch(vt){case"bold":return f.replaceSelection("**"+Et+"**"),Et===""&&f.setCursor(Tt.line,Tt.ch+2),f.focus();case"italic":return f.replaceSelection("*"+Et+"*"),Et===""&&f.setCursor(Tt.line,Tt.ch+1),f.focus();case"code":return f.replaceSelection("`"+Et+"`"),Et===""&&f.setCursor(Tt.line,Tt.ch+1),f.focus();case"inline-latex":return f.replaceSelection("`$$"+Et+"$$`"),Et===""&&f.setCursor(Tt.line,Tt.ch+3),f.focus();case"latex":return f.replaceSelection("```latex\n"+Et+"\n```"),f.setCursor(Tt.line+1,Et.length+1),f.focus();case"line-break":return f.replaceSelection(`
    `),f.focus();case"list-ul":return Et===""?f.replaceSelection("- "+Et):f.replaceSelection(Pt.map(function(Ht){return Ht===""?"":"- ".concat(Ht)}).join(` `)),f.focus();case"list-ol":return Et===""?f.replaceSelection("1. "+Et):f.replaceSelection(Pt.map(function(Ht,Yt){return Ht===""?"":"".concat(Yt+1,". ").concat(Ht)}).join(` `)),f.focus();case"add-null-ch":return Et===""&&f.setCursor(Tt.line,Tt.ch+1),f.replaceSelection(Ke),f.focus();case"inster-template-1":return Et===""&&f.setCursor(Tt.line,Tt.ch),f.replaceSelection(ue),f.focus();case"eraser":return f.setValue(""),f.focus();case"trigger-watch":return en(!Nt),f.focus();case"trigger-full-screen":return qn(!mn),f.focus();case He:Hn(He);return;case qe:Hn(qe);return;case Ye:Hn(Ye);return;case Je:Hn(Je);return;default:throw new Error}},[f,Nt,mn]),xi=Object(x.useCallback)(function(vt){Hn("");switch(Yn){case He:var Tt=vt.title,Et=vt.link;return f.replaceSelection("[".concat(Tt,"](").concat(Et,")")),f.focus();case qe:var Pt=vt.language,Ht=vt.content;return f.replaceSelection(["```"+Pt,Ht,"```"].join(` `)),f.focus();case Ye:var Yt=vt.src,Ft=vt.alt,dn=vt.name;return Yt.indexOf("type=image")>-1?f.replaceSelection("![ ".concat(Ft||""," ]( ").concat(Yt,' "').concat(Ft||"",'" )')):Yt.indexOf("type=application/pdf")>-1?f.replaceSelection('').concat(dn,"")):f.replaceSelection('').concat(dn,"")),f.focus();case Je:for(var Pn=vt.row,It=vt.col,Ci=vt.align,zt=` `,vn=0;vn300&&(dn=300);var Pn=pt+dn+"px";$n(Pn)}}return vt.addEventListener("mousedown",Pt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Ht),function(){vt.removeEventListener("mousedown",Pt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Ht)}}},[f,hi]),Object(x.useEffect)(function(){$n(pt)},[pt]);var fr=ie(Lt),ai=ie(oi),Ki={width:fr,height:ai},Ur=Object(x.useMemo)(function(){if(mi){var vt=new Date(mi),Tt=vt.getHours(),Et=vt.getMinutes(),Pt=vt.getSeconds();return Tt=Tt<10?"0"+Tt:Tt,Et=Et<10?"0"+Et:Et,Pt=Pt<10?"0"+Pt:Pt,"".concat(Tt,":").concat(Et,":").concat(Pt)}return 0},[mi]);function Di(){window.sessionStorage.removeItem(rt),sn(!1),ci(0)}function Jo(){sn(!1),ci(0),f.setValue(window.sessionStorage.getItem(rt))}function co(vt,Tt){var Et=f.getValue();Et=Et.replace(vt,Tt),ut(Et),f==null||f.setValue(Et)}return C.a.createElement(x.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:Vt},C.a.createElement("div",{className:"markdown-editor-container ".concat(ot," ").concat(Nt?"on-preview":""," ").concat(jt?"mini":""," ").concat(mn?"full-screen":""),style:Ki},C.a.createElement(H,{insertTemp:Un,watch:Nt,fullScreen:mn,showNullButton:mt,onActionCallback:Xi,hidetoolBar:ni,uuid:Ut.current,setOpenPhones:function(){wn.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:hn,placeholder:qt})),Nt?C.a.createElement("div",{ref:un,className:"preview-container"},bt==="stex"&&C.a.createElement(Ie,{value:Qe}),bt!=="stex"&&C.a.createElement(xe.a,{edit:!0,value:Qe,replaces:co})):null))),Zt?C.a.createElement("a",{ref:hi,className:"editor-resize"}):null,C.a.createElement(te.a,null,Q[Yn]?C.a.createElement(pe.a,{centered:!0,title:Q[Yn],visible:!0,onCancel:Wn,footer:null},Br):null))}},QDVR:function(ht,de,y){"use strict";y.d(de,"e",function(){return pe}),y.d(de,"d",function(){return ce}),y.d(de,"c",function(){return z}),y.d(de,"b",function(){return $}),y.d(de,"a",function(){return P});var Y=function(){var x=function(C,k){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,S){E.__proto__=S}||function(E,S){for(var j in S)S.hasOwnProperty(j)&&(E[j]=S[j])},x(C,k)};return function(C,k){x(C,k);function E(){this.constructor=C}C.prototype=k===null?Object.create(k):(E.prototype=k.prototype,new E)}}();function pe(x){var C=[];return x.forEach(function(k){return C.push(k)}),C}function ce(x){var C=[];return x.forEach(function(k,E){return C.push(E)}),C}var be=function(){function x(){this._value="",this._pos=0}return x.prototype.reset=function(C){return this._value=C,this._pos=0,this},x.prototype.next=function(){return this._pos+=1,this},x.prototype.hasNext=function(){return this._pos0)S.left||(S.left=new q,S.left.segment=E.value()),S=S.left;else if(j<0)S.right||(S.right=new q,S.right.segment=E.value()),S=S.right;else if(E.hasNext())E.next(),S.mid||(S.mid=new q,S.mid.segment=E.value()),S=S.mid;else break}var v=S.value;return S.value=k,S.key=C,v},x.prototype.get=function(C){for(var k=this._iter.reset(C),E=this._root;E;){var S=k.cmp(E.segment);if(S>0)E=E.left;else if(S<0)E=E.right;else if(k.hasNext())k.next(),E=E.mid;else break}return E?E.value:void 0},x.prototype.findSubstr=function(C){for(var k=this._iter.reset(C),E=this._root,S=void 0;E;){var j=k.cmp(E.segment);if(j>0)E=E.left;else if(j<0)E=E.right;else if(k.hasNext())k.next(),S=E.value||S,E=E.mid;else break}return E&&E.value||S},x.prototype.forEach=function(C){this._forEach(this._root,C)},x.prototype._forEach=function(C,k){C&&(this._forEach(C.left,k),C.value&&k(C.value,C.key),this._forEach(C.mid,k),this._forEach(C.right,k))},x}(),$=function(){function x(){this.map=new Map,this.ignoreCase=!1}return x.prototype.set=function(C,k){this.map.set(this.toKey(C),k)},x.prototype.get=function(C){return this.map.get(this.toKey(C))},x.prototype.toKey=function(C){var k=C.toString();return this.ignoreCase&&(k=k.toLowerCase()),k},x}(),N=function(){function x(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return x.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(x.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),x.prototype.get=function(C,k){k===void 0&&(k=0);var E=this._map.get(C);return E?(k!==0&&this.touch(E,k),E.value):void 0},x.prototype.set=function(C,k,E){E===void 0&&(E=0);var S=this._map.get(C);if(S)S.value=k,E!==0&&this.touch(S,E);else{S={key:C,value:k,next:void 0,previous:void 0};switch(E){case 0:this.addItemLast(S);break;case 1:this.addItemFirst(S);break;case 2:this.addItemLast(S);break;default:this.addItemLast(S);break}this._map.set(C,S),this._size++}},x.prototype.delete=function(C){return!!this.remove(C)},x.prototype.remove=function(C){var k=this._map.get(C);return k?(this._map.delete(C),this.removeItem(k),this._size--,k.value):void 0},x.prototype.forEach=function(C,k){for(var E=this._head;E;)k?C.bind(k)(E.value,E.key,this):C(E.value,E.key,this),E=E.next},x.prototype.trimOld=function(C){if(C>=this.size)return;if(C===0){this.clear();return}for(var k=this._head,E=this.size;k&&E>C;)this._map.delete(k.key),k=k.next,E--;this._head=k,this._size=E,k&&(k.previous=void 0)},x.prototype.addItemFirst=function(C){if(!this._head&&!this._tail)this._tail=C;else if(this._head)C.next=this._head,this._head.previous=C;else throw new Error("Invalid list");this._head=C},x.prototype.addItemLast=function(C){if(!this._head&&!this._tail)this._head=C;else if(this._tail)C.previous=this._tail,this._tail.next=C;else throw new Error("Invalid list");this._tail=C},x.prototype.removeItem=function(C){if(C===this._head&&C===this._tail)this._head=void 0,this._tail=void 0;else if(C===this._head){if(!C.next)throw new Error("Invalid list");C.next.previous=void 0,this._head=C.next}else if(C===this._tail){if(!C.previous)throw new Error("Invalid list");C.previous.next=void 0,this._tail=C.previous}else{var k=C.next,E=C.previous;if(!k||!E)throw new Error("Invalid list");k.previous=E,E.next=k}C.next=void 0,C.previous=void 0},x.prototype.touch=function(C,k){if(!this._head||!this._tail)throw new Error("Invalid list");if(k!==1&&k!==2)return;if(k===1){if(C===this._head)return;var E=C.next,S=C.previous;C===this._tail?(S.next=void 0,this._tail=S):(E.previous=S,S.next=E),C.previous=void 0,C.next=this._head,this._head.previous=C,this._head=C}else if(k===2){if(C===this._tail)return;var E=C.next,S=C.previous;C===this._head?(E.previous=void 0,this._head=E):(E.previous=S,S.next=E),C.next=void 0,C.previous=this._tail,this._tail.next=C,this._tail=C}},x.prototype.toJSON=function(){var C=[];return this.forEach(function(k,E){C.push([E,k])}),C},x}(),P=function(x){Y(C,x);function C(k,E){E===void 0&&(E=1);var S=x.call(this)||this;return S._limit=k,S._ratio=Math.min(Math.max(0,E),1),S}return C.prototype.get=function(k){return x.prototype.get.call(this,k,2)},C.prototype.peek=function(k){return x.prototype.get.call(this,k,0)},C.prototype.set=function(k,E){x.prototype.set.call(this,k,E,2),this.checkTrim()},C.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},C}(N)},SJMd:function(ht,de){/** * @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 y,Y,pe,ce=!1,be,fe;window.PR_SHOULD_USE_CONTINUATION=!0;var q,z;(function(){var $=window,N=["break,continue,do,else,for,if,return,while"],P=[N,"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"],x=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[x,"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"],k=[x,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],E=[x,"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"],S="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",j=[x,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],v="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",b=[N,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],L=[N,"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"],U=[N,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],ve=[C,E,k,j,v,b,L,U],he=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,xe="str",Ie="kwd",Ee="com",Pe="typ",De="lit",ae="pun",O="pln",me="tag",re="dec",H="src",te="atn",W="atv",B="nocode",I="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(_){for(var ne=0,Ce=!1,Re=!1,Me=0,je=_.length;Me122||(A<65||se>90||nt.push([Math.max(65,se)|32,Math.min(A,90)|32]),A<97||se>122||nt.push([Math.max(97,se)&~32,Math.min(A,122)&~32]))}}nt.sort(function(Ae,ge){return Ae[0]-ge[0]||ge[1]-Ae[1]});for(var R=[],X=[],Ke=0;KeQ[0]&&(Q[1]+1>Q[0]&&Ue.push("-"),Ue.push(Je(Q[1])))}return Ue.push("]"),Ue.join("")}function yt(st){for(var Oe=st.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),nt=Oe.length,dt=[],Ue=0,Ke=0;Ue=2&&se==="["?Oe[Ue]=Ze(ue):se!=="\\"&&(Oe[Ue]=ue.replace(/[a-zA-Z]/g,function(X){var Q=X.charCodeAt(0);return"["+String.fromCharCode(Q&~32,Q|32)+"]"}))}return Oe.join("")}for(var gt=[],Me=0,je=_.length;Me=0;)Ce[gt.charAt(st)]=yt;var Oe=yt[1],nt=""+Oe;qe.hasOwnProperty(nt)||(Ye.push(Oe),qe[nt]=null)}Ye.push(/[\0-\uffff]/),Re=m(Ye)})();var Me=ne.length,je=function(He){for(var Ye=He.sourceCode,qe=He.basePos,Je=He.sourceNode,Ze=[qe,O],yt=0,gt=Ye.match(Re)||[],st={},Oe=0,nt=gt.length;Oe=5&&Ue.substring(0,5)==="lang-",ue&&!(Ke&&typeof Ke[1]=="string")&&(ue=!1,Ue=H),ue||(st[dt]=Ue)}var A=yt;if(yt+=dt.length,!ue)Ze.push(qe+A,Ue);else{var R=Ke[1],X=dt.indexOf(R),Q=X+R.length;Ke[2]&&(Q=dt.length-Ke[2].length,X=Q-R.length);var Ae=Ue.substring(5);M(Je,qe+A,dt.substring(0,X),je,Ze),M(Je,qe+A+X,R,Z(Ae,R),Ze),M(Je,qe+A+Q,dt.substring(Q),je,Ze)}}He.decorations=Ze};return je}function Be(_){var ne=[],Ce=[];_.tripleQuotedStrings?ne.push([xe,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_.multiLineStrings?ne.push([xe,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ne.push([xe,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_.verbatimStrings&&Ce.push([xe,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Re=_.hashComments;Re&&(_.cStyleComments?(Re>1?ne.push([Ee,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ne.push([Ee,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ce.push([xe,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ne.push([Ee,/^#[^\r\n]*/,null,"#"])),_.cStyleComments&&(Ce.push([Ee,/^\/\/[^\r\n]*/,null]),Ce.push([Ee,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Me=_.regexLiterals;if(Me){var je=Me>1?"":` \r`,He=je?".":"[\\S\\s]",Ye="/(?=[^/*"+je+"])(?:[^/\\x5B\\x5C"+je+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+je+"]|\\x5C"+He+")*(?:\\x5D|$))+/";Ce.push(["lang-regex",RegExp("^"+I+"("+Ye+")")])}var qe=_.types;qe&&Ce.push([Pe,qe]);var Je=(""+_.keywords).replace(/^ | $/g,"");Je.length&&Ce.push([Ie,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),ne.push([O,/^\s+/,null,` \r \xA0`]);var Ze="^.[^\\s\\w.$@'\"`/\\\\]*";return _.regexLiterals&&(Ze+="(?!s*/)"),Ce.push([De,/^@[a-z_$][a-z_$@0-9]*/i,null],[Pe,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[O,/^[a-z_$][a-z_$@0-9]*/i,null],[De,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[O,/^\\[\s\S]?/,null],[ae,new RegExp(Ze),null]),Le(ne,Ce)}var _e=Be({keywords:ve,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ne(_,ne,Ce){for(var Re=/(?:^|\s)nocode(?:\s|$)/,Me=/\r\n?|\n/,je=_.ownerDocument,He=je.createElement("li");_.firstChild;)He.appendChild(_.firstChild);var Ye=[He];function qe(Oe){var nt=Oe.nodeType;if(nt==1&&!Re.test(Oe.className))if(Oe.nodeName==="br")Je(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var dt=Oe.firstChild;dt;dt=dt.nextSibling)qe(dt);else if((nt==3||nt==4)&&Ce){var Ue=Oe.nodeValue,Ke=Ue.match(Me);if(Ke){var ue=Ue.substring(0,Ke.index);Oe.nodeValue=ue;var ie=Ue.substring(Ke.index+Ke[0].length);if(ie){var se=Oe.parentNode;se.insertBefore(je.createTextNode(ie),Oe.nextSibling)}Je(Oe),ue||Oe.parentNode.removeChild(Oe)}}}function Je(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function nt(Ke,ue){var ie=ue?Ke.cloneNode(!1):Ke,se=Ke.parentNode;if(se){var A=nt(se,1),R=Ke.nextSibling;A.appendChild(ie);for(var X=R;X;X=R)R=X.nextSibling,A.appendChild(X)}return ie}for(var dt=nt(Oe.nextSibling,0),Ue;(Ue=dt.parentNode)&&Ue.nodeType===1;)dt=Ue;Ye.push(dt)}for(var Ze=0;Ze=se&&(qe+=2),je>=A&&(yt+=2)}}finally{Ue&&(Ue.style.display=Ke)}}var Te={};function le(_,ne){for(var Ce=ne.length;--Ce>=0;){var Re=ne[Ce];Te.hasOwnProperty(Re)?$.console&&console.warn("cannot override language handler %s",Re):Te[Re]=_}}function Z(_,ne){return _&&Te.hasOwnProperty(_)||(_=/^\s*]*(?:>|$)/],[Ee,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ae,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),le(Le([[O,/^[\s]+/,null,` \r `],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[me,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[te,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ae,/^[=<>\/]+/],["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"]),le(Le([],[[W,/^[\s\S]+/]]),["uq.val"]),le(Be({keywords:C,hashComments:!0,cStyleComments:!0,types:he}),["c","cc","cpp","cxx","cyc","m"]),le(Be({keywords:"null,true,false"}),["json"]),le(Be({keywords:E,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:he}),["cs"]),le(Be({keywords:k,cStyleComments:!0}),["java"]),le(Be({keywords:U,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),le(Be({keywords:b,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),le(Be({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),le(Be({keywords:L,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),le(Be({keywords:j,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),le(Be({keywords:S,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),le(Le([],[[xe,/^[\s\S]+/]]),["regex"]);function T(_){var ne=_.langExtension;try{var Ce=d(_.sourceNode,_.pre),Re=Ce.sourceCode;_.sourceCode=Re,_.spans=Ce.spans,_.basePos=0,Z(ne,Re)(_),ke(_)}catch(Me){$.console&&console.log(Me&&Me.stack||Me)}}function K(_,ne,Ce){var Re=Ce||!1,Me=ne||null,je=document.createElement("div");je.innerHTML="
    "+_+"
    ",je=je.firstChild,Re&&Ne(je,Re,!0);var He={langExtension:Me,numberLines:Re,sourceNode:je,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return T(He),je.innerHTML}function F(_,ne){var Ce=ne||document.body,Re=Ce.ownerDocument||document;function Me(ie){return Ce.getElementsByTagName(ie)}for(var je=[Me("pre"),Me("code"),Me("xmp")],He=[],Ye=0;Ye=0){var U=b.split("!=");return $.create(U[0].trim(),this._deserializeValue(U[1],L))}if(b.indexOf("==")>=0){var U=b.split("==");return z.create(U[0].trim(),this._deserializeValue(U[1],L))}if(b.indexOf("=~")>=0){var U=b.split("=~");return P.create(U[0].trim(),this._deserializeRegexValue(U[1],L))}return/^\!\s*/.test(b)?N.create(b.substr(1).trim()):q.create(b)},v._deserializeValue=function(b,L){if(b=b.trim(),b==="true")return!0;if(b==="false")return!1;var U=/^'([^']*)'$/.exec(b);return U?U[1].trim():b},v._deserializeRegexValue=function(b,L){if(Object(Y.x)(b)){if(L)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var U=b.indexOf("/"),ve=b.lastIndexOf("/");if(U===ve||U<0){if(L)throw new Error("bad regexp-value '"+b+"', missing /-enclosure");return console.warn("bad regexp-value '"+b+"', missing /-enclosure"),null}var he=b.slice(U+1,ve),xe=b[ve+1]==="i"?"i":"";try{return new RegExp(he,xe)}catch(Ie){if(L)throw new Error("bad regexp-value '"+b+"', parse error: "+Ie);return console.warn("bad regexp-value '"+b+"', parse error: "+Ie),null}},v}();function fe(v,b){var L=v.getType(),U=b.getType();if(L!==U)return L-U;switch(L){case 1:return v.cmp(b);case 2:return v.cmp(b);case 3:return v.cmp(b);case 4:return v.cmp(b);case 6:return v.cmp(b);case 7:return v.cmp(b);case 5:return v.cmp(b);default:throw new Error("Unknown ContextKeyExpr!")}}var q=function(){function v(b){this.key=b}return v.create=function(b){return new v(b)},v.prototype.getType=function(){return 1},v.prototype.cmp=function(b){return this.keyb.key?1:0},v.prototype.equals=function(b){return b instanceof v?this.key===b.key:!1},v.prototype.evaluate=function(b){return!!b.getValue(this.key)},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return N.create(this.key)},v}(),z=function(){function v(b,L){this.key=b,this.value=L}return v.create=function(b,L){return typeof L=="boolean"?L?q.create(b):N.create(b):new v(b,L)},v.prototype.getType=function(){return 3},v.prototype.cmp=function(b){return this.keyb.key?1:this.valueb.value?1:0},v.prototype.equals=function(b){return b instanceof v?this.key===b.key&&this.value===b.value:!1},v.prototype.evaluate=function(b){return b.getValue(this.key)==this.value},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return $.create(this.key,this.value)},v}(),$=function(){function v(b,L){this.key=b,this.value=L}return v.create=function(b,L){return typeof L=="boolean"?L?N.create(b):q.create(b):new v(b,L)},v.prototype.getType=function(){return 4},v.prototype.cmp=function(b){return this.keyb.key?1:this.valueb.value?1:0},v.prototype.equals=function(b){return b instanceof v?this.key===b.key&&this.value===b.value:!1},v.prototype.evaluate=function(b){return b.getValue(this.key)!=this.value},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return z.create(this.key,this.value)},v}(),N=function(){function v(b){this.key=b}return v.create=function(b){return new v(b)},v.prototype.getType=function(){return 2},v.prototype.cmp=function(b){return this.keyb.key?1:0},v.prototype.equals=function(b){return b instanceof v?this.key===b.key:!1},v.prototype.evaluate=function(b){return!b.getValue(this.key)},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return q.create(this.key)},v}(),P=function(){function v(b,L){this.key=b,this.regexp=L}return v.create=function(b,L){return new v(b,L)},v.prototype.getType=function(){return 6},v.prototype.cmp=function(b){if(this.keyb.key)return 1;var L=this.regexp?this.regexp.source:"",U=b.regexp?b.regexp.source:"";return LU?1:0},v.prototype.equals=function(b){if(b instanceof v){var L=this.regexp?this.regexp.source:"",U=b.regexp?b.regexp.source:"";return this.key===b.key&&L===U}return!1},v.prototype.evaluate=function(b){var L=b.getValue(this.key);return this.regexp?this.regexp.test(L):!1},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return x.create(this)},v}(),x=function(){function v(b){this._actual=b}return v.create=function(b){return new v(b)},v.prototype.getType=function(){return 7},v.prototype.cmp=function(b){return this._actual.cmp(b._actual)},v.prototype.equals=function(b){return b instanceof v?this._actual.equals(b._actual):!1},v.prototype.evaluate=function(b){return!this._actual.evaluate(b)},v.prototype.keys=function(){return this._actual.keys()},v.prototype.negate=function(){return this._actual},v}(),C=function(){function v(b){this.expr=b}return v.create=function(b){var L=v._normalizeArr(b);return L.length===0?void 0:L.length===1?L[0]:new v(L)},v.prototype.getType=function(){return 5},v.prototype.cmp=function(b){if(this.expr.lengthb.expr.length)return 1;for(var L=0,U=this.expr.length;L1;){for(var xe=b.shift(),Ie=b.shift(),Ee=[],Pe=0,De=he(xe);Pe=15&&(C=!1,N=!0);var xe=L&&(P||C&&(he==null||he<12.11)),Ie=ce||z&&$>=9;function Ee(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Pe=function(e,t){var i=e.className,n=Ee(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 De(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ae(e,t){return De(e).appendChild(t)}function O(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s=t)return l+(t-s);l+=p-s,l+=i-l%i,s=p+1}}var V=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var le=[""];function Z(e){for(;le.length<=e;)le.push(T(le)+" ");return le[e]}function T(e){return e[e.length-1]}function K(e,t){for(var i=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||_.test(e))}function Ce(e,t){return t?t.source.indexOf("\\w")>-1&&ne(e)?!0:t.test(e):ne(e)}function Re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Me=/[\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 je(e){return e.charCodeAt(0)>=768&&Me.test(e)}function He(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function qe(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;st||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var Je=null;function Ze(e,t,i){var n;Je=null;for(var r=0;rt)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:Je=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:Je=r)}return n!=null?n:Je}var yt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(w){return w<=247?e.charAt(w):1424<=w&&w<=1524?"R":1536<=w&&w<=1785?t.charAt(w-1536):1774<=w&&w<=2220?"r":8192<=w&&w<=8203?"w":w==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,p=/[1n]/;function g(w,G,J){this.level=w,this.from=G,this.to=J}return function(w,G){var J=G=="ltr"?"L":"R";if(w.length==0||G=="ltr"&&!n.test(w))return!1;for(var we=w.length,ye=[],Fe=0;Fe-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Ue(e,t){var i=nt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r0}function se(e){e.prototype.on=function(t,i){Oe(this,t,i)},e.prototype.off=function(t,i){dt(this,t,i)}}function A(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function R(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function X(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Q(e){A(e),R(e)}function Ae(e){return e.target||e.srcElement}function ge(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),L&&e.ctrlKey&&t==1&&(t=3),t}var Ve=function(){if(z&&$<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}(),it;function ft(e){if(it==null){var t=O("span","\u200B");ae(e,O("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(it=t.offsetWidth<=1&&t.offsetHeight>2&&!(z&&$<8))}var i=it?O("span","\u200B"):O("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var lt;function Lt(e){if(lt!=null)return lt;var t=ae(e,document.createTextNode("A\u062EA")),i=re(t,0,1).getBoundingClientRect(),n=re(t,1,2).getBoundingClientRect();return De(e),!i||i.left==i.right?!1:lt=n.right-i.right<3}var At=` 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/)},pt=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},$t=function(){var e=O("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jt=null;function Jt(e){if(jt!=null)return jt;var t=ae(e,O("span","x")),i=t.getBoundingClientRect(),n=re(t,0,1).getBoundingClientRect();return jt=Math.abs(i.left-n.left)>1}var Wt={},Mt={};function Un(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wt[e]=t}function Qn(e,t){Mt[e]=t}function bt(e){if(typeof e=="string"&&Mt.hasOwnProperty(e))e=Mt[e];else if(e&&typeof e.name=="string"&&Mt.hasOwnProperty(e.name)){var t=Mt[e.name];typeof t=="string"&&(t={name:t}),e=D(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wt(e,t){t=bt(t);var i=Wt[t.name];if(!i)return wt(e,"text/plain");var n=i(e,t);if(rt.hasOwnProperty(t.name)){var r=rt[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 rt={};function xt(e,t){var i=rt.hasOwnProperty(e)?rt[e]:rt[e]={};d(t,i)}function Zt(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 rn(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 nn(e,t,i){return e.startState?e.startState(t,i):!0}var Rt=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};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.post},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function mt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t=e.first&&ti?We(i,mt(e,i).text.length):a(t,mt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?We(e.line,t):i<0?We(e.line,0):e}function u(e,t){for(var i=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},h.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof f?new h(e,Zt(e.mode,t.state),i,t.lookAhead):new h(e,Zt(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new f(t,this.maxLookAhead):t};function ee(e,t,i,n){var r=[e.state.modeGen],s={};Kn(e,t.text,e.doc.mode,i,function(w,G){return r.push(w,G)},s,n);for(var l=i.state,p=function(w){i.baseTokens=r;var G=e.state.overlays[w],J=1,we=0;i.state=!0,Kn(e,t.text,G.mode,i,function(ye,Fe){for(var Xe=J;weye&&r.splice(J,1,ye,r[J+1],$e),J+=2,we=Math.min(ye,$e)}if(!Fe)return;if(G.opaque)r.splice(Xe,J-Xe,ye,"overlay "+Fe),J=Xe+2;else for(;Xee.options.maxHighlightLength&&Zt(e.doc.mode,n.state),s=ee(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 Qe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=mn(e,t,i),l=s>n.first&&mt(n,s-1).stateAfter,p=l?h.fromSaved(n,l,s):new h(n,nn(n.mode),s);return n.iter(s,t,function(g){ut(e,g.text,p);var w=p.line;g.stateAfter=w==t-1||w%5==0||w>=r.viewFrom&&wt.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Nt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function en(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var p=mt(r,t.line),g=Qe(e,t.line,i),w=new Rt(p.text,e.options.tabSize,g),G;for(n&&(G=[]);(n||w.pose.options.maxHighlightLength?(p=!1,l&&ut(e,t,n,G.pos),G.pos=t.length,J=null):J=Xn(kt(i,G,n.state,we),s),we){var ye=we[0].name;ye&&(J="m-"+(J?ye+" "+J:ye))}if(!p||w!=J){for(;gl;--p){if(p<=s.first)return s.first;var g=mt(s,p-1),w=g.stateAfter;if(w&&(!i||p+(w instanceof f?w.lookAhead:0)<=s.modeFrontier))return p;var G=M(g.text,null,e.options.tabSize);(r==null||n>G)&&(r=p-1,n=G)}return r}function qn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;n--){var r=mt(e,n).stateAfter;if(r&&(!(r instanceof f)||n+r.lookAhead=t:s.to>t);(n||(n=[])).push(new bi(l,s.from,g?null:s.to))}}return n}function Gi(e,t,i){var n;if(e)for(var r=0;r=t:s.to>t);if(p||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from0&&p)for(var ct=0;ct0)continue;var G=[g,1],J=ot(w.from,p.from),we=ot(w.to,p.to);(J<0||!l.inclusiveLeft&&!J)&&G.push({from:w.from,to:p.from}),(we>0||!l.inclusiveRight&&!we)&&G.push({from:p.to,to:w.to}),r.splice.apply(r,G),g+=G.length-3}return r}function Oi(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!n||wn(n,s.marker)<0)&&(n=s.marker)}return n}function un(e,t,i,n,r){var s=mt(e,t),l=Dn&&s.markedSpans;if(l)for(var p=0;p=0&&J<=0||G<=0&&J>=0)continue;if(G<=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?ot(w.to,i)>=0:ot(w.to,i)>0)||G>=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?ot(w.from,n)<=0:ot(w.from,n)<0))return!0}}function _n(e){for(var t;t=hn(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Vt(e);)e=t.find(1,!0).line;return e}function Xi(e){for(var t,i;t=Vt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function xi(e,t){var i=mt(e,t),n=_n(i);return i==n?t:Ot(n)}function Br(e,t){if(t>e.lastLine())return t;var i=mt(e,t),n;if(!Wn(e,i))return t;for(;n=Vt(i);)i=n.find(1,!0).line;return Ot(i)+1}function Wn(e,t){var i=Dn&&t.markedSpans;if(i)for(var n=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Di=function(e,t,i){this.text=e,dr(this,t),this.height=i?i(this):1};Di.prototype.lineNo=function(){return Ot(this)},se(Di);function Jo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Oi(e),dr(e,i);var r=n?n(e):1;r!=e.height&&kn(e,r)}function co(e){e.parent=null,Oi(e)}var vt={},Tt={};function Et(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Tt:vt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Pt(e,t){var i=me("span",null,null,N?"padding-right: .1px":null),n={pre:me("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=Yt,Lt(e.display.measure)&&(l=gt(s,e.doc.direction))&&(n.addToken=dn(n.addToken,l)),n.map=[];var p=t!=e.display.externalMeasured&&Ot(s);It(s,n,ze(e,s,p)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=B(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=B(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(ft(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(N){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ue(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=B(n.pre.className,n.textClass||"")),n}function Ht(e){var t=O("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yt(e,t,i,n,r,s,l){if(!t)return;var p=e.splitSpaces?Ft(t,e.trailingSpace):t,g=e.cm.state.specialChars,w=!1,G;if(!g.test(t))e.col+=t.length,G=document.createTextNode(p),e.map.push(e.pos,e.pos+t.length,G),z&&$<9&&(w=!0),e.pos+=t.length;else{G=document.createDocumentFragment();for(var J=0;;){g.lastIndex=J;var we=g.exec(t),ye=we?we.index-J:t.length-J;if(ye){var Fe=document.createTextNode(p.slice(J,J+ye));z&&$<9?G.appendChild(O("span",[Fe])):G.appendChild(Fe),e.map.push(e.pos,e.pos+ye,Fe),e.col+=ye,e.pos+=ye}if(!we)break;J+=ye+1;var Xe=void 0;if(we[0]==" "){var $e=e.cm.options.tabSize,et=$e-e.col%$e;Xe=G.appendChild(O("span",Z(et),"cm-tab")),Xe.setAttribute("role","presentation"),Xe.setAttribute("cm-text"," "),e.col+=et}else we[0]=="\r"||we[0]==` `?(Xe=G.appendChild(O("span",we[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Xe.setAttribute("cm-text",we[0]),e.col+=1):(Xe=e.cm.options.specialCharPlaceholder(we[0]),Xe.setAttribute("cm-text",we[0]),z&&$<9?G.appendChild(O("span",[Xe])):G.appendChild(Xe),e.col+=1);e.map.push(e.pos,e.pos+1,Xe),e.pos++}}if(e.trailingSpace=p.charCodeAt(t.length-1)==32,i||n||r||w||s||l){var at=i||"";n&&(at+=n),r&&(at+=r);var tt=O("span",[G],at,s);if(l)for(var ct in l)l.hasOwnProperty(ct)&&ct!="style"&&ct!="class"&&tt.setAttribute(ct,l[ct]);return e.content.appendChild(tt)}e.content.appendChild(G)}function Ft(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;rw&&J.from<=w);we++);if(J.to>=G)return e(i,n,r,s,l,p,g);e(i,n.slice(0,J.to-w),r,s,null,p,g),s=null,n=n.slice(J.to-w),w=J.to}}}function Pn(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 It(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;lg||Dt.collapsed&&Ct.to==g&&Ct.from==g)){if(Ct.to!=null&&Ct.to!=g&&ye>Ct.to&&(ye=Ct.to,Xe=""),Dt.className&&(Fe+=" "+Dt.className),Dt.css&&(we=(we?we+";":"")+Dt.css),Dt.startStyle&&Ct.from==g&&($e+=" "+Dt.startStyle),Dt.endStyle&&Ct.to==ye&&(ct||(ct=[])).push(Dt.endStyle,Ct.to),Dt.title&&((at||(at={})).title=Dt.title),Dt.attributes)for(var tn in Dt.attributes)(at||(at={}))[tn]=Dt.attributes[tn];Dt.collapsed&&(!et||wn(et.marker,Dt)<0)&&(et=Ct)}else Ct.from>g&&ye>Ct.from&&(ye=Ct.from)}if(ct)for(var xn=0;xn=p)break;for(var Gn=Math.min(p,ye);;){if(G){var jn=g+G.length;if(!et){var fn=jn>Gn?G.slice(0,Gn-g):G;t.addToken(t,fn,J?J+Fe:Fe,$e,g+fn.length==ye?Xe:"",we,at)}if(jn>=Gn){G=G.slice(Gn-g),g=Gn;break}g=jn,$e=""}G=r.slice(s,s=i[w++]),J=Et(i[w++],t.cm.options)}}}function Ci(e,t,i){this.line=t,this.rest=Xi(t),this.size=this.rest?Ot(T(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Wn(e,t)}function zt(e,t,i){for(var n=[],r,s=t;s2&&s.push((g.bottom+w.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ia(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;ni)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Bs(e,t){t=_n(t);var i=Ot(t),n=e.display.externalMeasured=new Ci(e.doc,t,i);n.lineN=i;var r=n.built=Pt(e,n);return n.text=r.pre,ae(e.display.lineMeasure,r.pre),n}function ra(e,t,i,n){return fi(e,Yi(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(s=g-p,r=s-1,t>=g&&(l="right")),r!=null){if(n=e[w+2],p==g&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;w&&e[w-2]==e[w-3]&&e[w-1].insertLeft;)n=e[(w-=3)+2],l="left";if(i=="right"&&r==g-p)for(;w=0&&!((i=e[r]).left!=i.right);r--);return i}function Hs(e,t,i,n){var r=aa(t.map,i,n),s=r.node,l=r.start,p=r.end,g=r.collapse,w;if(s.nodeType==3){for(var G=0;G<4;G++){for(;l&&je(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+p0&&(g=n="right");var J;e.options.lineWrapping&&(J=s.getClientRects()).length>1?w=J[n=="right"?J.length-1:0]:w=s.getBoundingClientRect()}if(z&&$<9&&!l&&(!w||!w.left&&!w.right)){var we=s.parentNode.getClientRects()[0];we?w={left:we.left,right:we.left+Ji(e.display),top:we.top,bottom:we.bottom}:w=oa}for(var ye=w.top-t.rect.top,Fe=w.bottom-t.rect.top,Xe=(ye+Fe)/2,$e=t.view.measure.heights,et=0;et<$e.length-1&&!(Xe<$e[et]);et++);var at=et?$e[et-1]:0,tt=$e[et],ct={left:(g=="right"?w.right:w.left)-t.rect.left,right:(g=="left"?w.left:w.right)-t.rect.left,top:at,bottom:tt};return!w.left&&!w.right&&(ct.bogus=!0),e.options.singleCursorHeightPerLine||(ct.rtop=ye,ct.rbottom=Fe),ct}function Ws(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function sa(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(g=n.text.length,w="before"):g<=0&&(g=0,w="after"),!p)return l(w=="before"?g-1:g,w=="before");function G(Fe,Xe,$e){var et=p[Xe],at=et.level==1;return l($e?Fe-1:Fe,at!=$e)}var J=Ze(p,g,w),we=Je,ye=G(g,J,w=="before");return we!=null&&(ye.other=G(g,we,w!="before")),ye}function da(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Ji(e.display)*t.ch);var n=mt(e.doc,t.line),r=ai(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function yo(e,t,i,n,r){var s=We(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function bo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return yo(n.first,0,null,-1,-1);var r=Ln(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,mt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=mt(n,r);;){var p=zs(e,l,r,t,i),g=hi(l,p.ch+(p.xRel>0||p.outside>0?1:0));if(!g)return p;var w=g.find(1);if(w.line==r)return w;l=mt(n,r=w.line)}}function fa(e,t,i,n){n-=go(t);var r=t.text.length,s=Ye(function(l){return fi(e,i,l-1).bottom<=n},r,0);return r=Ye(function(l){return fi(e,i,l).top>n},s,r),{begin:s,end:r}}function pa(e,t,i,n){i||(i=Yi(e,t));var r=zr(e,t,fi(e,i,n),"line").top;return fa(e,t,i,r)}function xo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=ai(t);var s=Yi(e,t),l=go(t),p=0,g=t.text.length,w=!0,G=gt(t,e.doc.direction);if(G){var J=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,G,n,r);w=J.level!=1,p=w?J.from:J.to-1,g=w?J.to:J.from-1}var we=null,ye=null,Fe=Ye(function(St){var Ct=fi(e,s,St);return Ct.top+=l,Ct.bottom+=l,xo(Ct,n,r,!1)?(Ct.top<=r&&Ct.left<=n&&(we=St,ye=Ct),!0):!1},p,g),Xe,$e,et=!1;if(ye){var at=n-ye.left=ct.bottom?1:0}return Fe=He(t.text,Fe,1),yo(i,Fe,$e,et,n-Xe)}function Gs(e,t,i,n,r,s,l){var p=Ye(function(J){var we=r[J],ye=we.level!=1;return xo(si(e,We(i,ye?we.to:we.from,ye?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),g=r[p];if(p>0){var w=g.level!=1,G=si(e,We(i,w?g.from:g.to,w?"after":"before"),"line",t,n);xo(G,s,l,!0)&&G.top>l&&(g=r[p-1])}return g}function Vs(e,t,i,n,r,s,l){var p=fa(e,t,n,l),g=p.begin,w=p.end;/\s/.test(t.text.charAt(w-1))&&w--;for(var G=null,J=null,we=0;we=w||ye.to<=g)continue;var Fe=ye.level!=1,Xe=fi(e,n,Fe?Math.min(w,ye.to)-1:Math.max(g,ye.from)).right,$e=Xe$e)&&(G=ye,J=$e)}return G||(G=r[r.length-1]),G.fromw&&(G={from:G.from,to:w,level:G.level}),G}var Pi;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(O("br"));Pi.appendChild(document.createTextNode("x"))}ae(e.measure,Pi);var i=Pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),De(e.measure),i||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),i=O("pre",[t],"CodeMirror-line-like");ae(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var p=e.display.gutterSpecs[l].className;i[p]=s.offsetLeft+s.clientLeft+r,n[p]=s.clientWidth}return{fixedPos:wo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function wo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=$i(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return function(r){if(Wn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l0&&(w=mt(e.doc,g.line).text).length==g.ch){var G=M(w,w.length,e.options.tabSize)-w.length;g=We(g.line,Math.max(0,Math.round((s-na(e.display).left)/Ji(e.display))-G))}return g}function Ii(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;nt)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Dn&&xi(e.doc,t)r.viewFrom?Ei(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ei(e);else if(t<=r.viewFrom){var s=Gr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ei(e)}else if(i>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ei(e)}else{var p=Gr(e,t,t,-1),g=Gr(e,i,i+n,1);p&&g?(r.view=r.view.slice(0,p.index).concat(zt(e,p.lineN,g.lineN)).concat(r.view.slice(g.index)),r.viewTo+=n):Ei(e)}var w=r.externalMeasured;w&&(i=r.lineN&&t=n.viewTo)return;var s=n.view[Ii(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);oe(l,i)==-1&&l.push(i)}function Ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,i,n){var r=Ii(e,t),s,l=e.display.view;if(!Dn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var p=e.display.viewFrom,g=0;g0){if(r==l.length-1)return null;s=p+l[r].size-t,r++}else s=p-t;t+=s,i+=s}for(;xi(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=zt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=zt(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Ii(e,i)))),n.viewTo=i}function ga(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||p.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Zi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zi(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),N&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function Zi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,Pe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Xr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n.005||G<-.005)&&(kn(r.line,l),Ca(r.line),r.rest))for(var J=0;Je.display.sizerWidth){var we=Math.ceil(p/Ji(e.display));we>e.display.maxLineLength&&(e.display.maxLineLength=we,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(e){if(e.widgets)for(var t=0;t=l&&(s=Ln(t,ai(mt(t,g))-e.wrapper.clientHeight),l=g)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(Ke(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&&!S){var s=O("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-Wr(e.display))+`px; height: `+(t.bottom-t.top+di(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,p=si(e,t),g=!i||i==t?p:si(e,i);r={left:Math.min(p.left,g.left),top:Math.min(p.top,g.top)-n,right:Math.max(p.left,g.left),bottom:Math.max(p.bottom,g.bottom)+n};var w=Ao(e,r),G=e.doc.scrollTop,J=e.doc.scrollLeft;if(w.scrollTop!=null&&(xr(e,w.scrollTop),Math.abs(e.doc.scrollTop-G)>1&&(l=!0)),w.scrollLeft!=null&&(ji(e,w.scrollLeft),Math.abs(e.doc.scrollLeft-J)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=Ao(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&ji(e,i.scrollLeft)}function Ao(e,t){var i=e.display,n=$i(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var p=e.doc.height+fo(i),g=t.topp-n;if(t.topr+s){var G=Math.min(t.top,(w?p:t.bottom)-s);G!=r&&(l.scrollTop=G)}var J=e.options.fixedGutter?0:i.gutters.offsetWidth,we=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-J,ye=_i(e)-i.gutters.offsetWidth,Fe=t.right-t.left>ye;return Fe&&(t.right=t.left+ye),t.left<10?l.scrollLeft=0:t.leftye+we-3&&(l.scrollLeft=t.right+(Fe?0:10)-ye),l}function To(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=da(e,t.from),n=da(e,t.to);wa(e,i,n,t.margin)}}function wa(e,t,i,n){var r=Ao(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ce||Ro(e,{top:t}),Ea(e,t,!0),ce&&Ro(e),Er(e,100)}function Ea(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ji(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,La(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+fo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+di(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Fi=function(e,t,i){this.cm=i;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Oe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Oe(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&$<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fi.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}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.prototype.zeroWidthHack=function(){var e=L&&!E?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},Fi.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)},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function qi(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Xr(e),Sa(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ka={native:Fi,null:wr};function Aa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Pe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ji(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Bi(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},ei(e.curOp)}function Ui(e){var t=e.curOp;t&&Hr(t,function(i){for(var n=0;n=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Lo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Xr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+di(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-_i(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Qe(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,p=s.text.length>e.options.maxHighlightLength?Zt(t.mode,n.state):null,g=ee(e,s,n,!0);p&&(n.state=p),s.styles=g.styles;var w=s.styleClasses,G=g.classes;G?s.styleClasses=G:w&&(s.styleClasses=null);for(var J=!l||l.length!=s.styles.length||w!=G&&(!w||!G||w.bgClass!=G.bgClass||w.textClass!=G.textClass),we=0;!J&&wei)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&zn(e,function(){for(var s=0;s=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&ga(e)==0)return!1;Ra(e)&&(Ei(e),t.dims=Co(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFroml&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),Dn&&(s=xi(e.doc,s),l=Br(e.doc,l));var p=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=ai(mt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=ga(e);if(!p&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var w=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(w),De(i.cursorDiv),De(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,p&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function Ta(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==_i(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+fo(e.display)-po(e),i.top)}),t.visible=Kr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Kr(e.display,e.doc,i));if(!Lo(e,t))break;Xr(e);var r=Cr(e);yr(e),qi(e,r),Oo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ro(e,t){var i=new $r(e,t);if(Lo(e,i)){Xr(e),Ta(e,i);var n=Cr(e);yr(e),qi(e,n),Oo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function p(Fe){var Xe=Fe.nextSibling;return N&&L&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Xe}for(var g=n.view,w=n.viewFrom,G=0;G-1&&(ye=!1),Zo(e,J,w,i)),ye&&(De(J.lineNumber),J.lineNumber.appendChild(document.createTextNode(ii(e.options,w)))),l=J.node.nextSibling}w+=J.size}for(;l;)l=p(l)}function Mo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+di(e)+"px"}function La(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=wo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;ll.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&p||r&&g))return;if(r&&L&&N){e:for(var w=t.target,G=s.view;w!=l;w=w.parentNode)for(var J=0;J=0&&ot(e,n.to())<=0)return i}return-1};var Xt=function(e,t){this.anchor=e,this.head=t};Xt.prototype.from=function(){return qt(this.anchor,this.head)},Xt.prototype.to=function(){return Kt(this.anchor,this.head)},Xt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function li(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(we,ye){return ot(we.from(),ye.from())}),i=oe(t,r);for(var s=1;s0:g>=0){var w=qt(p.from(),l.from()),G=Kt(p.to(),l.to()),J=p.empty()?l.from()==l.head:p.from()==p.head;s<=i&&--i,t.splice(--s,2,new Xt(J?G:w,J?w:G))}}return new Zn(t,i)}function Si(e,t){return new Zn([new Xt(e,t||e)],0)}function ki(e){return e.text?We(e.from.line+e.text.length-1,T(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function _a(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return ki(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+=ki(t).ch-t.to.ch),We(i,n)}function _o(e,t){for(var i=[],n=0;n1&&e.remove(p.line+1,Fe-1),e.insert(p.line+1,et)}En(e,"change",e,t)}function Ai(e,t,i){function n(r,s,l){if(r.linked)for(var p=0;p1&&!e.done[e.done.length-2].ranges)return e.done.pop(),T(e.done)}function Ba(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,p;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))p=T(l.changes),ot(t.from,t.to)==0&&ot(t.from,p.to)==0?p.to=ki(t):l.changes.push(Io(e,t));else{var g=T(r.done);for((!g||!g.ranges)&&Qr(e.sel,r.done),l={changes:[Io(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,p||Ue(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,T(r.done),t))?r.done[r.done.length-1]=t:Qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Fa(r.undone)}function Qr(e,t){var i=T(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ua(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i-1&&(T(p)[J]=w[J],delete w[J]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=ot(t,r)<0;s!=ot(i,r)<0?(r=t,t=i):s!=ot(t,i)<0&&(t=i)}return new Xt(r,t)}else return new Xt(i||t,t)}function qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),An(e,new Zn([jo(e.sel.primary(),t,i,r)],0),n)}function Wa(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s=t.ch:p.to>t.ch))){if(r&&(Ue(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var J=g.find(n<0?1:-1),we=void 0;if((n<0?G:w)&&(J=Ya(e,J,-n,J&&J.line==t.line?s:null)),J&&J.line==t.line&&(we=ot(J,i))&&(n<0?we<0:we>0))return tr(e,J,t,n,r)}var ye=g.find(n<0?-1:1);return(n<0?w:G)&&(ye=Ya(e,ye,n,ye.line==t.line?s:null)),ye?tr(e,ye,t,n,r):null}}return t}function to(e,t,i,n,r){var s=n||1,l=tr(e,t,i,s,r)||!r&&tr(e,t,i,s,!0)||tr(e,t,i,-s,r)||!r&&tr(e,t,i,-s,!0);return l||(e.cantEdit=!0,We(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,We(t.line-1)):null:i>0&&t.ch==(n||mt(e,t.line)).text.length?t.line=0;--r)Za(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Za(e,t)}function Za(e,t){if(t.text.length==1&&t.text[0]==""&&ot(t.from,t.to)==0)return;var i=_o(e,t);Ba(e,t,i,e.cm?e.cm.curOp.id:NaN),Ar(e,t,i,oi(e,t));var n=[];Ai(e,function(r,s){!s&&oe(n,r.history)==-1&&(ts(r.history,t),n.push(r.history)),Ar(r,t,null,oi(r,t))})}function no(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,p=t=="undo"?r.done:r.undone,g=t=="undo"?r.undone:r.done,w=0;w=0;--ye){var Fe=we(ye);if(Fe)return Fe.v}}function Qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Zn(K(e.sel.ranges,function(r){return new Xt(We(r.anchor.line+t,r.anchor.ch),We(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Nn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())return;if(t.from.lines&&(t={from:t.from,to:We(s,mt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=On(e,t.from,t.to),i||(i=_o(e,t)),e.cm?xl(e.cm,t,n):No(e,t,n),eo(e,i,_e),e.cantEdit&&to(e,We(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,p=!1,g=s.line;e.options.lineWrapping||(g=Ot(_n(mt(n,s.line))),n.iter(g,l.line+1,function(ye){if(ye==r.maxLine)return p=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ue(e),No(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(ye){var Fe=Ki(ye);Fe>r.maxLineLength&&(r.maxLine=ye,r.maxLineLength=Fe,r.maxLineChanged=!0,p=!1)}),p&&(e.curOp.updateMaxLine=!0)),qn(n,s.line),Er(e,400);var w=t.text.length-(l.line-s.line)-1;t.full?Nn(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?wi(e,s.line,"text"):Nn(e,s.line,l.line+1,w);var G=ie(e,"changes"),J=ie(e,"change");if(J||G){var we={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};J&&En(e,"change",e,we),G&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(we)}e.display.selForContextMenu=null}function ir(e,t,i,n,r){var s;n||(n=i),ot(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:r})}function qa(e,t,i,n){i1||!(this.children[0]instanceof Lr))){var p=[];this.collapse(p),this.children=[new Lr(p)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=r.lines.length%25+25,p=l;p10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=w,e.display.maxLineLength=G,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Nn(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&&En(e,"markerCleared",e,this,n,r),t&&Ui(e),this.parent&&this.parent.clear()},Ti.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=me("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(un(e,t.line,t,i,s)||t.line!=i.line&&un(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Hn()}s.addToHistory&&Ba(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var p=t.line,g=e.cm,w;if(e.iter(p,i.line+1,function(J){g&&s.collapsed&&!g.options.lineWrapping&&_n(J)==g.display.maxLine&&(w=!0),s.collapsed&&p!=t.line&&kn(J,0),ci(J,new bi(s,p==t.line?t.ch:null,p==i.line?i.ch:null)),++p}),s.collapsed&&e.iter(t.line,i.line+1,function(J){Wn(e,J)&&kn(J,0)}),s.clearOnEnter&&Oe(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++is,s.atomic=!0),g){if(w&&(g.curOp.updateMaxLine=!0),s.collapsed)Nn(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var G=t.line;G<=i.line;G++)wi(g,G,"text");s.atomic&&Xa(g.doc),En(g,"markerAdded",g,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;g--)nr(this,n[g]);p?Ga(this,p):this.cm&&Qi(this.cm)}),undo:bn(function(){no(this,"undo")}),redo:bn(function(){no(this,"redo")}),undoSelection:bn(function(){no(this,"undo",!0)}),redoSelection:bn(function(){no(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var p=0;p=g.to||g.from==null&&r!=e.line||g.from!=null&&r==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=s,++i}),o(this,We(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var G=e.dataTransfer.getData("Text");if(G){var J;if(t.state.draggingText&&!t.state.draggingText.copy&&(J=t.listSelections()),eo(t.doc,Si(i,i)),J)for(var we=0;we=0;p--)ir(e.doc,"",n[p].from,n[p].to,"+delete");Qi(e)})}function Bo(e,t,i){var n=He(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Uo(e,t,i){var n=Bo(e,t.ch,i);return n==null?null:new We(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=gt(i,t.doc.direction);if(s){var l=r<0?T(s):s[0],p=r<0==(l.level==1),g=p?"after":"before",w;if(l.level>0||t.doc.direction=="rtl"){var G=Yi(t,i);w=r<0?i.text.length-1:0;var J=fi(t,G,w).top;w=Ye(function(we){return fi(t,G,we).top==J},r<0==(l.level==1)?l.from:l.to-1,w),g=="before"&&(w=Bo(i,w,1))}else w=r<0?l.to:l.from;return new We(n,w,g)}}return new We(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=gt(t,e.doc.direction);if(!r)return Uo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=Ze(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from=l.from&&we>=G.begin)){var ye=J?"before":"after";return new We(i.line,we,ye)}}var Fe=function(et,at,tt){for(var ct=function(tn,xn){return xn?new We(i.line,p(tn,1),"before"):new We(i.line,tn,"after")};et>=0&&et0==(St.level!=1),Dt=Ct?tt.begin:p(tt.end,-1);if(St.from<=Dt&&Dt0?G.end:p(G.begin,-1);return $e!=null&&!(n>0&&$e==t.text.length)&&(Xe=Fe(n>0?0:r.length-1,n,w($e)),Xe)?Xe:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),_e)},killLine:function(e){return ar(e,function(t){if(t.empty()){var i=mt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)r=new We(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),We(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=mt(e.doc,r.line-1).text;l&&(r=new We(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),We(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Xt(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return zn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;ne&&ot(t,this.pos)==0&&i==this.button};var Ir,jr;function Hl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new zo(i,e,t),Ir=null,"double"):(Ir=new zo(i,e,t),jr=null,"single")}function bs(e){var t=this,i=t.display;if(Ke(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,gi(i,e)){N||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Go(t,e))return;var n=Ni(t,e),r=ge(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?Gl(t,n,s,e):Ae(e)==i.scroller&&A(e):r==2?(n&&qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ie?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,Nr(e,cs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),p=l(e,i)!=Be}finally{e.state.suppressEdits=!1}return p})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=U?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=L?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(L?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){z?setTimeout(m(ba,e),0):e.curOp.focus=te();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ve&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(ot((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(ot(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=yn(e,function(w){N&&(r.scroller.draggable=!1),e.state.draggingText=!1,dt(r.wrapper.ownerDocument,"mouseup",l),dt(r.wrapper.ownerDocument,"mousemove",p),dt(r.scroller,"dragstart",g),dt(r.scroller,"drop",l),s||(A(w),n.addNew||qr(e.doc,i,null,null,n.extend),N&&!k||z&&$==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),p=function(w){s=s||Math.abs(t.clientX-w.clientX)+Math.abs(t.clientY-w.clientY)>=10},g=function(){return s=!0};N&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Oe(r.wrapper.ownerDocument,"mouseup",l),Oe(r.wrapper.ownerDocument,"mousemove",p),Oe(r.scroller,"dragstart",g),Oe(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Xt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Xt(We(t.line,0),o(e.doc,We(t.line+1,0)));var n=i(e,t);return new Xt(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;A(t);var l,p,g=s.sel,w=g.ranges;if(n.addNew&&!n.extend?(p=s.sel.contains(i),p>-1?l=w[p]:l=new Xt(i,i)):(l=s.sel.primary(),p=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Xt(i,i)),i=Ni(e,t,!0,!0),p=-1;else{var G=xs(e,i,n.unit);n.extend?l=jo(l,G.anchor,G.head,n.extend):l=G}n.addNew?p==-1?(p=w.length,An(s,li(e,w.concat([l]),p),{scroll:!1,origin:"*mouse"})):w.length>1&&w[p].empty()&&n.unit=="char"&&!n.extend?(An(s,li(e,w.slice(0,p).concat(w.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):Fo(s,p,l,Ne):(p=0,An(s,new Zn([l],0),Ne),g=s.sel);var J=i;function we(tt){if(ot(J,tt)==0)return;if(J=tt,n.unit=="rectangle"){for(var ct=[],St=e.options.tabSize,Ct=M(mt(s,i.line).text,i.ch,St),Dt=M(mt(s,tt.line).text,tt.ch,St),tn=Math.min(Ct,Dt),xn=Math.max(Ct,Dt),an=Math.min(i.line,tt.line),Gn=Math.min(e.lastLine(),Math.max(i.line,tt.line));an<=Gn;an++){var jn=mt(s,an).text,fn=Te(jn,tn,St);tn==xn?ct.push(new Xt(We(an,fn),We(an,fn))):jn.length>fn&&ct.push(new Xt(We(an,fn),We(an,Te(jn,xn,St))))}ct.length||ct.push(new Xt(i,i)),An(s,li(e,g.ranges.slice(0,p).concat(ct),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(tt)}else{var Fn=l,Sn=xs(e,tt,n.unit),gn=Fn.anchor,pn;ot(Sn.anchor,gn)>0?(pn=Sn.head,gn=qt(Fn.from(),Sn.anchor)):(pn=Sn.anchor,gn=Kt(Fn.to(),Sn.head));var ln=g.ranges.slice(0);ln[p]=Kl(e,new Xt(o(s,gn),pn)),An(s,li(e,ln,p),Ne)}}var ye=r.wrapper.getBoundingClientRect(),Fe=0;function Xe(tt){var ct=++Fe,St=Ni(e,tt,!0,n.unit=="rectangle");if(!St)return;if(ot(St,J)!=0){e.curOp.focus=te(),we(St);var Ct=Kr(r,s);(St.line>=Ct.to||St.lineye.bottom?20:0;Dt&&setTimeout(yn(e,function(){if(Fe!=ct)return;r.scroller.scrollTop+=Dt,Xe(tt)}),50)}}function $e(tt){e.state.selectingText=!1,Fe=Infinity,tt&&(A(tt),r.input.focus()),dt(r.wrapper.ownerDocument,"mousemove",et),dt(r.wrapper.ownerDocument,"mouseup",at),s.history.lastSelOrigin=null}var et=yn(e,function(tt){tt.buttons===0||!ge(tt)?$e(tt):Xe(tt)}),at=yn(e,$e);e.state.selectingText=at,Oe(r.wrapper.ownerDocument,"mousemove",et),Oe(r.wrapper.ownerDocument,"mouseup",at)}function Kl(e,t){var i=t.anchor,n=t.head,r=mt(e.doc,i.line);if(ot(i,n)==0&&i.sticky==n.sticky)return t;var s=gt(r);if(!s)return t;var l=Ze(s,i.ch,i.sticky),p=s[l];if(p.from!=i.ch&&p.to!=i.ch)return t;var g=l+(p.from==i.ch==(p.level!=1)?0:1);if(g==0||g==s.length)return t;var w;if(n.line!=i.line)w=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var G=Ze(s,n.ch,n.sticky),J=G-l||(n.ch-i.ch)*(p.level==1?-1:1);G==g-1||G==g?w=J<0:w=J>0}var we=s[g+(w?-1:0)],ye=w==(we.level==1),Fe=ye?we.from:we.to,Xe=ye?"after":"before";return i.ch==Fe&&i.sticky==Xe?t:new Xt(new We(i.line,Fe,Xe),n)}function Cs(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(we){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&A(t);var l=e.display,p=l.lineDiv.getBoundingClientRect();if(s>p.bottom||!ie(e,i))return X(t);s-=p.top-l.viewOffset;for(var g=0;g=r){var G=Ln(e.doc,s),J=e.display.gutterSpecs[g];return Ue(e,i,e,G,J.className,t),X(t)}}}function Go(e,t){return Cs(e,t,"gutterClick",!0)}function ws(e,t){if(gi(e.display,t)||Yl(e,t))return;if(Ke(e,t,"contextmenu"))return;Ie||e.display.input.onContextMenu(t)}function Yl(e,t){return ie(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Es(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var sr={toString:function(){return"CodeMirror.Init"}},Ss={},ao={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(p,g,w){w!=sr&&s(p,g,w)}:s)}e.defineOption=i,e.Init=sr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Po(n)},!0),i("indentUnit",2,Po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){kr(n),vr(n),Nn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(g){for(var w=0;;){var G=g.text.indexOf(r,w);if(G==-1)break;w=G+r.length,s.push(We(l,G))}l++});for(var p=s.length-1;p>=0;p--)ir(n.doc,r,s[p],We(s[p].line,s[p].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=sr&&n.refresh()}),i("specialCharPlaceholder",Ht,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",b?"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",!ve),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Sr(n)},!0),i("keyMap","default",function(n,r,s){var l=ro(r),p=s!=sr&&ro(s);p&&p.detach&&p.detach(n,l),l.attach&&l.attach(n,p||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Sr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?wo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qi(n)},!0),i("scrollbarStyle","native",function(n){Aa(n),qi(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Do(n.options.gutters,r),Sr(n)},!0),i("firstLineNumber",1,Sr,!0),i("lineNumberFormatter",function(n){return n},Sr,!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"&&(Zi(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,kr,!0),i("addModeClass",!1,kr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,kr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=sr;if(!t!=!n){var r=e.display.dragFunctions,s=t?Oe:dt;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?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Pe(e.display.wrapper,"CodeMirror-wrap"),Ur(e)),Eo(e),Nn(e),vr(e),setTimeout(function(){return qi(e)},100)}function on(e,t){var i=this;if(!(this instanceof on))return new on(e,t);this.options=t=t?d(t):{},d(Ss,t,!1);var n=t.value;typeof n=="string"?n=new In(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new on.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,r,t);s.wrapper.CodeMirror=this,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Aa(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 V,keySeq:null,specialChars:null},t.autofocus&&!b&&s.input.focus(),z&&$<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Rl(),Bi(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!b||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):Zi(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);Ra(this),t.finishInit&&t.finishInit(this);for(var p=0;p20*20}Oe(t.scroller,"touchstart",function(g){if(!Ke(e,g)&&!s(g)&&!Go(e,g)){t.input.ensurePolled(),clearTimeout(i);var w=+new Date;t.activeTouch={start:w,moved:!1,prev:w-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function(g){var w=t.activeTouch;if(w&&!gi(t,g)&&w.left!=null&&!w.moved&&new Date-w.start<300){var G=e.coordsChar(t.activeTouch,"page"),J;!w.prev||l(w,w.prev)?J=new Xt(G,G):!w.prev.prev||l(w,w.prev.prev)?J=e.findWordAt(G):J=new Xt(We(G.line,0),o(e.doc,We(G.line+1,0))),e.setSelection(J.anchor,J.head),e.focus(),A(g)}r()}),Oe(t.scroller,"touchcancel",r),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),ji(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function(g){return Da(e,g)}),Oe(t.scroller,"DOMMouseScroll",function(g){return Da(e,g)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){Ke(e,g)||Q(g)},over:function(g){Ke(e,g)||(Ll(e,g),Q(g))},start:function(g){return Tl(e,g)},drop:yn(e,Al),leave:function(g){Ke(e,g)||as(e)}};var p=t.input.getField();Oe(p,"keyup",function(g){return vs.call(e,g)}),Oe(p,"keydown",yn(e,gs)),Oe(p,"keypress",yn(e,ys)),Oe(p,"focus",function(g){return ko(e,g)}),Oe(p,"blur",function(g){return Zi(e,g)})}var Vo=[];on.defineInitHook=function(e){return Vo.push(e)};function Fr(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=Qe(e,t).state:i="prev");var l=e.options.tabSize,p=mt(r,t),g=M(p.text,null,l);p.stateAfter&&(p.stateAfter=null);var w=p.text.match(/^\s*/)[0],G;if(!n&&!/\S/.test(p.text))G=0,i="not";else if(i=="smart"&&(G=r.mode.indent(s,p.text.slice(w.length),p.text),G==Be||G>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?G=M(mt(r,t-1).text,null,l):G=0:i=="add"?G=g+e.options.indentUnit:i=="subtract"?G=g-e.options.indentUnit:typeof i=="number"&&(G=g+i),G=Math.max(0,G);var J="",we=0;if(e.options.indentWithTabs)for(var ye=Math.floor(G/l);ye;--ye)we+=l,J+=" ";if(wel,g=At(t),w=null;if(p&&n.ranges.length>1)if(ui&&ui.text.join(` `)==t){if(n.ranges.length%ui.text.length==0){w=[];for(var G=0;G=0;we--){var ye=n.ranges[we],Fe=ye.from(),Xe=ye.to();ye.empty()&&(i&&i>0?Fe=We(Fe.line,Fe.ch-i):e.state.overwrite&&!p?Xe=We(Xe.line,Math.min(mt(s,Xe.line).text.length,Xe.ch+T(g).length)):p&&ui&&ui.lineWise&&ui.text.join(` `)==g.join(` `)&&(Fe=Xe=We(Fe.line,0)));var $e={from:Fe,to:Xe,text:w?w[we%w.length]:g,origin:r||(p?"paste":e.state.cutIncoming>l?"cut":"+input")};nr(e.doc,$e),En(e,"inputRead",e,$e)}t&&!p&&As(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=J),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&zn(t,function(){return Xo(t,i,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var p=0;p-1){l=Fr(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(mt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Fr(e,r.head.line,"smart")));l&&En(e,"electricInput",e,r.head.line)}}function Ts(e){for(var t=[],i=[],n=0;ns&&(Fr(this,p.head.line,n,!0),s=p.head.line,l==this.doc.sel.primIndex&&Qi(this));else{var g=p.from(),w=p.to(),G=Math.max(s,g.line);s=Math.min(this.lastLine(),w.line-(w.ch?0:1))+1;for(var J=G;J0&&Fo(this.doc,l,new Xt(g,we[l].to()),_e)}}}),getTokenAt:function(n,r){return en(this,n,r)},getLineTokens:function(n,r){return en(this,We(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=ze(this,mt(this.doc,n.line)),s=0,l=(r.length-1)/2,p=n.ch,g;if(p==0)g=r[2];else for(;;){var w=s+l>>1;if((w?r[w*2-1]:0)>=p)l=w;else if(r[w*2+1]g&&(n=g,l=!0),p=mt(this.doc,n)}else p=n;return zr(this,p,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-ai(p):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return Ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,p){var g=this.display;n=si(this,o(this.doc,n));var w=n.bottom,G=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),g.sizer.appendChild(r),l=="over")w=n.top;else if(l=="above"||l=="near"){var J=Math.max(g.wrapper.clientHeight,this.doc.height),we=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>J)&&n.top>r.offsetHeight?w=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=J&&(w=n.bottom),G+r.offsetWidth>we&&(G=we-r.offsetWidth)}r.style.top=w+"px",r.style.left=r.style.right="",p=="right"?(G=g.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(p=="left"?G=0:p=="middle"&&(G=(g.sizer.clientWidth-r.offsetWidth)/2),r.style.left=G+"px"),s&&Js(this,{left:G,top:w,right:G+r.offsetWidth,bottom:w+r.offsetHeight})},triggerOnKeyDown:Rn(gs),triggerOnKeyPress:Rn(ys),triggerOnKeyUp:vs,triggerOnMouseDown:Rn(bs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Rn(function(n){As(this,n)}),findPosH:function(n,r,s,l){var p=1;r<0&&(p=-1,r=-r);for(var g=o(this.doc,n),w=0;w0&&G(s.charAt(l-1));)--l;for(;p.5||this.options.lineWrapping)&&Eo(this),Ue(this,"refresh",this)}),swapDoc:Rn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,En(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}},se(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function Ko(e,t,i,n,r){var s=t,l=i,p=mt(e,t.line),g=r&&e.direction=="rtl"?-i:i;function w(){var at=t.line+g;return at=e.first+e.size?!1:(t=new We(at,t.ch,t.sticky),p=mt(e,at))}function G(at){var tt;if(n=="codepoint"){var ct=p.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ct)?tt=null:tt=new We(t.line,Math.max(0,Math.min(p.text.length,t.ch+i*(ct>=55296&&ct<56320?2:1))),-i)}else r?tt=Pl(e.cm,p,t,i):tt=Uo(p,t,i);if(tt==null)if(!at&&w())t=Ho(r,e.cm,p,t.line,g);else return!1;else t=tt;return!0}if(n=="char"||n=="codepoint")G();else if(n=="column")G(!0);else if(n=="word"||n=="group")for(var J=null,we=n=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(i<0&&!G(!Fe));Fe=!1){var Xe=p.text.charAt(t.ch)||` `,$e=Ce(Xe,ye)?"w":we&&Xe==` `?"n":!we||/\s/.test(Xe)?null:"p";if(we&&!Fe&&!$e&&($e="s"),J&&J!=$e){i<0&&(i=1,G(),t.sticky="after");break}if($e&&(J=$e),i>0&&!G(!Fe))break}var et=to(e,t,s,l,!0);return _t(s,et)&&(et.hitSide=!0),et}function Ms(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var p=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=Math.max(p-.5*$i(e.display),3);l=(i>0?t.bottom:t.top)+i*g}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var w;!(w=bo(e,s,l),!w.outside);){if(i<0?l<=0:l>=r.height){w.hitSide=!0;break}l+=i*5}return w}var Qt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Ls(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(p){for(var g=p.target;g;g=g.parentNode){if(g==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}Oe(r,"paste",function(p){if(!s(p)||Ke(n,p)||ks(p,n))return;$<=11&&setTimeout(yn(n,function(){return t.updateFromDOM()}),20)}),Oe(r,"compositionstart",function(p){t.composing={data:p.data,done:!1}}),Oe(r,"compositionupdate",function(p){t.composing||(t.composing={data:p.data,done:!1})}),Oe(r,"compositionend",function(p){t.composing&&(p.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(r,"touchstart",function(){return i.forceCompositionEnd()}),Oe(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(p){if(!s(p)||Ke(n,p))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()}),p.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var g=Ts(n);so({lineWise:!0,text:g.text}),p.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,_e),n.replaceSelection("",null,"cut")})}else return;if(p.clipboardData){p.clipboardData.clearData();var w=ui.text.join(` `);if(p.clipboardData.setData("Text",w),p.clipboardData.getData("Text")==w){p.preventDefault();return}}var G=Rs(),J=G.firstChild;n.display.lineSpace.insertBefore(G,n.display.lineSpace.firstChild),J.value=ui.text.join(` `);var we=document.activeElement;I(J),setTimeout(function(){n.display.lineSpace.removeChild(G),we.focus(),we==r&&i.showPrimarySelection()},50)}Oe(r,"copy",l),Oe(r,"cut",l)},Qt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Qt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qt.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&&Os(t,n)||{node:p[0].measure.map[2],offset:0},w=r.linee.firstLine()&&(n=We(n.line-1,mt(e.doc,n.line-1).length)),r.ch==mt(e.doc,r.line).text.length&&r.linet.viewTo-1)return!1;var s,l,p;n.line==t.viewFrom||(s=Ii(e,n.line))==0?(l=Ot(t.view[0].line),p=t.view[0].node):(l=Ot(t.view[s].line),p=t.view[s-1].node.nextSibling);var g=Ii(e,r.line),w,G;if(g==t.view.length-1?(w=t.viewTo-1,G=t.lineDiv.lastChild):(w=Ot(t.view[g+1].line)-1,G=t.view[g+1].node.previousSibling),!p)return!1;for(var J=e.doc.splitLines(tu(e,p,G,l,w)),we=On(e.doc,We(l,0),We(w,mt(e.doc,w).text.length));J.length>1&&we.length>1;)if(T(J)==T(we))J.pop(),we.pop(),w--;else if(J[0]==we[0])J.shift(),we.shift(),l++;else break;for(var ye=0,Fe=0,Xe=J[0],$e=we[0],et=Math.min(Xe.length,$e.length);yen.ch&&at.charCodeAt(at.length-Fe-1)==tt.charCodeAt(tt.length-Fe-1);)ye--,Fe++;J[J.length-1]=at.slice(0,at.length-Fe).replace(/^\u200b+/,""),J[0]=J[0].slice(ye).replace(/\u200b+$/,"");var St=We(l,ye),Ct=We(w,we.length?T(we).length-Fe:0);if(J.length>1||J[0]||ot(St,Ct))return ir(e.doc,J,St,Ct,"+input"),!0},Qt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qt.prototype.reset=function(){this.forceCompositionEnd()},Qt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Qt.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)},Qt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&zn(this.cm,function(){return Nn(e.cm)})},Qt.prototype.setUneditable=function(e){e.contentEditable="false"},Qt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||yn(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Qt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qt.prototype.onContextMenu=function(){},Qt.prototype.resetPosition=function(){},Qt.prototype.needsContentAttribute=!0;function Os(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=mt(e.doc,t.line),r=ia(i,n,t.line),s=gt(n,e.doc.direction),l="left";if(s){var p=Ze(s,t.ch);l=p%2?"right":"left"}var g=aa(r.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,p=e.doc.lineSeparator(),g=!1;function w(ye){return function(Fe){return Fe.id==ye}}function G(){l&&(s+=p,g&&(s+=p),l=g=!1)}function J(ye){ye&&(G(),s+=ye)}function we(ye){if(ye.nodeType==1){var Fe=ye.getAttribute("cm-text");if(Fe){J(Fe);return}var Xe=ye.getAttribute("cm-marker"),$e;if(Xe){var et=e.findMarks(We(n,0),We(r+1,0),w(+Xe));et.length&&($e=et[0].find(0))&&J(On(e.doc,$e.from,$e.to).join(p));return}if(ye.getAttribute("contenteditable")=="false")return;var at=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;at&&G();for(var tt=0;tt=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Oe(r,"paste",function(l){if(Ke(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Ke(n,l))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var p=Ts(n);so({lineWise:!0,text:p.text}),l.type=="cut"?n.setSelections(p.ranges,null,_e):(i.prevInput="",r.value=p.text.join(` `),I(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Oe(r,"cut",s),Oe(r,"copy",s),Oe(e.scroller,"paste",function(l){if(gi(e,l)||Ke(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var p=new Event("paste");p.clipboardData=l.clipboardData,r.dispatchEvent(p)}),Oe(e.lineSpace,"selectstart",function(l){gi(e,l)||A(l)}),Oe(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"})}}),Oe(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},cn.prototype.createField=function(e){this.wrapper=Rs(),this.textarea=this.wrapper.firstChild},cn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},cn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=va(e);if(e.options.moveInputWithCursor){var r=si(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},cn.prototype.showSelection=function(e){var t=this.cm,i=t.display;ae(i.cursorDiv,e.cursors),ae(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},cn.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&&I(this.textarea),z&&$>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",z&&$>=9&&(this.hasSelection=null))},cn.prototype.getField=function(){return this.textarea},cn.prototype.supportsTouch=function(){return!1},cn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||te()!=this.textarea))try{this.textarea.focus()}catch(e){}},cn.prototype.blur=function(){this.textarea.blur()},cn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},cn.prototype.receivedFocus=function(){this.slowPoll()},cn.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()})},cn.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)},cn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||pt(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(z&&$>=9&&this.hasSelection===r||L&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,p=Math.min(n.length,r.length);l1e3||r.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},cn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},cn.prototype.onKeyPress=function(){z&&$>=9&&(this.hasSelection=null),this.fastPoll()},cn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Ni(i,e),l=n.scroller.scrollTop;if(!s||C)return;var p=i.options.resetSelectionOnContextMenu;p&&i.doc.sel.contains(s)==-1&&yn(i,An)(i.doc,Si(s),_e);var g=r.style.cssText,w=t.wrapper.style.cssText,G=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-G.top-5)+"px; left: "+(e.clientX-G.left-5)+`px; z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var J;N&&(J=window.scrollY),n.input.focus(),N&&window.scrollTo(null,J),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ye,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function we(){if(r.selectionStart!=null){var Xe=i.somethingSelected(),$e="\u200B"+(Xe?r.value:"");r.value="\u21DA",r.value=$e,t.prevInput=Xe?"":"\u200B",r.selectionStart=1,r.selectionEnd=$e.length,n.selForContextMenu=i.doc.sel}}function ye(){if(t.contextMenuPending!=ye)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=w,r.style.cssText=g,z&&$<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!z||z&&$<9)&&we();var Xe=0,$e=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?yn(i,$a)(i):Xe++<10?n.detectingSelectAll=setTimeout($e,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout($e,200)}}if(z&&$>=9&&we(),Ie){Q(e);var Fe=function(){dt(window,"mouseup",Fe),setTimeout(ye,20)};Oe(window,"mouseup",Fe)}else setTimeout(ye,50)},cn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},cn.prototype.setUneditable=function(){},cn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?d(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=te();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=p.getValue()}var r;if(e.form&&(Oe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(dt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var p=on(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return p}function ru(e){e.off=dt,e.on=Oe,e.wheelEventPixels=hl,e.Doc=In,e.splitLines=At,e.countColumn=M,e.findColumn=Te,e.isWordChar=ne,e.Pass=Be,e.signal=Ue,e.Line=Di,e.changeEnd=ki,e.scrollbarModel=ka,e.Pos=We,e.cmpPos=ot,e.modes=Wt,e.mimeModes=Mt,e.resolveMode=bt,e.getMode=wt,e.modeExtensions=rt,e.extendMode=xt,e.copyState=Zt,e.startState=nn,e.innerMode=rn,e.commands=Pr,e.keyMap=vi,e.keyName=hs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=_l,e.StringStream=Rt,e.SharedTextMarker=Or,e.TextMarker=Ti,e.LineWidget=Mr,e.e_preventDefault=A,e.e_stopPropagation=R,e.e_stop=Q,e.addClass=W,e.contains=H,e.rmClass=Pe,e.keyNames=Li}$l(on),ql(on);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in In.prototype)In.prototype.hasOwnProperty(uo)&&oe(ou,uo)<0&&(on.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(In.prototype[uo]));return se(In),on.inputStyles={textarea:cn,contenteditable:Qt},on.defineMode=function(e){!on.defaults.mode&&e!="null"&&(on.defaults.mode=e),Un.apply(this,arguments)},on.defineMIME=Qn,on.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),on.defineMIME("text/plain","null"),on.defineExtension=function(e,t){on.prototype[e]=t},on.defineDocExtension=function(e,t){In.prototype[e]=t},on.fromTextArea=iu,ru(on),on.version="5.58.2",on})},X0ci:function(ht,de,y){},Y1PL:function(ht,de,y){"use strict";y.r(de),y.d(de,"ResizableTextArea",function(){return oe});var Y=y("wx14"),pe=y("1OyB"),ce=y("vuIU"),be=y("Ji7U"),fe=y("LK+K"),q=y("q1tI"),z=y("VTBJ"),$=y("rePB"),N=y("Zm9Q"),P=y("Kwbf"),x=y("c+Xe"),C=y("m+aA"),k=y("bdgK"),E=new Map;function S(_e){_e.forEach(function(Ne){var ke,Te=Ne.target;(ke=E.get(Te))===null||ke===void 0||ke.forEach(function(le){return le(Te)})})}var j=new k.default(S),v=null,b=null;function L(_e,Ne){E.has(_e)||(E.set(_e,new Set),j.observe(_e)),E.get(_e).add(Ne)}function U(_e,Ne){E.has(_e)&&(E.get(_e).delete(Ne),E.get(_e).size||(j.unobserve(_e),E.delete(_e)))}var ve=function(_e){Object(be.a)(ke,_e);var Ne=Object(fe.a)(ke);function ke(){return Object(pe.a)(this,ke),Ne.apply(this,arguments)}return Object(ce.a)(ke,[{key:"render",value:function(){return this.props.children}}]),ke}(q.Component),he=q.createContext(null);function xe(_e){var Ne=_e.children,ke=_e.onBatchResize,Te=q.useRef(0),le=q.useRef([]),Z=q.useContext(he),T=q.useCallback(function(K,F,Se){Te.current+=1;var D=Te.current;le.current.push({size:K,element:F,data:Se}),Promise.resolve().then(function(){D===Te.current&&(ke==null||ke(le.current),le.current=[])}),Z==null||Z(K,F,Se)},[ke,Z]);return q.createElement(he.Provider,{value:T},Ne)}function Ie(_e){var Ne=_e.children,ke=_e.disabled,Te=q.useRef(null),le=q.useRef(null),Z=q.useContext(he),T=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),K=q.isValidElement(Ne)&&Object(x.c)(Ne),F=K?Ne.ref:null,Se=q.useMemo(function(){return Object(x.a)(F,Te)},[F,Te]),D=q.useRef(_e);D.current=_e;var _=q.useCallback(function(ne){var Ce=D.current,Re=Ce.onResize,Me=Ce.data,je=ne.getBoundingClientRect(),He=je.width,Ye=je.height,qe=ne.offsetWidth,Je=ne.offsetHeight,Ze=Math.floor(He),yt=Math.floor(Ye);if(T.current.width!==Ze||T.current.height!==yt||T.current.offsetWidth!==qe||T.current.offsetHeight!==Je){var gt={width:Ze,height:yt,offsetWidth:qe,offsetHeight:Je};T.current=gt;var st=qe===Math.round(He)?He:qe,Oe=Je===Math.round(Ye)?Ye:Je,nt=Object(z.a)(Object(z.a)({},gt),{},{offsetWidth:st,offsetHeight:Oe});Z==null||Z(nt,ne,Me),Re&&Promise.resolve().then(function(){Re(nt,ne)})}},[]);return q.useEffect(function(){var ne=Object(C.a)(Te.current)||Object(C.a)(le.current);return ne&&!ke&&L(ne,_),function(){return U(ne,_)}},[Te.current,ke]),q.createElement(ve,{ref:le},K?q.cloneElement(Ne,{ref:Se}):Ne)}var Ee="rc-observer-key";function Pe(_e){var Ne=_e.children,ke=Object(N.a)(Ne);return ke.map(function(Te,le){var Z=(Te==null?void 0:Te.key)||"".concat(Ee,"-").concat(le);return q.createElement(Ie,Object(Y.a)({},_e,{key:Z}),Te)})}Pe.Collection=xe;var De=Pe,ae=y("bT9E"),O=y("TSYQ"),me=y.n(O),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 `,H=["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"],te={},W;function B(_e){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(Ne&&te[ke])return te[ke];var Te=window.getComputedStyle(_e),le=Te.getPropertyValue("box-sizing")||Te.getPropertyValue("-moz-box-sizing")||Te.getPropertyValue("-webkit-box-sizing"),Z=parseFloat(Te.getPropertyValue("padding-bottom"))+parseFloat(Te.getPropertyValue("padding-top")),T=parseFloat(Te.getPropertyValue("border-bottom-width"))+parseFloat(Te.getPropertyValue("border-top-width")),K=H.map(function(Se){return"".concat(Se,":").concat(Te.getPropertyValue(Se))}).join(";"),F={sizingStyle:K,paddingSize:Z,borderSize:T,boxSizing:le};return Ne&&ke&&(te[ke]=F),F}function I(_e){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),_e.getAttribute("wrap")?W.setAttribute("wrap",_e.getAttribute("wrap")):W.removeAttribute("wrap");var le=B(_e,Ne),Z=le.paddingSize,T=le.borderSize,K=le.boxSizing,F=le.sizingStyle;W.setAttribute("style","".concat(F,";").concat(re)),W.value=_e.value||_e.placeholder||"";var Se=Number.MIN_SAFE_INTEGER,D=Number.MAX_SAFE_INTEGER,_=W.scrollHeight,ne;if(K==="border-box"?_+=T:K==="content-box"&&(_-=Z),ke!==null||Te!==null){W.value=" ";var Ce=W.scrollHeight-Z;ke!==null&&(Se=Ce*ke,K==="border-box"&&(Se=Se+Z+T),_=Math.max(Se,_)),Te!==null&&(D=Ce*Te,K==="border-box"&&(D=D+Z+T),ne=_>D?"":"hidden",_=Math.min(D,_))}return{height:_,minHeight:Se,maxHeight:D,overflowY:ne,resize:"none"}}var m=y("Gytx"),d=y.n(m),M;(function(_e){_e[_e.NONE=0]="NONE",_e[_e.RESIZING=1]="RESIZING",_e[_e.RESIZED=2]="RESIZED"})(M||(M={}));var V=function(_e){Object(be.a)(ke,_e);var Ne=Object(fe.a)(ke);function ke(Te){var le;return Object(pe.a)(this,ke),le=Ne.call(this,Te),le.nextFrameActionId=void 0,le.resizeFrameId=void 0,le.textArea=void 0,le.saveTextArea=function(Z){le.textArea=Z},le.handleResize=function(Z){var T=le.state.resizeStatus,K=le.props,F=K.autoSize,Se=K.onResize;if(T!==M.NONE)return;typeof Se=="function"&&Se(Z),F&&le.resizeOnNextFrame()},le.resizeOnNextFrame=function(){cancelAnimationFrame(le.nextFrameActionId),le.nextFrameActionId=requestAnimationFrame(le.resizeTextarea)},le.resizeTextarea=function(){var Z=le.props.autoSize;if(!Z||!le.textArea)return;var T=Z.minRows,K=Z.maxRows,F=I(le.textArea,!1,T,K);le.setState({textareaStyles:F,resizeStatus:M.RESIZING},function(){cancelAnimationFrame(le.resizeFrameId),le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:M.RESIZED},function(){le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:M.NONE}),le.fixFirefoxAutoScroll()})})})})},le.renderTextArea=function(){var Z=le.props,T=Z.prefixCls,K=T===void 0?"rc-textarea":T,F=Z.autoSize,Se=Z.onResize,D=Z.className,_=Z.disabled,ne=le.state,Ce=ne.textareaStyles,Re=ne.resizeStatus,Me=Object(ae.a)(le.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),je=me()(K,D,Object($.a)({},"".concat(K,"-disabled"),_));"value"in Me&&(Me.value=Me.value||"");var He=Object(z.a)(Object(z.a)(Object(z.a)({},le.props.style),Ce),Re===M.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return q.createElement(De,{onResize:le.handleResize,disabled:!(F||Se)},q.createElement("textarea",Object(Y.a)({},Me,{className:je,style:He,ref:le.saveTextArea})))},le.state={textareaStyles:{},resizeStatus:M.NONE},le}return Object(ce.a)(ke,[{key:"componentDidUpdate",value:function(le){(le.value!==this.props.value||!d()(le.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 le=this.textArea.selectionStart,Z=this.textArea.selectionEnd;this.textArea.setSelectionRange(le,Z)}}catch(T){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ke}(q.Component),oe=V,Le=function(_e){Object(be.a)(ke,_e);var Ne=Object(fe.a)(ke);function ke(Te){var le;Object(pe.a)(this,ke),le=Ne.call(this,Te),le.resizableTextArea=void 0,le.focus=function(){le.resizableTextArea.textArea.focus()},le.saveTextArea=function(T){le.resizableTextArea=T},le.handleChange=function(T){var K=le.props.onChange;le.setValue(T.target.value,function(){le.resizableTextArea.resizeTextarea()}),K&&K(T)},le.handleKeyDown=function(T){var K=le.props,F=K.onPressEnter,Se=K.onKeyDown;T.keyCode===13&&F&&F(T),Se&&Se(T)};var Z=typeof Te.value=="undefined"||Te.value===null?Te.defaultValue:Te.value;return le.state={value:Z},le}return Object(ce.a)(ke,[{key:"setValue",value:function(le,Z){"value"in this.props||this.setState({value:le},Z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return q.createElement(oe,Object(Y.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(le){return"value"in le?{value:le.value}:null}}]),ke}(q.Component),Be=de.default=Le},ZW9T:function(ht,de,y){"use strict";y.d(de,"a",function(){return De});var Y=y("k1fw"),pe=y("oBTY"),ce=y("9og8"),be=y("miYZ"),fe=y("tsqr"),q=y("rAM+"),z=y("tJVT"),$=y("PpiC"),N=y("WmNS"),P=y.n(N),x=y("q1tI"),C=y.n(x),k=y("bdgK");function E(ae,O,me,re,H){var te=O.getWordUntilPosition(me),W={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:te.startColumn,endColumn:te.endColumn},B=re.map(function(I){return{label:I,kind:ae.languages.CompletionItemKind.Keyword,insertText:I,insertTextRules:ae.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:W}});return H.map(function(I){B.push(Object(Y.a)(Object(Y.a)({},I),{},{range:W}))}),B}var S=function(ae){var O={label:"ifelse",kind:ae.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:ae.languages.CompletionItemInsertTextRule.InsertAsSnippet},me=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];ae.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(W,B){var I=E(ae,W,B,me,[O]);return{suggestions:I}}});var re=["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"];ae.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(W,B){var I=[{label:"print",kind:ae.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:ae.languages.CompletionItemInsertTextRule.InsertAsSnippet}],m=E(ae,W,B,re,I);return{suggestions:m}}});var H=["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"];ae.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(W,B){var I=[O,{label:"main",kind:ae.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:ae.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ae.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:ae.languages.CompletionItemInsertTextRule.InsertAsSnippet}],m=E(ae,W,B,H,I);return{suggestions:m}}})},j="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=y("fjLI"),b=y("LvDl"),L=y("+ua5");function U(ae){return/^\d+$/.test(ae)?"".concat(ae,"px"):ae}function ve(){}var he=!1,xe={"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",Scala:"scale"};function Ie(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],O=ae;if(Array.isArray(ae)){for(var me=0;me0||rn.target.offsetWidth>0)&&nt.current.instance.layout()}}catch(nn){xt.e(nn)}finally{xt.f()}}),wt.observe(Oe.current)),wt}function Ae(){fe.b.warn({content:decodeURIComponent(j),key:"monaco-editor-tip"})}var ge=function(){var rt=nt.current.instance;if(te!=null&&rt&&R){var xt=rt.getModel();xt&&te!==xt.getValue()&&(he=!0,xt.setValue(te),rt.layout(),he=!1)}};Object(x.useEffect)(function(){try{var wt,rt=nt.current.instance;Ue.current&&clearTimeout(Ue.current),Ue.current=setTimeout(function(){ge()},500),rt==null||((wt=rt.updateOptions)===null||wt===void 0)||wt.call(rt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(te.split(/\r\n|\r|\n/g).length))+3,5)})}catch(xt){debugger}},[te,R,nt.current]),Object(x.useEffect)(function(){try{if(Ye&&nt.current&&nt.current.instance){var wt=nt.current.instance;wt.changeViewZones(function(xt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=Je,xt.addZone({afterLineNumber:Ye||11,heightInLines:3,domNode:Zt})});var rt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};wt.addOverlayWidget(rt),wt.revealPositionInCenter({lineNumber:20,column:1})}}catch(xt){debugger}},[Ye,nt.current,R]),Object(x.useEffect)(function(){var wt;if((wt=nt.current)!==null&&wt!==void 0&&wt.instance&&R&>){var rt=nt.current.instance,xt=rt.getModel();if(!xt)return;var Zt=function(){var ot=[],_t=[],Gt=xt.getAllDecorations(),Kt=Object(q.a)(Gt),qt;try{for(Kt.s();!(qt=Kt.n()).done;){var c=qt.value;if(c.options.className==="highlighted-line"){var o;ot.push(c==null||((o=c.range)===null||o===void 0)?void 0:o.startLineNumber),_t.push(c==null?void 0:c.id)}}}catch(u){Kt.e(u)}finally{Kt.f()}xt.deltaDecorations(_t,[]);var a=xt.getLineCount();!!Ze&&Ze<=a&&(rt.deltaDecorations([],[{range:new Ee.Range(Ze,1,Ze,xt.getLineMaxColumn(Ze)),options:{isWholeLine:!0,className:"highlighted-line"}}]),rt.revealLineInCenter(Ze))};Zt();var rn=function(){var ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_t=[],Gt=[],Kt=xt.getAllDecorations(),qt=Object(q.a)(Kt),c;try{for(qt.s();!(c=qt.n()).done;){var o=c.value;if(o.options.linesDecorationsClassName==="breakpoints"){var a;_t.push(o==null||((a=o.range)===null||a===void 0)?void 0:a.startLineNumber),Gt.push(o==null?void 0:o.id)}}}catch(u){qt.e(u)}finally{qt.f()}if(ot)return{lines:_t,ids:Gt};Ce(_t)},nn=function(){var We=Object(ce.a)(P.a.mark(function ot(_t){var Gt;return P.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return Gt={range:new Ee.Range(_t,1,_t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},qt.next=3,xt.deltaDecorations([],[Gt]);case 3:rn();case 4:case"end":return qt.stop()}},ot)}));return function(_t){return We.apply(this,arguments)}}(),Rt=function(){var We=Object(ce.a)(P.a.mark(function ot(_t){var Gt,Kt,qt,c,o;return P.a.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:Gt=[],Kt=rt.getLineDecorations(_t),qt=Object(q.a)(Kt);try{for(qt.s();!(c=qt.n()).done;)o=c.value,o.options.linesDecorationsClassName==="breakpoints"&&Gt.push(o.id)}catch(f){qt.e(f)}finally{qt.f()}return u.next=6,xt.deltaDecorations(Gt,[]);case 6:rn();case 7:case"end":return u.stop()}},ot)}));return function(_t){return We.apply(this,arguments)}}(),mt=function(ot){var _t=rt.getLineDecorations(ot),Gt=Object(q.a)(_t),Kt;try{for(Gt.s();!(Kt=Gt.n()).done;){var qt=Kt.value;if(qt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(c){Gt.e(c)}finally{Gt.f()}return!1};if(!Object(b.isEqual)(Me,rn(!0).lines)){xt.deltaDecorations(rn(!0).ids,[]);var On=Me.map(function(We){return{range:new Ee.Range(We,1,We,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});xt.deltaDecorations([],On)}var ni=rt.onDidChangeModelContent(function(We){var ot=rt.getPosition();if(ot){var _t=ot.lineNumber;xt.getLineContent(_t).trim()===""?Rt(_t):mt(_t)&&(Rt(_t),nn(_t))}}),kn=rt.onMouseDown(function(We){var ot,_t,Gt;if(We.target.detail&&(ot=We.target)!==null&&ot!==void 0&&(_t=ot.element)!==null&&_t!==void 0&&(Gt=_t.className)!==null&&Gt!==void 0&&Gt.includes("line-numbers")){var Kt=We.target.position.lineNumber;if(xt.getLineContent(Kt).trim()==="")return;mt(Kt)?Rt(Kt):nn(Kt)}}),Ot=function(ot){var _t={range:new Ee.Range(ot,1,ot,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Ke.current=rt.deltaDecorations(Ke.current,[_t])},Ln=function(){Ke.current=rt.deltaDecorations(Ke.current,[])},Vn=rt.onMouseMove(function(We){var ot,_t,Gt;if(Ln(),We.target.detail&&(ot=We.target)!==null&&ot!==void 0&&(_t=ot.element)!==null&&_t!==void 0&&(Gt=_t.className)!==null&&Gt!==void 0&&Gt.includes("line-numbers")){var Kt=We.target.position.lineNumber;if(xt.getLineContent(Kt).trim()==="")return;Ot(Kt)}}),ii=rt.onMouseLeave(function(){Ln()});return function(){ni.dispose(),kn.dispose(),Vn.dispose(),ii.dispose()}}},[nt.current,R,Me,Ze,gt]);function Ve(){var wt=nt.current.instance;if(wt){var rt=wt.getSelection(),xt=nt.current.pastePos||{},Zt=new Ee.Range(xt.startLineNumber||rt.endLineNumber,xt.startColumn||rt.endColumn,xt.endLineNumber||rt.endLineNumber,xt.endColumn||rt.endColumn);setTimeout(function(){wt.executeEdits("",[{range:Zt,text:""}])},300)}}function it(wt){(window.navigator.platform.match("Mac")?wt.metaKey:wt.ctrlKey)&&wt.keyCode==83&&(wt.preventDefault(),Ne())}var ft=function(){if(Te&&nt.current.instance){var rt=nt.current.instance.getContentHeight();Qn(rt0||F.target.offsetWidth>0)&&Te.layout()}}catch(Se){T.e(Se)}finally{T.f()}}),le.observe(d.current)),le}Object(x.useEffect)(function(){return d.current&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(Te){Ee=Te;var le=Ee.editor.createDiffEditor(d.current,Object(Y.a)(Object(Y.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},m),{},{wordWrap:!0}));Le(le);var Z=Be(le);return function(){le.dispose();var T=le.getModel();T&&T.dispose(),Z.unobserve(d.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(x.useEffect)(function(){oe&&oe.setModel({original:Ee.editor.createModel(te,B),modified:Ee.editor.createModel(W,B)})},[te,W,B,oe]);var _e=U(me),Ne=U(H),ke={width:_e,height:Ne};return C.a.createElement("div",{className:"my-diff-editor",ref:d,style:ke})}},ZpRC:function(ht,de,y){"use strict";function Y(x){return typeof x=="object"&&x!=null&&x.nodeType===1}function pe(x,C){return(!C||x!=="hidden")&&x!=="visible"&&x!=="clip"}function ce(x,C){if(x.clientHeightC||j>x&&v=C&&b>=k?j-x-E:v>C&&bk?v-C+S:0}var fe=function(x,C){var k=window,E=C.scrollMode,S=C.block,j=C.inline,v=C.boundary,b=C.skipOverflowHiddenElements,L=typeof v=="function"?v:function(Ce){return Ce!==v};if(!Y(x))throw new TypeError("Invalid target");for(var U=document.scrollingElement||document.documentElement,ve=[],he=x;Y(he)&&L(he);){if((he=he.parentElement)===U){ve.push(he);break}he!=null&&he===document.body&&ce(he)&&!ce(document.documentElement)||he!=null&&ce(he,b)&&ve.push(he)}for(var xe=k.visualViewport?k.visualViewport.width:innerWidth,Ie=k.visualViewport?k.visualViewport.height:innerHeight,Ee=window.scrollX||pageXOffset,Pe=window.scrollY||pageYOffset,De=x.getBoundingClientRect(),ae=De.height,O=De.width,me=De.top,re=De.right,H=De.bottom,te=De.left,W=S==="start"||S==="nearest"?me:S==="end"?H:me+ae/2,B=j==="center"?te+O/2:j==="end"?re:te,I=[],m=0;m=0&&te>=0&&H<=Ie&&re<=xe&&me>=Le&&H<=_e&&te>=Ne&&re<=Be)return I;var ke=getComputedStyle(d),Te=parseInt(ke.borderLeftWidth,10),le=parseInt(ke.borderTopWidth,10),Z=parseInt(ke.borderRightWidth,10),T=parseInt(ke.borderBottomWidth,10),K=0,F=0,Se="offsetWidth"in d?d.offsetWidth-d.clientWidth-Te-Z:0,D="offsetHeight"in d?d.offsetHeight-d.clientHeight-le-T:0;if(U===d)K=S==="start"?W:S==="end"?W-Ie:S==="nearest"?be(Pe,Pe+Ie,Ie,le,T,Pe+W,Pe+W+ae,ae):W-Ie/2,F=j==="start"?B:j==="center"?B-xe/2:j==="end"?B-xe:be(Ee,Ee+xe,xe,Te,Z,Ee+B,Ee+B+O,O),K=Math.max(0,K+Pe),F=Math.max(0,F+Ee);else{K=S==="start"?W-Le-le:S==="end"?W-_e+T+D:S==="nearest"?be(Le,_e,V,le,T+D,W,W+ae,ae):W-(Le+V/2)+D/2,F=j==="start"?B-Ne-Te:j==="center"?B-(Ne+oe/2)+Se/2:j==="end"?B-Be+Z+Se:be(Ne,Be,oe,Te,Z+Se,B,B+O,O);var _=d.scrollLeft,ne=d.scrollTop;W+=ne-(K=Math.max(0,Math.min(ne+K,d.scrollHeight-V+D))),B+=_-(F=Math.max(0,Math.min(_+F,d.scrollWidth-oe+Se)))}I.push({el:d,top:K,left:F})}return I};function q(x){return x===Object(x)&&Object.keys(x).length!==0}function z(x,C){C===void 0&&(C="auto");var k="scrollBehavior"in document.body.style;x.forEach(function(E){var S=E.el,j=E.top,v=E.left;S.scroll&&k?S.scroll({top:j,left:v,behavior:C}):(S.scrollTop=j,S.scrollLeft=v)})}function $(x){return x===!1?{block:"end",inline:"nearest"}:q(x)?x:{block:"start",inline:"nearest"}}function N(x,C){var k=!x.ownerDocument.documentElement.contains(x);if(q(C)&&typeof C.behavior=="function")return C.behavior(k?[]:fe(x,C));if(k)return;var E=$(C);return z(fe(x,E),E.behavior)}var P=de.a=N},Zss7:function(ht,de,y){var Y;(function(pe){var ce=/^\s+/,be=/\s+$/,fe=0,q=pe.round,z=pe.min,$=pe.max,N=pe.random;function P(T,K){if(T=T||"",K=K||{},T instanceof P)return T;if(!(this instanceof P))return new P(T,K);var F=x(T);this._originalInput=T,this._r=F.r,this._g=F.g,this._b=F.b,this._a=F.a,this._roundA=q(100*this._a)/100,this._format=K.format||F.format,this._gradientType=K.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=F.ok,this._tc_id=fe++}P.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 T=this.toRgb();return(T.r*299+T.g*587+T.b*114)/1e3},getLuminance:function(){var T=this.toRgb(),K,F,Se,D,_,ne;return K=T.r/255,F=T.g/255,Se=T.b/255,K<=.03928?D=K/12.92:D=pe.pow((K+.055)/1.055,2.4),F<=.03928?_=F/12.92:_=pe.pow((F+.055)/1.055,2.4),Se<=.03928?ne=Se/12.92:ne=pe.pow((Se+.055)/1.055,2.4),.2126*D+.7152*_+.0722*ne},setAlpha:function(T){return this._a=I(T),this._roundA=q(100*this._a)/100,this},toHsv:function(){var T=S(this._r,this._g,this._b);return{h:T.h*360,s:T.s,v:T.v,a:this._a}},toHsvString:function(){var T=S(this._r,this._g,this._b),K=q(T.h*360),F=q(T.s*100),Se=q(T.v*100);return this._a==1?"hsv("+K+", "+F+"%, "+Se+"%)":"hsva("+K+", "+F+"%, "+Se+"%, "+this._roundA+")"},toHsl:function(){var T=k(this._r,this._g,this._b);return{h:T.h*360,s:T.s,l:T.l,a:this._a}},toHslString:function(){var T=k(this._r,this._g,this._b),K=q(T.h*360),F=q(T.s*100),Se=q(T.l*100);return this._a==1?"hsl("+K+", "+F+"%, "+Se+"%)":"hsla("+K+", "+F+"%, "+Se+"%, "+this._roundA+")"},toHex:function(T){return v(this._r,this._g,this._b,T)},toHexString:function(T){return"#"+this.toHex(T)},toHex8:function(T){return b(this._r,this._g,this._b,this._a,T)},toHex8String:function(T){return"#"+this.toHex8(T)},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(m(this._r,255)*100)+"%",g:q(m(this._g,255)*100)+"%",b:q(m(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+q(m(this._r,255)*100)+"%, "+q(m(this._g,255)*100)+"%, "+q(m(this._b,255)*100)+"%)":"rgba("+q(m(this._r,255)*100)+"%, "+q(m(this._g,255)*100)+"%, "+q(m(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:W[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(T){var K="#"+L(this._r,this._g,this._b,this._a),F=K,Se=this._gradientType?"GradientType = 1, ":"";if(T){var D=P(T);F="#"+L(D._r,D._g,D._b,D._a)}return"progid:DXImageTransform.Microsoft.gradient("+Se+"startColorstr="+K+",endColorstr="+F+")"},toString:function(T){var K=!!T;T=T||this._format;var F=!1,Se=this._a<1&&this._a>=0,D=!K&&Se&&(T==="hex"||T==="hex6"||T==="hex3"||T==="hex4"||T==="hex8"||T==="name");return D?T==="name"&&this._a===0?this.toName():this.toRgbString():(T==="rgb"&&(F=this.toRgbString()),T==="prgb"&&(F=this.toPercentageRgbString()),(T==="hex"||T==="hex6")&&(F=this.toHexString()),T==="hex3"&&(F=this.toHexString(!0)),T==="hex4"&&(F=this.toHex8String(!0)),T==="hex8"&&(F=this.toHex8String()),T==="name"&&(F=this.toName()),T==="hsl"&&(F=this.toHslString()),T==="hsv"&&(F=this.toHsvString()),F||this.toHexString())},clone:function(){return P(this.toString())},_applyModification:function(T,K){var F=T.apply(null,[this].concat([].slice.call(K)));return this._r=F._r,this._g=F._g,this._b=F._b,this.setAlpha(F._a),this},lighten:function(){return this._applyModification(xe,arguments)},brighten:function(){return this._applyModification(Ie,arguments)},darken:function(){return this._applyModification(Ee,arguments)},desaturate:function(){return this._applyModification(U,arguments)},saturate:function(){return this._applyModification(ve,arguments)},greyscale:function(){return this._applyModification(he,arguments)},spin:function(){return this._applyModification(Pe,arguments)},_applyCombination:function(T,K){return T.apply(null,[this].concat([].slice.call(K)))},analogous:function(){return this._applyCombination(re,arguments)},complement:function(){return this._applyCombination(De,arguments)},monochromatic:function(){return this._applyCombination(H,arguments)},splitcomplement:function(){return this._applyCombination(me,arguments)},triad:function(){return this._applyCombination(ae,arguments)},tetrad:function(){return this._applyCombination(O,arguments)}},P.fromRatio=function(T,K){if(typeof T=="object"){var F={};for(var Se in T)T.hasOwnProperty(Se)&&(Se==="a"?F[Se]=T[Se]:F[Se]=Be(T[Se]));T=F}return P(T,K)};function x(T){var K={r:0,g:0,b:0},F=1,Se=null,D=null,_=null,ne=!1,Ce=!1;return typeof T=="string"&&(T=le(T)),typeof T=="object"&&(Te(T.r)&&Te(T.g)&&Te(T.b)?(K=C(T.r,T.g,T.b),ne=!0,Ce=String(T.r).substr(-1)==="%"?"prgb":"rgb"):Te(T.h)&&Te(T.s)&&Te(T.v)?(Se=Be(T.s),D=Be(T.v),K=j(T.h,Se,D),ne=!0,Ce="hsv"):Te(T.h)&&Te(T.s)&&Te(T.l)&&(Se=Be(T.s),_=Be(T.l),K=E(T.h,Se,_),ne=!0,Ce="hsl"),T.hasOwnProperty("a")&&(F=T.a)),F=I(F),{ok:ne,format:T.format||Ce,r:z(255,$(K.r,0)),g:z(255,$(K.g,0)),b:z(255,$(K.b,0)),a:F}}function C(T,K,F){return{r:m(T,255)*255,g:m(K,255)*255,b:m(F,255)*255}}function k(T,K,F){T=m(T,255),K=m(K,255),F=m(F,255);var Se=$(T,K,F),D=z(T,K,F),_,ne,Ce=(Se+D)/2;if(Se==D)_=ne=0;else{var Re=Se-D;ne=Ce>.5?Re/(2-Se-D):Re/(Se+D);switch(Se){case T:_=(K-F)/Re+(K1&&(He-=1),He<1/6?Me+(je-Me)*6*He:He<1/2?je:He<2/3?Me+(je-Me)*(2/3-He)*6:Me}if(K===0)Se=D=_=F;else{var Ce=F<.5?F*(1+K):F+K-F*K,Re=2*F-Ce;Se=ne(Re,Ce,T+1/3),D=ne(Re,Ce,T),_=ne(Re,Ce,T-1/3)}return{r:Se*255,g:D*255,b:_*255}}function S(T,K,F){T=m(T,255),K=m(K,255),F=m(F,255);var Se=$(T,K,F),D=z(T,K,F),_,ne,Ce=Se,Re=Se-D;if(ne=Se===0?0:Re/Se,Se==D)_=0;else{switch(Se){case T:_=(K-F)/Re+(K>1)+720)%360;--K;)Se.h=(Se.h+D)%360,_.push(P(Se));return _}function H(T,K){K=K||6;for(var F=P(T).toHsv(),Se=F.h,D=F.s,_=F.v,ne=[],Ce=1/K;K--;)ne.push(P({h:Se,s:D,v:_})),_=(_+Ce)%1;return ne}P.mix=function(T,K,F){F=F===0?0:F||50;var Se=P(T).toRgb(),D=P(K).toRgb(),_=F/100,ne={r:(D.r-Se.r)*_+Se.r,g:(D.g-Se.g)*_+Se.g,b:(D.b-Se.b)*_+Se.b,a:(D.a-Se.a)*_+Se.a};return P(ne)},P.readability=function(T,K){var F=P(T),Se=P(K);return(pe.max(F.getLuminance(),Se.getLuminance())+.05)/(pe.min(F.getLuminance(),Se.getLuminance())+.05)},P.isReadable=function(T,K,F){var Se=P.readability(T,K),D,_;_=!1,D=Z(F);switch(D.level+D.size){case"AAsmall":case"AAAlarge":_=Se>=4.5;break;case"AAlarge":_=Se>=3;break;case"AAAsmall":_=Se>=7;break}return _},P.mostReadable=function(T,K,F){var Se=null,D=0,_,ne,Ce,Re;F=F||{},ne=F.includeFallbackColors,Ce=F.level,Re=F.size;for(var Me=0;MeD&&(D=_,Se=P(K[Me]));return P.isReadable(T,Se,{level:Ce,size:Re})||!ne?Se:(F.includeFallbackColors=!1,P.mostReadable(T,["#fff","#000"],F))};var te=P.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"},W=P.hexNames=B(te);function B(T){var K={};for(var F in T)T.hasOwnProperty(F)&&(K[T[F]]=F);return K}function I(T){return T=parseFloat(T),(isNaN(T)||T<0||T>1)&&(T=1),T}function m(T,K){V(T)&&(T="100%");var F=oe(T);return T=z(K,$(0,parseFloat(T))),F&&(T=parseInt(T*K,10)/100),pe.abs(T-K)<1e-6?1:T%K/parseFloat(K)}function d(T){return z(1,$(0,T))}function M(T){return parseInt(T,16)}function V(T){return typeof T=="string"&&T.indexOf(".")!=-1&&parseFloat(T)===1}function oe(T){return typeof T=="string"&&T.indexOf("%")!=-1}function Le(T){return T.length==1?"0"+T:""+T}function Be(T){return T<=1&&(T=T*100+"%"),T}function _e(T){return pe.round(parseFloat(T)*255).toString(16)}function Ne(T){return M(T)/255}var ke=function(){var T="[-\\+]?\\d+%?",K="[-\\+]?\\d*\\.\\d+%?",F="(?:"+K+")|(?:"+T+")",Se="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",D="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?";return{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+Se),rgba:new RegExp("rgba"+D),hsl:new RegExp("hsl"+Se),hsla:new RegExp("hsla"+D),hsv:new RegExp("hsv"+Se),hsva:new RegExp("hsva"+D),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 Te(T){return!!ke.CSS_UNIT.exec(T)}function le(T){T=T.replace(ce,"").replace(be,"").toLowerCase();var K=!1;if(te[T])T=te[T],K=!0;else if(T=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var F;return(F=ke.rgb.exec(T))?{r:F[1],g:F[2],b:F[3]}:(F=ke.rgba.exec(T))?{r:F[1],g:F[2],b:F[3],a:F[4]}:(F=ke.hsl.exec(T))?{h:F[1],s:F[2],l:F[3]}:(F=ke.hsla.exec(T))?{h:F[1],s:F[2],l:F[3],a:F[4]}:(F=ke.hsv.exec(T))?{h:F[1],s:F[2],v:F[3]}:(F=ke.hsva.exec(T))?{h:F[1],s:F[2],v:F[3],a:F[4]}:(F=ke.hex8.exec(T))?{r:M(F[1]),g:M(F[2]),b:M(F[3]),a:Ne(F[4]),format:K?"name":"hex8"}:(F=ke.hex6.exec(T))?{r:M(F[1]),g:M(F[2]),b:M(F[3]),format:K?"name":"hex"}:(F=ke.hex4.exec(T))?{r:M(F[1]+""+F[1]),g:M(F[2]+""+F[2]),b:M(F[3]+""+F[3]),a:Ne(F[4]+""+F[4]),format:K?"name":"hex8"}:(F=ke.hex3.exec(T))?{r:M(F[1]+""+F[1]),g:M(F[2]+""+F[2]),b:M(F[3]+""+F[3]),format:K?"name":"hex"}:!1}function Z(T){var K,F;return T=T||{level:"AA",size:"small"},K=(T.level||"AA").toUpperCase(),F=(T.size||"small").toLowerCase(),K!=="AA"&&K!=="AAA"&&(K="AA"),F!=="small"&&F!=="large"&&(F="small"),{level:K,size:F}}ht.exports?ht.exports=P:!(Y=function(){return P}.call(de,y,de,ht),Y!==void 0&&(ht.exports=Y))})(Math)},bT9E:function(ht,de,y){"use strict";y.d(de,"a",function(){return pe});var Y=y("VTBJ");function pe(ce,be){var fe=Object(Y.a)({},ce);return Array.isArray(be)&&be.forEach(function(q){delete fe[q]}),fe}},c5Ni:function(ht,de,y){},dejd:function(ht,de,y){},dmUQ:function(ht,de,y){"use strict";var Y=y("Ff2n"),pe=y("rePB"),ce=y("1OyB"),be=y("vuIU"),fe=y("Ji7U"),q=y("md7G"),z=y("foSv"),$=y("q1tI"),N=y.n($),P=y("TSYQ"),x=y.n(P),C=y("4IlW");function k(ae,O){var me=Object.keys(ae);if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(ae);O&&(re=re.filter(function(H){return Object.getOwnPropertyDescriptor(ae,H).enumerable})),me.push.apply(me,re)}return me}function E(ae){for(var O=1;O1?oe-1:0),Be=1;Be1?m-1:0),M=1;M=0)return parseInt(I.slice(I.indexOf("e-")+2),10);var m=0;return I.indexOf(".")>=0&&(m=I.length-I.indexOf(".")-1),m},H.getInputDisplayValue=function(B){var I=B||H.state,m=I.focused,d=I.inputValue,M=I.value,V;m?V=d:V=H.toPrecisionAsStep(M),V==null&&(V="");var oe=H.formatWrapper(V);return xe(H.props.decimalSeparator)&&(oe=oe.toString().replace(".",H.props.decimalSeparator)),oe},H.recordCursorPosition=function(){try{H.cursorStart=H.input.selectionStart,H.cursorEnd=H.input.selectionEnd,H.currentValue=H.input.value,H.cursorBefore=H.input.value.substring(0,H.cursorStart),H.cursorAfter=H.input.value.substring(H.cursorEnd)}catch(B){}},H.restoreByAfter=function(B){if(B===void 0)return!1;var I=H.input.value,m=I.lastIndexOf(B);if(m===-1)return!1;var d=H.cursorBefore.length;return H.lastKeyCode===C.a.DELETE&&H.cursorBefore.charAt(d-1)===B[0]?(H.fixCaret(d,d),!0):m+B.length===I.length?(H.fixCaret(m,m),!0):!1},H.partRestoreByAfter=function(B){return B===void 0?!1:Array.prototype.some.call(B,function(I,m){var d=B.substring(m);return H.restoreByAfter(d)})},H.isNotCompleteNumber=function(B){return isNaN(B)||B===""||B===null||B&&B.toString().indexOf(".")===B.toString().length-1},H.stop=function(){H.autoStepTimer&&clearTimeout(H.autoStepTimer)},H.down=function(B,I,m){H.pressingUpOrDown=!0,H.step("down",B,I,m)},H.up=function(B,I,m){H.pressingUpOrDown=!0,H.step("up",B,I,m)},H.saveInput=function(B){H.input=B};var te=re.value;te===void 0&&(te=re.defaultValue),H.state={focused:re.autoFocus};var W=H.getValidValue(H.toNumber(te));return H.state=E(E({},H.state),{},{inputValue:H.toPrecisionAsStep(W),value:W}),H}return Object(be.a)(me,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(H){var te=this.props,W=te.value,B=te.onChange,I=te.max,m=te.min,d=this.state.focused;if(H){if(!Ie(H.value,W)||!Ie(H.max,I)||!Ie(H.min,m)){var M=d?W:this.getValidValue(W),V;this.pressingUpOrDown?V=M:this.inputting?V=this.rawInput:V=this.toPrecisionAsStep(M),this.setState({value:M,inputValue:V})}var oe="value"in this.props?W:this.state.value;"max"in this.props&&H.max!==I&&typeof oe=="number"&&oe>I&&B&&B(I),"min"in this.props&&H.min!==m&&typeof oe=="number"&&oe1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,B=parseFloat(H);return isNaN(B)?H:(BW&&(B=W),B)}},{key:"setValue",value:function(H,te){var W=this.props.precision,B=this.isNotCompleteNumber(parseFloat(H))?null:parseFloat(H),I=this.state.value,m=I===void 0?null:I,d=this.state.inputValue,M=d===void 0?null:d,V=typeof B=="number"?B.toFixed(W):"".concat(B),oe=B!==m||V!=="".concat(M);return"value"in this.props?(M=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:M},te)):this.setState({value:B,inputValue:this.toPrecisionAsStep(H)},te),oe&&this.props.onChange(B),B}},{key:"getMaxPrecision",value:function(H){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,B=W.precision,I=W.step;if(xe(B))return B;var m=this.getPrecision(te),d=this.getPrecision(I),M=this.getPrecision(H);return H?Math.max(M,m+d):m+d}},{key:"getPrecisionFactor",value:function(H){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(H,te);return Math.pow(10,W)}},{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(H){return this.props.formatter?this.props.formatter(H):H}},{key:"toPrecisionAsStep",value:function(H){if(this.isNotCompleteNumber(H)||H==="")return H;var te=Math.abs(this.getMaxPrecision(H));return isNaN(te)?H.toString():Number(H).toFixed(te)}},{key:"toNumber",value:function(H){var te=this.props.precision,W=this.state.focused,B=H&&H.length>16&&W;return this.isNotCompleteNumber(H)||B?H:xe(te)?Math.round(H*Math.pow(10,te))/Math.pow(10,te):Number(H)}},{key:"upStep",value:function(H,te){var W=this.props.step,B=this.getPrecisionFactor(H,te),I=Math.abs(this.getMaxPrecision(H,te)),m=((B*H+B*W*te)/B).toFixed(I);return this.toNumber(m)}},{key:"downStep",value:function(H,te){var W=this.props.step,B=this.getPrecisionFactor(H,te),I=Math.abs(this.getMaxPrecision(H,te)),m=((B*H-B*W*te)/B).toFixed(I);return this.toNumber(m)}},{key:"step",value:function(H,te){var W=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=arguments.length>3?arguments[3]:void 0;this.stop(),te&&(te.persist(),te.preventDefault());var m=this.props;if(m.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var M=this["".concat(H,"Step")](d,B),V=M>m.max||Mm.max?M=m.max:M=Le),Ke=(yt||yt===0)&&(isNaN(yt)||Number(yt)<=Be),ue=Ue||B||I,ie=Ke||B||I,se=x()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(pe.a)({},"".concat(W,"-handler-up-disabled"),ue)),A=x()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(pe.a)({},"".concat(W,"-handler-down-disabled"),ie)),R=m?{onTouchStart:ue?v:this.up,onTouchEnd:this.stop}:{onMouseDown:ue?v:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},X=m?{onTouchStart:ie?v:this.down,onTouchEnd:this.stop}:{onMouseDown:ie?v:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return N.a.createElement("div",{className:st,style:_e,title:Ne,onMouseEnter:ke,onMouseLeave:Te,onMouseOver:le,onMouseOut:Z,onFocus:function(){return null},onBlur:function(){return null}},N.a.createElement("div",{className:"".concat(W,"-handler-wrap")},N.a.createElement("span",Object.assign({unselectable:"on"},R,{role:"button","aria-label":"Increase Value","aria-disabled":ue,className:se}),M||N.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:b})),N.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Decrease Value","aria-disabled":ie,className:A}),V||N.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:b}))),N.a.createElement("div",{className:"".concat(W,"-input-wrap")},N.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Be,"aria-valuemax":Le,"aria-valuenow":yt,required:T,type:Se,placeholder:D,onPaste:Ye,onClick:K,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:F,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:v,onKeyUp:nt?this.onKeyUp:v,autoFocus:je,maxLength:Me,readOnly:I,disabled:B,max:Le,min:Be,step:Re,name:He,title:Ne,id:_,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(dt),pattern:Ce,inputMode:ne,onInput:qe},Oe))))}}]),me}(N.a.Component);Ee.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:he,min:-he,step:1,style:{},onChange:v,onKeyDown:v,onPressEnter:v,onFocus:v,onBlur:v,parser:L,required:!1,autoComplete:"off"};var Pe=Ee,De=de.a=Pe},fjLI:function(ht,de,y){"use strict";y.d(de,"e",function(){return P}),y.d(de,"a",function(){return x}),y.d(de,"c",function(){return C}),y.d(de,"d",function(){return E}),y.d(de,"b",function(){return S});var Y=y("8HAY"),pe=y("Cg/j"),ce=y("T8No"),be=y("nnTU"),fe=y("MI8n"),q=function(){var j=function(v,b){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,U){L.__proto__=U}||function(L,U){for(var ve in U)U.hasOwnProperty(ve)&&(L[ve]=U[ve])},j(v,b)};return function(v,b){j(v,b);function L(){this.constructor=v}v.prototype=b===null?Object.create(b):(L.prototype=b.prototype,new L)}}(),z=function(j,v,b,L){var U=arguments.length,ve=U<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,b):L,he;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ve=Reflect.decorate(j,v,b,L);else for(var xe=j.length-1;xe>=0;xe--)(he=j[xe])&&(ve=(U<3?he(ve):U>3?he(v,b,ve):he(v,b))||ve);return U>3&&ve&&Object.defineProperty(v,b,ve),ve},$=function(j,v){return function(b,L){v(b,L,j)}},N=function(){for(var j=0,v=0,b=arguments.length;v=0&&(U.splice(ve,1),L._onDidChangeMenu.fire(v))}}},j.prototype.getMenuItems=function(v){var b=(this._menuItems.get(v)||[]).slice(0);return v===0&&this._appendImplicitItems(b),b},j.prototype._appendImplicitItems=function(v){for(var b=new Set,L=v.filter(function(Ee){return P(Ee)}),U=0,ve=L;UW.length)&&(B=W.length);for(var I=0,m=new Array(B);I=0)continue;if(!Object.prototype.propertyIsEnumerable.call(W,m))continue;I[m]=W[m]}}return I}function S(W,B){if(W==null)return{};var I={},m=Object.keys(W),d,M;for(M=0;M=0)continue;I[d]=W[d]}return I}var j=function(B){var I=B.className,m=B.percent,d=B.prefixCls,M=B.strokeColor,V=B.strokeLinecap,oe=B.strokeWidth,Le=B.style,Be=B.trailColor,_e=B.trailWidth,Ne=B.transition,ke=E(B,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ke.gapPosition;var Te=Array.isArray(m)?m:[m],le=Array.isArray(M)?M:[M],Z=q(Te),T=$(Z,1),K=T[0],F=oe/2,Se=100-oe/2,D="M ".concat(V==="round"?F:0,",").concat(F,` L `).concat(V==="round"?Se:100,",").concat(F),_="0 0 100 ".concat(oe),ne=0;return pe.a.createElement("svg",z({className:be()("".concat(d,"-line"),I),viewBox:_,preserveAspectRatio:"none",style:Le},ke),pe.a.createElement("path",{className:"".concat(d,"-line-trail"),d:D,strokeLinecap:V,stroke:Be,strokeWidth:_e||oe,fillOpacity:"0"}),Te.map(function(Ce,Re){var Me={strokeDasharray:"".concat(Ce,"px, 100px"),strokeDashoffset:"-".concat(ne,"px"),transition:Ne||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},je=le[Re]||le[le.length-1];return ne+=Ce,pe.a.createElement("path",{key:Re,className:"".concat(d,"-line-path"),d:D,strokeLinecap:V,stroke:je,strokeWidth:oe,fillOpacity:"0",ref:K[Re],style:Me})}))};j.defaultProps=fe;var v=j;function b(){return b=Object.assign||function(W){for(var B=1;BW.length)&&(B=W.length);for(var I=0,m=new Array(B);I=0)continue;if(!Object.prototype.propertyIsEnumerable.call(W,m))continue;I[m]=W[m]}}return I}function Pe(W,B){if(W==null)return{};var I={},m=Object.keys(W),d,M;for(M=0;M=0)continue;I[d]=W[d]}return I}var De=0;function ae(W){return+W.replace("%","")}function O(W){return Array.isArray(W)?W:[W]}function me(W,B,I,m){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,M=arguments.length>5?arguments[5]:void 0,V=50-m/2,oe=0,Le=-V,Be=0,_e=-2*V;switch(M){case"left":oe=-V,Le=0,Be=2*V,_e=0;break;case"right":oe=V,Le=0,Be=-2*V,_e=0;break;case"bottom":Le=V,_e=2*V;break;default:}var Ne="M 50,50 m ".concat(oe,",").concat(Le,` a `).concat(V,",").concat(V," 0 1 1 ").concat(Be,",").concat(-_e,` a `).concat(V,",").concat(V," 0 1 1 ").concat(-Be,",").concat(_e),ke=Math.PI*2*V,Te={stroke:I,strokeDasharray:"".concat(B/100*(ke-d),"px ").concat(ke,"px"),strokeDashoffset:"-".concat(d/2+W/100*(ke-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ne,pathStyle:Te}}var re=function(B){var I=B.prefixCls,m=B.strokeWidth,d=B.trailWidth,M=B.gapDegree,V=B.gapPosition,oe=B.trailColor,Le=B.strokeLinecap,Be=B.style,_e=B.className,Ne=B.strokeColor,ke=B.percent,Te=Ee(B,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),le=Object(Y.useMemo)(function(){return De+=1,De},[]),Z=me(0,100,oe,m,M,V),T=Z.pathString,K=Z.pathStyle,F=O(ke),Se=O(Ne),D=Se.find(function(Me){return Object.prototype.toString.call(Me)==="[object Object]"}),_=q(F),ne=L(_,1),Ce=ne[0],Re=function(){var je=0;return F.map(function(He,Ye){var qe=Se[Ye]||Se[Se.length-1],Je=Object.prototype.toString.call(qe)==="[object Object]"?"url(#".concat(I,"-gradient-").concat(le,")"):"",Ze=me(je,He,qe,m,M,V);return je+=He,pe.a.createElement("path",{key:Ye,className:"".concat(I,"-circle-path"),d:Ze.pathString,stroke:Je,strokeLinecap:Le,strokeWidth:m,opacity:He===0?0:1,fillOpacity:"0",style:Ze.pathStyle,ref:Ce[Ye]})})};return pe.a.createElement("svg",b({className:be()("".concat(I,"-circle"),_e),viewBox:"0 0 100 100",style:Be},Te),D&&pe.a.createElement("defs",null,pe.a.createElement("linearGradient",{id:"".concat(I,"-gradient-").concat(le),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(D).sort(function(Me,je){return ae(Me)-ae(je)}).map(function(Me,je){return pe.a.createElement("stop",{key:je,offset:Me,stopColor:D[Me]})}))),pe.a.createElement("path",{className:"".concat(I,"-circle-trail"),d:T,stroke:oe,strokeLinecap:Le,strokeWidth:d||m,fillOpacity:"0",style:K}),Re().reverse())};re.defaultProps=fe;var H=re,te={Line:v,Circle:H}},iIVh:function(ht,de,y){},kSUc:function(ht,de,y){},lZu9:function(ht,de,y){(function(Y){Y(y("VrN/"),y("1eCo"),y("8EBN"))})(function(Y){"use strict";Y.defineMode("markdown",function(pe,ce){var be=Y.getMode(pe,"text/html"),fe=be.name=="null";function q(m){if(Y.findModeByName){var d=Y.findModeByName(m);d&&(m=d.mime||d.mimes[0])}var M=Y.getMode(pe,m);return M.name=="null"?null:M}ce.highlightFormatting===void 0&&(ce.highlightFormatting=!1),ce.maxBlockquoteDepth===void 0&&(ce.maxBlockquoteDepth=0),ce.taskLists===void 0&&(ce.taskLists=!1),ce.strikethrough===void 0&&(ce.strikethrough=!1),ce.emoji===void 0&&(ce.emoji=!1),ce.fencedCodeBlockHighlighting===void 0&&(ce.fencedCodeBlockHighlighting=!0),ce.fencedCodeBlockDefaultMode===void 0&&(ce.fencedCodeBlockDefaultMode="text/plain"),ce.xml===void 0&&(ce.xml=!0),ce.tokenTypeOverrides===void 0&&(ce.tokenTypeOverrides={});var z={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 $ in z)z.hasOwnProperty($)&&ce.tokenTypeOverrides[$]&&(z[$]=ce.tokenTypeOverrides[$]);var N=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,C=ce.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,E=/^[^#!\[\]*_\\<>` "'(~:]+/,S=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,j=/^\s*\[[^\]]+?\]:.*$/,v=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,b=" ";function L(m,d,M){return d.f=d.inline=M,M(m,d)}function U(m,d,M){return d.f=d.block=M,M(m,d)}function ve(m){return!m||!/\S/.test(m.string)}function he(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==Ie){var d=fe;if(!d){var M=Y.innerMode(be,m.htmlState);d=M.mode.name=="xml"&&M.state.tagStart===null&&!M.state.context&&M.state.tokenize.isInText}d&&(m.f=ae,m.block=xe,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function xe(m,d){var M=m.column()===d.indentation,V=ve(d.prevLine.stream),oe=d.indentedCode,Le=d.prevLine.hr,Be=d.list!==!1,_e=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Ne=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Be)){for(d.list=null;Ne=4&&(oe||d.prevLine.fencedCodeEnd||d.prevLine.header||V))return m.skipToEnd(),d.indentedCode=!0,z.code;if(m.eatSpace())return null;if(M&&d.indentation<=_e&&(le=m.match(C))&&le[1].length<=6)return d.quote=0,d.header=le[1].length,d.thisLine.header=!0,ce.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Pe(d);if(d.indentation<=_e&&m.eat(">"))return d.quote=M?1:d.quote+1,ce.highlightFormatting&&(d.formatting="quote"),m.eatSpace(),Pe(d);if(!Te&&!d.setext&&M&&d.indentation<=_e&&(le=m.match(P))){var Z=le[1]?"ol":"ul";return d.indentation=Ne+m.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,ce.taskLists&&m.match(x,!1)&&(d.taskList=!0),d.f=d.inline,ce.highlightFormatting&&(d.formatting=["list","list-"+Z]),Pe(d)}else{if(M&&d.indentation<=_e&&(le=m.match(S,!0)))return d.quote=0,d.fencedEndRE=new RegExp(le[1]+"+ *$"),d.localMode=ce.fencedCodeBlockHighlighting&&q(le[2]||ce.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=Y.startState(d.localMode)),d.f=d.block=Ee,ce.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Pe(d);if(d.setext||(!ke||!Be)&&!d.quote&&d.list===!1&&!d.code&&!Te&&!j.test(m.string)&&(le=m.lookAhead(1))&&(le=le.match(k)))return d.setext?(d.header=d.setext,d.setext=0,m.skipToEnd(),ce.highlightFormatting&&(d.formatting="header")):(d.header=le[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Pe(d);if(Te)return m.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,z.hr;if(m.peek()==="[")return L(m,d,te)}return L(m,d,d.inline)}function Ie(m,d){var M=be.token(m,d.htmlState);if(!fe){var V=Y.innerMode(be,d.htmlState);(V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText||d.md_inside&&m.current().indexOf(">")>-1)&&(d.f=ae,d.block=xe,d.htmlState=null)}return M}function Ee(m,d){var M=d.listStack[d.listStack.length-1]||0,V=d.indentation=m.quote?d.push(z.formatting+"-"+m.formatting[M]+"-"+m.quote):d.push("error"))}if(m.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(m.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(m.linkHref?d.push(z.linkHref,"url"):(m.strong&&d.push(z.strong),m.em&&d.push(z.em),m.strikethrough&&d.push(z.strikethrough),m.emoji&&d.push(z.emoji),m.linkText&&d.push(z.linkText),m.code&&d.push(z.code),m.image&&d.push(z.image),m.imageAltText&&d.push(z.imageAltText,"link"),m.imageMarker&&d.push(z.imageMarker)),m.header&&d.push(z.header,z.header+"-"+m.header),m.quote&&(d.push(z.quote),!ce.maxBlockquoteDepth||ce.maxBlockquoteDepth>=m.quote?d.push(z.quote+"-"+m.quote):d.push(z.quote+"-"+ce.maxBlockquoteDepth)),m.list!==!1){var V=(m.listStack.length-1)%3;V?V===1?d.push(z.list2):d.push(z.list3):d.push(z.list1)}return m.trailingSpaceNewLine?d.push("trailing-space-new-line"):m.trailingSpace&&d.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function De(m,d){return m.match(E,!0)?Pe(d):void 0}function ae(m,d){var M=d.text(m,d);if(typeof M!="undefined")return M;if(d.list)return d.list=null,Pe(d);if(d.taskList){var V=m.match(x,!0)[1]===" ";return V?d.taskOpen=!0:d.taskClosed=!0,ce.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Pe(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&m.match(/^#+$/,!0))return ce.highlightFormatting&&(d.formatting="header"),Pe(d);var oe=m.next();if(d.linkTitle){d.linkTitle=!1;var Le=oe;oe==="("&&(Le=")"),Le=(Le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Be="^\\s*(?:[^"+Le+"\\\\]+|\\\\\\\\|\\\\.)"+Le;if(m.match(new RegExp(Be),!0))return z.linkHref}if(oe==="`"){var _e=d.formatting;ce.highlightFormatting&&(d.formatting="code"),m.eatWhile("`");var Ne=m.current().length;if(d.code==0&&(!d.quote||Ne==1))return d.code=Ne,Pe(d);if(Ne==d.code){var ke=Pe(d);return d.code=0,ke}else return d.formatting=_e,Pe(d)}else if(d.code)return Pe(d);if(oe==="\\"&&(m.next(),ce.highlightFormatting)){var Te=Pe(d),le=z.formatting+"-escape";return Te?Te+" "+le:le}if(oe==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,ce.highlightFormatting&&(d.formatting="image"),Pe(d);if(oe==="["&&d.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,ce.highlightFormatting&&(d.formatting="image"),Pe(d);if(oe==="]"&&d.imageAltText){ce.highlightFormatting&&(d.formatting="image");var Te=Pe(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=me,Te}if(oe==="["&&!d.image)return d.linkText&&m.match(/^.*?\]/)||(d.linkText=!0,ce.highlightFormatting&&(d.formatting="link")),Pe(d);if(oe==="]"&&d.linkText){ce.highlightFormatting&&(d.formatting="link");var Te=Pe(d);return d.linkText=!1,d.inline=d.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?me:ae,Te}if(oe==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,ce.highlightFormatting&&(d.formatting="link");var Te=Pe(d);return Te?Te+=" ":Te="",Te+z.linkInline}if(oe==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,ce.highlightFormatting&&(d.formatting="link");var Te=Pe(d);return Te?Te+=" ":Te="",Te+z.linkEmail}if(ce.xml&&oe==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Z=m.string.indexOf(">",m.pos);if(Z!=-1){var T=m.string.substring(m.start,Z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(T)&&(d.md_inside=!0)}return m.backUp(1),d.htmlState=Y.startState(be),U(m,d,Ie)}if(ce.xml&&oe==="<"&&m.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var K=1,F=m.pos==1?" ":m.string.charAt(m.pos-2);K<3&&m.eat(oe);)K++;var Se=m.peek()||" ",D=!/\s/.test(Se)&&(!v.test(Se)||/\s/.test(F)||v.test(F)),_=!/\s/.test(F)&&(!v.test(F)||/\s/.test(Se)||v.test(Se)),ne=null,Ce=null;if(K%2&&(!d.em&&D&&(oe==="*"||!_||v.test(F))?ne=!0:d.em==oe&&_&&(oe==="*"||!D||v.test(Se))&&(ne=!1)),K>1&&(!d.strong&&D&&(oe==="*"||!_||v.test(F))?Ce=!0:d.strong==oe&&_&&(oe==="*"||!D||v.test(Se))&&(Ce=!1)),Ce!=null||ne!=null){ce.highlightFormatting&&(d.formatting=ne==null?"strong":Ce==null?"em":"strong em"),ne===!0&&(d.em=oe),Ce===!0&&(d.strong=oe);var ke=Pe(d);return ne===!1&&(d.em=!1),Ce===!1&&(d.strong=!1),ke}}else if(oe===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return Pe(d);m.backUp(1)}if(ce.strikethrough){if(oe==="~"&&m.eatWhile(oe)){if(d.strikethrough){ce.highlightFormatting&&(d.formatting="strikethrough");var ke=Pe(d);return d.strikethrough=!1,ke}else if(m.match(/^[^\s]/,!1))return d.strikethrough=!0,ce.highlightFormatting&&(d.formatting="strikethrough"),Pe(d)}else if(oe===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return Pe(d);m.backUp(2)}}if(ce.emoji&&oe===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,ce.highlightFormatting&&(d.formatting="emoji");var Re=Pe(d);return d.emoji=!1,Re}return oe===" "&&(m.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Pe(d)}function O(m,d){var M=m.next();if(M===">"){d.f=d.inline=ae,ce.highlightFormatting&&(d.formatting="link");var V=Pe(d);return V?V+=" ":V="",V+z.linkInline}return m.match(/^[^>]+/,!0),z.linkInline}function me(m,d){if(m.eatSpace())return null;var M=m.next();return M==="("||M==="["?(d.f=d.inline=H(M==="("?")":"]"),ce.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Pe(d)):"error"}var re={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function H(m){return function(d,M){var V=d.next();if(V===m){M.f=M.inline=ae,ce.highlightFormatting&&(M.formatting="link-string");var oe=Pe(M);return M.linkHref=!1,oe}return d.match(re[m]),M.linkHref=!0,Pe(M)}}function te(m,d){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=W,m.next(),ce.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Pe(d)):L(m,d,ae)}function W(m,d){if(m.match(/^\]:/,!0)){d.f=d.inline=B,ce.highlightFormatting&&(d.formatting="link");var M=Pe(d);return d.linkText=!1,M}return m.match(/^([^\]\\]|\\.)+/,!0),z.linkText}function B(m,d){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?d.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=ae,z.linkHref+" url")}var I={startState:function(){return{f:xe,prevLine:{stream:null},thisLine:{stream:null},block:xe,htmlState:null,indentation:0,inline:ae,text:De,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&Y.copyState(be,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?Y.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,d){if(d.formatting=!1,m!=d.thisLine.stream){if(d.header=0,d.hr=!1,m.match(/^\s*$/,!0))return he(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:m},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=Ie)){var M=m.match(/^\s*/,!0)[0].replace(/\t/g,b).length;if(d.indentation=M,d.indentationDiff=null,M>0)return null}}return d.f(m,d)},innerMode:function(m){return m.block==Ie?{state:m.htmlState,mode:be}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:I}},indent:function(m,d,M){return m.block==Ie&&be.indent?be.indent(m.htmlState,d,M):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,d,M):Y.Pass},blankLine:he,getType:Pe,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return I},"xml"),Y.defineMIME("text/markdown","markdown"),Y.defineMIME("text/x-markdown","markdown")})},nnTU:function(ht,de,y){"use strict";y.d(de,"b",function(){return $}),y.d(de,"a",function(){return N});var Y=y("pmY6"),pe=y("746U"),ce=y("Cg/j"),be=y("MI8n"),fe=y("24hK"),q=y("QDVR"),z=function(){for(var P=0,x=0,C=arguments.length;x0&&K(me.a.IMG_SERVER+ke.cover_id[0].url))},[ke]),N.a.createElement(Ie.a,{form:D,initialValues:ke,className:"moop-panel",onFinish:_},N.a.createElement(Ie.a.Item,{label:"\u6807\u9898",name:"title",extra:N.a.createElement("p",{className:"tip"},"\u7B80\u660E\u627C\u8981\u4ECB\u7ECD\u6587\u6863/\u89C6\u9891\u6240\u5305\u542B\u7684\u4E3B\u8981\u7684\u5185\u5BB9"),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},N.a.createElement(v.a,{placeholder:"\u4F8B\u5982\uFF1A\u8F6F\u4EF6\u5DE5\u7A0B\u6559\u5B66\u6848\u4F8B"})),N.a.createElement("div",{className:"flex-container"},N.a.createElement(Ie.a.Item,{label:"\u4F5C\u8005",name:"author_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u540D\u79F0"}]},N.a.createElement(v.a,{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",style:{marginRight:20,width:200}})),N.a.createElement(Ie.a.Item,{name:"author_school_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0"}]},N.a.createElement(v.a,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0",style:{width:200}}))),N.a.createElement(Ie.a.Item,{name:"tag_ids",label:"\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6807\u7B7E"}]},N.a.createElement(H,null,_e.map(function(je){return N.a.createElement(ae.a,{key:je.id,value:je.id}," ",je.name," ")}))),N.a.createElement(Ie.a.Item,{name:"publish",valuePropName:"checked"},N.a.createElement(ae.a,null,"\u662F\u5426\u7533\u8BF7\u53D1\u5E03")),N.a.createElement(Ie.a.Item,{name:"content",label:"\u63CF\u8FF0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},N.a.createElement(re.a,{id:"moop_cases_content",height:400})),N.a.createElement(Ie.a.Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:ne},N.a.createElement(te,Ce,N.a.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4E0A\u4F20\u9644\u4EF6"),N.a.createElement("p",{className:"c-grey-c"},"\u4ECE\u6211\u7684\u7535\u8111\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u6863\uFF1A\u6309\u4F4FCTRL\u53EF\u4EE5\u4E0A\u4F20\u591A\u4EFD\u6587\u6863\u3002\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\uFF1A100MB"))),N.a.createElement(Ie.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",extra:"\u4E0A\u4F20\u5C3A\u5BF8\uFF1A120*90 px",getValueFromEvent:ne,valuePropName:"fileList",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"}]},N.a.createElement(Pe.a,Me,T?N.a.createElement("img",{src:T,width:120}):N.a.createElement("a",{title:"\u4E0A\u4F20\u5C01\u9762\u56FE",className:"upload-cover"}," ",N.a.createElement(O.a,null)," "))),N.a.createElement("div",{className:"desc"},N.a.createElement("h3",null,"\u5BA1\u6838\u8BF4\u660E"),N.a.createElement("p",null," \u5E73\u53F0\u7BA1\u7406\u5458\u5C06\u5BF9\u6BCF\u5929\u65B0\u4E0A\u4F20\u7684\u6587\u6863\u8FDB\u884C\u5BA1\u6838\uFF0C\u5BA1\u6838\u901A\u8FC7\u7684\u6587\u6863\u5C06\u516C\u5F00\u663E\u793A\uFF0C\u5426\u5219\u5C06\u79C1\u6709\u5316\u6216\u79FB\u9664 ")),N.a.createElement("div",{className:"desc"},N.a.createElement("h3",null,"\u6E29\u99A8\u63D0\u793A"),N.a.createElement("ul",{style:{padding:0}},N.a.createElement("li",null,"1.\u8BF7\u52FF\u4E0A\u4F20\u5DF2\u8BBE\u7F6E\u52A0\u5BC6\u53E3\u4EE4\u7684\u6587\u6863\u8D44\u6E90\uFF1B"),N.a.createElement("li",null,"2.\u53EF\u4EE5\u4E0A\u4F20\u7B26\u5408\u6559\u5B66\u6848\u4F8B\u6807\u51C6\u7684\u6587\u6863\u8D44\u6599\uFF0C\u5982",N.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4F8B\u5165\u5E93\u6807\u51C6 ")," \u3001",N.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4F8B\u4F7F\u7528\u8BF4\u660E\u4E66"),"\u4EE5\u53CA\u5176\u4ED6\u8D44\u6599\u7B49\uFF0C\u4E0A\u4F20\u652F\u6301\u7684\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF1A100MB\uFF1B"),N.a.createElement("li",null,"3.\u8BF7\u786E\u4FDD\u4E0A\u4F20\u5185\u5BB9\u65E0\u4FB5\u6743\u6216\u8FDD\u53CD\u56FD\u5BB6\u5173\u4E8E\u4E92\u8054\u7F51\u653F\u7B56\u7684\u4E0D\u826F\u884C\u4E3A\uFF1B"),N.a.createElement("li",null,"4.\u8BF7\u4F7F\u7528Chrome\uFF0CFirefox\uFF0CSafari\uFF0CIE11\uFF08\u53CA\u4EE5\u4E0A\u7248\u672C\uFF09\u6D4F\u89C8\u5668\uFF1B"))),N.a.createElement(Ie.a.Item,{style:{marginTop:10}},N.a.createElement(S.a,{type:"primary",htmlType:"submit"},"\u63D0\u4EA4")))},I=y("wzkS"),m={loading:!1,data:{},tags:[]},d;(function(oe){oe[oe.GET_DATA=0]="GET_DATA",oe[oe.SET_LOADING=1]="SET_LOADING",oe[oe.GET_TAGS=2]="GET_TAGS"})(d||(d={}));function M(oe,Le){switch(Le.type){case d.GET_DATA:return Object(fe.a)(Object(fe.a)({},oe),Le.payload);case d.GET_TAGS:return Object(fe.a)(Object(fe.a)({},oe),{},{tags:Le.payload});case d.SET_LOADING:return Object(fe.a)(Object(fe.a)({},oe),{},{loading:Le.payload});default:throw new Error}}var V=de.default=function(){var oe=Object(C.i)(),Le=oe.caseId,Be=Object(C.g)(),_e=Object($.useReducer)(M,m),Ne=Object(be.a)(_e,2),ke=Ne[0],Te=Ne[1],le=ke.loading,Z=ke.tags,T=ke.data;Object($.useEffect)(function(){function D(){return _.apply(this,arguments)}function _(){return _=Object(ce.a)(z.a.mark(function ne(){var Ce;return z.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,Object(I.b)();case 2:Ce=Me.sent,Te({type:d.GET_TAGS,payload:Ce.library_tags});case 4:case"end":return Me.stop()}},ne)})),_.apply(this,arguments)}D()},[]),Object($.useEffect)(function(){var D=!1;function _(){return ne.apply(this,arguments)}function ne(){return ne=Object(ce.a)(z.a.mark(function Ce(){var Re,Me,je,He,Ye,qe,Je,Ze,yt;return z.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return Te({type:d.SET_LOADING,payload:!1}),st.next=3,Object(I.c)(Le);case 3:Re=st.sent,Me=Re.author_name,je=Re.author_school_name,He=Re.content,Ye=Re.cover,qe=Re.attachments,Je=Re.status,Ze=Re.title,yt=Re.tags,D||(Re.status===404?Be.push("/moop_cases"):Te({type:d.GET_DATA,payload:{data:{title:Ze,author_name:Me,author_school_name:je,content:He,tag_ids:yt.map(function(Oe){return Oe.id}),publish:Je==="published",attachment_ids:qe.map(function(Oe){return{uid:Oe.id,id:Oe.id,name:Oe.title,url:Oe.url,filesize:Oe.filesize,status:"done"}}),cover_id:Ye!=null&&Ye.id?[{uid:Ye==null?void 0:Ye.id,id:Ye==null?void 0:Ye.id,name:Ye==null?void 0:Ye.title,url:Ye==null?void 0:Ye.url,filesize:Ye==null?void 0:Ye.filesize,status:"done"}]:[]},loading:!1}}));case 6:case"end":return st.stop()}},Ce)})),ne.apply(this,arguments)}return!D&&Le&&_(),function(){D=!0}},[Le]);function K(D){return F.apply(this,arguments)}function F(){return F=Object(ce.a)(z.a.mark(function D(_){var ne,Ce;return z.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(!Le){Me.next=6;break}return Me.next=3,Object(I.e)(Le,_);case 3:Be.push("/moop_cases/".concat(Le,"/publish-success")),Me.next=11;break;case 6:return Me.next=8,Object(I.a)(_);case 8:ne=Me.sent,Ce=ne.id,Ce&&Be.push("/moop_cases/".concat(Ce,"/publish-success"));case 11:case"end":return Me.stop()}},D)})),F.apply(this,arguments)}var Se={initialValues:T,tags:Z,removeAttachment:I.d,callback:K};return N.a.createElement(pe.a,{spinning:le,delay:500},N.a.createElement("div",{className:"moop-info"},N.a.createElement("div",{className:"crumb"},N.a.createElement(k.a,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),N.a.createElement("span",null,"\u65B0\u5EFA")),N.a.createElement("div",{className:"title"},N.a.createElement("h2",null,"\u4E0A\u4F20\u6559\u5B66\u6848\u4F8B"),N.a.createElement(k.a,{to:"/moop_cases"},"\u8FD4\u56DE")),N.a.createElement(B,Se)))}},osHv:function(ht,de,y){(function(Y){Y(y("VrN/"))})(function(Y){"use strict";var pe=Y.Pos;function ce(v,b){return v.line-b.line||v.ch-b.ch}var be="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",fe=be+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",q=new RegExp("<(/?)(["+be+"]["+fe+"]*)","g");function z(v,b,L,U){this.line=b,this.ch=L,this.cm=v,this.text=v.getLine(b),this.min=U?Math.max(U.from,v.firstLine()):v.firstLine(),this.max=U?Math.min(U.to-1,v.lastLine()):v.lastLine()}function $(v,b){var L=v.cm.getTokenTypeAt(pe(v.line,b));return L&&/\btag\b/.test(L)}function N(v){return v.line>=v.max?void 0:(v.ch=0,v.text=v.cm.getLine(++v.line),!0)}function P(v){return v.line<=v.min?void 0:(v.text=v.cm.getLine(--v.line),v.ch=v.text.length,!0)}function x(v){for(;;){var b=v.text.indexOf(">",v.ch);if(b==-1){if(N(v))continue;return}if(!$(v,b+1)){v.ch=b+1;continue}var L=v.text.lastIndexOf("/",b),U=L>-1&&!/\S/.test(v.text.slice(L+1,b));return v.ch=b+1,U?"selfClose":"regular"}}function C(v){for(;;){var b=v.ch?v.text.lastIndexOf("<",v.ch-1):-1;if(b==-1){if(P(v))continue;return}if(!$(v,b+1)){v.ch=b;continue}q.lastIndex=b,v.ch=b;var L=q.exec(v.text);if(L&&L.index==b)return L}}function k(v){for(;;){q.lastIndex=v.ch;var b=q.exec(v.text);if(!b){if(N(v))continue;return}if(!$(v,b.index+1)){v.ch=b.index+1;continue}return v.ch=b.index+b[0].length,b}}function E(v){for(;;){var b=v.ch?v.text.lastIndexOf(">",v.ch-1):-1;if(b==-1){if(P(v))continue;return}if(!$(v,b+1)){v.ch=b;continue}var L=v.text.lastIndexOf("/",b),U=L>-1&&!/\S/.test(v.text.slice(L+1,b));return v.ch=b+1,U?"selfClose":"regular"}}function S(v,b){for(var L=[];;){var U=k(v),ve,he=v.line,xe=v.ch-(U?U[0].length:0);if(!U||!(ve=x(v)))return;if(ve=="selfClose")continue;if(U[1]){for(var Ie=L.length-1;Ie>=0;--Ie)if(L[Ie]==U[2]){L.length=Ie;break}if(Ie<0&&(!b||b==U[2]))return{tag:U[2],from:pe(he,xe),to:pe(v.line,v.ch)}}else L.push(U[2])}}function j(v,b){for(var L=[];;){var U=E(v);if(!U)return;if(U=="selfClose"){C(v);continue}var ve=v.line,he=v.ch,xe=C(v);if(!xe)return;if(xe[1])L.push(xe[2]);else{for(var Ie=L.length-1;Ie>=0;--Ie)if(L[Ie]==xe[2]){L.length=Ie;break}if(Ie<0&&(!b||b==xe[2]))return{tag:xe[2],from:pe(v.line,v.ch),to:pe(ve,he)}}}}Y.registerHelper("fold","xml",function(v,b){for(var L=new z(v,b.line,0);;){var U=k(L);if(!U||L.line!=b.line)return;var ve=x(L);if(!ve)return;if(!U[1]&&ve!="selfClose"){var he=pe(L.line,L.ch),xe=S(L,U[2]);return xe&&ce(xe.from,he)>0?{from:he,to:xe.from}:null}}}),Y.findMatchingTag=function(v,b,L){var U=new z(v,b.line,b.ch,L);if(U.text.indexOf(">")==-1&&U.text.indexOf("<")==-1)return;var ve=x(U),he=ve&&pe(U.line,U.ch),xe=ve&&C(U);if(!ve||!xe||ce(U,b)>0)return;var Ie={from:pe(U.line,U.ch),to:he,tag:xe[2]};return ve=="selfClose"?{open:Ie,close:null,at:"open"}:xe[1]?{open:j(U,xe[2]),close:Ie,at:"close"}:(U=new z(v,he.line,he.ch,L),{open:Ie,close:S(U,xe[2]),at:"open"})},Y.findEnclosingTag=function(v,b,L,U){for(var ve=new z(v,b.line,b.ch,L);;){var he=j(ve,U);if(!he)break;var xe=new z(v,b.line,b.ch,L),Ie=S(xe,he.tag);if(Ie)return{open:he,close:Ie}}},Y.scanForClosingTag=function(v,b,L,U){var ve=new z(v,b.line,b.ch,U?{from:0,to:U}:null);return S(ve,L)}})},p5ED:function(ht,de,y){"use strict";var Y=y("+L6B"),pe=y("2/Rp"),ce=y("5Dmo"),be=y("3S7+"),fe=y("k1fw"),q=y("9og8"),z=y("tJVT"),$=y("WmNS"),N=y.n($),P=y("q1tI"),x=y.n(P),C=y("vHTk"),k=y.n(C),E=y("yEEn"),S=y("ZW9T"),j=y("1vsH"),v=y("V0Rq"),b=y("m3rI");de.a=function(L){var U,ve,he,xe,Ie,Ee,Pe=L.editOffice,De=Pe===void 0?"view":Pe,ae=L.name,O=L.data,me=L.theme,re=L.type,H=L.filename,te=L.monacoEditor,W=L.className,B=L.style,I=L.close,m=L.onClose,d=L.hasMask,M=L.disabledDownload,V=L.onImgDimensions,oe=L.otherData,Le=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Be=Object(z.a)(Le,2),_e=Be[0],Ne=Be[1],ke=Object(P.useState)(""),Te=Object(z.a)(ke,2),le=Te[0],Z=Te[1],T=Object(P.useState)(),K=Object(z.a)(T,2),F=K[0],Se=K[1],D=window.ENV==="build"?"/react/build":"",_=location.host.startsWith("localhost")?b.a.PROXY_SERVER:b.a.API_SERVER,ne,Ce=1024*1024,Re=10*Ce,Me=Object(P.useRef)();(U=O)!==null&&U!==void 0&&U.startsWith("/api")&&re!=="txt"&&(O=b.a.API_SERVER+O),re==="office"&&(ne=Object(j.P)(O).filesize,ne>Re&&(re="other")),H&&(te.filename=H),Object(P.useEffect)(function(){var qe,Je,Ze=(qe=document.cookie)===null||qe===void 0||((Je=qe.replace(/\s/g,""))===null||Je===void 0)?void 0:Je.split(";");Ze==null||Ze.map(function(yt){var gt=yt.split("=");gt[0]==="_educoder_session"&&Z(gt[1])})},[]),Object(P.useEffect)(function(){re==="office"&&je()},[re,O]);var je=function(){var qe=Object(q.a)(N.a.mark(function Je(){var Ze,yt,gt;return N.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return console.log("data:",O),Ze=O,O.startsWith("http")||(Ze=location.origin+Ze),yt=new URL(Ze).pathname.split("/").pop(),Oe.next=6,Object(v.U)({attachment_id:yt});case 6:gt=Oe.sent,Se(gt);case 8:case"end":return Oe.stop()}},Je)}));return function(){return qe.apply(this,arguments)}}(),He=function(){if(O.startsWith("http")||O.startsWith("blob:")){Ye();return}Object(j.x)(H||"educoder",O,H)},Ye=function(){Object(j.v)(H||"educoder",decodeURIComponent(O))};return x.a.createElement("div",{style:Object(fe.a)({},B||{}),className:"".concat(d&&k.a.bgBlack," ").concat(re?k.a.wrp:"hide")},I&&x.a.createElement("div",{className:k.a.close,ref:Me},!!V&&x.a.createElement(be.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Me.current}},x.a.createElement("span",{onClick:function(){m(),V()}},x.a.createElement("i",{className:"icon-yulanpizhu"}))),!M&&x.a.createElement(be.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Me.current}},x.a.createElement("span",{onClick:Ye},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(be.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Me.current}},x.a.createElement("span",{className:"",onClick:m},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(k.a[W]," ").concat(W," ").concat(k.a.monaco," ").concat(re==="txt"?"show":"hide")},re==="txt"&&x.a.createElement(S.b,te)),re==="audio"&&x.a.createElement("audio",{src:"".concat(((ve=O)===null||ve===void 0?void 0:ve.indexOf("http://"))>-1||((he=O)===null||he===void 0?void 0:he.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(O),autoPlay:!0}),re==="video"&&x.a.createElement(x.a.Fragment,null,((xe=O)===null||xe===void 0?void 0:xe.indexOf("http"))>-1?x.a.createElement("video",{controls:!0,src:"".concat(O),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(O),autoPlay:!0})),re==="office"&&F&&x.a.createElement("iframe",{src:"".concat(D,"/office.html?key=").concat(F.key,"&url=").concat(_+F.url,"&callbackUrl=").concat(_+F.callbackUrl,"&fileType=").concat(F.fileType,"&title=").concat(F.title,"&model=").concat(De,"&officeServer=").concat(b.a.OFFICE_SERVER,"&disabledDownload=").concat(!!M)}),(re==="xlsx"||re==="doc"||re==="pptx"||re==="docx")&&x.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(oe.key,"&url=").concat(b.a.API_SERVER+oe.url,"&callbackUrl=").concat(b.a.API_SERVER+oe.callbackUrl,"&fileType=").concat(oe.fileType,"&title=").concat(oe.title,"&model=").concat(oe.model)}),re==="html"&&x.a.createElement("iframe",{src:O+"&disposition=inline"}),re==="pdf"&&x.a.createElement("embed",{className:k.a.embed,src:O}),re==="image"&&x.a.createElement("img",{src:"".concat(((Ie=O)===null||Ie===void 0?void 0:Ie.indexOf("http://"))>-1||((Ee=O)===null||Ee===void 0?void 0:Ee.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(O)}),re==="other"&&x.a.createElement("div",null,x.a.createElement(pe.a,{type:"primary",size:"large",onClick:He},x.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),re==="download"&&x.a.createElement(pe.a,{type:"primary",size:"large",onClick:He},x.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ht,de,y){},pmY6:function(ht,de,y){"use strict";y.d(de,"g",function(){return fe}),y.d(de,"f",function(){return q}),y.d(de,"e",function(){return z}),y.d(de,"h",function(){return $}),y.d(de,"b",function(){return N}),y.d(de,"a",function(){return P}),y.d(de,"d",function(){return x}),y.d(de,"c",function(){return C});var Y=!1,pe="__is_disposable_tracked__";function ce(k){if(!Y)return;if(k&&k!==P.None)try{k[pe]=!0}catch(E){}}function be(k){if(!Y)return k;var E=new Error("Potentially leaked disposable").stack;return setTimeout(function(){k[pe]||console.log(E)},3e3),k}function fe(k){return typeof k.dispose=="function"&&k.dispose.length===0}function q(k){return Array.isArray(k)?(k.forEach(function(E){E&&(ce(E),E.dispose())}),[]):k?(ce(k),k.dispose(),k):void 0}function z(){for(var k=[],E=0;E=ce.length?{done:!0}:{done:!1,value:ce[q++]}},e:function(C){throw C},f:z}}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 $=!0,N=!1,P;return{s:function(){fe=ce[Symbol.iterator]()},n:function(){var C=fe.next();return $=C.done,C},e:function(C){N=!0,P=C},f:function(){try{!$&&fe.return!=null&&fe.return()}finally{if(N)throw P}}}}},rUJ1:function(ht,de){const y=/[&<>"']/,Y=/[&<>"']/g,pe=/[<>"']|&(?!#?\w+;)/,ce=/[<>"']|&(?!#?\w+;)/g,be={"&":"&","<":"<",">":">",'"':""","'":"'"},fe=Ee=>be[Ee];function q(Ee,Pe){if(Pe){if(y.test(Ee))return Ee.replace(Y,fe)}else if(pe.test(Ee))return Ee.replace(ce,fe);return Ee}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function $(Ee){return Ee.replace(z,(Pe,De)=>(De=De.toLowerCase(),De==="colon"?":":De.charAt(0)==="#"?De.charAt(1)==="x"?String.fromCharCode(parseInt(De.substring(2),16)):String.fromCharCode(+De.substring(1)):""))}const N=/(^|[^\[])\^/g;function P(Ee,Pe){Ee=Ee.source||Ee,Pe=Pe||"";const De={replace:(ae,O)=>(O=O.source||O,O=O.replace(N,"$1"),Ee=Ee.replace(ae,O),De),getRegex:()=>new RegExp(Ee,Pe)};return De}const x=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(Ee,Pe,De){if(Ee){let ae;try{ae=decodeURIComponent($(De)).replace(x,"").toLowerCase()}catch(O){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}Pe&&!C.test(De)&&(De=b(Pe,De));try{De=encodeURI(De).replace(/%25/g,"%")}catch(ae){return null}return De}const E={},S=/^[^:]+:\/*[^/]*$/,j=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(Ee,Pe){E[" "+Ee]||(S.test(Ee)?E[" "+Ee]=Ee+"/":E[" "+Ee]=he(Ee,"/",!0)),Ee=E[" "+Ee];const De=Ee.indexOf(":")===-1;return Pe.substring(0,2)==="//"?De?Pe:Ee.replace(j,"$1")+Pe:Pe.charAt(0)==="/"?De?Pe:Ee.replace(v,"$1")+Pe:Ee+Pe}const L={exec:function(){}};function U(Ee){let Pe=1,De,ae;for(;Pe{let te=!1,W=re;for(;--W>=0&&H[W]==="\\";)te=!te;return te?"|":" |"}),ae=De.split(/ \|/);let O=0;if(ae.length>Pe)ae.splice(Pe);else for(;ae.length