You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Edit__body__Lev...

345 lines
563 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[220,7],{"+NIl":function(bt,Xe,b){(function(j){j(b("VrN/"))})(function(j){"use strict";j.defineMode("stex",function(Ae,Q){"use strict";function ge(U,B){U.cmdState.push(B)}function he(U){return U.cmdState.length>0?U.cmdState[U.cmdState.length-1]:null}function fe(U){var B=U.cmdState.pop();B&&B.closeBracket()}function D(U){for(var B=U.cmdState,F=B.length-1;F>=0;F--){var N=B[F];if(N.name=="DEFAULT")continue;return N}return{styleIdentifier:function(){return null}}}function $(U,B,F){return function(){this.name=U,this.bracketNo=0,this.style=B,this.styles=F,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var K={};K.importmodule=$("importmodule","tag",["string","builtin"]),K.documentclass=$("documentclass","tag",["","atom"]),K.usepackage=$("usepackage","tag",["atom"]),K.begin=$("begin","tag",["atom"]),K.end=$("end","tag",["atom"]),K.label=$("label","tag",["atom"]),K.ref=$("ref","tag",["atom"]),K.eqref=$("eqref","tag",["atom"]),K.cite=$("cite","tag",["atom"]),K.bibitem=$("bibitem","tag",["atom"]),K.Bibitem=$("Bibitem","tag",["atom"]),K.RBibitem=$("RBibitem","tag",["atom"]),K.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function le(U,B){U.f=B}function L(U,B){var F;if(U.match(/^\\[a-zA-Z@]+/)){var N=U.current().slice(1);return F=K.hasOwnProperty(N)?K[N]:K.DEFAULT,F=new F,ge(B,F),le(B,ee),F.style}if(U.match(/^\\[$&%#{}_]/))return"tag";if(U.match(/^\\[,;!\/\\]/))return"tag";if(U.match("\\["))return le(B,function(Z,Le){return P(Z,Le,"\\]")}),"keyword";if(U.match("\\("))return le(B,function(Z,Le){return P(Z,Le,"\\)")}),"keyword";if(U.match("$$"))return le(B,function(Z,Le){return P(Z,Le,"$$")}),"keyword";if(U.match("$"))return le(B,function(Z,Le){return P(Z,Le,"$")}),"keyword";var te=U.next();if(te=="%")return U.skipToEnd(),"comment";if(te=="}"||te=="]"){if(F=he(B),F)F.closeBracket(te),le(B,ee);else return"error";return"bracket"}else return te=="{"||te=="["?(F=K.DEFAULT,F=new F,ge(B,F),"bracket"):/\d/.test(te)?(U.eatWhile(/[\w.%]/),"atom"):(U.eatWhile(/[\w\-_]/),F=D(B),F.name=="begin"&&(F.argument=U.current()),F.styleIdentifier())}function P(U,B,F){if(U.eatSpace())return null;if(F&&U.match(F))return le(B,L),"keyword";if(U.match(/^\\[a-zA-Z@]+/))return"tag";if(U.match(/^[a-zA-Z]+/))return"variable-2";if(U.match(/^\\[$&%#{}_]/))return"tag";if(U.match(/^\\[,;!\/]/))return"tag";if(U.match(/^[\^_&]/))return"tag";if(U.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(U.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var N=U.next();return N=="{"||N=="}"||N=="["||N=="]"||N=="("||N==")"?"bracket":N=="%"?(U.skipToEnd(),"comment"):"error"}function ee(U,B){var F=U.peek(),N;return F=="{"||F=="["?(N=he(B),N.openBracket(F),U.eat(F),le(B,L),"bracket"):/[ \t\r]/.test(F)?(U.eat(F),null):(le(B,L),fe(B),L(U,B))}return{startState:function(){var U=Q.inMathMode?function(B,F){return P(B,F)}:L;return{cmdState:[],f:U}},copyState:function(U){return{cmdState:U.cmdState.slice(),f:U.f}},token:function(U,B){return B.f(U,B)},blankLine:function(U){U.f=L,U.cmdState.length=0},lineComment:"%"}}),j.defineMIME("text/x-stex","stex"),j.defineMIME("text/x-latex","stex")})},"19Vz":function(bt,Xe,b){(function(j){j(b("VrN/"))})(function(j){j.defineOption("placeholder","",function($,K,le){var L=le&&le!=j.Init;if(K&&!L)$.on("blur",he),$.on("change",fe),$.on("swapDoc",fe),j.on($.getInputField(),"compositionupdate",$.state.placeholderCompose=function(){ge($)}),fe($);else if(!K&&L){$.off("blur",he),$.off("change",fe),$.off("swapDoc",fe),j.off($.getInputField(),"compositionupdate",$.state.placeholderCompose),Ae($);var P=$.getWrapperElement();P.className=P.className.replace(" CodeMirror-empty","")}K&&!$.hasFocus()&&he($)});function Ae($){$.state.placeholder&&($.state.placeholder.parentNode.removeChild($.state.placeholder),$.state.placeholder=null)}function Q($){Ae($);var K=$.state.placeholder=document.createElement("pre");K.style.cssText="height: 0; overflow: visible",K.style.direction=$.getOption("direction"),K.className="CodeMirror-placeholder CodeMirror-line-like";var le=$.getOption("placeholder");typeof le=="string"&&(le=document.createTextNode(le)),K.appendChild(le),$.display.lineSpace.insertBefore(K,$.display.lineSpace.firstChild)}function ge($){setTimeout(function(){var K=!1,le=$.getInputField();le.nodeName=="TEXTAREA"?K=!le.value:$.lineCount()==1&&(K=!/[^\u200b]/.test(le.querySelector(".CodeMirror-line").textContent)),K?Q($):Ae($)},20)}function he($){D($)&&Q($)}function fe($){var K=$.getWrapperElement(),le=D($);K.className=K.className.replace(" CodeMirror-empty","")+(le?" CodeMirror-empty":""),le?Q($):Ae($)}function D($){return $.lineCount()===1&&$.getLine(0)===""}})},"1eCo":function(bt,Xe,b){(function(j){j(b("VrN/"))})(function(j){"use strict";var Ae={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},Q={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};j.defineMode("xml",function(ge,he){var fe=ge.indentUnit,D={},$=he.htmlMode?Ae:Q;for(var K in $)D[K]=$[K];for(var K in he)D[K]=he[K];var le,L;function P(w,q){function z(me){return q.tokenize=me,me(w,q)}var _=w.next();if(_=="<")return w.eat("!")?w.eat("[")?w.match("CDATA[")?z(B("atom","]]>")):null:w.match("--")?z(B("comment","-->")):w.match("DOCTYPE",!0,!0)?(w.eatWhile(/[\w\._\-]/),z(F(1))):null:w.eat("?")?(w.eatWhile(/[\w\._\-]/),q.tokenize=B("meta","?>"),"meta"):(le=w.eat("/")?"closeTag":"openTag",q.tokenize=ee,"tag bracket");if(_=="&"){var ie;return w.eat("#")?w.eat("x")?ie=w.eatWhile(/[a-fA-F\d]/)&&w.eat(";"):ie=w.eatWhile(/[\d]/)&&w.eat(";"):ie=w.eatWhile(/[\w\.\-:]/)&&w.eat(";"),ie?"atom":"error"}else return w.eatWhile(/[^&<]/),null}P.isInText=!0;function ee(w,q){var z=w.next();if(z==">"||z=="/"&&w.eat(">"))return q.tokenize=P,le=z==">"?"endTag":"selfcloseTag","tag bracket";if(z=="=")return le="equals",null;if(z=="<"){q.tokenize=P,q.state=Le,q.tagName=q.tagStart=null;var _=q.tokenize(w,q);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(z)?(q.tokenize=U(z),q.stringStartCol=w.column(),q.tokenize(w,q)):(w.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function U(w){var q=function(z,_){for(;!z.eol();)if(z.next()==w){_.tokenize=ee;break}return"string"};return q.isInAttribute=!0,q}function B(w,q){return function(z,_){for(;!z.eol();){if(z.match(q)){_.tokenize=P;break}z.next()}return w}}function F(w){return function(q,z){for(var _;(_=q.next())!=null;){if(_=="<")return z.tokenize=F(w+1),z.tokenize(q,z);if(_==">")if(w==1){z.tokenize=P;break}else return z.tokenize=F(w-1),z.tokenize(q,z)}return"meta"}}function N(w,q,z){this.prev=w.context,this.tagName=q,this.indent=w.indented,this.startOfLine=z,(D.doNotIndent.hasOwnProperty(q)||w.context&&w.context.noIndent)&&(this.noIndent=!0)}function te(w){w.context&&(w.context=w.context.prev)}function Z(w,q){for(var z;;){if(!w.context)return;if(z=w.context.tagName,!D.contextGrabbers.hasOwnProperty(z)||!D.contextGrabbers[z].hasOwnProperty(q))return;te(w)}}function Le(w,q,z){return w=="openTag"?(z.tagStart=q.column(),Ue):w=="closeTag"?oe:Le}function Ue(w,q,z){return w=="word"?(z.tagName=q.current(),L="tag",H):D.allowMissingTagName&&w=="endTag"?(L="tag bracket",H(w,q,z)):(L="error",Ue)}function oe(w,q,z){if(w=="word"){var _=q.current();return z.context&&z.context.tagName!=_&&D.implicitlyClosed.hasOwnProperty(z.context.tagName)&&te(z),z.context&&z.context.tagName==_||D.matchClosing===!1?(L="tag",ne):(L="tag error",Oe)}else return D.allowMissingTagName&&w=="endTag"?(L="tag bracket",ne(w,q,z)):(L="error",Oe)}function ne(w,q,z){return w!="endTag"?(L="error",ne):(te(z),Le)}function Oe(w,q,z){return L="error",ne(w,q,z)}function H(w,q,z){if(w=="word")return L="attribute",se;if(w=="endTag"||w=="selfcloseTag"){var _=z.tagName,ie=z.tagStart;return z.tagName=z.tagStart=null,w=="selfcloseTag"||D.autoSelfClosers.hasOwnProperty(_)?Z(z,_):(Z(z,_),z.context=new N(z,_,ie==z.indented)),Le}return L="error",H}function se(w,q,z){return w=="equals"?ke:(D.allowMissing||(L="error"),H(w,q,z))}function ke(w,q,z){return w=="string"?re:w=="word"&&D.allowUnquoted?(L="string",H):(L="error",H(w,q,z))}function re(w,q,z){return w=="string"?re:H(w,q,z)}return{startState:function(w){var q={tokenize:P,state:Le,indented:w||0,tagName:null,tagStart:null,context:null};return w!=null&&(q.baseIndent=w),q},token:function(w,q){if(!q.tagName&&w.sol()&&(q.indented=w.indentation()),w.eatSpace())return null;le=null;var z=q.tokenize(w,q);return(z||le)&&z!="comment"&&(L=null,q.state=q.state(le||z,w,q),L&&(z=L=="error"?z+" error":L)),z},indent:function(w,q,z){var _=w.context;if(w.tokenize.isInAttribute)return w.tagStart==w.indented?w.stringStartCol+1:w.indented+fe;if(_&&_.noIndent)return j.Pass;if(w.tokenize!=ee&&w.tokenize!=P)return z?z.match(/^(\s*)/)[0].length:0;if(w.tagName)return D.multilineTagIndentPastTag!==!1?w.tagStart+w.tagName.length+2:w.tagStart+fe*(D.multilineTagIndentFactor||1);if(D.alignCDATA&&/<!\[CDATA\[/.test(q))return 0;var ie=q&&/^<(\/)?([\w_:\.-]*)/.exec(q);if(ie&&ie[1])for(;_;)if(_.tagName==ie[2]){_=_.prev;break}else if(D.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(ie)for(;_;){var me=D.contextGrabbers[_.tagName];if(me&&me.hasOwnProperty(ie[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+fe:w.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:D.htmlMode?"html":"xml",helperType:D.htmlMode?"html":"xml",skipAttribute:function(w){w.state==ke&&(w.state=H)},xmlCurrentTag:function(w){return w.tagName?{name:w.tagName,close:w.type=="closeTag"}:null},xmlCurrentContext:function(w){for(var q=[],z=w.context;z;z=z.prev)z.tagName&&q.push(z.tagName);return q.reverse()}}}),j.defineMIME("text/xml","xml"),j.defineMIME("application/xml","xml"),j.mimeModes.hasOwnProperty("text/html")||j.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"389U":function(bt,Xe,b){"use strict";b.r(Xe);var j=b("+L6B"),Ae=b("2/Rp"),Q=b("oBTY"),ge=b("giR+"),he=b("fyUT"),fe=b("5Dmo"),D=b("3S7+"),$=b("sRBo"),K=b("kaz8"),le=b("2qtc"),L=b("kLXV"),P=b("miYZ"),ee=b("tsqr"),U=b("k1fw"),B=b("9og8"),F=b("tJVT"),N=b("PpiC"),te=b("5NDa"),Z=b("5rEg"),Le=b("OaEy"),Ue=b("2fM7"),oe=b("WmNS"),ne=b.n(oe),Oe=b("q1tI"),H=b.n(Oe),se=b("9kvl"),ke=b("Ot1p"),re=b("HBuW"),w=b("LvDl"),q=b.n(w),z=b("bNIU"),_=b.n(z),ie=b("9ZNV"),me=b("fnXi"),J=b("nuEh"),Pe=b("UqFu"),C=Ue.a.Option,g=Z.a.TextArea,V=function(ve){var Ye=ve.shixunsDetail,$e=ve.dispatch,Ce=ve.match,Te=ve.practiceSetting,we=Object(N.a)(ve,["shixunsDetail","dispatch","match","practiceSetting"]),_e=Object(Oe.useState)({}),G=Object(F.a)(_e,2),O=G[0],Ie=G[1],qe=Object(Oe.useState)([]),dt=Object(F.a)(qe,2),We=dt[0],Ke=dt[1],pe=Object(Oe.useState)(!1),De=Object(F.a)(pe,2),je=De[0],Ze=De[1],He=Object(Oe.useRef)(null),Me=Object(Oe.useRef)({editData:null,answerList:null}),Be=Object(Oe.useState)(!0),ft=Object(F.a)(Be,2),it=ft[0],Je=ft[1];Object(Oe.useEffect)(function(){et()},[]),Object(Oe.useEffect)(function(){ue()},[O,We]);var et=function(){var ae=Object(B.a)(ne.a.mark(function de(){return ne.a.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return Je(!0),k.next=3,gt();case 3:return k.next=5,ut();case 5:Je(!1);case 6:case"end":return k.stop()}},de)}));return function(){return ae.apply(this,arguments)}}(),gt=function(){var ae=Object(B.a)(ne.a.mark(function de(){var R;return ne.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,Object(re.G)({id:Ce.params.id,challengeId:Ce.params.challengesId,tab:2});case 2:R=A.sent,Me.current.editData=R,R&&Ie(R);case 5:case"end":return A.stop()}},de)}));return function(){return ae.apply(this,arguments)}}(),ut=function(){var ae=Object(B.a)(ne.a.mark(function de(){var R,k;return ne.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Object(re.H)({id:Ce.params.id,challengeId:Ce.params.challengesId});case 2:R=v.sent,k=R.map(function(y){return Object(U.a)(Object(U.a)({},y),{},{contents:Object(Pe.a)(y.contents)})}),Me.current.answerList=k,R&&Ke(k);case 6:case"end":return v.stop()}},de)}));return function(){return ae.apply(this,arguments)}}(),nt=function(){var ae=Object(B.a)(ne.a.mark(function de(){var R,k,A;return ne.a.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(Ze(!0),R=We.map(function(x){return x.score}),k=R.reduce(function(x,S){return x+S},0),!(k!==100&&We!==null&&We!==void 0&&We.length)){y.next=7;break}return Ze(!1),ee.b.info("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),y.abrupt("return");case 7:if(We.every(function(x){return x.name})){y.next=11;break}return Ze(!1),ee.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u540D\u79F0"),y.abrupt("return");case 11:if(We.every(function(x){return x.contents})){y.next=15;break}return Ze(!1),ee.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u5185\u5BB9"),y.abrupt("return");case 15:return y.next=17,Object(re.Kb)({id:Ce.params.id,challengeId:Ce.params.challengesId,challenge_answer:We,hide_answer:O==null?void 0:O.hide_answer,disable_copy:O==null?void 0:O.disable_copy});case 17:A=y.sent,Ze(!1),$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),A!=null&&A.message&&ee.b.info(A.message),A.status===1&&se.d.push("/shixuns/".concat(Ce.params.id,"/edit/").concat(Ce.params.challengesId,"/tab=4"));case 22:case"end":return y.stop()}},de)}));return function(){return ae.apply(this,arguments)}}(),ue=function(){clearTimeout(He.current),He.current=setTimeout(mt,500)},mt=function(){!Object(w.isEqual)(Me.current.editData,O)||!Object(w.isEqual)(Me.current.answerList,We)?$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},tt=function(){var de,R=function(){se.d.push("/shixuns/".concat(Ce.params.id,"/challenges")),$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Te!=null&&(de=Te.sideBar)!==null&&de!==void 0&&de.confirmLeave?L.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){R()}}):R()};return H.a.createElement("section",{className:_.a.bg},H.a.createElement("div",{className:_.a.formWrap},H.a.createElement(me.a,{activeIndex:2}),H.a.createElement("div",{className:_.a.check},H.a.createElement("div",null,H.a.createElement(K.a,{checked:O==null?void 0:O.hide_answer,onChange:function(de){return Ie(Object(U.a)(Object(U.a)({},O),{},{hide_answer:de.target.checked}))}},"\u9690\u85CF\u53C2\u8003\u7B54\u6848\u6A21\u5757")),H.a.createElement("div",null,H.a.createElement(K.a,{checked:O==null?void 0:O.disable_copy,onChange:function(de){return Ie(Object(U.a)(Object(U.a)({},O),{},{disable_copy:de.target.checked}))}},"\u7981\u6B62\u590D\u5236\u53C2\u8003\u7B54\u6848"))),H.a.createElement("div",{className:_.a.fieldWrap},H.a.createElement("p",null,"\u53EF\u4EE5\u5C06\u53C2\u8003\u7B54\u6848\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),H.a.createElement("p",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),H.a.createElement("p",null,"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002"),We==null?void 0:We.map(function(ae,de){return H.a.createElement("div",{key:de,className:"mt30 pb5"},H.a.createElement("div",{className:_.a.flexRow},H.a.createElement("b",{className:"font16"},"\u7EA7\u522B\uFF1A",de+1),H.a.createElement("div",{className:"tr flex1"},H.a.createElement(D.a,{placement:"bottom",title:"\u5220\u9664"},H.a.createElement("span",{className:"font14 c-red current",onClick:function(){var k=We.filter(function(y,x){return x!==de}),A=Math.floor(100/k.length),v=A+100%k.length;k=k.map(function(y,x){return x===k.length-1?Object(U.a)(Object(U.a)({},y),{},{score:v}):Object(U.a)(Object(U.a)({},y),{},{score:A})}),Ke(k)}},"\u5220\xA0\u9664")))),H.a.createElement("div",{className:_.a.contentWrap},H.a.createElement("div",{className:_.a.flexRow},H.a.createElement("div",null,H.a.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),H.a.createElement(Z.a,{bordered:!1,value:ae.name,onChange:function(k){var A=We.map(function(v,y){return y===de?Object(U.a)(Object(U.a)({},v),{},{name:k.target.value}):v});Ke(A)}})),H.a.createElement("div",{className:"ml10"},H.a.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),H.a.createElement(he.a,{min:0,max:100,value:ae.score,onChange:function(k){var A=We.map(function(v,y){return y===de?Object(U.a)(Object(U.a)({},v),{},{score:k}):v});Ke(A)}})))),H.a.createElement("div",{className:"mt10 mb10"},H.a.createElement("div",{className:"font16 mb20"},"\u5185\u5BB9\uFF1A"),H.a.createElement(ke.a,{placeholder:"\u5EFA\u8BAE\u63D0\u4F9B\u5305\u62EC\u6587\u4EF6\u6240\u6709\u4EE3\u7801\u7684\u5B8C\u6574\u7B54\u6848",defaultValue:ae.contents,onChange:function(k){var A=We.map(function(v,y){return y===de?Object(U.a)(Object(U.a)({},v),{},{contents:k}):v});Ke(A)}})))}),H.a.createElement("div",null,H.a.createElement(Ae.a,{type:"primary",size:"large",ghost:!0,style:{width:200},className:"mt10",onClick:function(){var de=[].concat(Object(Q.a)(We),[{name:"\u89E3\u9898\u601D\u8DEF".concat(We.length+1),contents:"",score:0,id:null,level:null}]),R=Math.floor(100/de.length),k=R+100%de.length;de=de.map(function(A,v){return v===de.length-1?Object(U.a)(Object(U.a)({},A),{},{score:k}):Object(U.a)(Object(U.a)({},A),{},{score:R})}),Ke(de)}},"\u65B0\u589E\u53C2\u8003\u7B54\u6848")))),H.a.createElement(ie.a,{onOk:nt,className:"customFixedButton",onCancel:tt,loading:je}),H.a.createElement(J.a,{loading:it}))};Xe.default=Object(se.a)(function(xe){var ve=xe.shixunsDetail,Ye=xe.newCourse,$e=xe.globalSetting,Ce=xe.practiceSetting;return{shixunsDetail:ve,newCourse:Ye,globalSetting:$e,practiceSetting:Ce}})(V)},"7Cbv":function(bt,Xe,b){"use strict";var j=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Ae=new Uint8Array(16);function Q(){if(!j)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return j(Ae)}var ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function he(ee){return typeof ee=="string"&&ge.test(ee)}for(var fe=he,D=[],$=0;$<256;++$)D.push(($+256).toString(16).substr(1));function K(ee){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=(D[ee[U+0]]+D[ee[U+1]]+D[ee[U+2]]+D[ee[U+3]]+"-"+D[ee[U+4]]+D[ee[U+5]]+"-"+D[ee[U+6]]+D[ee[U+7]]+"-"+D[ee[U+8]]+D[ee[U+9]]+"-"+D[ee[U+10]]+D[ee[U+11]]+D[ee[U+12]]+D[ee[U+13]]+D[ee[U+14]]+D[ee[U+15]]).toLowerCase();if(!fe(B))throw TypeError("Stringified UUID is invalid");return B}var le=K;function L(ee,U,B){ee=ee||{};var F=ee.random||(ee.rng||Q)();if(F[6]=F[6]&15|64,F[8]=F[8]&63|128,U){B=B||0;for(var N=0;N<16;++N)U[B+N]=F[N];return U}return le(F)}var P=Xe.a=L},"7ahc":function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return Ue});var j=b("k1fw"),Ae=b("0Owb"),Q=b("+L6B"),ge=b("2/Rp"),he=b("y8nQ"),fe=b("Vl3Y"),D=b("tJVT"),$=b("OaEy"),K=b("2fM7"),le=b("q1tI"),L=b.n(le),P=b("VrN/"),ee=b.n(P),U=b("p77/"),B=b.n(U),F=b("c5Ni"),N=b.n(F),te=K.a.Option,Z={labelCol:{span:4},wrapperCol:{span:20}},Le={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Xe.b=function(oe){var ne=oe.callback,Oe=oe.onCancel,H=Object(le.useState)("python"),se=Object(D.a)(H,2),ke=se[0],re=se[1];function w(z){re(Le[z][1])}function q(z){ne(z)}return L.a.createElement(fe.a,Object(Ae.a)({},Z,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:q}),L.a.createElement(fe.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},L.a.createElement(K.a,{onChange:w},Object.keys(Le).map(function(z){return L.a.createElement(te,{key:z,value:z},Le[z][0])}))),L.a.createElement(fe.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},L.a.createElement(Ue,{mode:ke})),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(ge.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(ge.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))};function Ue(oe){var ne=oe.value,Oe=oe.onChange,H=oe.mode,se=oe.options,ke=se===void 0?{}:se,re=Object(le.useRef)(),w=Object(le.useState)(),q=Object(D.a)(w,2),z=q[0],_=q[1];return Object(le.useEffect)(function(){if(z){function ie(me){var J=me.getValue();Oe&&Oe(J)}return z.on("change",ie),function(){z.off("change",ie)}}},[z,Oe]),Object(le.useEffect)(function(){z&&z.setOption("mode",H)},[z,H]),Object(le.useEffect)(function(){z&&((ne!==z.getValue()||ne==="")&&setTimeout(function(){z.setValue(ne||" ")},300))},[z,ne]),Object(le.useEffect)(function(){if(re.current&&!z){var ie=ee.a.fromTextArea(re.current,Object(j.a)({mode:H,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ke));_(ie)}},[re.current,z]),L.a.createElement("div",{className:"my-codemirror-container"},L.a.createElement("textarea",{ref:re}))}},"7ixt":function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return Q});var j={adjustX:1,adjustY:1},Ae=[0,0],Q={left:{points:["cr","cl"],overflow:j,offset:[-4,0],targetOffset:Ae},right:{points:["cl","cr"],overflow:j,offset:[4,0],targetOffset:Ae},top:{points:["bc","tc"],overflow:j,offset:[0,-4],targetOffset:Ae},bottom:{points:["tc","bc"],overflow:j,offset:[0,4],targetOffset:Ae},topLeft:{points:["bl","tl"],overflow:j,offset:[0,-4],targetOffset:Ae},leftTop:{points:["tr","tl"],overflow:j,offset:[-4,0],targetOffset:Ae},topRight:{points:["br","tr"],overflow:j,offset:[0,-4],targetOffset:Ae},rightTop:{points:["tl","tr"],overflow:j,offset:[4,0],targetOffset:Ae},bottomRight:{points:["tr","br"],overflow:j,offset:[0,4],targetOffset:Ae},rightBottom:{points:["bl","br"],overflow:j,offset:[4,0],targetOffset:Ae},bottomLeft:{points:["tl","bl"],overflow:j,offset:[0,4],targetOffset:Ae},leftBottom:{points:["br","bl"],overflow:j,offset:[-4,0],targetOffset:Ae}},ge=Q},"8EBN":function(bt,Xe,b){(function(j){j(b("VrN/"))})(function(j){"use strict";j.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 Ae=0;Ae<j.modeInfo.length;Ae++){var Q=j.modeInfo[Ae];Q.mimes&&(Q.mime=Q.mimes[0])}j.findModeByMIME=function(ge){ge=ge.toLowerCase();for(var he=0;he<j.modeInfo.length;he++){var fe=j.modeInfo[he];if(fe.mime==ge)return fe;if(fe.mimes){for(var D=0;D<fe.mimes.length;D++)if(fe.mimes[D]==ge)return fe}}if(/\+xml$/.test(ge))return j.findModeByMIME("application/xml");if(/\+json$/.test(ge))return j.findModeByMIME("application/json")},j.findModeByExtension=function(ge){ge=ge.toLowerCase();for(var he=0;he<j.modeInfo.length;he++){var fe=j.modeInfo[he];if(fe.ext){for(var D=0;D<fe.ext.length;D++)if(fe.ext[D]==ge)return fe}}},j.findModeByFileName=function(ge){for(var he=0;he<j.modeInfo.length;he++){var fe=j.modeInfo[he];if(fe.file&&fe.file.test(ge))return fe}var D=ge.lastIndexOf("."),$=D>-1&&ge.substring(D+1,ge.length);if($)return j.findModeByExtension($)},j.findModeByName=function(ge){ge=ge.toLowerCase();for(var he=0;he<j.modeInfo.length;he++){var fe=j.modeInfo[he];if(fe.name.toLowerCase()==ge)return fe;if(fe.alias){for(var D=0;D<fe.alias.length;D++)if(fe.alias[D].toLowerCase()==ge)return fe}}}})},"8hTe":function(bt,Xe,b){bt.exports={button:"button___1wy9m"}},"93VE":function(bt,Xe,b){},"9Bee":function(bt,Xe,b){"use strict";var j=b("DYRE"),Ae=b("zeV3"),Q=b("+L6B"),ge=b("2/Rp"),he=b("k1fw"),fe=b("9og8"),D=b("tJVT"),$=b("WmNS"),K=b.n($),le=b("q1tI"),L=b.n(le),P=b("vg9a"),ee=b("DlQD"),U=b.n(ee),B=b("rUJ1");function F(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(d){var h=d.match(/^\s+/);if(h===null)return d;var M=Object(D.a)(h,1),be=M[0];return be.length>=u.length?d.slice(u.length):d}).join(`
`)}var N=[],te=["<ul>"],Z=new U.a.Renderer,Le=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ue(){N.length=0,te=["<ul>"]}var oe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ne(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var d=c[o];u.push("<li><a href='#"+d.anchor+"'>"+d.text+"</a>"),o++;var h=[];return o=ne(c,o,d.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(M){u.push(M)}),u.push("</ul>")),u.push("</li>"),o=ne(c,o,a,u),o}function Oe(){return ne(N,0,0,te),te.push("</ul>"),te.join("")}var H={heading:function(o){var a=Le.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],d=F(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var M=re(),be=d;d=M,w[M]={type:"block",expression:be}}return{type:"code",raw:u,lang:h,text:d}}}},se=/(?:\${2})([^\n`]+?)(?:\${2})/gi,ke=0,re=function(){return"__special_katext_id_".concat(ke++,"__")},w={};function q(){return w}function z(){ke=0,w={}}function _(c){return c=c.replace(se,function(o,a){var u=re();return w[u]={type:"inline",expression:a},u}),c}var ie=Z.listitem;Z.listitem=function(c){return ie(_(c))};var me=Z.paragraph;Z.paragraph=function(c){return me(_(c))};var J=Z.tablecell;Z.tablecell=function(c,o){return J(_(c),o)},Z.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(c,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?c:Object(B.escape)(c,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(B.escape)(c,!0))+"</code></pre>"},Z.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return N.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},U.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),U.a.use({tokenizer:H,renderer:Z});var Pe=U.a,C=b("SJMd"),g=b("ulZh"),V=b.n(g),xe=b("m3rI"),ve=b("Oy/b"),Ye=b("p5ED"),$e=b("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ce=function(c,o){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(c,o)};function Te(c,o){function a(){this.constructor=c}Ce(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function we(c,o,a,u){return new(a||(a=Promise))(function(d,h){function M(rt){try{Fe(u.next(rt))}catch(Se){h(Se)}}function be(rt){try{Fe(u.throw(rt))}catch(Se){h(Se)}}function Fe(rt){var Se;rt.done?d(rt.value):(Se=rt.value,Se instanceof a?Se:new a(function(Ct){Ct(Se)})).then(M,be)}Fe((u=u.apply(c,o||[])).next())})}function _e(c,o){var a,u,d,h,M={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:be(0),throw:be(1),return:be(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function be(Fe){return function(rt){return function(Se){if(a)throw new TypeError("Generator is already executing.");for(;M;)try{if(a=1,u&&(d=2&Se[0]?u.return:Se[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Se[1])).done)return d;switch(u=0,d&&(Se=[2&Se[0],d.value]),Se[0]){case 0:case 1:d=Se;break;case 4:return M.label++,{value:Se[1],done:!1};case 5:M.label++,u=Se[1],Se=[0];continue;case 7:Se=M.ops.pop(),M.trys.pop();continue;default:if(!(d=M.trys,(d=d.length>0&&d[d.length-1])||Se[0]!==6&&Se[0]!==2)){M=0;continue}if(Se[0]===3&&(!d||Se[1]>d[0]&&Se[1]<d[3])){M.label=Se[1];break}if(Se[0]===6&&M.label<d[1]){M.label=d[1],d=Se;break}if(d&&M.label<d[2]){M.label=d[2],M.ops.push(Se);break}d[2]&&M.ops.pop(),M.trys.pop();continue}Se=o.call(c,M)}catch(Ct){Se=[6,Ct],u=0}finally{a=d=0}if(5&Se[0])throw Se[1];return{value:Se[0]?Se[1]:void 0,done:!0}}([Fe,rt])}}}function G(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),d=0;for(o=0;o<a;o++)for(var h=arguments[o],M=0,be=h.length;M<be;M++,d++)u[d]=h[M];return u}var O=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,d=a;u<d.length;u++){var h=d[u],M=h[0],be=h[1];o.setAttribute(M,be)}},c.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&c.setAttributes(d,u),d},c.createLine=function(o,a,u,d,h){var M=document.createElementNS("http://www.w3.org/2000/svg","line");return M.setAttribute("x1",o.toString()),M.setAttribute("y1",a.toString()),M.setAttribute("x2",u.toString()),M.setAttribute("y2",d.toString()),h&&c.setAttributes(M,h),M},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(d,u),d},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,d,h,M,be){var Fe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Fe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",M.toString()]]),Fe.appendChild(be),Fe},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c}(),Ie=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),qe=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var d=this;return new Promise(function(h){var M=u!==void 0?u:document.createElement("canvas");o===null&&(d.markersOnly=!0,d.naturalSize=!1);var be=document.createElementNS("http://www.w3.org/2000/svg","svg");be.setAttribute("xmlns","http://www.w3.org/2000/svg"),be.setAttribute("width",a.width.baseVal.valueAsString),be.setAttribute("height",a.height.baseVal.valueAsString),be.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),be.innerHTML=a.innerHTML,d.naturalSize===!0?(be.width.baseVal.value=o.naturalWidth,be.height.baseVal.value=o.naturalHeight):d.width!==void 0&&d.height!==void 0&&(be.width.baseVal.value=d.width,be.height.baseVal.value=d.height),M.width=be.width.baseVal.value,M.height=be.height.baseVal.value;var Fe=be.outerHTML,rt=M.getContext("2d");d.markersOnly!==!0&&rt.drawImage(o,0,0,M.width,M.height);var Se=window.URL,Ct=new Image(M.width,M.height);Ct.setAttribute("crossOrigin","anonymous");var At=new Blob([Fe],{type:"image/svg+xml"}),Vt=Se.createObjectURL(At);Ct.onload=function(){rt.drawImage(Ct,0,0),Se.revokeObjectURL(Vt);var Ni=M.toDataURL(d.imageType,d.imageQuality);h(Ni)},Ct.src=Vt})},c}(),dt=function(){},We=function(){function c(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new Ke("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ke("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ke("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new pe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new pe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),Ke=function(c,o){this.selector=c,this.style=o},pe=function(c,o){this.localName=c,this.style=o},De=function(){function c(o,a,u,d,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=d,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return c.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(h){var M=document.createElement("div");M.className=""+a.toolbarButtonStyleClass.name,M.setAttribute("data-type-name",h.typeName),M.innerHTML=h.icon,M.addEventListener("click",function(){a.markerToolbarButtonClicked(M,h)}),a.buttons.push(M),a.markerButtons.push(M)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var d=document.createElement("div");d.className=this.toolbarBlockStyleClass.name,d.style.whiteSpace="nowrap",d.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(d),this.addActionButton(d,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(d,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},c.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},c.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},c.prototype.addActionButton=function(o,a,u){var d=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){d.actionToolbarButtonClicked(h,u)}),u){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pe("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new pe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new pe("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new pe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pe("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
padding: `+o+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ke("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ke("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},c.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),je=function(){function c(o,a,u,d){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=d,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new pe("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 pe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new pe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new pe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new pe("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 pe("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new pe("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 pe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new pe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ke("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ke("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},c.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var a,u,d=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(h){var M;h.uiStyleSettings=d.uiStyleSettings;var be=document.createElement("div");be.className=d.toolboxButtonStyleClass.name+" "+((M=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&M!==void 0?M:d.toolboxButtonStyleColorsClass.name),be.innerHTML=h.icon,be.title=h.title,be.addEventListener("click",function(){d.panelButtonClick(h)}),d.panelButtons.push(be),d.buttonRow.appendChild(be)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var d=o.getUi();d.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(d),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(h,M){var be,Fe;h.className=a.toolboxButtonStyleClass.name+" "+(M===u?""+((be=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&be!==void 0?be:a.toolboxActiveButtonStyleColorsClass.name):""+((Fe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:a.toolboxButtonStyleColorsClass.name))})},c}(),Ze=function(c,o){this.title=c,this.icon=o},He=function(c){function o(a,u,d,h){var M=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return M.colors=[],M.addTransparent=!1,M.colorBoxes=[],M.colors=u,M.currentColor=d,M.setCurrentColor=M.setCurrentColor.bind(M),M.getColorBox=M.getColorBox.bind(M),M}return Te(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(d){var h=a.getColorBox(d);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,d=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-d,M=document.createElement("div");M.style.display="inline-block",M.style.boxSizing="content-box",M.style.width=h-2+"px",M.style.height=h-2+"px",M.style.padding="1px",M.style.marginRight="2px",M.style.marginBottom="2px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderRadius=(h+2)/2+"px",M.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){u.setCurrentColor(a,M)});var be=document.createElement("div");return be.style.display="inline-block",be.style.width=h-2+"px",be.style.height=h-2+"px",be.style.backgroundColor=a,be.style.borderRadius=h/2+"px",a==="transparent"&&(be.style.fill=this.uiStyleSettings.toolboxAccentColor,be.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),M.appendChild(be),M},o.prototype.setCurrentColor=function(a,u){var d=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ze),Me=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}(),Be=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}(),ft=function(){function c(){this.GRIP_SIZE=10,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.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}(),it=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,d){var h=c.call(this,a,u,d)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(O.createTransform()),h.setupControlBox(),h}return Te(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=O.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var d=this.unrotatePoint(a);if(this.manipulationStartX=d.x,this.manipulationStartY=d.y,this.offsetX=d.x-this.left,this.offsetY=d.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,d=this.manipulationStartWidth,h=this.manipulationStartTop,M=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,d=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:d=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,M=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:M=this.manipulationStartHeight+a.y-this.manipulationStartY}d>=0?(this.left=u,this.width=d):(this.left=u+d,this.width=-d),M>=0?(this.top=h,this.height=M):(this.top=h+M,this.height=-M),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),d=O.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var d=O.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=O.createGroup();var a=O.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=O.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=O.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 Be,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 ft;return a.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,d=u,h=(this.width+this.CB_DISTANCE)/2-a/2,M=(this.height+this.CB_DISTANCE)/2-a/2,be=this.height+this.CB_DISTANCE-a/2,Fe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,d),this.positionGrip(this.controlGrips.topCenter.visual,h,d),this.positionGrip(this.controlGrips.topRight.visual,Fe,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,M),this.positionGrip(this.controlGrips.centerRight.visual,Fe,M),this.positionGrip(this.controlGrips.bottomLeft.visual,u,be),this.positionGrip(this.controlGrips.bottomCenter.visual,h,be),this.positionGrip(this.controlGrips.bottomRight.visual,Fe,be),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,d-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,d){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,d),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:it.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:it.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(it.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var d=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:d.x*a,y:d.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Me),et=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return Te(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=O.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),O.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&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&O.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),gt=function(c){function o(a,u,d,h){var M=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return M.widths=[],M.widthBoxes=[],M.widths=u,M.currentWidth=d,M.setCurrentWidth=M.setCurrentWidth.bind(M),M}return Te(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(d){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=d===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(d,h)}),u.appendChild(h);var M=document.createElement("div");M.innerText=d.toString(),M.style.marginRight="5px",h.appendChild(M);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.display="flex",be.style.alignItems="center";var Fe=document.createElement("hr");Fe.style.minWidth="20px",Fe.style.border="0px",Fe.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,Fe.style.flexGrow="2",be.appendChild(Fe),h.appendChild(be),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var d=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ze),ut=function(c){function o(a,u,d,h){var M=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return M.styles=[],M.styleBoxes=[],M.styles=u,M.currentStyle=d,M.setCurrentStyle=M.setCurrentStyle.bind(M),M}return Te(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(d){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=d===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(d,h)}),u.appendChild(h);var M=document.createElement("div");M.style.minHeight="20px",M.style.flexGrow="2",M.style.overflow="hidden";var be=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(d!==""?'stroke-dasharray="'+d+'"':"")+` />
</svg>`;M.innerHTML=be,h.appendChild(M),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var d=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ze),nt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new He("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Te(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(et),ue=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},mt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return Te(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=O.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 ft;return a.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,d){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,d),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Me),tt=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new He("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Te(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=O.createGroup(),this.selectorLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=O.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()),O.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(mt),ae=function(c){function o(a,u,d,h){var M=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return M.fonts=[],M.fontBoxes=[],M.fonts=u,M.currentFont=d,M.setCurrentFont=M.setCurrentFont.bind(M),M}return Te(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(d){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=d===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(d,h)}),u.appendChild(h);var M=document.createElement("div");M.style.display="flex",M.style.minHeight="20px",M.style.flexGrow="2",M.style.fontFamily=d,M.style.overflow="hidden";var be=document.createElement("div");be.style.whiteSpace="nowrap",be.style.overflow="hidden",be.style.textOverflow="ellipsis",be.innerHTML="The quick brown fox jumps over the lazy dog",M.appendChild(be),h.appendChild(M),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var d=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ze),de=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=d.defaultColor,h.fontFamily=d.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new He("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new ae("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return Te(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(d){d===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=O.createGroup(),this.bgRectangle=O.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=O.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.textElement.transform.baseVal.appendItem(O.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(O.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var d=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(d,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),d=0,h=0;return u.width>0&&u.height>0&&(d=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:d,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),d=this.getTextPosition(u);d.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+d.x+"px, "+d.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(d.x,d.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var d=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(d)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),d=this.textElement.getBBox(),h={x:d.width*a,y:d.height*a};u.x-=h.x/2,u.y-=h.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&O.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&&O.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(Je),R=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=d.defaultColor,h.lineWidth=d.defaultStrokeWidth,h.pixelRatio=d.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new He("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new gt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return Te(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=O.createGroup(),this.drawingImage=O.createImage(),this.visual.appendChild(this.drawingImage);var a=O.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),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],d=u[0],h=u[1],M=u[2],be=u[3],Fe=!1,rt=0;rt<this.canvasElement.height;rt++)for(var Se=0;Se<this.canvasElement.width;Se++)a.data[rt*this.canvasElement.width*4+4*Se+3]>0&&(Fe=!0,rt<h&&(h=rt),Se<d&&(d=Se),rt>be&&(be=rt),Se>M&&(M=Se));if(Fe){this.left=d/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(M-d)/this.pixelRatio,this.height=(be-h)/this.pixelRatio;var Ct=document.createElement("canvas");Ct.width=M-d,Ct.height=be-h,Ct.getContext("2d").putImageData(this.canvasContext.getImageData(d,h,M-d,be-h),0,0),this.drawingImgUrl=Ct.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(Je),k=function(c){function o(a,u,d){var h=c.call(this,a,d||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return Te(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var d=function(be){var Fe="both";switch(be){case 0:Fe="both";break;case 1:Fe="start";break;case 2:Fe="end";break;case 3:Fe="none"}var rt=document.createElement("div");if(rt.style.display="flex",rt.style.flexGrow="2",rt.style.alignItems="center",rt.style.justifyContent="space-between",rt.style.padding="5px",rt.style.borderWidth="2px",rt.style.borderStyle="solid",rt.style.borderColor=Fe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",rt.addEventListener("click",function(){a.setCurrentType(Fe,rt)}),u.appendChild(rt),Fe==="both"||Fe==="start"){var Se=document.createElement("div");Se.style.display="flex",Se.style.alignItems="center",Se.style.minHeight="20px",Se.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Se.style.marginLeft="5px",rt.appendChild(Se)}var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.style.flexGrow="2";var At=document.createElement("hr");if(At.style.minWidth="20px",At.style.border="0px",At.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),At.style.flexGrow="2",Ct.appendChild(At),rt.appendChild(Ct),Fe==="both"||Fe==="end"){var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Vt.style.marginRight="5px",rt.appendChild(Vt)}h.typeBoxes.push(rt)},h=this,M=0;M<4;M++)d(M);return u},o.prototype.setCurrentType=function(a,u){var d=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ze),A=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new k("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return Te(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var d=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-d/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+d/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=O.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=O.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(O.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",O.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),O.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var d=this.arrow2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(d,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(tt),v=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor=d.defaultFillColor,h.strokeWidth=0,h.fillPanel=new He("Color",d.defaultColorSet,d.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return Te(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(et),y=function(c){function o(a,u,d,h){var M=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return M.opacities=[],M.opacityBoxes=[],M.opacities=u,M.currentOpacity=d,M.setCurrentOpacity=M.setCurrentOpacity.bind(M),M}return Te(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(d){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=d===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(d,h)}),u.appendChild(h);var M=document.createElement("div");M.innerText=100*d+"%",h.appendChild(M),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var d=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ze),x=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=d.defaultHighlightColor,h.strokeWidth=0,h.opacity=d.defaultHighlightOpacity,h.fillPanel=new He("Color",d.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new y("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Te(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(v),S='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Y=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=d.defaultStrokeColor,h.bgColor=d.defaultFillColor,h.fontFamily=d.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new He("Text color",d.defaultColorSet,h.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new He("Fill color",d.defaultColorSet,h.bgColor,S),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new ae("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new ft,h.tipGrip.visual.transform.baseVal.appendItem(O.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return Te(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(){O.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=O.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&&(O.setAttributes(this.bgRectangle,[["fill",a]]),O.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),d=this.height/5;a&&(this.tipPosition={x:u+d/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+d,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+d}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+d}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-d},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+d,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-d})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){O.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),c.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,c.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(de),I=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.fillColor=d.defaultFillColor,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new He("Line color",G(d.defaultColorSet,["transparent"]),d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new He("Fill color",G(d.defaultColorSet,["transparent"]),h.fillColor,S),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new gt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new y("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Te(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=O.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),O.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(Je),ye=function(c){function o(a,u,d){return c.call(this,a,u,d)||this}return Te(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=O.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.tip1),this.tip2=O.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(O.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var d=this.tip2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(d,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(tt),Ve=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokePanel.colors=d.defaultColorSet,h.fillColor="transparent",h}return Te(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(I),ht=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}(),at=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new He("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Te(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=O.createGroup(),this.selectorCurve=O.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=O.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()),O.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=O.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=O.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,c.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(mt),kt=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),Et=function(c){function o(a,u,d){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=d,h}return Te(o,c),o}(kt),st=function(c){function o(a,u,d){d===void 0&&(d=!1);var h=c.call(this,a,d)||this;return h.marker=u,h}return Te(o,c),o}(kt),Kt=function(){function c(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),Nt=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ue,this._isOpen=!1,this.undoRedoManager=new ht,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Kt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new We(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[nt,R,A,de,Ve,I,x,Y,ye,v,tt,at]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[nt,R,A,de,I,x,Y]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[nt,R,A,de,x]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var d=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});d!==void 0&&a._availableMarkerTypes.push(d)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ie.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&dt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=dt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new kt(o))})},c.prototype.render=function(){return we(this,void 0,void 0,function(){var o;return _e(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new qe).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(d){var h=new kt(a,!0);d(h),h.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(d){return d(new kt(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},c.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},c.prototype.removeRenderEventListener=function(o){},c.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},c.prototype.removeCloseEventListener=function(o){},c.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,d=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,d),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,d=this;this._currentMarker&&this._currentMarker instanceof de?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==d._currentMarker&&h.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},c.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},c.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},c.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},c.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=O.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},c.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},c.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},c.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},c.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},c.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},c.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},c.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},c.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new De(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},c.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},c.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(d){var h=new st(o,o._currentMarker,!0);d(h),h.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(d){return d(new st(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(M){var be=new st(o,void 0,!0);M(be),be.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(M){var be=d.markers[M];d.setCurrentMarker(d.markers[M]),d._currentMarker.dispose(),d.markerImage.removeChild(d._currentMarker.container),d.markers.splice(d.markers.indexOf(d._currentMarker),1),d.eventListeners.markerdelete.forEach(function(Fe){return Fe(new st(o,be))})},d=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var d=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),d<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new kt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new kt(o))})}},c.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},c.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new kt(o))}))},c.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},c.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new kt(o))}))},c.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},c.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},c.prototype.startRenderAndClose=function(){return we(this,void 0,void 0,function(){var o,a,u=this;return _e(this,function(d){switch(d.label){case 0:return[4,this.render()];case 1:return o=d.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new Et(u,o,a))}),this.close(!0),[2]}})})},c.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},c.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var d=a._availableMarkerTypes.find(function(M){return M.typeName===u.typeName});if(d!==void 0){var h=a.addNewMarker(d);h.restoreState(u),a.markers.push(h)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new kt(a))})},c.prototype.addNewMarker=function(o){var a=O.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},c.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(d){return d.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(d){return d(new st(u,u._currentMarker))}))},c.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof R&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(R):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new st(a,a._currentMarker))})},c.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},c.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},c.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new st(a,o))})},c.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new st(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new st(a,a._currentMarker))}))},c.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},c.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},c.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},c.prototype.addLicenseKey=function(o){Ie.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new kt(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new kt(o))}))},c.instanceCounter=0,c}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Gt=function(c,o){return(Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(c,o)};function 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}Gt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Tt(c,o,a,u){return new(a||(a=Promise))(function(d,h){function M(rt){try{Fe(u.next(rt))}catch(Se){h(Se)}}function be(rt){try{Fe(u.throw(rt))}catch(Se){h(Se)}}function Fe(rt){var Se;rt.done?d(rt.value):(Se=rt.value,Se instanceof a?Se:new a(function(Ct){Ct(Se)})).then(M,be)}Fe((u=u.apply(c,o||[])).next())})}function Wi(c,o){var a,u,d,h,M={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:be(0),throw:be(1),return:be(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function be(Fe){return function(rt){return function(Se){if(a)throw new TypeError("Generator is already executing.");for(;M;)try{if(a=1,u&&(d=2&Se[0]?u.return:Se[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Se[1])).done)return d;switch(u=0,d&&(Se=[2&Se[0],d.value]),Se[0]){case 0:case 1:d=Se;break;case 4:return M.label++,{value:Se[1],done:!1};case 5:M.label++,u=Se[1],Se=[0];continue;case 7:Se=M.ops.pop(),M.trys.pop();continue;default:if(!(d=M.trys,(d=d.length>0&&d[d.length-1])||Se[0]!==6&&Se[0]!==2)){M=0;continue}if(Se[0]===3&&(!d||Se[1]>d[0]&&Se[1]<d[3])){M.label=Se[1];break}if(Se[0]===6&&M.label<d[1]){M.label=d[1],d=Se;break}if(d&&M.label<d[2]){M.label=d[2],M.ops.push(Se);break}d[2]&&M.ops.pop(),M.trys.pop();continue}Se=o.call(c,M)}catch(Ct){Se=[6,Ct],u=0}finally{a=d=0}if(5&Se[0])throw Se[1];return{value:Se[0]?Se[1]:void 0,done:!0}}([Fe,rt])}}}var an=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),vt=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,d=a;u<d.length;u++){var h=d[u],M=h[0],be=h[1];o.setAttribute(M,be)}},c.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&c.setAttributes(d,u),d},c.createLine=function(o,a,u,d,h){var M=document.createElementNS("http://www.w3.org/2000/svg","line");return M.setAttribute("x1",o.toString()),M.setAttribute("y1",a.toString()),M.setAttribute("x2",u.toString()),M.setAttribute("y2",d.toString()),h&&c.setAttributes(M,h),M},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(d,u),d},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,d,h,M,be){var Fe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Fe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",M.toString()]]),Fe.appendChild(be),Fe},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&c.setAttributes(u,a),u},c.getHollowRectanglePath=function(o,a,u,d,h,M,be,Fe){return"M"+o+","+a+"V"+(a+d)+"H"+(o+u)+"V"+a+"H"+h+"V"+M+"H"+(h+be)+"V"+(M+Fe)+"H"+h+"V"+a+"Z"},c}(),Xi=function(){function c(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new ri("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ri("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ri("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new di("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new di("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),ri=function(c,o){this.selector=c,this.style=o},di=function(c,o){this.localName=c,this.style=o},Hi=function(){function c(){this.blocks=[],this.display=""}return c.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},c.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},c.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},c}(),sn=function(){function c(){}return c.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},c}(),ln=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return Wt(o,c),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(sn),Dt=function(){function c(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(c.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},c.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},c.prototype.hide=function(){this._isHidden=!0},c}(),lt=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return Wt(o,c),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(sn),Di=function(){function c(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(c.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),c.prototype.getVerticalLength=function(o){return o/this.ratio},c.prototype.getHorizontalLength=function(o){return o*this.ratio},c}(),un=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Di(o,a),d=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),M=document.createElementNS("http://www.w3.org/2000/svg","svg");M.setAttribute("xmlns","http://www.w3.org/2000/svg"),M.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(M);var be=vt.createDefs();M.appendChild(be);var Fe=vt.createElement("clipPath",[["id","text-bg-clip"]]);be.appendChild(Fe);var rt=vt.createPath(vt.getHollowRectanglePath((24-d)/2,(24-h)/2,d,h,(24-d)/2+2,(24-h)/2+2,d-4,h-4));M.appendChild(rt);var Se=vt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Se.appendChild(vt.createTSpan(o+":"+a)),M.appendChild(Se);var Ct=Se.getBBox();vt.setAttributes(Se,[["x",((24-Ct.width)/2).toString()],["y",((24-Ct.height)/2-Ct.y).toString()]]);var At=vt.createPath(vt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ct.width))/2,(24-Math.ceil(Ct.height))/2,Math.ceil(Ct.width),Math.ceil(Ct.height)));return Fe.appendChild(At),vt.setAttributes(rt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(M),M.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},c}(),xi=function(c){function o(a,u,d){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=d,h}return 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}(Dt),Lt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=vt.createGroup(),this.visual.appendChild(vt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(vt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return vt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Pi=function(){function c(o,a,u,d){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=d,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&vt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=vt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=vt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(vt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(vt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=vt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},c.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),vt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,M){var be=a.y+u*(M+1);vt.setAttributes(h,[["x1",""+a.x],["y1",""+be],["x2",""+(a.x+a.width)],["y2",""+be]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,M){var be=a.x+d*(M+1);vt.setAttributes(h,[["x1",""+be],["y1",""+a.y],["x2",""+be],["y2",""+(a.y+a.height)]])}),vt.setAttributes(this.cropShadeElement,[["d",vt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,d=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=d,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=d}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),d=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<d/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=d,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},c.prototype.getRescaledRect=function(o,a,u,d,h,M){var be=u/o,Fe=d/a;return{x:(h.x-M)*be+M,y:(h.y-M)*Fe+M,width:h.width*be,height:h.height*Fe}},c.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),Ki=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();vt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var d=u%5==0?this.height/3:this.height/6;a+="h4v"+-d+"h1v"+d}a+="v1H0Z",this.scaleShape=vt.createPath(a);var h=vt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=vt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=vt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var M=vt.createTSpan("");return M.innerHTML="&deg;",this.angleLabelElement.appendChild(M),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),hn=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,d,h,M,be){var Fe=this;return new Promise(function(rt){var Se=document.createElement("canvas");Se.width=o.width.baseVal.value-2*d,Se.height=o.height.baseVal.value-2*d;var Ct=1,At=1;Fe.naturalSize===!0?(Ct=a.naturalWidth/(o.width.baseVal.value-2*d)/M,At=a.naturalHeight/(o.height.baseVal.value-2*d)/be,Se.width=a.naturalWidth/M,Se.height=a.naturalHeight/be):Fe.width!==void 0&&Fe.height!==void 0&&(Ct=Fe.width/u.width,At=Fe.height/u.height,Se.width*=Ct,Se.height*=At);var Vt=Se.getContext("2d");Vt.translate(Se.width/2,Se.height/2),Vt.rotate(h*Math.PI/180),Vt.scale(M,be),Vt.translate(-Se.width/2,-Se.height/2),Vt.drawImage(a,0,0,Se.width,Se.height);var Ni=document.createElement("canvas");Ni.width=u.width*Ct,Ni.height=u.height*At,Ni.getContext("2d").putImageData(Vt.getImageData((u.x-d)*Ct,(u.y-d)*At,u.width*Ct,u.height*At),0,0),rt(Ni.toDataURL(Fe.imageType,Fe.imageQuality))})},c}(),Re=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 Xi(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",vt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},c.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},c.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();vt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},c.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},c.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=vt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=vt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=vt.createGroup(),this.editingTargetRotationScaleContainer=vt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=vt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=vt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=vt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},c.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},c.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=vt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Pi(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},c.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},c.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},c.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},c.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Hi,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new ln;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(At){var Vt=new Dt(un.getIcon(At.horizontal,At.vertical),At.horizontal===0&&At.vertical===0?"FREE":At.horizontal+":"+At.vertical);Vt.onClick=function(){return o.ratioButtonClicked(At)},u.push(Vt)}),this.aspectRatioButton=new xi(un.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var d=new Dt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");d.isActive=this.isGridVisible,d.onClick=function(){o.isGridVisible=!o.isGridVisible,d.isActive=o.isGridVisible},a.addButton(d);var h=new Dt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!an.isLicensed){var M=new lt;this.topToolbar.addElementBlock(M);var be=document.createElement("div");be.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Fe=document.createElement("a");Fe.style.color="currentColor",Fe.href="https://markerjs.com/products/cropro",Fe.target="_blank",Fe.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',be.appendChild(Fe),M.addElement(be)}var rt=new ln;rt.minWidth=3*this.toolbarHeight+"px",rt.contentAlign="end",this.topToolbar.addButtonBlock(rt);var Se=new Dt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Se.onClick=this.startRenderAndClose,rt.addButton(Se),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Se.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ct=new Dt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Ct.onClick=this.close,rt.addButton(Ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Hi,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new ln;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Dt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var d=new Dt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");d.onClick=this.rotateRightButtonClicked,a.addButton(d);var h=new lt;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new Ki("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(rt){o.rotateBy(rt),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var M=new ln;M.minWidth=2*this.toolbarHeight+"px",M.contentAlign="end",this.bottomToolbar.addButtonBlock(M);var be=new Dt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");be.onClick=this.flipHorizontallyButtonClicked,M.addButton(be);var Fe=new Dt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Fe.onClick=this.flipVerticallyButtonClicked,M.addButton(Fe)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=un.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Di(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 Tt(this,void 0,void 0,function(){var o,a;return Wi(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(d){return d(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return Tt(this,void 0,void 0,function(){var o;return Wi(this,function(a){switch(a.label){case 0:return(o=new hn).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),vt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new di("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 di("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new di("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new di("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 di("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new di("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new ri("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new ri("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new di("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 di("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new di("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 di("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 di("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},c.instanceCounter=0,c}(),wt=b("8hTe"),cn=b.n(wt),Ln=/<pre[^>]*>/g;function dn(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Mn=Xe.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,d=u===void 0?!1:u,h=c.className,M=c.showTextOnly,be=c.showLines,Fe=c.replaces,rt=c.zoomImg,Se=c.hasMask,Ct=c.style,At=Ct===void 0?{}:Ct,Vt=c.stylesPrev,Ni=Vt===void 0?{}:Vt,Ii=String(a),oi=Object(le.useRef)(),zi=Object(le.useRef)(),zn=Object(le.useState)(""),Ci=Object(D.a)(zn,2),Bi=Ci[0],Mi=Ci[1],vn=Object(le.useState)("office"),Yi=Object(D.a)(vn,2),fn=Yi[0],en=Yi[1],cr=function(){var It=new Re(zi.current);It.displayMode="popup",It.addRenderEventListener(function(){var fi=Object(fe.a)(K.a.mark(function Pt(ei){var Ut;return K.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return oi.current.style.display="none",Qt.next=3,Object($e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ei}});case 3:Ut=Qt.sent,Ut!=null&&Ut.id&&Fe(zi.current.getAttribute("src").replace(xe.a.API_SERVER,""),"/api/attachments/".concat(Ut==null?void 0:Ut.id,"?type=").concat(Ut.content_type));case 5:case"end":return Qt.stop()}},Pt)}));return function(Pt){return fi.apply(this,arguments)}}()),It.show()},Gn=function(){var It=new Nt(zi.current);It.settings.displayMode="popup",It.addEventListener("render",function(){var fi=Object(fe.a)(K.a.mark(function Pt(ei){var Ut;return K.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(oi.current.style.display="none",!zi.current){Qt.next=6;break}return Qt.next=4,Object($e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ei.dataUrl}});case 4:Ut=Qt.sent,Ut!=null&&Ut.id&&Fe(zi.current.getAttribute("src").replace(xe.a.API_SERVER,""),"/api/attachments/".concat(Ut==null?void 0:Ut.id,"?type=").concat(Ut.content_type));case 6:case"end":return Qt.stop()}},Pt)}));return function(Pt){return fi.apply(this,arguments)}}()),It.show(),window.markerArea=It},$i=Object(le.useMemo)(function(){try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,It=/\"\/api\/attachments\/|\"\/attachments\/download\//g,fi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ii=Ii.replace(Zt,"("+xe.a.API_SERVER+"/api/attachments/").replace(It,'"'+xe.a.API_SERVER+"/api/attachments/").replace(fi,'"'+xe.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,`
`),Ii=Ii.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(tn){}var Pt=Pe(Ii),ei=q();if(Ii.match(/\[TOC\]/)&&(Pt=Pt.replace("<p>[TOC]</p>",Oe()),Ue()),Pt=Pt.replace(/(__special_katext_id_\d+__)/g,function(tn,Qt){var wi=ei[Qt],Vn=wi.type,Xn=wi.expression;return Object(ve.renderToString)(dn(Xn)||"",{displayMode:Vn==="block",throwOnError:!1,output:"html"})}),Pt=Pt.replace(/▁/g,"\u2581\u2581\u2581"),z(),M){var Ut=document.createElement("div");return Ut.innerHTML=Pt,Ut.innerText}return setTimeout(function(){return On()},500),Pt},[Ii]),ji=Object(le.useRef)();oe.WebkitLineClamp=be,be&&(At=Object(he.a)(Object(he.a)({},At),oe));function An(Zt){var It=Zt.target;if(It.tagName.toUpperCase()==="IMG"){if(rt){var fi=It.getAttribute("src");Mi(fi),en("image")}}else if(It.tagName.toUpperCase()==="A"){var Pt=It.getAttribute("href");if(Pt.indexOf("office")>-1)Zt.preventDefault(),Mi(Pt),en("office");else if(Pt.indexOf("application/pdf")>-1)Zt.preventDefault(),Mi(Pt),en("pdf");else if(Pt.indexOf("type=text")>-1)Zt.preventDefault(),Mi(Pt),en("html");else if(Pt.startsWith("#")){Zt.preventDefault();var ei=document.getElementById(Pt.replace("#",""));ei&&ei.scrollIntoView(!0)}}}var On=function(){var It,fi=(It=ji.current)===null||It===void 0?void 0:It.querySelectorAll("video");fi==null||fi.forEach(function(Pt){if(Pt.oncontextmenu=function(){return!1},Pt.src.indexOf(".m3u8")>-1&&!Pt.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var ei=new V.a;ei.loadSource(Pt.src),ei.attachMedia(Pt)}}})};Object(le.useEffect)(function(){if(ji.current&&$i&&($i.match(Ln)&&window.PR.prettyPrint()),ji.current)return ji.current.addEventListener("click",An),function(){ji.current.removeEventListener("click",An),z(),Ue()}},[$i,ji.current,An]);var dr=function(It){if(!d)return;It.target.nodeName==="IMG"?(oi.current.style.display="flex",oi.current.style.width=It.target.clientWidth+"px",oi.current.style.height=It.target.clientHeight+"px",oi.current.style.top=It.target.offsetTop+"px",oi.current.style.left=It.target.offsetLeft+"px",zi.current.src=It.target.getAttribute("src")):oi.current.style.display="none"};return L.a.createElement("div",{style:{position:"relative"}},L.a.createElement("div",{ref:ji,style:Object(he.a)({},At),className:"".concat(h||""," markdown-body ").concat(cn.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:$i}}),L.a.createElement("div",{ref:oi,className:cn.a.button},L.a.createElement(Ae.a,null,L.a.createElement(ge.a,{onClick:function(){return cr()}},"\u88C1\u526A"),L.a.createElement(ge.a,{onClick:function(){return Gn()}},"\u7F16\u8F91"))),L.a.createElement("img",{ref:zi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),L.a.createElement(Ye.a,{close:!0,data:Bi,hasMask:Se,type:Bi!=null&&Bi.length?fn:"",style:Object(he.a)({},Ni),onClose:function(){return Mi("")}}))}},"9VGf":function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return Q});var j=b("q1tI"),Ae=b.n(j);function Q(ge,he){var fe=Object(j.useRef)();Object(j.useEffect)(function(){fe.current=ge}),Object(j.useEffect)(function(){function D(){fe.current()}if(he!==null){var $=setInterval(D,he);return function(){return clearInterval($)}}},[he])}},"9ZNV":function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return le});var j=b("0Owb"),Ae=b("+L6B"),Q=b("2/Rp"),ge=b("q1tI"),he=b.n(ge),fe=b("UUDw"),D=b.n(fe),$=b("TSYQ"),K=b.n($),le=function(P){var ee=P.cancelText,U=ee===void 0?"\u53D6\u6D88":ee,B=P.okText,F=B===void 0?"\u786E\u5B9A":B,N=P.loading,te=N===void 0?!1:N,Z=P.hasOkBtn,Le=Z===void 0?!0:Z,Ue=P.okButtonProps,oe=Ue===void 0?{}:Ue,ne=P.onCancel,Oe=ne===void 0?function(){}:ne,H=P.onOk,se=H===void 0?function(){}:H,ke=P.className,re=ke===void 0?"":ke;return he.a.createElement("div",{className:K()(D.a.buttonFixed,re)},he.a.createElement("div",{className:D.a.buttonWrap},he.a.createElement(Q.a,{size:"large",className:"".concat(D.a.button," mr20"),onClick:Oe},U),Le&&he.a.createElement(Q.a,Object(j.a)({size:"large",type:"primary",className:"".concat(D.a.button," mr20"),loading:te,onClick:se},oe),F)))}},Bd2K:function(bt,Xe,b){(function(j){j(b("VrN/"),b("osHv"))})(function(j){j.defineOption("autoCloseTags",!1,function(K,le,L){if(L!=j.Init&&L&&K.removeKeyMap("autoCloseTags"),!le)return;var P={name:"autoCloseTags"};(typeof le!="object"||le.whenClosing!==!1)&&(P["'/'"]=function(ee){return fe(ee)}),(typeof le!="object"||le.whenOpening!==!1)&&(P["'>'"]=function(ee){return ge(ee)}),K.addKeyMap(P)});var Ae=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Q=["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 ge(K){if(K.getOption("disableInput"))return j.Pass;for(var le=K.listSelections(),L=[],P=K.getOption("autoCloseTags"),ee=0;ee<le.length;ee++){if(!le[ee].empty())return j.Pass;var U=le[ee].head,B=K.getTokenAt(U),F=j.innerMode(K.getMode(),B.state),N=F.state,te=F.mode.xmlCurrentTag&&F.mode.xmlCurrentTag(N),Z=te&&te.name;if(!Z)return j.Pass;var Le=F.mode.configuration=="html",Ue=typeof P=="object"&&P.dontCloseTags||Le&&Ae,oe=typeof P=="object"&&P.indentTags||Le&&Q;B.end>U.ch&&(Z=Z.slice(0,Z.length-B.end+U.ch));var ne=Z.toLowerCase();if(!Z||B.type=="string"&&(B.end!=U.ch||!/[\"\']/.test(B.string.charAt(B.string.length-1))||B.string.length==1)||B.type=="tag"&&te.close||B.string.indexOf("/")==U.ch-B.start-1||Ue&&D(Ue,ne)>-1||$(K,F.mode.xmlCurrentContext&&F.mode.xmlCurrentContext(N)||[],Z,U,!0))return j.Pass;var Oe=typeof P=="object"&&P.emptyTags;if(Oe&&D(Oe,Z)>-1){L[ee]={text:"/>",newPos:j.Pos(U.line,U.ch+2)};continue}var H=oe&&D(oe,ne)>-1;L[ee]={indent:H,text:">"+(H?`
`:"")+"</"+Z+">",newPos:H?j.Pos(U.line+1,0):j.Pos(U.line,U.ch+1)}}for(var se=typeof P=="object"&&P.dontIndentOnAutoClose,ee=le.length-1;ee>=0;ee--){var ke=L[ee];K.replaceRange(ke.text,le[ee].head,le[ee].anchor,"+insert");var re=K.listSelections().slice(0);re[ee]={head:ke.newPos,anchor:ke.newPos},K.setSelections(re),!se&&ke.indent&&(K.indentLine(ke.newPos.line,null,!0),K.indentLine(ke.newPos.line+1,null,!0))}}function he(K,le){for(var L=K.listSelections(),P=[],ee=le?"/":"</",U=K.getOption("autoCloseTags"),B=typeof U=="object"&&U.dontIndentOnSlash,F=0;F<L.length;F++){if(!L[F].empty())return j.Pass;var N=L[F].head,te=K.getTokenAt(N),Z=j.innerMode(K.getMode(),te.state),Le=Z.state;if(le&&(te.type=="string"||te.string.charAt(0)!="<"||te.start!=N.ch-1))return j.Pass;var Ue,oe=Z.mode.name!="xml"&&K.getMode().name=="htmlmixed";if(oe&&Z.mode.name=="javascript")Ue=ee+"script";else if(oe&&Z.mode.name=="css")Ue=ee+"style";else{var ne=Z.mode.xmlCurrentContext&&Z.mode.xmlCurrentContext(Le);if(!ne||ne.length&&$(K,ne,ne[ne.length-1],N))return j.Pass;Ue=ee+ne[ne.length-1]}K.getLine(N.line).charAt(te.end)!=">"&&(Ue+=">"),P[F]=Ue}if(K.replaceSelections(P),L=K.listSelections(),!B)for(var F=0;F<L.length;F++)(F==L.length-1||L[F].head.line<L[F+1].head.line)&&K.indentLine(L[F].head.line)}function fe(K){return K.getOption("disableInput")?j.Pass:he(K,!0)}j.commands.closeTag=function(K){return he(K)};function D(K,le){if(K.indexOf)return K.indexOf(le);for(var L=0,P=K.length;L<P;++L)if(K[L]==le)return L;return-1}function $(K,le,L,P,ee){if(!j.scanForClosingTag)return!1;var U=Math.min(K.lastLine()+1,P.line+500),B=j.scanForClosingTag(K,P,null,U);if(!B||B.tag!=L)return!1;for(var F=ee?1:0,N=le.length-1;N>=0&&le[N]==L;N--)++F;P=B.to;for(var N=1;N<F;N++){var te=j.scanForClosingTag(K,P,null,U);if(!te||te.tag!=L)return!1;P=te.to}return!0}})},BjJ7:function(bt,Xe,b){"use strict";b.d(Xe,"d",function(){return Ae}),b.d(Xe,"c",function(){return Q}),b.d(Xe,"e",function(){return ge}),b.d(Xe,"b",function(){return he}),b.d(Xe,"a",function(){return D});var j=b("m3rI");function Ae($){var K=!0;if($.length>0){for(var le=0;le<$.length;le++)if($[le].compile_success==0||!$[le].compile_success){K=!1;break}}else K=!1;return K}function Q($){for(var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",le=[],L=0;L<$.length;L++){var P=$[L],ee=K?"".concat(K,"/").concat(P.name):"".concat(P.name);le.push({title:P.name,isLeaf:!(P.type==="tree"),key:ee})}return le}function ge($,K,le){for(var L=0;L<$.length;L++){var P=$[L];if(P.key===K){P.children=le;break}P.children&&ge(P.children,K,le)}return $}function he($,K,le){var L;return function(){var P=this,ee=arguments,U=function(){L=null,le||$.apply(P,ee)},B=le&&!L;clearTimeout(L),L=setTimeout(U,K),B&&$.apply(P,ee)}}var fe=!0,D=j.a.API_SERVER},"C+DQ":function(bt,Xe,b){},DlQD:function(bt,Xe,b){(function(j,Ae){bt.exports=Ae()})(this,function(){"use strict";function j(R,k){for(var A=0;A<k.length;A++){var v=k[A];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(R,v.key,v)}}function Ae(R,k,A){return k&&j(R.prototype,k),A&&j(R,A),R}function Q(R,k){if(!R)return;if(typeof R=="string")return ge(R,k);var A=Object.prototype.toString.call(R).slice(8,-1);if(A==="Object"&&R.constructor&&(A=R.constructor.name),A==="Map"||A==="Set")return Array.from(R);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return ge(R,k)}function ge(R,k){(k==null||k>R.length)&&(k=R.length);for(var A=0,v=new Array(k);A<k;A++)v[A]=R[A];return v}function he(R,k){var A;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(A=Q(R))||k&&R&&typeof R.length=="number"){A&&(R=A);var v=0;return function(){return v>=R.length?{done:!0}:{done:!1,value:R[v++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return A=R[Symbol.iterator](),A.next.bind(A)}function fe(R,k){return k={exports:{}},R(k,k.exports),k.exports}var D=fe(function(R){function k(){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 A(v){R.exports.defaults=v}R.exports={defaults:k(),getDefaults:k,changeDefaults:A}}),$=D.defaults,K=D.getDefaults,le=D.changeDefaults,L=/[&<>"']/,P=/[&<>"']/g,ee=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},F=function(k){return B[k]};function N(R,k){if(k){if(L.test(R))return R.replace(P,F)}else if(ee.test(R))return R.replace(U,F);return R}var te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Z(R){return R.replace(te,function(k,A){return A=A.toLowerCase(),A==="colon"?":":A.charAt(0)==="#"?A.charAt(1)==="x"?String.fromCharCode(parseInt(A.substring(2),16)):String.fromCharCode(+A.substring(1)):""})}var Le=/(^|[^\[])\^/g;function Ue(R,k){R=R.source||R,k=k||"";var A={replace:function(y,x){return x=x.source||x,x=x.replace(Le,"$1"),R=R.replace(y,x),A},getRegex:function(){return new RegExp(R,k)}};return A}var oe=/[^\w:]/g,ne=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Oe(R,k,A){if(R){var v;try{v=decodeURIComponent(Z(A)).replace(oe,"").toLowerCase()}catch(y){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}k&&!ne.test(A)&&(A=w(k,A));try{A=encodeURI(A).replace(/%25/g,"%")}catch(y){return null}return A}var H={},se=/^[^:]+:\/*[^/]*$/,ke=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function w(R,k){H[" "+R]||(se.test(R)?H[" "+R]=R+"/":H[" "+R]=ie(R,"/",!0)),R=H[" "+R];var A=R.indexOf(":")===-1;return k.substring(0,2)==="//"?A?k:R.replace(ke,"$1")+k:k.charAt(0)==="/"?A?k:R.replace(re,"$1")+k:R+k}var q={exec:function(){}};function z(R){for(var k=1,A,v;k<arguments.length;k++){A=arguments[k];for(v in A)Object.prototype.hasOwnProperty.call(A,v)&&(R[v]=A[v])}return R}function _(R,k){var A=R.replace(/\|/g,function(x,S,Y){for(var I=!1,ye=S;--ye>=0&&Y[ye]==="\\";)I=!I;return I?"|":" |"}),v=A.split(/ \|/),y=0;if(v.length>k)v.splice(k);else for(;v.length<k;)v.push("");for(;y<v.length;y++)v[y]=v[y].trim().replace(/\\\|/g,"|");return v}function ie(R,k,A){var v=R.length;if(v===0)return"";for(var y=0;y<v;){var x=R.charAt(v-y-1);if(x===k&&!A)y++;else if(x!==k&&A)y++;else break}return R.substr(0,v-y)}function me(R,k){if(R.indexOf(k[1])===-1)return-1;for(var A=R.length,v=0,y=0;y<A;y++)if(R[y]==="\\")y++;else if(R[y]===k[0])v++;else if(R[y]===k[1]&&(v--,v<0))return y;return-1}function J(R){R&&R.sanitize&&!R.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Pe={escape:N,unescape:Z,edit:Ue,cleanUrl:Oe,resolveUrl:w,noopTest:q,merge:z,splitCells:_,rtrim:ie,findClosingBracket:me,checkSanitizeDeprecation:J},C=D.defaults,g=Pe.rtrim,V=Pe.splitCells,xe=Pe.escape,ve=Pe.findClosingBracket;function Ye(R,k,A){var v=k.href,y=k.title?xe(k.title):null,x=R[1].replace(/\\([\[\]])/g,"$1");return R[0].charAt(0)!=="!"?{type:"link",raw:A,href:v,title:y,text:x}:{type:"image",raw:A,href:v,title:y,text:xe(x)}}function $e(R,k){var A=R.match(/^(\s+)(?:```)/);if(A===null)return k;var v=A[1];return k.split(`
`).map(function(y){var x=y.match(/^\s+/);if(x===null)return y;var S=x[0];return S.length>=v.length?y.slice(v.length):y}).join(`
`)}var Ce=function(){function R(A){this.options=A||C}var k=R.prototype;return k.space=function(v){var y=this.rules.block.newline.exec(v);if(y)return y[0].length>1?{type:"space",raw:y[0]}:{raw:`
`}},k.code=function(v,y){var x=this.rules.block.code.exec(v);if(x){var S=y[y.length-1];if(S&&S.type==="paragraph")return{raw:x[0],text:x[0].trimRight()};var Y=x[0].replace(/^ {4}/gm,"");return{type:"code",raw:x[0],codeBlockStyle:"indented",text:this.options.pedantic?Y:g(Y,`
`)}}},k.fences=function(v){var y=this.rules.block.fences.exec(v);if(y){var x=y[0],S=$e(x,y[3]||"");return{type:"code",raw:x,lang:y[2]?y[2].trim():y[2],text:S}}},k.heading=function(v){var y=this.rules.block.heading.exec(v);if(y)return{type:"heading",raw:y[0],depth:y[1].length,text:y[2]}},k.nptable=function(v){var y=this.rules.block.nptable.exec(v);if(y){var x={type:"table",header:V(y[1].replace(/^ *| *\| *$/g,"")),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:y[3]?y[3].replace(/\n$/,"").split(`
`):[],raw:y[0]};if(x.header.length===x.align.length){var S=x.align.length,Y;for(Y=0;Y<S;Y++)/^ *-+: *$/.test(x.align[Y])?x.align[Y]="right":/^ *:-+: *$/.test(x.align[Y])?x.align[Y]="center":/^ *:-+ *$/.test(x.align[Y])?x.align[Y]="left":x.align[Y]=null;for(S=x.cells.length,Y=0;Y<S;Y++)x.cells[Y]=V(x.cells[Y],x.header.length);return x}}},k.hr=function(v){var y=this.rules.block.hr.exec(v);if(y)return{type:"hr",raw:y[0]}},k.blockquote=function(v){var y=this.rules.block.blockquote.exec(v);if(y){var x=y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:y[0],text:x}}},k.list=function(v){var y=this.rules.block.list.exec(v);if(y){for(var x=y[0],S=y[2],Y=S.length>1,I=S[S.length-1]===")",ye={type:"list",raw:x,ordered:Y,start:Y?+S.slice(0,-1):"",loose:!1,items:[]},Ve=y[0].match(this.rules.block.item),ht=!1,at,kt,Et,st,Kt,Nt,Gt,Wt=Ve.length,Tt=0;Tt<Wt;Tt++)at=Ve[Tt],x=at,kt=at.length,at=at.replace(/^ *([*+-]|\d+[.)]) */,""),~at.indexOf(`
`)&&(kt-=at.length,at=this.options.pedantic?at.replace(/^ {1,4}/gm,""):at.replace(new RegExp("^ {1,"+kt+"}","gm"),"")),Tt!==Wt-1&&(Et=this.rules.block.bullet.exec(Ve[Tt+1])[0],(Y?Et.length===1||!I&&Et[Et.length-1]===")":Et.length>1||this.options.smartLists&&Et!==S)&&(st=Ve.slice(Tt+1).join(`
`),ye.raw=ye.raw.substring(0,ye.raw.length-st.length),Tt=Wt-1)),Kt=ht||/\n\n(?!\s*$)/.test(at),Tt!==Wt-1&&(ht=at.charAt(at.length-1)===`
`,Kt||(Kt=ht)),Kt&&(ye.loose=!0),Nt=/^\[[ xX]\] /.test(at),Gt=void 0,Nt&&(Gt=at[1]!==" ",at=at.replace(/^\[[ xX]\] +/,"")),ye.items.push({type:"list_item",raw:x,task:Nt,checked:Gt,loose:Kt,text:at});return ye}},k.html=function(v){var y=this.rules.block.html.exec(v);if(y)return{type:this.options.sanitize?"paragraph":"html",raw:y[0],pre:!this.options.sanitizer&&(y[1]==="pre"||y[1]==="script"||y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(y[0]):xe(y[0]):y[0]}},k.def=function(v){var y=this.rules.block.def.exec(v);if(y){y[3]&&(y[3]=y[3].substring(1,y[3].length-1));var x=y[1].toLowerCase().replace(/\s+/g," ");return{tag:x,raw:y[0],href:y[2],title:y[3]}}},k.table=function(v){var y=this.rules.block.table.exec(v);if(y){var x={type:"table",header:V(y[1].replace(/^ *| *\| *$/g,"")),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:y[3]?y[3].replace(/\n$/,"").split(`
`):[]};if(x.header.length===x.align.length){x.raw=y[0];var S=x.align.length,Y;for(Y=0;Y<S;Y++)/^ *-+: *$/.test(x.align[Y])?x.align[Y]="right":/^ *:-+: *$/.test(x.align[Y])?x.align[Y]="center":/^ *:-+ *$/.test(x.align[Y])?x.align[Y]="left":x.align[Y]=null;for(S=x.cells.length,Y=0;Y<S;Y++)x.cells[Y]=V(x.cells[Y].replace(/^ *\| *| *\| *$/g,""),x.header.length);return x}}},k.lheading=function(v){var y=this.rules.block.lheading.exec(v);if(y)return{type:"heading",raw:y[0],depth:y[2].charAt(0)==="="?1:2,text:y[1]}},k.paragraph=function(v){var y=this.rules.block.paragraph.exec(v);if(y)return{type:"paragraph",raw:y[0],text:y[1].charAt(y[1].length-1)===`
`?y[1].slice(0,-1):y[1]}},k.text=function(v,y){var x=this.rules.block.text.exec(v);if(x){var S=y[y.length-1];return S&&S.type==="text"?{raw:x[0],text:x[0]}:{type:"text",raw:x[0],text:x[0]}}},k.escape=function(v){var y=this.rules.inline.escape.exec(v);if(y)return{type:"escape",raw:y[0],text:xe(y[1])}},k.tag=function(v,y,x){var S=this.rules.inline.tag.exec(v);if(S)return!y&&/^<a /i.test(S[0])?y=!0:y&&/^<\/a>/i.test(S[0])&&(y=!1),!x&&/^<(pre|code|kbd|script)(\s|>)/i.test(S[0])?x=!0:x&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(S[0])&&(x=!1),{type:this.options.sanitize?"text":"html",raw:S[0],inLink:y,inRawBlock:x,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):xe(S[0]):S[0]}},k.link=function(v){var y=this.rules.inline.link.exec(v);if(y){var x=ve(y[2],"()");if(x>-1){var S=y[0].indexOf("!")===0?5:4,Y=S+y[1].length+x;y[2]=y[2].substring(0,x),y[0]=y[0].substring(0,Y).trim(),y[3]=""}var I=y[2],ye="";if(this.options.pedantic){var Ve=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(I);Ve?(I=Ve[1],ye=Ve[3]):ye=""}else ye=y[3]?y[3].slice(1,-1):"";I=I.trim().replace(/^<([\s\S]*)>$/,"$1");var ht=Ye(y,{href:I&&I.replace(this.rules.inline._escapes,"$1"),title:ye&&ye.replace(this.rules.inline._escapes,"$1")},y[0]);return ht}},k.reflink=function(v,y){var x;if((x=this.rules.inline.reflink.exec(v))||(x=this.rules.inline.nolink.exec(v))){var S=(x[2]||x[1]).replace(/\s+/g," ");if(S=y[S.toLowerCase()],!S||!S.href){var Y=x[0].charAt(0);return{type:"text",raw:Y,text:Y}}var I=Ye(x,S,x[0]);return I}},k.strong=function(v,y,x){x===void 0&&(x="");var S=this.rules.inline.strong.start.exec(v);if(S&&(!S[1]||S[1]&&(x===""||this.rules.inline.punctuation.exec(x)))){y=y.slice(-1*v.length);var Y=S[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Y.lastIndex=0;for(var I;(S=Y.exec(y))!=null;)if(I=this.rules.inline.strong.middle.exec(y.slice(0,S.index+3)),I)return{type:"strong",raw:v.slice(0,I[0].length),text:v.slice(2,I[0].length-2)}}},k.em=function(v,y,x){x===void 0&&(x="");var S=this.rules.inline.em.start.exec(v);if(S&&(!S[1]||S[1]&&(x===""||this.rules.inline.punctuation.exec(x)))){y=y.slice(-1*v.length);var Y=S[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Y.lastIndex=0;for(var I;(S=Y.exec(y))!=null;)if(I=this.rules.inline.em.middle.exec(y.slice(0,S.index+2)),I)return{type:"em",raw:v.slice(0,I[0].length),text:v.slice(1,I[0].length-1)}}},k.codespan=function(v){var y=this.rules.inline.code.exec(v);if(y){var x=y[2].replace(/\n/g," "),S=/[^ ]/.test(x),Y=x.startsWith(" ")&&x.endsWith(" ");return S&&Y&&(x=x.substring(1,x.length-1)),x=xe(x,!0),{type:"codespan",raw:y[0],text:x}}},k.br=function(v){var y=this.rules.inline.br.exec(v);if(y)return{type:"br",raw:y[0]}},k.del=function(v){var y=this.rules.inline.del.exec(v);if(y)return{type:"del",raw:y[0],text:y[1]}},k.autolink=function(v,y){var x=this.rules.inline.autolink.exec(v);if(x){var S,Y;return x[2]==="@"?(S=xe(this.options.mangle?y(x[1]):x[1]),Y="mailto:"+S):(S=xe(x[1]),Y=S),{type:"link",raw:x[0],text:S,href:Y,tokens:[{type:"text",raw:S,text:S}]}}},k.url=function(v,y){var x;if(x=this.rules.inline.url.exec(v)){var S,Y;if(x[2]==="@")S=xe(this.options.mangle?y(x[0]):x[0]),Y="mailto:"+S;else{var I;do I=x[0],x[0]=this.rules.inline._backpedal.exec(x[0])[0];while(I!==x[0]);S=xe(x[0]),x[1]==="www."?Y="http://"+S:Y=S}return{type:"link",raw:x[0],text:S,href:Y,tokens:[{type:"text",raw:S,text:S}]}}},k.inlineText=function(v,y,x){var S=this.rules.inline.text.exec(v);if(S){var Y;return y?Y=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):xe(S[0]):S[0]:Y=xe(this.options.smartypants?x(S[0]):S[0]),{type:"text",raw:S[0],text:Y}}},R}(),Te=Pe.noopTest,we=Pe.edit,_e=Pe.merge,G={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};G._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,G._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,G.def=we(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,G.item=we(G.item,"gm").replace(/bull/g,G.bullet).getRegex(),G.list=we(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._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",G._comment=/<!--(?!-?>)[\s\S]*?-->/,G.html=we(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=we(G._paragraph).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",G._tag).getRegex(),G.blockquote=we(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=_e({},G),G.gfm=_e({},G.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*|$)"}),G.gfm.nptable=we(G.gfm.nptable).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",G._tag).getRegex(),G.gfm.table=we(G.gfm.table).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",G._tag).getRegex(),G.pedantic=_e({},G.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",G._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Te,paragraph:we(G.normal._paragraph).replace("hr",G.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var O={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};O._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",O.punctuation=we(O.punctuation).replace(/punctuation/g,O._punctuation).getRegex(),O._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",O._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",O.em.start=we(O.em.start).replace(/punctuation/g,O._punctuation).getRegex(),O.em.middle=we(O.em.middle).replace(/punctuation/g,O._punctuation).replace(/overlapSkip/g,O._overlapSkip).getRegex(),O.em.endAst=we(O.em.endAst,"g").replace(/punctuation/g,O._punctuation).getRegex(),O.em.endUnd=we(O.em.endUnd,"g").replace(/punctuation/g,O._punctuation).getRegex(),O.strong.start=we(O.strong.start).replace(/punctuation/g,O._punctuation).getRegex(),O.strong.middle=we(O.strong.middle).replace(/punctuation/g,O._punctuation).replace(/blockSkip/g,O._blockSkip).getRegex(),O.strong.endAst=we(O.strong.endAst,"g").replace(/punctuation/g,O._punctuation).getRegex(),O.strong.endUnd=we(O.strong.endUnd,"g").replace(/punctuation/g,O._punctuation).getRegex(),O.blockSkip=we(O._blockSkip,"g").getRegex(),O.overlapSkip=we(O._overlapSkip,"g").getRegex(),O._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,O._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,O._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])?)+(?![-_])/,O.autolink=we(O.autolink).replace("scheme",O._scheme).replace("email",O._email).getRegex(),O._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,O.tag=we(O.tag).replace("comment",G._comment).replace("attribute",O._attribute).getRegex(),O._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,O._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,O._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,O.link=we(O.link).replace("label",O._label).replace("href",O._href).replace("title",O._title).getRegex(),O.reflink=we(O.reflink).replace("label",O._label).getRegex(),O.reflinkSearch=we(O.reflinkSearch,"g").replace("reflink",O.reflink).replace("nolink",O.nolink).getRegex(),O.normal=_e({},O),O.pedantic=_e({},O.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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",O._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",O._label).getRegex()}),O.gfm=_e({},O.normal,{escape:we(O.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),O.gfm.url=we(O.gfm.url,"i").replace("email",O.gfm._extended_email).getRegex(),O.breaks=_e({},O.gfm,{br:we(O.br).replace("{2,}","*").getRegex(),text:we(O.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ie={block:G,inline:O},qe=D.defaults,dt=Ie.block,We=Ie.inline;function Ke(R){return R.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function pe(R){var k="",A,v,y=R.length;for(A=0;A<y;A++)v=R.charCodeAt(A),Math.random()>.5&&(v="x"+v.toString(16)),k+="&#"+v+";";return k}var De=function(){function R(A){this.tokens=[],this.tokens.links=Object.create(null),this.options=A||qe,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var v={block:dt.normal,inline:We.normal};this.options.pedantic?(v.block=dt.pedantic,v.inline=We.pedantic):this.options.gfm&&(v.block=dt.gfm,this.options.breaks?v.inline=We.breaks:v.inline=We.gfm),this.tokenizer.rules=v}R.lex=function(v,y){var x=new R(y);return x.lex(v)};var k=R.prototype;return k.lex=function(v){return v=v.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(v,this.tokens,!0),this.inline(this.tokens),this.tokens},k.blockTokens=function(v,y,x){y===void 0&&(y=[]),x===void 0&&(x=!0),v=v.replace(/^ +$/gm,"");for(var S,Y,I,ye;v;){if(S=this.tokenizer.space(v)){v=v.substring(S.raw.length),S.type&&y.push(S);continue}if(S=this.tokenizer.code(v,y)){v=v.substring(S.raw.length),S.type?y.push(S):(ye=y[y.length-1],ye.raw+=`
`+S.raw,ye.text+=`
`+S.text);continue}if(S=this.tokenizer.fences(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.heading(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.nptable(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.hr(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.blockquote(v)){v=v.substring(S.raw.length),S.tokens=this.blockTokens(S.text,[],x),y.push(S);continue}if(S=this.tokenizer.list(v)){for(v=v.substring(S.raw.length),I=S.items.length,Y=0;Y<I;Y++)S.items[Y].tokens=this.blockTokens(S.items[Y].text,[],!1);y.push(S);continue}if(S=this.tokenizer.html(v)){v=v.substring(S.raw.length),y.push(S);continue}if(x&&(S=this.tokenizer.def(v))){v=v.substring(S.raw.length),this.tokens.links[S.tag]||(this.tokens.links[S.tag]={href:S.href,title:S.title});continue}if(S=this.tokenizer.table(v)){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.lheading(v)){v=v.substring(S.raw.length),y.push(S);continue}if(x&&(S=this.tokenizer.paragraph(v))){v=v.substring(S.raw.length),y.push(S);continue}if(S=this.tokenizer.text(v,y)){v=v.substring(S.raw.length),S.type?y.push(S):(ye=y[y.length-1],ye.raw+=`
`+S.raw,ye.text+=`
`+S.text);continue}if(v){var Ve="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(Ve);break}else throw new Error(Ve)}}return y},k.inline=function(v){var y,x,S,Y,I,ye,Ve=v.length;for(y=0;y<Ve;y++){ye=v[y];switch(ye.type){case"paragraph":case"text":case"heading":{ye.tokens=[],this.inlineTokens(ye.text,ye.tokens);break}case"table":{for(ye.tokens={header:[],cells:[]},Y=ye.header.length,x=0;x<Y;x++)ye.tokens.header[x]=[],this.inlineTokens(ye.header[x],ye.tokens.header[x]);for(Y=ye.cells.length,x=0;x<Y;x++)for(I=ye.cells[x],ye.tokens.cells[x]=[],S=0;S<I.length;S++)ye.tokens.cells[x][S]=[],this.inlineTokens(I[S],ye.tokens.cells[x][S]);break}case"blockquote":{this.inline(ye.tokens);break}case"list":{for(Y=ye.items.length,x=0;x<Y;x++)this.inline(ye.items[x].tokens);break}}}return v},k.inlineTokens=function(v,y,x,S,Y){y===void 0&&(y=[]),x===void 0&&(x=!1),S===void 0&&(S=!1),Y===void 0&&(Y="");var I,ye=v,Ve;if(this.tokens.links){var ht=Object.keys(this.tokens.links);if(ht.length>0)for(;(Ve=this.tokenizer.rules.inline.reflinkSearch.exec(ye))!=null;)ht.includes(Ve[0].slice(Ve[0].lastIndexOf("[")+1,-1))&&(ye=ye.slice(0,Ve.index)+"["+"a".repeat(Ve[0].length-2)+"]"+ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ve=this.tokenizer.rules.inline.blockSkip.exec(ye))!=null;)ye=ye.slice(0,Ve.index)+"["+"a".repeat(Ve[0].length-2)+"]"+ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;v;){if(I=this.tokenizer.escape(v)){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.tag(v,x,S)){v=v.substring(I.raw.length),x=I.inLink,S=I.inRawBlock,y.push(I);continue}if(I=this.tokenizer.link(v)){v=v.substring(I.raw.length),I.type==="link"&&(I.tokens=this.inlineTokens(I.text,[],!0,S)),y.push(I);continue}if(I=this.tokenizer.reflink(v,this.tokens.links)){v=v.substring(I.raw.length),I.type==="link"&&(I.tokens=this.inlineTokens(I.text,[],!0,S)),y.push(I);continue}if(I=this.tokenizer.strong(v,ye,Y)){v=v.substring(I.raw.length),I.tokens=this.inlineTokens(I.text,[],x,S),y.push(I);continue}if(I=this.tokenizer.em(v,ye,Y)){v=v.substring(I.raw.length),I.tokens=this.inlineTokens(I.text,[],x,S),y.push(I);continue}if(I=this.tokenizer.codespan(v)){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.br(v)){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.del(v)){v=v.substring(I.raw.length),I.tokens=this.inlineTokens(I.text,[],x,S),y.push(I);continue}if(I=this.tokenizer.autolink(v,pe)){v=v.substring(I.raw.length),y.push(I);continue}if(!x&&(I=this.tokenizer.url(v,pe))){v=v.substring(I.raw.length),y.push(I);continue}if(I=this.tokenizer.inlineText(v,S,Ke)){v=v.substring(I.raw.length),Y=I.raw.slice(-1),y.push(I);continue}if(v){var at="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return y},Ae(R,null,[{key:"rules",get:function(){return{block:dt,inline:We}}}]),R}(),je=D.defaults,Ze=Pe.cleanUrl,He=Pe.escape,Me=function(){function R(A){this.options=A||je}var k=R.prototype;return k.code=function(v,y,x){var S=(y||"").match(/\S*/)[0];if(this.options.highlight){var Y=this.options.highlight(v,S);Y!=null&&Y!==v&&(x=!0,v=Y)}return S?'<pre><code class="'+this.options.langPrefix+He(S,!0)+'">'+(x?v:He(v,!0))+`</code></pre>
`:"<pre><code>"+(x?v:He(v,!0))+`</code></pre>
`},k.blockquote=function(v){return`<blockquote>
`+v+`</blockquote>
`},k.html=function(v){return v},k.heading=function(v,y,x,S){return this.options.headerIds?"<h"+y+' id="'+this.options.headerPrefix+S.slug(x)+'">'+v+"</h"+y+`>
`:"<h"+y+">"+v+"</h"+y+`>
`},k.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},k.list=function(v,y,x){var S=y?"ol":"ul",Y=y&&x!==1?' start="'+x+'"':"";return"<"+S+Y+`>
`+v+"</"+S+`>
`},k.listitem=function(v){return"<li>"+v+`</li>
`},k.checkbox=function(v){return"<input "+(v?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},k.paragraph=function(v){return"<p>"+v+`</p>
`},k.table=function(v,y){return y&&(y="<tbody>"+y+"</tbody>"),`<table>
<thead>
`+v+`</thead>
`+y+`</table>
`},k.tablerow=function(v){return`<tr>
`+v+`</tr>
`},k.tablecell=function(v,y){var x=y.header?"th":"td",S=y.align?"<"+x+' align="'+y.align+'">':"<"+x+">";return S+v+"</"+x+`>
`},k.strong=function(v){return"<strong>"+v+"</strong>"},k.em=function(v){return"<em>"+v+"</em>"},k.codespan=function(v){return"<code>"+v+"</code>"},k.br=function(){return this.options.xhtml?"<br/>":"<br>"},k.del=function(v){return"<del>"+v+"</del>"},k.link=function(v,y,x){if(v=Ze(this.options.sanitize,this.options.baseUrl,v),v===null)return x;var S='<a href="'+He(v)+'"';return y&&(S+=' title="'+y+'"'),S+=">"+x+"</a>",S},k.image=function(v,y,x){if(v=Ze(this.options.sanitize,this.options.baseUrl,v),v===null)return x;var S='<img src="'+v+'" alt="'+x+'"';return y&&(S+=' title="'+y+'"'),S+=this.options.xhtml?"/>":">",S},k.text=function(v){return v},R}(),Be=function(){function R(){}var k=R.prototype;return k.strong=function(v){return v},k.em=function(v){return v},k.codespan=function(v){return v},k.del=function(v){return v},k.html=function(v){return v},k.text=function(v){return v},k.link=function(v,y,x){return""+x},k.image=function(v,y,x){return""+x},k.br=function(){return""},R}(),ft=function(){function R(){this.seen={}}var k=R.prototype;return k.slug=function(v){var y=v.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(y)){var x=y;do this.seen[x]++,y=x+"-"+this.seen[x];while(this.seen.hasOwnProperty(y))}return this.seen[y]=0,y},R}(),it=D.defaults,Je=Pe.unescape,et=function(){function R(A){this.options=A||it,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new ft}R.parse=function(v,y){var x=new R(y);return x.parse(v)};var k=R.prototype;return k.parse=function(v,y){y===void 0&&(y=!0);var x="",S,Y,I,ye,Ve,ht,at,kt,Et,st,Kt,Nt,Gt,Wt,Tt,Wi,an,vt,Xi=v.length;for(S=0;S<Xi;S++){st=v[S];switch(st.type){case"space":continue;case"hr":{x+=this.renderer.hr();continue}case"heading":{x+=this.renderer.heading(this.parseInline(st.tokens),st.depth,Je(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{x+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(kt="",at="",ye=st.header.length,Y=0;Y<ye;Y++)at+=this.renderer.tablecell(this.parseInline(st.tokens.header[Y]),{header:!0,align:st.align[Y]});for(kt+=this.renderer.tablerow(at),Et="",ye=st.cells.length,Y=0;Y<ye;Y++){for(ht=st.tokens.cells[Y],at="",Ve=ht.length,I=0;I<Ve;I++)at+=this.renderer.tablecell(this.parseInline(ht[I]),{header:!1,align:st.align[I]});Et+=this.renderer.tablerow(at)}x+=this.renderer.table(kt,Et);continue}case"blockquote":{Et=this.parse(st.tokens),x+=this.renderer.blockquote(Et);continue}case"list":{for(Kt=st.ordered,Nt=st.start,Gt=st.loose,ye=st.items.length,Et="",Y=0;Y<ye;Y++)Tt=st.items[Y],Wi=Tt.checked,an=Tt.task,Wt="",Tt.task&&(vt=this.renderer.checkbox(Wi),Gt?Tt.tokens.length>0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=vt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=vt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:vt}):Wt+=vt),Wt+=this.parse(Tt.tokens,Gt),Et+=this.renderer.listitem(Wt,an,Wi);x+=this.renderer.list(Et,Kt,Nt);continue}case"html":{x+=this.renderer.html(st.text);continue}case"paragraph":{x+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(Et=st.tokens?this.parseInline(st.tokens):st.text;S+1<Xi&&v[S+1].type==="text";)st=v[++S],Et+=`
`+(st.tokens?this.parseInline(st.tokens):st.text);x+=y?this.renderer.paragraph(Et):Et;continue}default:{var ri='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(ri);return}else throw new Error(ri)}}}return x},k.parseInline=function(v,y){y=y||this.renderer;var x="",S,Y,I=v.length;for(S=0;S<I;S++){Y=v[S];switch(Y.type){case"escape":{x+=y.text(Y.text);break}case"html":{x+=y.html(Y.text);break}case"link":{x+=y.link(Y.href,Y.title,this.parseInline(Y.tokens,y));break}case"image":{x+=y.image(Y.href,Y.title,Y.text);break}case"strong":{x+=y.strong(this.parseInline(Y.tokens,y));break}case"em":{x+=y.em(this.parseInline(Y.tokens,y));break}case"codespan":{x+=y.codespan(Y.text);break}case"br":{x+=y.br();break}case"del":{x+=y.del(this.parseInline(Y.tokens,y));break}case"text":{x+=y.text(Y.text);break}default:{var ye='Token with "'+Y.type+'" type was not found.';if(this.options.silent){console.error(ye);return}else throw new Error(ye)}}}return x},R}(),gt=Pe.merge,ut=Pe.checkSanitizeDeprecation,nt=Pe.escape,ue=D.getDefaults,mt=D.changeDefaults,tt=D.defaults;function ae(R,k,A){if(typeof R=="undefined"||R===null)throw new Error("marked(): input parameter is undefined or null");if(typeof R!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(R)+", string expected");if(typeof k=="function"&&(A=k,k=null),k=gt({},ae.defaults,k||{}),ut(k),A){var v=k.highlight,y;try{y=De.lex(R,k)}catch(I){return A(I)}var x=function(ye){var Ve;if(!ye)try{Ve=et.parse(y,k)}catch(ht){ye=ht}return k.highlight=v,ye?A(ye):A(null,Ve)};if(!v||v.length<3)return x();if(delete k.highlight,!y.length)return x();var S=0;ae.walkTokens(y,function(I){I.type==="code"&&(S++,setTimeout(function(){v(I.text,I.lang,function(ye,Ve){if(ye)return x(ye);Ve!=null&&Ve!==I.text&&(I.text=Ve,I.escaped=!0),S--,S===0&&x()})},0))}),S===0&&x();return}try{var Y=De.lex(R,k);return k.walkTokens&&ae.walkTokens(Y,k.walkTokens),et.parse(Y,k)}catch(I){if(I.message+=`
Please report this to https://github.com/markedjs/marked.`,k.silent)return"<p>An error occurred:</p><pre>"+nt(I.message+"",!0)+"</pre>";throw I}}ae.options=ae.setOptions=function(R){return gt(ae.defaults,R),mt(ae.defaults),ae},ae.getDefaults=ue,ae.defaults=tt,ae.use=function(R){var k=gt({},R);if(R.renderer&&function(){var v=ae.defaults.renderer||new Me,y=function(Y){var I=v[Y];v[Y]=function(){for(var ye=arguments.length,Ve=new Array(ye),ht=0;ht<ye;ht++)Ve[ht]=arguments[ht];var at=R.renderer[Y].apply(v,Ve);return at===!1&&(at=I.apply(v,Ve)),at}};for(var x in R.renderer)y(x);k.renderer=v}(),R.tokenizer&&function(){var v=ae.defaults.tokenizer||new Ce,y=function(Y){var I=v[Y];v[Y]=function(){for(var ye=arguments.length,Ve=new Array(ye),ht=0;ht<ye;ht++)Ve[ht]=arguments[ht];var at=R.tokenizer[Y].apply(v,Ve);return at===!1&&(at=I.apply(v,Ve)),at}};for(var x in R.tokenizer)y(x);k.tokenizer=v}(),R.walkTokens){var A=ae.defaults.walkTokens;k.walkTokens=function(v){R.walkTokens(v),A&&A(v)}}ae.setOptions(k)},ae.walkTokens=function(R,k){for(var A=he(R),v;!(v=A()).done;){var y=v.value;k(y);switch(y.type){case"table":{for(var x=he(y.tokens.header),S;!(S=x()).done;){var Y=S.value;ae.walkTokens(Y,k)}for(var I=he(y.tokens.cells),ye;!(ye=I()).done;)for(var Ve=ye.value,ht=he(Ve),at;!(at=ht()).done;){var kt=at.value;ae.walkTokens(kt,k)}break}case"list":{ae.walkTokens(y.items,k);break}default:y.tokens&&ae.walkTokens(y.tokens,k)}}},ae.Parser=et,ae.parser=et.parse,ae.Renderer=Me,ae.TextRenderer=Be,ae.Lexer=De,ae.lexer=De.lex,ae.Tokenizer=Ce,ae.Slugger=ft,ae.parse=ae;var de=ae;return de})},ELLl:function(bt,Xe,b){(function(j){j(b("VrN/"))})(function(j){var Ae={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Q=j.Pos;j.defineOption("autoCloseBrackets",!1,function(B,F,N){N&&N!=j.Init&&(B.removeKeyMap(he),B.state.closeBrackets=null),F&&(fe(ge(F,"pairs")),B.state.closeBrackets=F,B.addKeyMap(he))});function ge(B,F){return F=="pairs"&&typeof B=="string"?B:typeof B=="object"&&B[F]!=null?B[F]:Ae[F]}var he={Backspace:K,Enter:le};function fe(B){for(var F=0;F<B.length;F++){var N=B.charAt(F),te="'"+N+"'";he[te]||(he[te]=D(N))}}fe(Ae.pairs+"`");function D(B){return function(F){return P(F,B)}}function $(B){var F=B.state.closeBrackets;if(!F||F.override)return F;var N=B.getModeAt(B.getCursor());return N.closeBrackets||F}function K(B){var F=$(B);if(!F||B.getOption("disableInput"))return j.Pass;for(var N=ge(F,"pairs"),te=B.listSelections(),Z=0;Z<te.length;Z++){if(!te[Z].empty())return j.Pass;var Le=ee(B,te[Z].head);if(!Le||N.indexOf(Le)%2!=0)return j.Pass}for(var Z=te.length-1;Z>=0;Z--){var Ue=te[Z].head;B.replaceRange("",Q(Ue.line,Ue.ch-1),Q(Ue.line,Ue.ch+1),"+delete")}}function le(B){var F=$(B),N=F&&ge(F,"explode");if(!N||B.getOption("disableInput"))return j.Pass;for(var te=B.listSelections(),Z=0;Z<te.length;Z++){if(!te[Z].empty())return j.Pass;var Le=ee(B,te[Z].head);if(!Le||N.indexOf(Le)%2!=0)return j.Pass}B.operation(function(){var Ue=B.lineSeparator()||`
`;B.replaceSelection(Ue+Ue,null),B.execCommand("goCharLeft"),te=B.listSelections();for(var oe=0;oe<te.length;oe++){var ne=te[oe].head.line;B.indentLine(ne,null,!0),B.indentLine(ne+1,null,!0)}})}function L(B){var F=j.cmpPos(B.anchor,B.head)>0;return{anchor:new Q(B.anchor.line,B.anchor.ch+(F?-1:1)),head:new Q(B.head.line,B.head.ch+(F?1:-1))}}function P(B,F){var N=$(B);if(!N||B.getOption("disableInput"))return j.Pass;var te=ge(N,"pairs"),Z=te.indexOf(F);if(Z==-1)return j.Pass;for(var Le=ge(N,"closeBefore"),Ue=ge(N,"triples"),oe=te.charAt(Z+1)==F,ne=B.listSelections(),Oe=Z%2==0,H,se=0;se<ne.length;se++){var ke=ne[se],re=ke.head,w,q=B.getRange(re,Q(re.line,re.ch+1));if(Oe&&!ke.empty())w="surround";else if((oe||!Oe)&&q==F)oe&&U(B,re)?w="both":Ue.indexOf(F)>=0&&B.getRange(re,Q(re.line,re.ch+3))==F+F+F?w="skipThree":w="skip";else if(oe&&re.ch>1&&Ue.indexOf(F)>=0&&B.getRange(Q(re.line,re.ch-2),re)==F+F){if(re.ch>2&&/\bstring/.test(B.getTokenTypeAt(Q(re.line,re.ch-2))))return j.Pass;w="addFour"}else if(oe){var z=re.ch==0?" ":B.getRange(Q(re.line,re.ch-1),re);if(!j.isWordChar(q)&&z!=F&&!j.isWordChar(z))w="both";else return j.Pass}else if(Oe&&(q.length===0||/\s/.test(q)||Le.indexOf(q)>-1))w="both";else return j.Pass;if(!H)H=w;else if(H!=w)return j.Pass}var _=Z%2?te.charAt(Z-1):F,ie=Z%2?F:te.charAt(Z+1);B.operation(function(){if(H=="skip")B.execCommand("goCharRight");else if(H=="skipThree")for(var me=0;me<3;me++)B.execCommand("goCharRight");else if(H=="surround"){for(var J=B.getSelections(),me=0;me<J.length;me++)J[me]=_+J[me]+ie;B.replaceSelections(J,"around"),J=B.listSelections().slice();for(var me=0;me<J.length;me++)J[me]=L(J[me]);B.setSelections(J)}else H=="both"?(B.replaceSelection(_+ie,null),B.triggerElectric(_+ie),B.execCommand("goCharLeft")):H=="addFour"&&(B.replaceSelection(_+_+_+_,"before"),B.execCommand("goCharRight"))})}function ee(B,F){var N=B.getRange(Q(F.line,F.ch-1),Q(F.line,F.ch+1));return N.length==2?N:null}function U(B,F){var N=B.getTokenAt(Q(F.line,F.ch+1));return/\bstring/.test(N.type)&&N.start==F.ch&&(F.ch==0||!/\bstring/.test(B.getTokenTypeAt(F)))}})},F8wB:function(bt,Xe,b){bt.exports={loading:"loading___1SIOG"}},Gytx:function(bt,Xe){bt.exports=function(j,Ae,Q,ge){var he=Q?Q.call(ge,j,Ae):void 0;if(he!==void 0)return!!he;if(j===Ae)return!0;if(typeof j!="object"||!j||typeof Ae!="object"||!Ae)return!1;var fe=Object.keys(j),D=Object.keys(Ae);if(fe.length!==D.length)return!1;for(var $=Object.prototype.hasOwnProperty.bind(Ae),K=0;K<fe.length;K++){var le=fe[K];if(!$(le))return!1;var L=j[le],P=Ae[le];if(he=Q?Q.call(ge,L,P,le):void 0,he===!1||he===void 0&&L!==P)return!1}return!0}},HmJG:function(bt,Xe,b){},LdHM:function(bt,Xe,b){"use strict";b.d(Xe,"b",function(){return Le}),b.d(Xe,"a",function(){return oe});var j=b("1OyB"),Ae=b("vuIU"),Q=b("Ji7U"),ge=b("LK+K"),he=b("q1tI"),fe=b("rePB"),D=b("Ff2n"),$=b("ODXe"),K=b("4IlW"),le=b("bX4T"),L=b("YrtM"),P=b("TSYQ"),ee=b.n(P),U=b("+nKL"),B=b("8OUc"),F=function(V,xe){var ve=V.prefixCls,Ye=V.id,$e=V.flattenOptions,Ce=V.childrenAsData,Te=V.values,we=V.searchValue,_e=V.multiple,G=V.defaultActiveFirstOption,O=V.height,Ie=V.itemHeight,qe=V.notFoundContent,dt=V.open,We=V.menuItemSelectedIcon,Ke=V.virtual,pe=V.onSelect,De=V.onToggleOpen,je=V.onActiveValue,Ze=V.onScroll,He=V.onMouseEnter,Me="".concat(ve,"-item"),Be=Object(L.a)(function(){return $e},[dt,$e],function(de,R){return R[0]&&de[1]!==R[1]}),ft=he.useRef(null),it=function(R){R.preventDefault()},Je=function(R){ft.current&&ft.current.scrollTo({index:R})},et=function(R){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=Be.length,v=0;v<A;v+=1){var y=(R+v*k+A)%A,x=Be[y],S=x.group,Y=x.data;if(!S&&!Y.disabled)return y}return-1},gt=he.useState(function(){return et(0)}),ut=Object($.a)(gt,2),nt=ut[0],ue=ut[1],mt=function(R){ue(R);var k=Be[R];if(!k){je(null,-1);return}je(k.data.value,R)};he.useEffect(function(){mt(G!==!1?et(0):-1)},[Be.length,we]),he.useEffect(function(){var de=setTimeout(function(){if(!_e&&dt&&Te.size===1){var R=Array.from(Te)[0],k=Be.findIndex(function(A){var v=A.data;return v.value===R});mt(k),Je(k)}});return function(){return clearTimeout(de)}},[dt]);var tt=function(R){R!==void 0&&pe(R,{selected:!Te.has(R)}),_e||De(!1)};if(he.useImperativeHandle(xe,function(){return{onKeyDown:function(R){var k=R.which;switch(k){case K.a.UP:case K.a.DOWN:{var A=0;if(k===K.a.UP?A=-1:k===K.a.DOWN&&(A=1),A!==0){var v=et(nt+A,A);Je(v),mt(v)}break}case K.a.ENTER:{var y=Be[nt];y&&!y.data.disabled?tt(y.data.value):tt(void 0),dt&&R.preventDefault();break}case K.a.ESC:De(!1)}},onKeyUp:function(){},scrollTo:function(R){Je(R)}}}),Be.length===0)return he.createElement("div",{role:"listbox",id:"".concat(Ye,"_list"),className:"".concat(Me,"-empty"),onMouseDown:it},qe);function ae(de){var R=Be[de];if(!R)return null;var k=R.data||{},A=k.value,v=k.label,y=k.children,x=Object(le.a)(k,!0),S=Ce?y:v;return R?he.createElement("div",Object.assign({"aria-label":typeof S=="string"?S:null},x,{key:de,role:"option",id:"".concat(Ye,"_list_").concat(de),"aria-selected":Te.has(A)}),A):null}return he.createElement(he.Fragment,null,he.createElement("div",{role:"listbox",id:"".concat(Ye,"_list"),style:{height:0,width:0,overflow:"hidden"}},ae(nt-1),ae(nt),ae(nt+1)),he.createElement(U.a,{itemKey:"key",ref:ft,data:Be,height:O,itemHeight:Ie,fullHeight:!1,onMouseDown:it,onScroll:Ze,virtual:Ke,onMouseEnter:He},function(de,R){var k,A=de.group,v=de.groupOption,y=de.data,x=y.label,S=y.key;if(A)return he.createElement("div",{className:ee()(Me,"".concat(Me,"-group"))},x!==void 0?x:S);var Y=y.disabled,I=y.value,ye=y.title,Ve=y.children,ht=y.style,at=y.className,kt=Object(D.a)(y,["disabled","value","title","children","style","className"]),Et=Te.has(I),st="".concat(Me,"-option"),Kt=ee()(Me,st,at,(k={},Object(fe.a)(k,"".concat(st,"-grouped"),v),Object(fe.a)(k,"".concat(st,"-active"),nt===R&&!Y),Object(fe.a)(k,"".concat(st,"-disabled"),Y),Object(fe.a)(k,"".concat(st,"-selected"),Et),k)),Nt=Ce?Ve:x,Gt=!We||typeof We=="function"||Et;return he.createElement("div",Object.assign({},kt,{"aria-selected":Et,className:Kt,title:ye,onMouseMove:function(){if(nt===R||Y)return;mt(R)},onClick:function(){Y||tt(I)},style:ht}),he.createElement("div",{className:"".concat(st,"-content")},Nt||I),he.isValidElement(We)||Et,Gt&&he.createElement(B.a,{className:"".concat(Me,"-option-state"),customizeIcon:We,customizeIconProps:{isSelected:Et}},Et?"\u2713":null))}))},N=he.forwardRef(F);N.displayName="OptionList";var te=N,Z=function(){return null};Z.isSelectOption=!0;var Le=Z,Ue=function(){return null};Ue.isSelectOptGroup=!0;var oe=Ue,ne=b("VTBJ"),Oe=b("Zm9Q");function H(g){var V=g.key,xe=g.props,ve=xe.children,Ye=xe.value,$e=Object(D.a)(xe,["children","value"]);return Object(ne.a)({key:V,value:Ye!==void 0?Ye:V,children:ve},$e)}function se(g){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Oe.a)(g).map(function(xe,ve){if(!he.isValidElement(xe)||!xe.type)return null;var Ye=xe.type.isSelectOptGroup,$e=xe.key,Ce=xe.props,Te=Ce.children,we=Object(D.a)(Ce,["children"]);return V||!Ye?H(xe):Object(ne.a)(Object(ne.a)({key:"__RC_SELECT_GRP__".concat($e===null?ve:$e,"__"),label:$e},we),{},{options:se(Te)})}).filter(function(xe){return xe})}var ke=b("2Qr1"),re=b("qNPg"),w=b("U8pU"),q=b("Kwbf"),z=b("WKfj");function _(g){var V=g.mode,xe=g.options,ve=g.children,Ye=g.backfill,$e=g.allowClear,Ce=g.placeholder,Te=g.getInputElement,we=g.showSearch,_e=g.onSearch,G=g.defaultOpen,O=g.autoFocus,Ie=g.labelInValue,qe=g.value,dt=g.inputValue,We=g.optionLabelProp,Ke=V==="multiple"||V==="tags",pe=we!==void 0?we:Ke||V==="combobox",De=xe||se(ve);if(Object(q.a)(V!=="tags"||De.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var je=De.some(function(Me){return Me.options?Me.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(q.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(q.a)(V!=="combobox"||!We,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(q.a)(V==="combobox"||!Ye,"`backfill` only works with `combobox` mode."),Object(q.a)(V==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(q.b)(V!=="combobox"||!Te||!$e||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!pe&&V!=="combobox"&&V!=="tags"&&Object(q.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(q.b)(!G||O,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),qe!=null){var Ze=Object(z.d)(qe);Object(q.a)(!Ie||Ze.every(function(Me){return Object(w.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(q.a)(!Ke||Array.isArray(qe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ve){var He=null;Object(Oe.a)(ve).some(function(Me){if(!he.isValidElement(Me)||!Me.type)return!1;var Be=Me.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var ft=Object(Oe.a)(Me.props.children).every(function(it){return!he.isValidElement(it)||!Me.type||it.type.isSelectOption?!0:(He=it.type,!1)});return!ft}return He=Be,!0}),He&&Object(q.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(q.a)(dt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var ie=_,me=Object(re.a)({prefixCls:"rc-select",components:{optionList:te},convertChildrenToData:se,flattenOptions:ke.d,getLabeledValue:ke.e,filterOptions:ke.b,isValueDisabled:ke.g,findValueOption:ke.c,warningProps:ie,fillOptionsWithMissingValue:ke.a}),J=function(g){Object(Q.a)(xe,g);var V=Object(ge.a)(xe);function xe(){var ve;return Object(j.a)(this,xe),ve=V.apply(this,arguments),ve.selectRef=he.createRef(),ve.focus=function(){ve.selectRef.current.focus()},ve.blur=function(){ve.selectRef.current.blur()},ve}return Object(Ae.a)(xe,[{key:"render",value:function(){return he.createElement(me,Object.assign({ref:this.selectRef},this.props))}}]),xe}(he.Component);J.Option=Le,J.OptGroup=oe;var Pe=J,C=Xe.c=Pe},M8RZ:function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return K});var j=b("fWQN"),Ae=b("mtLc"),Q=b("yKVA"),ge=b("879j"),he=b("q1tI"),fe=b.n(he),D=b("i8i4"),$=b.n(D),K=function(le){Object(Q.a)(P,le);var L=Object(ge.a)(P);function P(ee){var U;Object(j.a)(this,P),U=L.call(this,ee);var B=window.document;return U.node=B.createElement("div"),B.body.appendChild(U.node),U}return Object(Ae.a)(P,[{key:"render",value:function(){var U=this.props.children;return Object(D.createPortal)(U,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),P}(fe.a.Component)},OLES:function(bt,Xe,b){"use strict";var j=b("U8pU"),Ae=b("VTBJ"),Q=b("Ff2n"),ge=b("q1tI"),he=b("uciX"),fe=b("7ixt"),D=function(ee){var U=ee.overlay,B=ee.prefixCls,F=ee.id,N=ee.overlayInnerStyle;return ge.createElement("div",{className:"".concat(B,"-inner"),id:F,role:"tooltip",style:N},typeof U=="function"?U():U)},$=D,K=function(ee,U){var B=ee.overlayClassName,F=ee.trigger,N=F===void 0?["hover"]:F,te=ee.mouseEnterDelay,Z=te===void 0?0:te,Le=ee.mouseLeaveDelay,Ue=Le===void 0?.1:Le,oe=ee.overlayStyle,ne=ee.prefixCls,Oe=ne===void 0?"rc-tooltip":ne,H=ee.children,se=ee.onVisibleChange,ke=ee.afterVisibleChange,re=ee.transitionName,w=ee.animation,q=ee.placement,z=q===void 0?"right":q,_=ee.align,ie=_===void 0?{}:_,me=ee.destroyTooltipOnHide,J=me===void 0?!1:me,Pe=ee.defaultVisible,C=ee.getTooltipContainer,g=ee.overlayInnerStyle,V=Object(Q.a)(ee,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),xe=Object(ge.useRef)(null);Object(ge.useImperativeHandle)(U,function(){return xe.current});var ve=Object(Ae.a)({},V);"visible"in ee&&(ve.popupVisible=ee.visible);var Ye=function(){var _e=ee.arrowContent,G=_e===void 0?null:_e,O=ee.overlay,Ie=ee.id;return[ge.createElement("div",{className:"".concat(Oe,"-arrow"),key:"arrow"},G),ge.createElement($,{key:"content",prefixCls:Oe,id:Ie,overlay:O,overlayInnerStyle:g})]},$e=!1,Ce=!1;if(typeof J=="boolean")$e=J;else if(J&&Object(j.a)(J)==="object"){var Te=J.keepParent;$e=Te===!0,Ce=Te===!1}return ge.createElement(he.a,Object.assign({popupClassName:B,prefixCls:Oe,popup:Ye,action:N,builtinPlacements:fe.a,popupPlacement:z,ref:xe,popupAlign:ie,getPopupContainer:C,onPopupVisibleChange:se,afterPopupVisibleChange:ke,popupTransitionName:re,popupAnimation:w,defaultPopupVisible:Pe,destroyPopupOnHide:$e,autoDestroy:Ce,mouseLeaveDelay:Ue,popupStyle:oe,mouseEnterDelay:Z},ve),H)},le=Object(ge.forwardRef)(K),L=Xe.a=le},Ot1p:function(bt,Xe,b){"use strict";var j=b("2qtc"),Ae=b("kLXV"),Q=b("rAM+"),ge=b("miYZ"),he=b("tsqr"),fe=b("9og8"),D=b("tJVT"),$=b("jrin"),K=b("WmNS"),le=b.n(K),L=b("q1tI"),P=b.n(L),ee=b("VrN/"),U=b.n(ee),B=b("bdgK"),F=b("p77/"),N=b("Bd2K"),te=b("ELLl"),Z=b("19Vz"),Le=b("lZu9"),Ue=b("+NIl"),oe=b("kSUc"),ne=b("9Bee"),Oe=function(I){var ye=I.value,Ve=ye===void 0?"":ye,ht=I.className,at=I.showTextOnly,kt=I.showLines,Et=I.style,st=Et===void 0?{}:Et,Kt=Object(L.useMemo)(function(){return""},[Ve]);return P.a.createElement(P.a.Fragment,null,P.a.createElement("div",{dangerouslySetInnerHTML:{__html:Kt}}))},H=b("0Owb"),se=b("dejd"),ke=b("C+DQ"),re=b("1vsH"),w=b("m3rI"),q=[{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 z(I){var ye=I.onActionCallback,Ve=I.title,ht=I.icon,at=I.actionName,kt=I.className,Et=kt===void 0?"":kt,st=I.children;function Kt(){ye(at)}return P.a.createElement("a",{title:Ve,className:Et,onClick:Kt},P.a.createElement("i",{className:"md-iconfont ".concat(ht)}),st)}var _=function(I){var ye=I.watch,Ve=I.showNullButton,ht=I.onActionCallback,at=I.fullScreen,kt=I.insertTemp,Et=I.hidetoolBar,st=I.uuid,Kt=I.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(re.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(re.E)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(w.a.PROXY_SERVER)));var Nt=[].concat(q,[{title:"".concat(ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ye?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return P.a.createElement("ul",{className:"markdown-toolbar-container"},!Et&&Nt.map(function(Gt,Wt){return P.a.createElement("li",{key:Wt},Gt.actionName?P.a.createElement(z,Object(H.a)({},Gt,{onActionCallback:ht})):P.a.createElement("span",{className:"v-line"}))}),Ve?P.a.createElement("li",null,P.a.createElement(z,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ht},P.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&P.a.createElement("li",null,P.a.createElement(z,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:ht},P.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),P.a.createElement("li",{className:"btn-full-screen"},P.a.createElement(z,{icon:"".concat(at?"icon-shrink":"icon-enlarge"),title:at?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ht})))},ie=b("M8RZ"),me=b("+L6B"),J=b("2/Rp"),Pe=b("y8nQ"),C=b("Vl3Y"),g=b("5NDa"),V=b("5rEg"),xe={labelCol:{span:4},wrapperCol:{span:20}},ve=function(I){var ye=I.callback,Ve=I.onCancel;function ht(at){ye(at)}return P.a.createElement(C.a,Object(H.a)({},xe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ht}),P.a.createElement(C.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},P.a.createElement(V.a,null)),P.a.createElement(C.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},P.a.createElement(V.a,null)),P.a.createElement("div",{className:"flex-container flex-end"},P.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),P.a.createElement(J.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))},Ye=b("7ahc"),$e=b("k1fw"),Ce=b("HmJG"),Te=b("BjJ7"),we=C.a.useForm,_e={width:280,marginRight:10},G={labelCol:{span:5},wrapperCol:{span:19}},O=function(I){var ye=I.callback,Ve=I.onCancel,ht=we(),at=Object(D.a)(ht,1),kt=at[0],Et=Object(L.useRef)();function st(Gt){ye(Object($e.a)(Object($e.a)({},Gt),{},{name:Et.current}))}function Kt(Gt,Wt){kt.setFieldsValue({src:"/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type),type:Wt.type})}function Nt(Gt){var Wt=Gt.target.files[0];Et.current=Wt.name,qe(Wt,Kt)}return P.a.createElement(C.a,Object(H.a)({form:kt},G,{className:"upload-image-panel",onFinish:st}),P.a.createElement(C.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},P.a.createElement("div",{className:"flex-container"},P.a.createElement(C.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},P.a.createElement(V.a,{style:_e})),P.a.createElement(Ie,{onFileChange:Nt}))),P.a.createElement(C.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},P.a.createElement(V.a,{style:{width:264}})),P.a.createElement(C.a.Item,{style:{textAlign:"right"}},P.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),P.a.createElement(J.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function Ie(I){var ye=I.onFileChange;return P.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",P.a.createElement("input",{type:"file",onChange:ye}))}function qe(I,ye){if(!I)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ve=new FormData;Ve.append("editormd-image-file",I),Ve.append("file_param_name","editormd-image-file"),Ve.append("byxhr","true");var ht=new window.XMLHttpRequest;ht.withCredentials=!0,ht.addEventListener("load",function(at){ye(JSON.parse(at.target.responseText),I)},!1),ht.addEventListener("error",function(at){console.error(at)},!1),ht.open("POST","".concat(Te.a,"/api/attachments.json")),ht.send(Ve)}var dt=b("giR+"),We=b("fyUT"),Ke=b("7Kak"),pe=b("9yH6"),De=pe.a.Group,je={margin:"0 8px"},Ze=function(I){var ye=I.callback,Ve=I.onCancel;function ht(at){ye(at)}return P.a.createElement(C.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ht},P.a.createElement("div",{className:"flex-container"},P.a.createElement("span",{style:je},"\u5355\u5143\u683C\u6570\uFF1A"),P.a.createElement("span",{style:je},"\u884C\u6570"),P.a.createElement(C.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},P.a.createElement(We.a,null)),P.a.createElement("span",{style:je},"\u5217\u6570"),P.a.createElement(C.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},P.a.createElement(We.a,null))),P.a.createElement("div",{className:"flex-container",style:{marginTop:12}},P.a.createElement("span",{style:je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),P.a.createElement(C.a.Item,{name:"align"},P.a.createElement(De,null,P.a.createElement(pe.a,{value:"default"},P.a.createElement("i",{className:"fa fa-align-justify"})),P.a.createElement(pe.a,{value:"left"},P.a.createElement("i",{className:"fa fa-align-left"})),P.a.createElement(pe.a,{value:"center"},P.a.createElement("i",{className:"fa fa-align-center"})),P.a.createElement(pe.a,{value:"right"},P.a.createElement("i",{className:"fa fa-align-right"}))))),P.a.createElement("div",{className:"flex-container flex-end"},P.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),P.a.createElement(J.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))},He=b("ErOA"),Me=b("7Cbv"),Be="link",ft="upload-image",it="code-block",Je="add-table",et="------------",gt={default:et,left:":".concat(et),center:":".concat(et,":"),right:"".concat(et,":")},ut=b("9VGf"),nt,ue;function mt(){}var tt=0,ae=1e4,de="\u2581",R=`
**\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 k(I){return/^\d+$/.test(I)?"".concat(I,"px"):I}var A=navigator.platform.toUpperCase().indexOf("MAC")>=0,v=A?"Cmd":"Ctrl",y=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],x=(nt={},Object($.a)(nt,v+"-B","bold"),Object($.a)(nt,v+"-I","italic"),nt),S=(ue={},Object($.a)(ue,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object($.a)(ue,it,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object($.a)(ue,ft,"\u6DFB\u52A0\u6587\u4EF6"),Object($.a)(ue,Je,"\u6DFB\u52A0\u8868\u683C"),ue),Y=Xe.a=function(I){var ye=I.defaultValue,Ve=ye===void 0?"":ye,ht=I.onChange,at=I.width,kt=at===void 0?"100%":at,Et=I.height,st=Et===void 0?400:Et,Kt=I.miniToolbar,Nt=Kt===void 0?!1:Kt,Gt=I.isFocus,Wt=Gt===void 0?!1:Gt,Tt=I.watch,Wi=I.insertTemp,an=I.mode,vt=an===void 0?"markdown":an,Xi=I.id,ri=Xi===void 0?"markdown-editor-id":Xi,di=I.showResizeBar,Hi=di===void 0?!1:di,sn=I.noStorage,ln=sn===void 0?!1:sn,Dt=I.showNullButton,lt=Dt===void 0?!1:Dt,Di=I.hidetoolBar,un=Di===void 0?!1:Di,xi=I.fullScreen,Lt=xi===void 0?!1:xi,Pi=I.onBlur,Ki=I.onCMBeforeChange,hn=I.onFullScreen,Re=I.className,wt=Re===void 0?"":Re,cn=I.disablePaste,Ln=cn===void 0?!1:cn,dn=I.placeholder,Mn=dn===void 0?"":dn,c=I.values,o=c===void 0?"":c,a=Object(L.useState)(null),u=Object(D.a)(a,2),d=u[0],h=u[1],M=Object(L.useState)(Ve),be=Object(D.a)(M,2),Fe=be[0],rt=be[1],Se=Object(L.useState)(Tt),Ct=Object(D.a)(Se,2),At=Ct[0],Vt=Ct[1],Ni=Object(L.useState)(Lt),Ii=Object(D.a)(Ni,2),oi=Ii[0],zi=Ii[1],zn=Object(L.useState)(""),Ci=Object(D.a)(zn,2),Bi=Ci[0],Mi=Ci[1],vn=Object(L.useState)(0),Yi=Object(D.a)(vn,2),fn=Yi[0],en=Yi[1],cr=Object(L.useState)(st),Gn=Object(D.a)(cr,2),$i=Gn[0],ji=Gn[1],An=Object(L.useState)(!1),On=Object(D.a)(An,2),dr=On[0],Zt=On[1],It=Object(L.useRef)(Object(Me.a)()),fi=Object(L.useRef)(!1),Pt=Object(L.useRef)(),ei=Object(L.useRef)(),Ut=Object(L.useRef)(),tn=Object(L.useRef)(),Qt=Object(L.useRef)(),wi=function(){var ct=Object(fe.a)(le.a.mark(function St(){var yt,Mt;return le.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(He.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:It.current}});case 2:Mt=Ht.sent,Mt!=null&&(yt=Mt.attachments)!==null&&yt!==void 0&&yt.length&&(console.log("cm:",d,ei),Mt.attachments.map(function(Rt){Rt.content_type.indexOf("image")>-1?d.replaceSelection("![,](/api/attachments/".concat(Rt.id,"?type=").concat(Rt.content_type,")")):Rt.content_type.indexOf("video")>-1?d.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Rt.content_type.indexOf("pdf")>-1?d.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,'&disposition=inline" target="_blank">').concat(Rt.name,"</a>")):d.replaceSelection("[".concat(Rt.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}));case 4:case"end":return Ht.stop()}},St)}));return function(){return ct.apply(this,arguments)}}();Object(L.useEffect)(function(){rt(o),d==null||d.setValue(o)},[o]),Object(L.useEffect)(function(){hn==null||hn(oi)},[oi]),Object(L.useEffect)(function(){if(ei.current){var ct=U.a.fromTextArea(ei.current,{mode:vt,lineNumbers:!Nt,lineWrapping:!0,value:Ve,autoCloseTags:!0,autoCloseBrackets:!0});Wt&&ct.focus();function St(yt,Mt){if(Ln){Mt.preventDefault();return}var Bt=Mt.clipboardData;if(Bt){var Ht=Bt.types.toString(),Rt=Bt.items;if(Ht==="Files"||Bt.types.indexOf("Files")>-1){if(Mt.preventDefault(),vt=="stex")return;try{var ti,Si=Rt[1];((ti=Rt[0])===null||ti===void 0?void 0:ti.kind)==="file"&&(Si=Rt[0]);var Ot=Si.getAsFile(),bn=Ot.name.split(".").pop();qe(Ot,function(jt){if(jt.id){var si,Gi,Vi;(Ot==null||((si=Ot.type)===null||si===void 0)?void 0:si.indexOf("image"))>-1?ct.replaceSelection("![,](/api/attachments/".concat(jt.id,"?type=").concat(jt.content_type,")")):(Ot==null||((Gi=Ot.type)===null||Gi===void 0)?void 0:Gi.indexOf("video"))>-1?ct.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,'"></video>')):(Ot==null||((Vi=Ot.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?ct.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(Ot.type,'&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):y.includes(bn)?ct.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,'?type=office&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):ct.replaceSelection("[".concat(Ot.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}else(jt==null?void 0:jt.status)===401&&(document.location.href="/user/login")})}catch(jt){he.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ct.on("paste",St),ct.on("dragleave",function(yt,Mt){Ut.current.classList.remove("mouse-hover-md")}),ct.on("dragover",function(yt,Mt){Ut.current.classList.add("mouse-hover-md")}),ct.on("drop",function(yt,Mt){Ut.current.classList.add("mouse-hover-md");var Bt;if(Bt=Mt.dataTransfer.files,Bt.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var Ht=function(Si){var Ot=Bt[Si],bn=Ot.name.split(".").pop();qe(Ot,function(jt){if(jt.id){var si,Gi,Vi;(Ot==null||((si=Ot.type)===null||si===void 0)?void 0:si.indexOf("image"))>-1?ct.replaceSelection("![,](/api/attachments/".concat(jt.id,"?type=").concat(jt.content_type,")")):(Ot==null||((Gi=Ot.type)===null||Gi===void 0)?void 0:Gi.indexOf("video"))>-1?ct.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,'"></video>')):(Ot==null||((Vi=Ot.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?ct.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(Ot.type,'&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):y.includes(bn)?ct.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,'?type=office&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):ct.replaceSelection("[".concat(Ot.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}else(jt==null?void 0:jt.status)===401&&(document.location.href="/user/login")})},Rt=0;Rt<Bt.length;Rt++)Ht(Rt)}}),h(ct),function(){ct.off("paste",St)}}},[]);var Vn=Object(L.useCallback)(function(){if(Ut.current)try{}catch(ct){console.log(ct,"---- to set md editor body height")}},[$i,Ut,oi]);Object(L.useEffect)(function(){function ct(){var yt=new B.default(function(Mt){var Bt=Object(Q.a)(Mt),Ht;try{for(Bt.s();!(Ht=Bt.n()).done;){var Rt=Ht.value;(Rt.target.offsetHeight>0||Rt.target.offsetWidth>0)&&(Vn(),d.setSize("100%","100%"),d.refresh())}}catch(ti){Bt.e(ti)}finally{Bt.f()}});return yt.observe(ei.current.parentElement),yt}if(d){var St=ct();return function(){St.unobserve(ei.current.parentElement)}}},[d,Vn]),Object(L.useEffect)(function(){if(d){for(var ct=[],St=function(){var Rt=Mt[yt];Bt=Object(D.a)(Rt,2);var ti=Bt[0],Si=Bt[1],Ot=Object($.a)({},ti,function(){Xn(Si)});ct.push(Ot),d.addKeyMap(Ot)},yt=0,Mt=Object.entries(x);yt<Mt.length;yt++){var Bt;St()}return Pt.current=setInterval(function(){fi.current&&wi()},4e3),function(){clearInterval(Pt.current);var Ht=Object(Q.a)(ct),Rt;try{for(Ht.s();!(Rt=Ht.n()).done;){var ti=Rt.value;d.removeKeyMap(ti)}}catch(Si){Ht.e(Si)}finally{Ht.f()}}}},[d]),Object(L.useEffect)(function(){Lt!==oi&&zi(Lt)},[Lt]),Object(ut.a)(function(){if(!ln&&fn>0){var ct=new Date().getTime(),St=window.sessionStorage.getItem(ri);ct>=fn+ae&&(!St||St!==Fe)&&(window.sessionStorage.setItem(ri,Fe),Zt(!0))}},ae),Object(L.useEffect)(function(){Vt(Tt)},[d,Tt]),Object(L.useEffect)(function(){d&&(Wt&&d.focus())},[d,Wt]),Object(L.useEffect)(function(){if(At&&d){var ct=d.getScrollerElement();function St(yt){var Mt=yt.target;if(Qt.current){var Bt=Mt.scrollTop/Mt.scrollHeight;Qt.current.scrollTop=Qt.current.scrollHeight*Bt}}return ct.addEventListener("scroll",St),function(){ct.removeEventListener("scroll",St)}}},[d,At]),Object(L.useEffect)(function(){if(d&&Ki){function ct(St,yt){Ki(St,yt)}return d.on("beforeChange",ct),function(){d.off("beforeChange",ct)}}},[d,Ki]),Object(L.useEffect)(function(){if(d&&Pi){function ct(){Pi(d.getValue())}return d.on("blur",ct),function(){d.off("blur",ct)}}},[d,Pi]),Object(L.useEffect)(function(){if(d){function ct(St){var yt=St.getValue();rt(yt),en(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ht&&ht(yt)}return d.on("change",ct),function(){d.off("change",ct)}}},[d,ht]),Object(L.useEffect)(function(){d&&(Ve==null?(d.setValue(""),rt("")):Ve!==d.getValue()&&(d.setValue(Ve),rt(Ve),d.setCursor(d.lineCount(),0)))},[d,Ve]);var Xn=Object(L.useCallback)(function(ct){var St=d.getCursor(),yt=d.getSelection(),Mt=yt.split(`
`);switch(ct){case"bold":return d.replaceSelection("**"+yt+"**"),yt===""&&d.setCursor(St.line,St.ch+2),d.focus();case"italic":return d.replaceSelection("*"+yt+"*"),yt===""&&d.setCursor(St.line,St.ch+1),d.focus();case"code":return d.replaceSelection("`"+yt+"`"),yt===""&&d.setCursor(St.line,St.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+yt+"$$`"),yt===""&&d.setCursor(St.line,St.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+yt+"\n```"),d.setCursor(St.line+1,yt.length+1),d.focus();case"line-break":return d.replaceSelection(`<br/>
`),d.focus();case"list-ul":return yt===""?d.replaceSelection("- "+yt):d.replaceSelection(Mt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
`)),d.focus();case"list-ol":return yt===""?d.replaceSelection("1. "+yt):d.replaceSelection(Mt.map(function(Bt,Ht){return Bt===""?"":"".concat(Ht+1,". ").concat(Bt)}).join(`
`)),d.focus();case"add-null-ch":return yt===""&&d.setCursor(St.line,St.ch+1),d.replaceSelection(de),d.focus();case"inster-template-1":return yt===""&&d.setCursor(St.line,St.ch),d.replaceSelection(R),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return Vt(!At),d.focus();case"trigger-full-screen":return zi(!oi),d.focus();case Be:Mi(Be);return;case it:Mi(it);return;case ft:Mi(ft);return;case Je:Mi(Je);return;default:throw new Error}},[d,At,oi]),yn=Object(L.useCallback)(function(ct){Mi("");switch(Bi){case Be:var St=ct.title,yt=ct.link;return d.replaceSelection("[".concat(St,"](").concat(yt,")")),d.focus();case it:var Mt=ct.language,Bt=ct.content;return d.replaceSelection(["```"+Mt,Bt,"```"].join(`
`)),d.focus();case ft:var Ht=ct.src,Rt=ct.alt,ti=ct.name;return Ht.indexOf("type=image")>-1?d.replaceSelection("![ ".concat(Rt||""," ]( ").concat(Ht,' "').concat(Rt||"",'" )')):Ht.indexOf("type=application/pdf")>-1?d.replaceSelection('<a href="'.concat(Ht,'&disposition=inline" target="_blank">').concat(ti,"</a>")):d.replaceSelection('<a href="'.concat(Ht,'" target="_blank">').concat(ti,"</a>")),d.focus();case Je:for(var Si=ct.row,Ot=ct.col,bn=ct.align,jt=`
`,si=0;si<Si;si++){for(var Gi=[],Vi=[],Wr=0;Wr<Ot;Wr++)si===1&&Vi.push(gt[bn]),Gi.push(" ");si===1&&(jt+="| ".concat(Vi.join(" | "),` |
`)),jt+="| ".concat(Gi.join(Ot===1?"":" | "),` |
`)}return d.replaceSelection(jt+`
`),d.focus();default:throw new Error}},[d,Bi]),Ur=Object(L.useMemo)(function(){switch(Bi){case Be:return P.a.createElement(ve,{callback:yn,onCancel:Ai});case it:return P.a.createElement(Ye.b,{callback:yn,onCancel:Ai});case ft:return P.a.createElement(O,{callback:yn,onCancel:Ai});case Je:return P.a.createElement(Ze,{callback:yn,onCancel:Ai});default:return null}},[Bi]);function Ai(){Mi("")}Object(L.useEffect)(function(){if(tn.current){var ct=tn.current,St=!1,yt=0;function Mt(Rt){St=!0,yt=Rt.pageY}function Bt(){St=!1}function Ht(Rt){if(St){var ti=Rt.pageY-yt;ti<0&&(ti=0),ti>300&&(ti=300);var Si=st+ti+"px";ji(Si)}}return ct.addEventListener("mousedown",Mt),document.addEventListener("mousemove",Ht),document.addEventListener("mouseup",Bt),function(){ct.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",Ht),document.removeEventListener("mouseup",Bt)}}},[d,tn]),Object(L.useEffect)(function(){ji(st)},[st]);var fr=k(kt),Zi=k($i),Kn={width:fr,height:Zi},Fr=Object(L.useMemo)(function(){if(fn){var ct=new Date(fn),St=ct.getHours(),yt=ct.getMinutes(),Mt=ct.getSeconds();return St=St<10?"0"+St:St,yt=yt<10?"0"+yt:yt,Mt=Mt<10?"0"+Mt:Mt,"".concat(St,":").concat(yt,":").concat(Mt)}return 0},[fn]);function Rn(){window.sessionStorage.removeItem(ri),Zt(!1),en(0)}function Zo(){Zt(!1),en(0),d.setValue(window.sessionStorage.getItem(ri))}function ho(ct,St){var yt=d.getValue();yt=yt.replace(ct,St),rt(yt),d==null||d.setValue(yt)}return P.a.createElement(L.Fragment,null,P.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ut},P.a.createElement("div",{className:"markdown-editor-container ".concat(wt," ").concat(At?"on-preview":""," ").concat(Nt?"mini":""," ").concat(oi?"full-screen":""),style:Kn},P.a.createElement(_,{insertTemp:Wi,watch:At,fullScreen:oi,showNullButton:lt,onActionCallback:Xn,hidetoolBar:un,uuid:It.current,setOpenPhones:function(){fi.current=!0}}),P.a.createElement("div",{className:"markdown-editor-body"},P.a.createElement("div",{className:"codemirror-container"},P.a.createElement("textarea",{ref:ei,placeholder:Mn})),At?P.a.createElement("div",{ref:Qt,className:"preview-container"},vt==="stex"&&P.a.createElement(Oe,{value:Fe}),vt!=="stex"&&P.a.createElement(ne.a,{edit:!0,value:Fe,replaces:ho})):null))),Hi?P.a.createElement("a",{ref:tn,className:"editor-resize"}):null,P.a.createElement(ie.a,null,S[Bi]?P.a.createElement(Ae.a,{centered:!0,title:S[Bi],visible:!0,onCancel:Ai,footer:null},Ur):null))}},SJMd:function(bt,Xe){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var b,j,Ae,Q=!1,ge,he;window.PR_SHOULD_USE_CONTINUATION=!0;var fe,D;(function(){var $=window,K=["break,continue,do,else,for,if,return,while"],le=[K,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],L=[le,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],P=[L,"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"],ee=[L,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],U=[L,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],B="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",F=[L,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],N="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",te=[K,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],Z=[K,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Le=[K,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ue=[P,U,ee,F,N,te,Z,Le],oe=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ne="str",Oe="kwd",H="com",se="typ",ke="lit",re="pun",w="pln",q="tag",z="dec",_="src",ie="atn",me="atv",J="nocode",Pe="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function C(pe){for(var De=0,je=!1,Ze=!1,He=0,Me=pe.length;He<Me;++He){var Be=pe[He];if(Be.ignoreCase)Ze=!0;else if(/[a-z]/i.test(Be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){je=!0,Ze=!1;break}}var ft={b:8,t:9,n:10,v:11,f:12,r:13};function it(nt){var ue=nt.charCodeAt(0);if(ue!==92)return ue;var mt=nt.charAt(1);return ue=ft[mt],ue||("0"<=mt&&mt<="7"?parseInt(nt.substring(1),8):mt==="u"||mt==="x"?parseInt(nt.substring(2),16):nt.charCodeAt(1))}function Je(nt){if(nt<32)return(nt<16?"\\x0":"\\x")+nt.toString(16);var ue=String.fromCharCode(nt);return ue==="\\"||ue==="-"||ue==="]"||ue==="^"?"\\"+ue:ue}function et(nt){var ue=nt.substring(1,nt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),mt=[],tt=ue[0]==="^",ae=["["];tt&&ae.push("^");for(var de=tt?1:0,R=ue.length;de<R;++de){var k=ue[de];if(/\\[bdsw]/i.test(k))ae.push(k);else{var A=it(k),v;de+2<R&&ue[de+1]==="-"?(v=it(ue[de+2]),de+=2):v=A,mt.push([A,v]),v<65||A>122||(v<65||A>90||mt.push([Math.max(65,A)|32,Math.min(v,90)|32]),v<97||A>122||mt.push([Math.max(97,A)&~32,Math.min(v,122)&~32]))}}mt.sort(function(Y,I){return Y[0]-I[0]||I[1]-Y[1]});for(var y=[],x=[],de=0;de<mt.length;++de){var S=mt[de];S[0]<=x[1]+1?x[1]=Math.max(x[1],S[1]):y.push(x=S)}for(var de=0;de<y.length;++de){var S=y[de];ae.push(Je(S[0])),S[1]>S[0]&&(S[1]+1>S[0]&&ae.push("-"),ae.push(Je(S[1])))}return ae.push("]"),ae.join("")}function gt(nt){for(var ue=nt.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")),mt=ue.length,tt=[],ae=0,de=0;ae<mt;++ae){var R=ue[ae];if(R==="(")++de;else if(R.charAt(0)==="\\"){var k=+R.substring(1);k&&(k<=de?tt[k]=-1:ue[ae]=Je(k))}}for(var ae=1;ae<tt.length;++ae)tt[ae]===-1&&(tt[ae]=++De);for(var ae=0,de=0;ae<mt;++ae){var R=ue[ae];if(R==="(")++de,tt[de]||(ue[ae]="(?:");else if(R.charAt(0)==="\\"){var k=+R.substring(1);k&&k<=de&&(ue[ae]="\\"+tt[k])}}for(var ae=0;ae<mt;++ae)ue[ae]==="^"&&ue[ae+1]!=="^"&&(ue[ae]="");if(nt.ignoreCase&&je)for(var ae=0;ae<mt;++ae){var R=ue[ae],A=R.charAt(0);R.length>=2&&A==="["?ue[ae]=et(R):A!=="\\"&&(ue[ae]=R.replace(/[a-zA-Z]/g,function(x){var S=x.charCodeAt(0);return"["+String.fromCharCode(S&~32,S|32)+"]"}))}return ue.join("")}for(var ut=[],He=0,Me=pe.length;He<Me;++He){var Be=pe[He];if(Be.global||Be.multiline)throw new Error(""+Be);ut.push("(?:"+gt(Be)+")")}return new RegExp(ut.join("|"),Ze?"gi":"g")}function g(pe,De){var je=/(?:^|\s)nocode(?:\s|$)/,Ze=[],He=0,Me=[],Be=0;function ft(it){var Je=it.nodeType;if(Je==1){if(je.test(it.className))return;for(var et=it.firstChild;et;et=et.nextSibling)ft(et);var gt=it.nodeName.toLowerCase();(gt==="br"||gt==="li")&&(Ze[Be]=`
`,Me[Be<<1]=He++,Me[Be++<<1|1]=it)}else if(Je==3||Je==4){var ut=it.nodeValue;ut.length&&(De?ut=ut.replace(/\r\n?/g,`
`):ut=ut.replace(/[ \t\r\n]+/g," "),Ze[Be]=ut,Me[Be<<1]=He,He+=ut.length,Me[Be++<<1|1]=it)}}return ft(pe),{sourceCode:Ze.join("").replace(/\n$/,""),spans:Me}}function V(pe,De,je,Ze,He){if(!je)return;var Me={sourceNode:pe,pre:1,langExtension:null,numberLines:null,sourceCode:je,spans:null,basePos:De,decorations:null};Ze(Me),He.push.apply(He,Me.decorations)}var xe=/\S/;function ve(pe){for(var De=void 0,je=pe.firstChild;je;je=je.nextSibling){var Ze=je.nodeType;De=Ze===1?De?pe:je:Ze===3&&xe.test(je.nodeValue)?pe:De}return De===pe?void 0:De}function Ye(pe,De){var je={},Ze;(function(){for(var Be=pe.concat(De),ft=[],it={},Je=0,et=Be.length;Je<et;++Je){var gt=Be[Je],ut=gt[3];if(ut)for(var nt=ut.length;--nt>=0;)je[ut.charAt(nt)]=gt;var ue=gt[1],mt=""+ue;it.hasOwnProperty(mt)||(ft.push(ue),it[mt]=null)}ft.push(/[\0-\uffff]/),Ze=C(ft)})();var He=De.length,Me=function(Be){for(var ft=Be.sourceCode,it=Be.basePos,Je=Be.sourceNode,et=[it,w],gt=0,ut=ft.match(Ze)||[],nt={},ue=0,mt=ut.length;ue<mt;++ue){var tt=ut[ue],ae=nt[tt],de=void 0,R;if(typeof ae=="string")R=!1;else{var k=je[tt.charAt(0)];if(k)de=tt.match(k[1]),ae=k[0];else{for(var A=0;A<He;++A)if(k=De[A],de=tt.match(k[1]),de){ae=k[0];break}de||(ae=w)}R=ae.length>=5&&ae.substring(0,5)==="lang-",R&&!(de&&typeof de[1]=="string")&&(R=!1,ae=_),R||(nt[tt]=ae)}var v=gt;if(gt+=tt.length,!R)et.push(it+v,ae);else{var y=de[1],x=tt.indexOf(y),S=x+y.length;de[2]&&(S=tt.length-de[2].length,x=S-y.length);var Y=ae.substring(5);V(Je,it+v,tt.substring(0,x),Me,et),V(Je,it+v+x,y,O(Y,y),et),V(Je,it+v+S,tt.substring(S),Me,et)}}Be.decorations=et};return Me}function $e(pe){var De=[],je=[];pe.tripleQuotedStrings?De.push([ne,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):pe.multiLineStrings?De.push([ne,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([ne,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),pe.verbatimStrings&&je.push([ne,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ze=pe.hashComments;Ze&&(pe.cStyleComments?(Ze>1?De.push([H,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.push([H,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([ne,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):De.push([H,/^#[^\r\n]*/,null,"#"])),pe.cStyleComments&&(je.push([H,/^\/\/[^\r\n]*/,null]),je.push([H,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=pe.regexLiterals;if(He){var Me=He>1?"":`
\r`,Be=Me?".":"[\\S\\s]",ft="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+Pe+"("+ft+")")])}var it=pe.types;it&&je.push([se,it]);var Je=(""+pe.keywords).replace(/^ | $/g,"");Je.length&&je.push([Oe,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([w,/^\s+/,null,` \r
\xA0`]);var et="^.[^\\s\\w.$@'\"`/\\\\]*";return pe.regexLiterals&&(et+="(?!s*/)"),je.push([ke,/^@[a-z_$][a-z_$@0-9]*/i,null],[se,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[w,/^[a-z_$][a-z_$@0-9]*/i,null],[ke,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[w,/^\\[\s\S]?/,null],[re,new RegExp(et),null]),Ye(De,je)}var Ce=$e({keywords:Ue,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(pe,De,je){for(var Ze=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,Me=pe.ownerDocument,Be=Me.createElement("li");pe.firstChild;)Be.appendChild(pe.firstChild);var ft=[Be];function it(ue){var mt=ue.nodeType;if(mt==1&&!Ze.test(ue.className))if(ue.nodeName==="br")Je(ue),ue.parentNode&&ue.parentNode.removeChild(ue);else for(var tt=ue.firstChild;tt;tt=tt.nextSibling)it(tt);else if((mt==3||mt==4)&&je){var ae=ue.nodeValue,de=ae.match(He);if(de){var R=ae.substring(0,de.index);ue.nodeValue=R;var k=ae.substring(de.index+de[0].length);if(k){var A=ue.parentNode;A.insertBefore(Me.createTextNode(k),ue.nextSibling)}Je(ue),R||ue.parentNode.removeChild(ue)}}}function Je(ue){for(;!ue.nextSibling;)if(ue=ue.parentNode,!ue)return;function mt(de,R){var k=R?de.cloneNode(!1):de,A=de.parentNode;if(A){var v=mt(A,1),y=de.nextSibling;v.appendChild(k);for(var x=y;x;x=y)y=x.nextSibling,v.appendChild(x)}return k}for(var tt=mt(ue.nextSibling,0),ae;(ae=tt.parentNode)&&ae.nodeType===1;)tt=ae;ft.push(tt)}for(var et=0;et<ft.length;++et)it(ft[et]);De===(De|0)&&ft[0].setAttribute("value",De);var gt=Me.createElement("ol");gt.className="linenums";for(var ut=Math.max(0,De-1|0)||0,et=0,nt=ft.length;et<nt;++et)Be=ft[et],Be.className="L"+(et+ut)%10,Be.firstChild||Be.appendChild(Me.createTextNode("\xA0")),gt.appendChild(Be);pe.appendChild(gt)}function we(pe){var De=/\bMSIE\s(\d+)/.exec(navigator.userAgent);De=De&&+De[1]<=8;var je=/\n/g,Ze=pe.sourceCode,He=Ze.length,Me=0,Be=pe.spans,ft=Be.length,it=0,Je=pe.decorations,et=Je.length,gt=0;Je[et]=He;var ut,nt;for(nt=ut=0;nt<et;)Je[nt]!==Je[nt+2]?(Je[ut++]=Je[nt++],Je[ut++]=Je[nt++]):nt+=2;for(et=ut,nt=ut=0;nt<et;){for(var ue=Je[nt],mt=Je[nt+1],tt=nt+2;tt+2<=et&&Je[tt+1]===mt;)tt+=2;Je[ut++]=ue,Je[ut++]=mt,nt=tt}et=Je.length=ut;var ae=pe.sourceNode,de="";ae&&(de=ae.style.display,ae.style.display="none");try{for(var R=null;it<ft;){var k=Be[it],A=Be[it+2]||He,v=Je[gt+2]||He,tt=Math.min(A,v),y=Be[it+1],x;if(y.nodeType!==1&&(x=Ze.substring(Me,tt))){De&&(x=x.replace(je,"\r")),y.nodeValue=x;var S=y.ownerDocument,Y=S.createElement("span");Y.className=Je[gt+1];var I=y.parentNode;I.replaceChild(Y,y),Y.appendChild(y),Me<A&&(Be[it+1]=y=S.createTextNode(Ze.substring(tt,A)),I.insertBefore(y,Y.nextSibling))}Me=tt,Me>=A&&(it+=2),Me>=v&&(gt+=2)}}finally{ae&&(ae.style.display=de)}}var _e={};function G(pe,De){for(var je=De.length;--je>=0;){var Ze=De[je];_e.hasOwnProperty(Ze)?$.console&&console.warn("cannot override language handler %s",Ze):_e[Ze]=pe}}function O(pe,De){return pe&&_e.hasOwnProperty(pe)||(pe=/^\s*</.test(De)?"default-markup":"default-code"),_e[pe]}G(Ce,["default-code"]),G(Ye([],[[w,/^[^<?]+/],[z,/^<!\w[^>]*(?:>|$)/],[H,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[re,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),G(Ye([[w,/^[\s]+/,null,` \r
`],[me,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[q,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ie,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[re,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),G(Ye([],[[me,/^[\s\S]+/]]),["uq.val"]),G($e({keywords:P,hashComments:!0,cStyleComments:!0,types:oe}),["c","cc","cpp","cxx","cyc","m"]),G($e({keywords:"null,true,false"}),["json"]),G($e({keywords:U,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:oe}),["cs"]),G($e({keywords:ee,cStyleComments:!0}),["java"]),G($e({keywords:Le,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),G($e({keywords:te,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),G($e({keywords:N,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),G($e({keywords:Z,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),G($e({keywords:F,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),G($e({keywords:B,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),G(Ye([],[[ne,/^[\s\S]+/]]),["regex"]);function Ie(pe){var De=pe.langExtension;try{var je=g(pe.sourceNode,pe.pre),Ze=je.sourceCode;pe.sourceCode=Ze,pe.spans=je.spans,pe.basePos=0,O(De,Ze)(pe),we(pe)}catch(He){$.console&&console.log(He&&He.stack||He)}}function qe(pe,De,je){var Ze=je||!1,He=De||null,Me=document.createElement("div");Me.innerHTML="<pre>"+pe+"</pre>",Me=Me.firstChild,Ze&&Te(Me,Ze,!0);var Be={langExtension:He,numberLines:Ze,sourceNode:Me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ie(Be),Me.innerHTML}function dt(pe,De){var je=De||document.body,Ze=je.ownerDocument||document;function He(k){return je.getElementsByTagName(k)}for(var Me=[He("pre"),He("code"),He("xmp")],Be=[],ft=0;ft<Me.length;++ft)for(var it=0,Je=Me[ft].length;it<Je;++it)Be.push(Me[ft][it]);Me=null;var et=Date;et.now||(et={now:function(){return+new Date}});var gt=0,ut=/\blang(?:uage)?-([\w.]+)(?!\S)/,nt=/\bprettyprint\b/,ue=/\bprettyprinted\b/,mt=/pre|xmp/i,tt=/^code$/i,ae=/^(?:pre|code|xmp)$/i,de={};function R(){for(var k=$.PR_SHOULD_USE_CONTINUATION?et.now()+250:Infinity;gt<Be.length&&et.now()<k;gt++){for(var A=Be[gt],v=de,y=A;y=y.previousSibling;){var x=y.nodeType,S=(x===7||x===8)&&y.nodeValue;if(S?!/^\??prettify\b/.test(S):x!==3||/\S/.test(y.nodeValue))break;if(S){v={},S.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Wt,Tt,Wi){v[Tt]=Wi});break}}var Y=A.className;if((v!==de||nt.test(Y))&&!ue.test(Y)){for(var I=!1,ye=A.parentNode;ye;ye=ye.parentNode){var Ve=ye.tagName;if(ae.test(Ve)&&ye.className&&nt.test(ye.className)){I=!0;break}}if(!I){A.className+=" prettyprinted";var ht=v.lang;if(!ht){ht=Y.match(ut);var at;!ht&&(at=ve(A))&&tt.test(at.tagName)&&(ht=at.className.match(ut)),ht&&(ht=ht[1])}var kt;if(mt.test(A.tagName))kt=1;else{var Et=A.currentStyle,st=Ze.defaultView,Kt=Et?Et.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(A,null).getPropertyValue("white-space"):0;kt=Kt&&Kt.substring(0,3)==="pre"}var Nt=v.linenums;(Nt=Nt==="true"||+Nt)||(Nt=Y.match(/\blinenums\b(?::(\d+))?/),Nt=Nt?Nt[1]&&Nt[1].length?+Nt[1]:!0:!1),Nt&&Te(A,Nt,kt);var Gt={langExtension:ht,sourceNode:A,numberLines:Nt,pre:kt,sourceCode:null,basePos:null,spans:null,decorations:null};Ie(Gt)}}}gt<Be.length?$.setTimeout(R,250):typeof pe=="function"&&pe()}R()}var We=$.PR={createSimpleLexer:Ye,registerLangHandler:G,sourceDecorator:$e,PR_ATTRIB_NAME:ie,PR_ATTRIB_VALUE:me,PR_COMMENT:H,PR_DECLARATION:z,PR_KEYWORD:Oe,PR_LITERAL:ke,PR_NOCODE:J,PR_PLAIN:w,PR_PUNCTUATION:re,PR_SOURCE:_,PR_STRING:ne,PR_TAG:q,PR_TYPE:se,prettyPrintOne:Q?$.prettyPrintOne=qe:fe=qe,prettyPrint:D=Q?$.prettyPrint=dt:D=dt},Ke=$.define;typeof Ke=="function"&&Ke.amd&&Ke("google-code-prettify",[],function(){return We})})()},UUDw:function(bt,Xe,b){bt.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return j});var j=function(Q){var ge=document.createElement("textarea");return ge.value=Q,ge.value}},"VrN/":function(bt,Xe,b){(function(j,Ae){bt.exports=Ae()})(this,function(){"use strict";var j=navigator.userAgent,Ae=navigator.platform,Q=/gecko\/\d/i.test(j),ge=/MSIE \d/.test(j),he=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(j),fe=/Edge\/(\d+)/.exec(j),D=ge||he||fe,$=D&&(ge?document.documentMode||6:+(fe||he)[1]),K=!fe&&/WebKit\//.test(j),le=K&&/Qt\/\d+\.\d+/.test(j),L=!fe&&/Chrome\//.test(j),P=/Opera\//.test(j),ee=/Apple Computer/.test(navigator.vendor),U=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(j),B=/PhantomJS/.test(j),F=!fe&&/AppleWebKit/.test(j)&&/Mobile\/\w+/.test(j),N=/Android/.test(j),te=F||N||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(j),Z=F||/Mac/.test(Ae),Le=/\bCrOS\b/.test(j),Ue=/win/i.test(Ae),oe=P&&j.match(/Version\/(\d*\.\d*)/);oe&&(oe=Number(oe[1])),oe&&oe>=15&&(P=!1,K=!0);var ne=Z&&(le||P&&(oe==null||oe<12.11)),Oe=Q||D&&$>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var se=function(e,t){var n=e.className,i=H(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function ke(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function re(e,t){return ke(e).appendChild(t)}function w(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function q(e,t,n,i){var r=w(e,t,n,i);return r.setAttribute("role","presentation"),r}var z;document.createRange?z=function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:z=function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};function _(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ie(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function me(e,t){var n=e.className;H(t).test(n)||(e.className+=(n?" ":"")+t)}function J(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!H(n[i]).test(t)&&(t+=" "+n[i]);return t}var Pe=function(e){e.select()};F?Pe=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(Pe=function(e){try{e.select()}catch(t){}});function C(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,n){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(n!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function V(e,t,n,i,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=i||0,l=r||0;;){var f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=n-l%n,s=f+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=C(this.onTimeout,this)};xe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},xe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ve(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ye=50,$e={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},Te={origin:"*mouse"},we={origin:"+move"};function _e(e,t,n){for(var i=0,r=0;;){var s=e.indexOf(" ",i);s==-1&&(s=e.length);var l=s-i;if(s==e.length||r+l>=t)return i+Math.min(l,t-r);if(r+=s-i,r+=n-r%n,i=s+1,r>=t)return i}}var G=[""];function O(e){for(;G.length<=e;)G.push(Ie(G)+" ");return G[e]}function Ie(e){return e[e.length-1]}function qe(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function dt(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)}function We(){}function Ke(e,t){var n;return Object.create?n=Object.create(e):(We.prototype=e,n=new We),t&&g(t,n),n}var pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function De(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||pe.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&De(e)?!0:t.test(e):De(e)}function Ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var He=/[\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 Me(e){return e.charCodeAt(0)>=768&&He.test(e)}function Be(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function ft(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,s=i<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:n;e(s)?n=s:t=s+i}}function it(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<n&&l.to>t||t==n&&l.to==t)&&(i(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",s),r=!0)}r||i(t,n,"ltr")}var Je=null;function et(e,t,n){var i;Je=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&n=="before"?i=r:Je=r),s.from==t&&(s.from!=s.to&&n!="before"?i=r:Je=r)}return i!=null?i:Je}var gt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function p(m,E,T){this.level=m,this.from=E,this.to=T}return function(m,E){var T=E=="ltr"?"L":"R";if(m.length==0||E=="ltr"&&!i.test(m))return!1;for(var X=m.length,W=[],ce=0;ce<X;++ce)W.push(n(m.charCodeAt(ce)));for(var Ee=0,Ne=T;Ee<X;++Ee){var ze=W[Ee];ze=="m"?W[Ee]=Ne:Ne=ze}for(var Qe=0,Ge=T;Qe<X;++Qe){var ot=W[Qe];ot=="1"&&Ge=="r"?W[Qe]="n":s.test(ot)&&(Ge=ot,ot=="r"&&(W[Qe]="R"))}for(var xt=1,pt=W[0];xt<X-1;++xt){var _t=W[xt];_t=="+"&&pt=="1"&&W[xt+1]=="1"?W[xt]="1":_t==","&&pt==W[xt+1]&&(pt=="1"||pt=="n")&&(W[xt]=pt),pt=_t}for(var Xt=0;Xt<X;++Xt){var hi=W[Xt];if(hi==",")W[Xt]="N";else if(hi=="%"){var $t=void 0;for($t=Xt+1;$t<X&&W[$t]=="%";++$t);for(var Ri=Xt&&W[Xt-1]=="!"||$t<X&&W[$t]=="1"?"1":"N",_i=Xt;_i<$t;++_i)W[_i]=Ri;Xt=$t-1}}for(var ii=0,Ti=T;ii<X;++ii){var mi=W[ii];Ti=="L"&&mi=="1"?W[ii]="L":s.test(mi)&&(Ti=mi)}for(var ai=0;ai<X;++ai)if(r.test(W[ai])){var ni=void 0;for(ni=ai+1;ni<X&&r.test(W[ni]);++ni);for(var Jt=(ai?W[ai-1]:T)=="L",Li=(ni<X?W[ni]:T)=="L",ur=Jt==Li?Jt?"L":"R":T,Tn=ai;Tn<ni;++Tn)W[Tn]=ur;ai=ni-1}for(var vi=[],on,ci=0;ci<X;)if(l.test(W[ci])){var Yo=ci;for(++ci;ci<X&&l.test(W[ci]);++ci);vi.push(new p(0,Yo,ci))}else{var gn=ci,Wn=vi.length,Hn=E=="rtl"?1:0;for(++ci;ci<X&&W[ci]!="L";++ci);for(var bi=gn;bi<ci;)if(f.test(W[bi])){gn<bi&&(vi.splice(Wn,0,new p(1,gn,bi)),Wn+=Hn);var hr=bi;for(++bi;bi<ci&&f.test(W[bi]);++bi);vi.splice(Wn,0,new p(2,hr,bi)),Wn+=Hn,gn=bi}else++bi;gn<ci&&vi.splice(Wn,0,new p(1,gn,ci))}return E=="ltr"&&(vi[0].level==1&&(on=m.match(/^\s+/))&&(vi[0].from=on[0].length,vi.unshift(new p(0,0,on[0].length))),Ie(vi).level==1&&(on=m.match(/\s+$/))&&(Ie(vi).to-=on[0].length,vi.push(new p(0,X-on[0].length,X)))),E=="rtl"?vi.reverse():vi}}();function ut(e,t){var n=e.order;return n==null&&(n=e.order=gt(e.text,t)),n}var nt=[],ue=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||nt).concat(n)}};function mt(e,t){return e._handlers&&e._handlers[t]||nt}function tt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var s=ve(r,n);s>-1&&(i[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function ae(e,t){var n=mt(e,t);if(!n.length)return;for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function de(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ae(e,n||t.type,e,t),x(t)||t.codemirrorIgnore}function R(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ve(n,t[i])==-1&&n.push(t[i])}function k(e,t){return mt(e,t).length>0}function A(e){e.prototype.on=function(t,n){ue(this,t,n)},e.prototype.off=function(t,n){tt(this,t,n)}}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function x(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function S(e){v(e),y(e)}function Y(e){return e.target||e.srcElement}function I(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Z&&e.ctrlKey&&t==1&&(t=3),t}var ye=function(){if(D&&$<9)return!1;var e=w("div");return"draggable"in e||"dragDrop"in e}(),Ve;function ht(e){if(Ve==null){var t=w("span","\u200B");re(e,w("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ve=t.offsetWidth<=1&&t.offsetHeight>2&&!(D&&$<8))}var n=Ve?w("span","\u200B"):w("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var at;function kt(e){if(at!=null)return at;var t=re(e,document.createTextNode("A\u062EA")),n=z(t,0,1).getBoundingClientRect(),i=z(t,1,2).getBoundingClientRect();return ke(e),!n||n.left==n.right?!1:at=i.right-n.right<3}var Et=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf(`
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(n.push(s.slice(0,l)),t+=l+1):(n.push(s),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},st=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Kt=function(){var e=w("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Nt=null;function Gt(e){if(Nt!=null)return Nt;var t=re(e,w("span","x")),n=t.getBoundingClientRect(),i=z(t,0,1).getBoundingClientRect();return Nt=Math.abs(n.left-i.left)>1}var Wt={},Tt={};function Wi(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wt[e]=t}function an(e,t){Tt[e]=t}function vt(e){if(typeof e=="string"&&Tt.hasOwnProperty(e))e=Tt[e];else if(e&&typeof e.name=="string"&&Tt.hasOwnProperty(e.name)){var t=Tt[e.name];typeof t=="string"&&(t={name:t}),e=Ke(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return vt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return vt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Xi(e,t){t=vt(t);var n=Wt[t.name];if(!n)return Xi(e,"text/plain");var i=n(e,t);if(ri.hasOwnProperty(t.name)){var r=ri[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=r[s]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)i[l]=t.modeProps[l];return i}var ri={};function di(e,t){var n=ri.hasOwnProperty(e)?ri[e]:ri[e]={};g(t,n)}function Hi(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function sn(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function ln(e,t,n){return e.startState?e.startState(t,n):!0}var Dt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.match=function(e,t,n){if(typeof e=="string"){var i=function(l){return n?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(i(r)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function lt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],s=r.chunkSize();if(t<s){n=r;break}t-=s}return n.lines[t]}function Di(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,function(s){var l=s.text;r==n.line&&(l=l.slice(0,n.ch)),r==t.line&&(l=l.slice(t.ch)),i.push(l),++r}),i}function un(e,t,n){var i=[];return e.iter(t,n,function(r){i.push(r.text)}),i}function xi(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Lt(e){if(e.parent==null)return null;for(var t=e.parent,n=ve(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;!(i.children[r]==t);++r)n+=i.children[r].chunkSize();return n+t.first}function Pi(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],s=r.height;if(t<s){e=r;continue e}t-=s,n+=r.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var f=e.lines[l],p=f.height;if(t<p)break;t-=p}return n+l}function Ki(e,t){return t>=e.first&&t<e.first+e.size}function hn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Re(e,t,n){if(n===void 0&&(n=null),!(this instanceof Re))return new Re(e,t,n);this.line=e,this.ch=t,this.sticky=n}function wt(e,t){return e.line-t.line||e.ch-t.ch}function cn(e,t){return e.sticky==t.sticky&&wt(e,t)==0}function Ln(e){return Re(e.line,e.ch)}function dn(e,t){return wt(e,t)<0?t:e}function Mn(e,t){return wt(e,t)<0?e:t}function c(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return Re(e.first,0);var n=e.first+e.size-1;return t.line>n?Re(n,lt(e,n).text.length):a(t,lt(e,t.line).text.length)}function a(e,t){var n=e.ch;return n==null||n>t?Re(e.line,t):n<0?Re(e.line,0):e}function u(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=o(e,t[i]);return n}var d=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},h.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,n){return t instanceof d?new h(e,Hi(e.mode,t.state),n,t.lookAhead):new h(e,Hi(e.mode,t),n)},h.prototype.save=function(e){var t=e!==!1?Hi(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new d(t,this.maxLookAhead):t};function M(e,t,n,i){var r=[e.state.modeGen],s={};Ii(e,t.text,e.doc.mode,n,function(m,E){return r.push(m,E)},s,i);for(var l=n.state,f=function(m){n.baseTokens=r;var E=e.state.overlays[m],T=1,X=0;n.state=!0,Ii(e,t.text,E.mode,n,function(W,ce){for(var Ee=T;X<W;){var Ne=r[T];Ne>W&&r.splice(T,1,W,r[T+1],Ne),T+=2,X=Math.min(W,Ne)}if(!ce)return;if(E.opaque)r.splice(Ee,T-Ee,W,"overlay "+ce),T=Ee+2;else for(;Ee<T;Ee+=2){var ze=r[Ee+1];r[Ee+1]=(ze?ze+" ":"")+"overlay "+ce}},s),n.state=l,n.baseTokens=null,n.baseTokenPos=1},p=0;p<e.state.overlays.length;++p)f(p);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function be(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=Fe(e,Lt(t)),r=t.text.length>e.options.maxHighlightLength&&Hi(e.doc.mode,i.state),s=M(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Fe(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new h(i,!0,t);var s=oi(e,t,n),l=s>i.first&&lt(i,s-1).stateAfter,f=l?h.fromSaved(i,l,s):new h(i,ln(i.mode),s);return i.iter(s,t,function(p){rt(e,p.text,f);var m=f.line;p.stateAfter=m==t-1||m%5==0||m>=r.viewFrom&&m<r.viewTo?f.save():null,f.nextLine()}),n&&(i.modeFrontier=f.line),f}function rt(e,t,n,i){var r=e.doc.mode,s=new Dt(t,e.options.tabSize,n);for(s.start=s.pos=i||0,t==""&&Se(r,n.state);!s.eol();)Ct(r,s,n.state),s.start=s.pos}function Se(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=sn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Ct(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=sn(e,n).mode);var s=e.token(t,n);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var At=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Vt(e,t,n,i){var r=e.doc,s=r.mode,l;t=o(r,t);var f=lt(r,t.line),p=Fe(e,t.line,n),m=new Dt(f.text,e.options.tabSize,p),E;for(i&&(E=[]);(i||m.pos<t.ch)&&!m.eol();)m.start=m.pos,l=Ct(s,m,p.state),i&&E.push(new At(m,l,Hi(r.mode,p.state)));return i?E:new At(m,l,p.state)}function Ni(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";t[i]==null?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function Ii(e,t,n,i,r,s,l){var f=n.flattenSpans;f==null&&(f=e.options.flattenSpans);var p=0,m=null,E=new Dt(t,e.options.tabSize,i),T,X=e.options.addModeClass&&[null];for(t==""&&Ni(Se(n,i.state),s);!E.eol();){if(E.pos>e.options.maxHighlightLength?(f=!1,l&&rt(e,t,i,E.pos),E.pos=t.length,T=null):T=Ni(Ct(n,E,i.state,X),s),X){var W=X[0].name;W&&(T="m-"+(T?W+" "+T:W))}if(!f||m!=T){for(;p<E.start;)p=Math.min(E.start,p+5e3),r(p,m);m=T}E.start=E.pos}for(;p<E.pos;){var ce=Math.min(E.pos,p+5e3);r(ce,m),p=ce}}function oi(e,t,n){for(var i,r,s=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var p=lt(s,f-1),m=p.stateAfter;if(m&&(!n||f+(m instanceof d?m.lookAhead:0)<=s.modeFrontier))return f;var E=V(p.text,null,e.options.tabSize);(r==null||i>E)&&(r=f-1,i=E)}return r}function zi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,i=t-1;i>n;i--){var r=lt(e,i).stateAfter;if(r&&(!(r instanceof d)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var zn=!1,Ci=!1;function Bi(){zn=!0}function Mi(){Ci=!0}function vn(e,t,n){this.marker=e,this.from=t,this.to=n}function Yi(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function fn(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function en(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!n||!s.marker.insertLeft)){var p=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push(new vn(l,s.from,p?null:s.to))}}return i}function Gn(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!n||s.marker.insertLeft)){var p=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(i||(i=[])).push(new vn(l,p?null:s.from-t,s.to==null?null:s.to-t))}}return i}function $i(e,t){if(t.full)return null;var n=Ki(e,t.from.line)&&lt(e,t.from.line).markedSpans,i=Ki(e,t.to.line)&&lt(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,s=t.to.ch,l=wt(t.from,t.to)==0,f=cr(n,r,l),p=Gn(i,s,l),m=t.text.length==1,E=Ie(t.text).length+(m?r:0);if(f)for(var T=0;T<f.length;++T){var X=f[T];if(X.to==null){var W=Yi(p,X.marker);W?m&&(X.to=W.to==null?null:W.to+E):X.to=r}}if(p)for(var ce=0;ce<p.length;++ce){var Ee=p[ce];if(Ee.to!=null&&(Ee.to+=E),Ee.from==null){var Ne=Yi(f,Ee.marker);Ne||(Ee.from=E,m&&(f||(f=[])).push(Ee))}else Ee.from+=E,m&&(f||(f=[])).push(Ee)}f&&(f=ji(f)),p&&p!=f&&(p=ji(p));var ze=[f];if(!m){var Qe=t.text.length-2,Ge;if(Qe>0&&f)for(var ot=0;ot<f.length;++ot)f[ot].to==null&&(Ge||(Ge=[])).push(new vn(f[ot].marker,null,null));for(var xt=0;xt<Qe;++xt)ze.push(Ge);ze.push(p)}return ze}function ji(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function An(e,t,n){var i=null;if(e.iter(t.line,n.line+1,function(W){if(W.markedSpans)for(var ce=0;ce<W.markedSpans.length;++ce){var Ee=W.markedSpans[ce].marker;Ee.readOnly&&(!i||ve(i,Ee)==-1)&&(i||(i=[])).push(Ee)}}),!i)return null;for(var r=[{from:t,to:n}],s=0;s<i.length;++s)for(var l=i[s],f=l.find(0),p=0;p<r.length;++p){var m=r[p];if(wt(m.to,f.from)<0||wt(m.from,f.to)>0)continue;var E=[p,1],T=wt(m.from,f.from),X=wt(m.to,f.to);(T<0||!l.inclusiveLeft&&!T)&&E.push({from:m.from,to:f.from}),(X>0||!l.inclusiveRight&&!X)&&E.push({from:f.to,to:m.to}),r.splice.apply(r,E),p+=E.length-3}return r}function On(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function dr(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Zt(e){return e.inclusiveLeft?-1:0}function It(e){return e.inclusiveRight?1:0}function fi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var i=e.find(),r=t.find(),s=wt(i.from,r.from)||Zt(e)-Zt(t);if(s)return-s;var l=wt(i.to,r.to)||It(e)-It(t);return l||t.id-e.id}function Pt(e,t){var n=Ci&&e.markedSpans,i;if(n)for(var r=void 0,s=0;s<n.length;++s)r=n[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!i||fi(i,r.marker)<0)&&(i=r.marker);return i}function ei(e){return Pt(e,!0)}function Ut(e){return Pt(e,!1)}function tn(e,t){var n=Ci&&e.markedSpans,i;if(n)for(var r=0;r<n.length;++r){var s=n[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!i||fi(i,s.marker)<0)&&(i=s.marker)}return i}function Qt(e,t,n,i,r){var s=lt(e,t),l=Ci&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var p=l[f];if(!p.marker.collapsed)continue;var m=p.marker.find(0),E=wt(m.from,n)||Zt(p.marker)-Zt(r),T=wt(m.to,i)||It(p.marker)-It(r);if(E>=0&&T<=0||E<=0&&T>=0)continue;if(E<=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?wt(m.to,n)>=0:wt(m.to,n)>0)||E>=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?wt(m.from,i)<=0:wt(m.from,i)<0))return!0}}function wi(e){for(var t;t=ei(e);)e=t.find(-1,!0).line;return e}function Vn(e){for(var t;t=Ut(e);)e=t.find(1,!0).line;return e}function Xn(e){for(var t,n;t=Ut(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function yn(e,t){var n=lt(e,t),i=wi(n);return n==i?t:Lt(i)}function Ur(e,t){if(t>e.lastLine())return t;var n=lt(e,t),i;if(!Ai(e,n))return t;for(;i=Ut(n);)n=i.find(1,!0).line;return Lt(n)+1}function Ai(e,t){var n=Ci&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r){if(i=n[r],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&fr(e,t,i))return!0}}function fr(e,t,n){if(n.to==null){var i=n.marker.find(1,!0);return fr(e,i.line,Yi(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(r.to==null||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&fr(e,t,r))return!0}function Zi(e){e=wi(e);for(var t=0,n=e.parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var s=n.parent;s;n=s,s=n.parent)for(var l=0;l<s.children.length;++l){var f=s.children[l];if(f==n)break;t+=f.height}return t}function Kn(e){if(e.height==0)return 0;for(var t=e.text.length,n,i=e;n=ei(i);){var r=n.find(0,!0);i=r.from.line,t+=r.from.ch-r.to.ch}for(i=e;n=Ut(i);){var s=n.find(0,!0);t-=i.text.length-s.from.ch,i=s.to.line,t+=i.text.length-s.to.ch}return t}function Fr(e){var t=e.display,n=e.doc;t.maxLine=lt(n,n.first),t.maxLineLength=Kn(t.maxLine),t.maxLineChanged=!0,n.iter(function(i){var r=Kn(i);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=i)})}var Rn=function(e,t,n){this.text=e,dr(this,t),this.height=n?n(this):1};Rn.prototype.lineNo=function(){return Lt(this)},A(Rn);function Zo(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),On(e),dr(e,n);var r=i?i(e):1;r!=e.height&&xi(e,r)}function ho(e){e.parent=null,On(e)}var ct={},St={};function yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?St:ct;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Mt(e,t){var n=q("span",null,null,K?"padding-right: .1px":null),i={pre:q("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;i.pos=0,i.addToken=Ht,kt(e.display.measure)&&(l=ut(s,e.doc.direction))&&(i.addToken=ti(i.addToken,l)),i.map=[];var f=t!=e.display.externalMeasured&&Lt(s);Ot(s,i,be(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=J(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=J(s.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(ht(e.display.measure))),r==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(K){var p=i.content.lastChild;(/\bcm-tab\b/.test(p.className)||p.querySelector&&p.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ae(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=J(i.pre.className,i.textClass||"")),i}function Bt(e){var t=w("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ht(e,t,n,i,r,s,l){if(!t)return;var f=e.splitSpaces?Rt(t,e.trailingSpace):t,p=e.cm.state.specialChars,m=!1,E;if(!p.test(t))e.col+=t.length,E=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,E),D&&$<9&&(m=!0),e.pos+=t.length;else{E=document.createDocumentFragment();for(var T=0;;){p.lastIndex=T;var X=p.exec(t),W=X?X.index-T:t.length-T;if(W){var ce=document.createTextNode(f.slice(T,T+W));D&&$<9?E.appendChild(w("span",[ce])):E.appendChild(ce),e.map.push(e.pos,e.pos+W,ce),e.col+=W,e.pos+=W}if(!X)break;T+=W+1;var Ee=void 0;if(X[0]==" "){var Ne=e.cm.options.tabSize,ze=Ne-e.col%Ne;Ee=E.appendChild(w("span",O(ze),"cm-tab")),Ee.setAttribute("role","presentation"),Ee.setAttribute("cm-text"," "),e.col+=ze}else X[0]=="\r"||X[0]==`
`?(Ee=E.appendChild(w("span",X[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ee.setAttribute("cm-text",X[0]),e.col+=1):(Ee=e.cm.options.specialCharPlaceholder(X[0]),Ee.setAttribute("cm-text",X[0]),D&&$<9?E.appendChild(w("span",[Ee])):E.appendChild(Ee),e.col+=1);e.map.push(e.pos,e.pos+1,Ee),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,n||i||r||m||s||l){var Qe=n||"";i&&(Qe+=i),r&&(Qe+=r);var Ge=w("span",[E],Qe,s);if(l)for(var ot in l)l.hasOwnProperty(ot)&&ot!="style"&&ot!="class"&&Ge.setAttribute(ot,l[ot]);return e.content.appendChild(Ge)}e.content.appendChild(E)}function Rt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&n&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),i+=s,n=s==" "}return i}function ti(e,t){return function(n,i,r,s,l,f,p){r=r?r+" cm-force-border":"cm-force-border";for(var m=n.pos,E=m+i.length;;){for(var T=void 0,X=0;X<t.length&&!(T=t[X],T.to>m&&T.from<=m);X++);if(T.to>=E)return e(n,i,r,s,l,f,p);e(n,i.slice(0,T.to-m),r,s,null,f,p),s=null,i=i.slice(T.to-m),m=T.to}}}function Si(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Ot(e,t,n){var i=e.markedSpans,r=e.text,s=0;if(!i){for(var l=1;l<n.length;l+=2)t.addToken(t,r.slice(s,s=n[l]),yt(n[l+1],t.cm.options));return}for(var f=r.length,p=0,m=1,E="",T,X,W=0,ce,Ee,Ne,ze,Qe;;){if(W==p){ce=Ee=Ne=X="",Qe=null,ze=null,W=Infinity;for(var Ge=[],ot=void 0,xt=0;xt<i.length;++xt){var pt=i[xt],_t=pt.marker;if(_t.type=="bookmark"&&pt.from==p&&_t.widgetNode)Ge.push(_t);else if(pt.from<=p&&(pt.to==null||pt.to>p||_t.collapsed&&pt.to==p&&pt.from==p)){if(pt.to!=null&&pt.to!=p&&W>pt.to&&(W=pt.to,Ee=""),_t.className&&(ce+=" "+_t.className),_t.css&&(X=(X?X+";":"")+_t.css),_t.startStyle&&pt.from==p&&(Ne+=" "+_t.startStyle),_t.endStyle&&pt.to==W&&(ot||(ot=[])).push(_t.endStyle,pt.to),_t.title&&((Qe||(Qe={})).title=_t.title),_t.attributes)for(var Xt in _t.attributes)(Qe||(Qe={}))[Xt]=_t.attributes[Xt];_t.collapsed&&(!ze||fi(ze.marker,_t)<0)&&(ze=pt)}else pt.from>p&&W>pt.from&&(W=pt.from)}if(ot)for(var hi=0;hi<ot.length;hi+=2)ot[hi+1]==W&&(Ee+=" "+ot[hi]);if(!ze||ze.from==p)for(var $t=0;$t<Ge.length;++$t)Si(t,0,Ge[$t]);if(ze&&(ze.from||0)==p){if(Si(t,(ze.to==null?f+1:ze.to)-p,ze.marker,ze.from==null),ze.to==null)return;ze.to==p&&(ze=!1)}}if(p>=f)break;for(var Ri=Math.min(f,W);;){if(E){var _i=p+E.length;if(!ze){var ii=_i>Ri?E.slice(0,Ri-p):E;t.addToken(t,ii,T?T+ce:ce,Ne,p+ii.length==W?Ee:"",X,Qe)}if(_i>=Ri){E=E.slice(Ri-p),p=Ri;break}p=_i,Ne=""}E=r.slice(s,s=n[m++]),T=yt(n[m++],t.cm.options)}}}function bn(e,t,n){this.line=t,this.rest=Xn(t),this.size=this.rest?Lt(Ie(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ai(e,t)}function jt(e,t,n){for(var i=[],r,s=t;s<n;s=r){var l=new bn(e.doc,lt(e.doc,s),s);r=s+l.size,i.push(l)}return i}var si=null;function Gi(e){si?si.ops.push(e):e.ownsGroup=si={ops:[e],delayedCallbacks:[]}}function Vi(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}function Wr(e,t){var n=e.ownsGroup;if(!n)return;try{Vi(n)}finally{si=null,t(n)}}var pr=null;function pi(e,t){var n=mt(e,t);if(!n.length)return;var i=Array.prototype.slice.call(arguments,2),r;si?r=si.delayedCallbacks:pr?r=pr:(r=pr=[],setTimeout(Rs,0));for(var s=function(f){r.push(function(){return n[f].apply(null,i)})},l=0;l<n.length;++l)s(l)}function Rs(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function Jo(e,t,n,i){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?qo(e,t,n,i):s=="class"?co(e,t):s=="widget"&&Ns(e,t,i)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=w("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),D&&$<8&&(e.node.style.zIndex=2)),e.node}function Ds(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=mr(t);t.background=i.insertBefore(w("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function Qo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Mt(e,t)}function Ps(e,t){var n=t.text.className,i=Qo(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,co(e,t)):n&&(t.text.className=n)}function co(e,t){Ds(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function qo(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=mr(t);t.gutterBackground=w("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),f=t.gutter=w("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(w("div",hn(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var p=0;p<e.display.gutterSpecs.length;++p){var m=e.display.gutterSpecs[p].className,E=s.hasOwnProperty(m)&&s[m];E&&f.appendChild(w("div",[E],"CodeMirror-gutter-elt","left: "+i.gutterLeft[m]+"px; width: "+i.gutterWidth[m]+"px"))}}}function Ns(e,t,n){t.alignable&&(t.alignable=null);for(var i=H("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);ea(e,t,n)}function Is(e,t,n,i){var r=Qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),co(e,t),qo(e,t,n,i),ea(e,t,i),t.node}function ea(e,t,n){if(ta(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)ta(e,t.rest[i],t,n,!1)}function ta(e,t,n,i,r){if(!t.widgets)return;for(var s=mr(n),l=0,f=t.widgets;l<f.length;++l){var p=f[l],m=w("div",[p.node],"CodeMirror-linewidget"+(p.className?" "+p.className:""));p.handleMouseEvents||m.setAttribute("cm-ignore-events","true"),Bs(p,m,n,i),e.display.input.setUneditable(m),r&&p.above?s.insertBefore(m,n.gutter||n.text):s.appendChild(m),pi(p,"redraw")}}function Bs(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),re(t.display.measure,w("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function pn(e,t){for(var n=Y(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function fo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=re(e.measure,w("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function nn(e){return Ye-e.display.nativeBarWidth}function Dn(e){return e.display.scroller.clientWidth-nn(e)-e.display.barWidth}function po(e){return e.display.scroller.clientHeight-nn(e)-e.display.barHeight}function js(e,t,n){var i=e.options.lineWrapping,r=i&&Dn(e);if(!t.measure.heights||i&&t.measure.width!=r){var s=t.measure.heights=[];if(i){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),f=0;f<l.length-1;f++){var p=l[f],m=l[f+1];Math.abs(p.bottom-m.bottom)>2&&s.push((p.bottom+m.top)/2-n.top)}}s.push(n.bottom-n.top)}}function na(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var r=0;r<e.rest.length;r++)if(Lt(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=wi(t);var n=Lt(t),i=e.display.externalMeasured=new bn(e.doc,t,n);i.lineN=n;var r=i.built=Mt(e,i);return i.text=r.pre,re(e.display.lineMeasure,r.pre),i}function ra(e,t,n,i){return rn(e,Yn(e,t),n,i)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[In(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Yn(e,t){var n=Lt(t),i=mo(e,n);i&&!i.text?i=null:i&&i.changes&&(Jo(e,i,n,Co(e)),e.curOp.forceUpdate=!0),i||(i=Us(e,t));var r=na(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function rn(e,t,n,i,r){t.before&&(n=-1);var s=n+(i||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(js(e,t.view,t.rect),t.hasHeights=!0),l=Ws(e,t,n,i),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var oa={left:0,right:0,top:0,bottom:0};function aa(e,t,n){for(var i,r,s,l,f,p,m=0;m<e.length;m+=3)if(f=e[m],p=e[m+1],t<f?(r=0,s=1,l="left"):t<p?(r=t-f,s=r+1):(m==e.length-3||t==p&&e[m+3]>t)&&(s=p-f,r=s-1,t>=p&&(l="right")),r!=null){if(i=e[m+2],f==p&&n==(i.insertLeft?"left":"right")&&(l=n),n=="left"&&r==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)i=e[(m-=3)+2],l="left";if(n=="right"&&r==p-f)for(;m<e.length-3&&e[m+3]==e[m+4]&&!e[m+5].insertLeft;)i=e[(m+=3)+2],l="right";break}return{node:i,start:r,end:s,collapse:l,coverStart:f,coverEnd:p}}function Fs(e,t){var n=oa;if(t=="left")for(var i=0;i<e.length&&!((n=e[i]).left!=n.right);i++);else for(var r=e.length-1;r>=0&&!((n=e[r]).left!=n.right);r--);return n}function Ws(e,t,n,i){var r=aa(t.map,n,i),s=r.node,l=r.start,f=r.end,p=r.collapse,m;if(s.nodeType==3){for(var E=0;E<4;E++){for(;l&&Me(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Me(t.line.text.charAt(r.coverStart+f));)++f;if(D&&$<9&&l==0&&f==r.coverEnd-r.coverStart?m=s.parentNode.getBoundingClientRect():m=Fs(z(s,l,f).getClientRects(),i),m.left||m.right||l==0)break;f=l,l=l-1,p="right"}D&&$<11&&(m=Hs(e.display.measure,m))}else{l>0&&(p=i="right");var T;e.options.lineWrapping&&(T=s.getClientRects()).length>1?m=T[i=="right"?T.length-1:0]:m=s.getBoundingClientRect()}if(D&&$<9&&!l&&(!m||!m.left&&!m.right)){var X=s.parentNode.getClientRects()[0];X?m={left:X.left,right:X.left+Zn(e.display),top:X.top,bottom:X.bottom}:m=oa}for(var W=m.top-t.rect.top,ce=m.bottom-t.rect.top,Ee=(W+ce)/2,Ne=t.view.measure.heights,ze=0;ze<Ne.length-1&&!(Ee<Ne[ze]);ze++);var Qe=ze?Ne[ze-1]:0,Ge=Ne[ze],ot={left:(p=="right"?m.right:m.left)-t.rect.left,right:(p=="left"?m.left:m.right)-t.rect.left,top:Qe,bottom:Ge};return!m.left&&!m.right&&(ot.bogus=!0),e.options.singleCursorHeightPerLine||(ot.rtop=W,ot.rbottom=ce),ot}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Gt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function sa(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function la(e){e.display.externalMeasure=null,ke(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)sa(e.display.view[t])}function vr(e){la(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ua(){return L&&N?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return L&&N?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function go(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=gr(e.widgets[n]));return t}function zr(e,t,n,i,r){if(!r){var s=go(t);n.top+=s,n.bottom+=s}if(i=="line")return n;i||(i="local");var l=Zi(t);if(i=="local"?l+=Hr(e.display):l-=e.display.viewOffset,i=="page"||i=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(i=="window"?0:ha());var p=f.left+(i=="window"?0:ua());n.left+=p,n.right+=p}return n.top+=l,n.bottom+=l,n}function ca(e,t,n){if(n=="div")return t;var i=t.left,r=t.top;if(n=="page")i-=ua(),r-=ha();else if(n=="local"||!n){var s=e.display.sizer.getBoundingClientRect();i+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:i-l.left,top:r-l.top}}function vo(e,t,n,i,r){return i||(i=lt(e.doc,t.line)),zr(e,i,ra(e,i,t.ch,r),n)}function Ji(e,t,n,i,r,s){i=i||lt(e.doc,t.line),r||(r=Yn(e,i));function l(ce,Ee){var Ne=rn(e,r,ce,Ee?"right":"left",s);return Ee?Ne.left=Ne.right:Ne.right=Ne.left,zr(e,i,Ne,n)}var f=ut(i,e.doc.direction),p=t.ch,m=t.sticky;if(p>=i.text.length?(p=i.text.length,m="before"):p<=0&&(p=0,m="after"),!f)return l(m=="before"?p-1:p,m=="before");function E(ce,Ee,Ne){var ze=f[Ee],Qe=ze.level==1;return l(Ne?ce-1:ce,Qe!=Ne)}var T=et(f,p,m),X=Je,W=E(p,T,m=="before");return X!=null&&(W.other=E(p,X,m!="before")),W}function da(e,t){var n=0;t=o(e.doc,t),e.options.lineWrapping||(n=Zn(e.display)*t.ch);var i=lt(e.doc,t.line),r=Zi(i)+Hr(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function yo(e,t,n,i,r){var s=Re(e,t,n);return s.xRel=r,i&&(s.outside=i),s}function bo(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,n<0)return yo(i.first,0,null,-1,-1);var r=Pi(i,n),s=i.first+i.size-1;if(r>s)return yo(i.first+i.size-1,lt(i,s).text.length,null,1,1);t<0&&(t=0);for(var l=lt(i,r);;){var f=zs(e,l,r,t,n),p=tn(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!p)return f;var m=p.find(1);if(m.line==r)return m;l=lt(i,r=m.line)}}function fa(e,t,n,i){i-=go(t);var r=t.text.length,s=ft(function(l){return rn(e,n,l-1).bottom<=i},r,0);return r=ft(function(l){return rn(e,n,l).top>i},s,r),{begin:s,end:r}}function pa(e,t,n,i){n||(n=Yn(e,t));var r=zr(e,t,rn(e,n,i),"line").top;return fa(e,t,n,r)}function xo(e,t,n,i){return e.bottom<=n?!1:e.top>n?!0:(i?e.left:e.right)>t}function zs(e,t,n,i,r){r-=Zi(t);var s=Yn(e,t),l=go(t),f=0,p=t.text.length,m=!0,E=ut(t,e.doc.direction);if(E){var T=(e.options.lineWrapping?Vs:Gs)(e,t,n,s,E,i,r);m=T.level!=1,f=m?T.from:T.to-1,p=m?T.to:T.from-1}var X=null,W=null,ce=ft(function(xt){var pt=rn(e,s,xt);return pt.top+=l,pt.bottom+=l,xo(pt,i,r,!1)?(pt.top<=r&&pt.left<=i&&(X=xt,W=pt),!0):!1},f,p),Ee,Ne,ze=!1;if(W){var Qe=i-W.left<W.right-i,Ge=Qe==m;ce=X+(Ge?0:1),Ne=Ge?"after":"before",Ee=Qe?W.left:W.right}else{!m&&(ce==p||ce==f)&&ce++,Ne=ce==0?"after":ce==t.text.length?"before":rn(e,s,ce-(m?1:0)).bottom+l<=r==m?"after":"before";var ot=Ji(e,Re(n,ce,Ne),"line",t,s);Ee=ot.left,ze=r<ot.top?-1:r>=ot.bottom?1:0}return ce=Be(t.text,ce,1),yo(n,ce,Ne,ze,i-Ee)}function Gs(e,t,n,i,r,s,l){var f=ft(function(T){var X=r[T],W=X.level!=1;return xo(Ji(e,Re(n,W?X.to:X.from,W?"before":"after"),"line",t,i),s,l,!0)},0,r.length-1),p=r[f];if(f>0){var m=p.level!=1,E=Ji(e,Re(n,m?p.from:p.to,m?"after":"before"),"line",t,i);xo(E,s,l,!0)&&E.top>l&&(p=r[f-1])}return p}function Vs(e,t,n,i,r,s,l){var f=fa(e,t,i,l),p=f.begin,m=f.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var E=null,T=null,X=0;X<r.length;X++){var W=r[X];if(W.from>=m||W.to<=p)continue;var ce=W.level!=1,Ee=rn(e,i,ce?Math.min(m,W.to)-1:Math.max(p,W.from)).right,Ne=Ee<s?s-Ee+1e9:Ee-s;(!E||T>Ne)&&(E=W,T=Ne)}return E||(E=r[r.length-1]),E.from<p&&(E={from:p,to:E.to,level:E.level}),E.to>m&&(E={from:E.from,to:m,level:E.level}),E}var Pn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pn==null){Pn=w("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(w("br"));Pn.appendChild(document.createTextNode("x"))}re(e.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),ke(e.measure),n||1}function Zn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=w("span","xxxxxxxxxx"),n=w("pre",[t],"CodeMirror-line-like");re(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;n[f]=s.offsetLeft+s.clientLeft+r,i[f]=s.clientWidth}return{fixedPos:wo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function wo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=$n(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Zn(e.display)-3);return function(r){if(Ai(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return n?s+(Math.ceil(r.text.length/i)||1)*t:s+t}}function So(e){var t=e.doc,n=ma(e);t.iter(function(i){var r=n(i);r!=i.height&&xi(i,r)})}function Nn(e,t,n,i){var r=e.display;if(!n&&Y(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=r.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(T){return null}var p=bo(e,s,l),m;if(i&&p.xRel>0&&(m=lt(e.doc,p.line).text).length==p.ch){var E=V(m,m.length,e.options.tabSize)-m.length;p=Re(p.line,Math.max(0,Math.round((s-ia(e.display).left)/Zn(e.display))-E))}return p}function In(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if(t-=n[i].size,t<0)return i}function Ei(e,t,n,i){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Ci&&yn(e.doc,t)<r.viewTo&&Cn(e);else if(n<=r.viewFrom)Ci&&Ur(e.doc,n+i)>r.viewFrom?Cn(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)Cn(e);else if(t<=r.viewFrom){var s=Gr(e,n,n+i,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=i):Cn(e)}else if(n>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Cn(e)}else{var f=Gr(e,t,t,-1),p=Gr(e,n,n+i,1);f&&p?(r.view=r.view.slice(0,f.index).concat(jt(e,f.lineN,p.lineN)).concat(r.view.slice(p.index)),r.viewTo+=i):Cn(e)}var m=r.externalMeasured;m&&(n<m.lineN?m.lineN+=i:t<m.lineN+m.size&&(r.externalMeasured=null))}function xn(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var s=i.view[In(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);ve(l,n)==-1&&l.push(n)}function Cn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,n,i){var r=In(e,t),s,l=e.display.view;if(!Ci||n==e.doc.first+e.doc.size)return{index:r,lineN:n};for(var f=e.display.viewFrom,p=0;p<r;p++)f+=l[p].size;if(f!=t){if(i>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,n+=s}for(;yn(e.doc,n)!=n;){if(r==(i<0?0:l.length-1))return null;n+=i*l[r-(i<0?1:0)].size,r+=i}return{index:r,lineN:n}}function Xs(e,t,n){var i=e.display,r=i.view;r.length==0||t>=i.viewTo||n<=i.viewFrom?(i.view=jt(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=jt(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(In(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(jt(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,In(e,n)))),i.viewTo=n}function ga(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];!r.hidden&&(!r.node||r.changes)&&++n}return n}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function va(e,t){t===void 0&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),s=i.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++){if(!t&&l==n.sel.primIndex)continue;var f=n.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var p=f.empty();(p||e.options.showCursorWhenSelecting)&&ya(e,f.head,r),p||Ks(e,f,s)}return i}function ya(e,t,n){var i=Ji(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(w("div","\xA0","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var s=n.appendChild(w("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=i.other.left+"px",s.style.top=i.other.top+"px",s.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,n){var i=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),f=l.left,p=Math.max(i.sizerWidth,Dn(e)-i.sizer.offsetLeft)-l.right,m=r.direction=="ltr";function E(Ge,ot,xt,pt){ot<0&&(ot=0),ot=Math.round(ot),pt=Math.round(pt),s.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+Ge+`px;
top: `+ot+"px; width: "+(xt==null?p-Ge:xt)+`px;
height: `+(pt-ot)+"px"))}function T(Ge,ot,xt){var pt=lt(r,Ge),_t=pt.text.length,Xt,hi;function $t(ii,Ti){return vo(e,Re(Ge,ii),"div",pt,Ti)}function Ri(ii,Ti,mi){var ai=pa(e,pt,null,ii),ni=Ti=="ltr"==(mi=="after")?"left":"right",Jt=mi=="after"?ai.begin:ai.end-(/\s/.test(pt.text.charAt(ai.end-1))?2:1);return $t(Jt,ni)[ni]}var _i=ut(pt,r.direction);return it(_i,ot||0,xt==null?_t:xt,function(ii,Ti,mi,ai){var ni=mi=="ltr",Jt=$t(ii,ni?"left":"right"),Li=$t(Ti-1,ni?"right":"left"),ur=ot==null&&ii==0,Tn=xt==null&&Ti==_t,vi=ai==0,on=!_i||ai==_i.length-1;if(Li.top-Jt.top<=3){var ci=(m?ur:Tn)&&vi,Yo=(m?Tn:ur)&&on,gn=ci?f:(ni?Jt:Li).left,Wn=Yo?p:(ni?Li:Jt).right;E(gn,Jt.top,Wn-gn,Jt.bottom)}else{var Hn,bi,hr,$o;ni?(Hn=m&&ur&&vi?f:Jt.left,bi=m?p:Ri(ii,mi,"before"),hr=m?f:Ri(Ti,mi,"after"),$o=m&&Tn&&on?p:Li.right):(Hn=m?Ri(ii,mi,"before"):f,bi=!m&&ur&&vi?p:Jt.right,hr=!m&&Tn&&on?f:Li.left,$o=m?Ri(Ti,mi,"after"):p),E(Hn,Jt.top,bi-Hn,Jt.bottom),Jt.bottom<Li.top&&E(f,Jt.bottom,null,Li.top),E(hr,Li.top,$o-hr,Li.bottom)}(!Xt||Vr(Jt,Xt)<0)&&(Xt=Jt),Vr(Li,Xt)<0&&(Xt=Li),(!hi||Vr(Jt,hi)<0)&&(hi=Jt),Vr(Li,hi)<0&&(hi=Li)}),{start:Xt,end:hi}}var X=t.from(),W=t.to();if(X.line==W.line)T(X.line,X.ch,W.ch);else{var ce=lt(r,X.line),Ee=lt(r,W.line),Ne=wi(ce)==wi(Ee),ze=T(X.line,X.ch,Ne?ce.text.length+1:null).end,Qe=T(W.line,Ne?0:null,W.ch).start;Ne&&(ze.top<Qe.top-2?(E(ze.right,ze.top,null,ze.bottom),E(f,Qe.top,Qe.left,Qe.bottom)):E(ze.right,ze.top,Qe.left-ze.right,ze.bottom)),ze.bottom<Qe.top&&E(f,ze.bottom,null,Qe.top)}n.appendChild(s)}function Eo(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Jn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Jn(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ae(e,"focus",e,t),e.state.focused=!0,me(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),K&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Eo(e)}function Jn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ae(e,"blur",e,t),e.state.focused=!1,se(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Xr(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],s=e.options.lineWrapping,l=void 0,f=0;if(r.hidden)continue;if(D&&$<8){var p=r.node.offsetTop+r.node.offsetHeight;l=p-n,n=p}else{var m=r.node.getBoundingClientRect();l=m.bottom-m.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-m.left-1)}var E=r.line.height-l;if((E>.005||E<-.005)&&(xi(r.line,l),Ca(r.line),r.rest))for(var T=0;T<r.rest.length;T++)Ca(r.rest[T]);if(f>e.display.sizerWidth){var X=Math.ceil(f/Zn(e.display));X>e.display.maxLineLength&&(e.display.maxLineLength=X,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Kr(e,t,n){var i=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Hr(e));var r=n&&n.bottom!=null?n.bottom:i+e.wrapper.clientHeight,s=Pi(t,i),l=Pi(t,r);if(n&&n.ensure){var f=n.ensure.from.line,p=n.ensure.to.line;f<s?(s=f,l=Pi(t,Zi(lt(t,f))+e.wrapper.clientHeight)):Math.min(p,t.lastLine())>=l&&(s=Pi(t,Zi(lt(t,p))-e.wrapper.clientHeight),l=p)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(de(e,"scrollCursorIntoView"))return;var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!B){var s=w("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Hr(e.display))+`px;
height: `+(t.bottom-t.top+nn(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $s(e,t,n,i){i==null&&(i=0);var r;!e.options.lineWrapping&&t==n&&(t=t.ch?Re(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Re(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Ji(e,t),p=!n||n==t?f:Ji(e,n);r={left:Math.min(f.left,p.left),top:Math.min(f.top,p.top)-i,right:Math.max(f.left,p.left),bottom:Math.max(f.bottom,p.bottom)+i};var m=_o(e,r),E=e.doc.scrollTop,T=e.doc.scrollLeft;if(m.scrollTop!=null&&(xr(e,m.scrollTop),Math.abs(e.doc.scrollTop-E)>1&&(l=!0)),m.scrollLeft!=null&&(Bn(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-T)>1&&(l=!0)),!l)break}return r}function Zs(e,t){var n=_o(e,t);n.scrollTop!=null&&xr(e,n.scrollTop),n.scrollLeft!=null&&Bn(e,n.scrollLeft)}function _o(e,t){var n=e.display,i=$n(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+fo(n),p=t.top<i,m=t.bottom>f-i;if(t.top<r)l.scrollTop=p?0:t.top;else if(t.bottom>r+s){var E=Math.min(t.top,(m?f:t.bottom)-s);E!=r&&(l.scrollTop=E)}var T=e.options.fixedGutter?0:n.gutters.offsetWidth,X=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-T,W=Dn(e)-n.gutters.offsetWidth,ce=t.right-t.left>W;return ce&&(t.right=t.left+W),t.left<10?l.scrollLeft=0:t.left<X?l.scrollLeft=Math.max(0,t.left+T-(ce?0:10)):t.right>W+X-3&&(l.scrollLeft=t.right+(ce?0:10)-W),l}function To(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,n){(t!=null||n!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Js(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=da(e,t.from),i=da(e,t.to);wa(e,n,i,t.margin)}}function wa(e,t,n,i){var r=_o(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;Q||Mo(e,{top:t}),Sa(e,t,!0),Q&&Mo(e),Sr(e,100)}function Sa(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,n,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,La(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+fo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+nn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var jn=function(e,t,n){this.cm=n;var i=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=w("div",[w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),ue(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),ue(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&$<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=Z&&!U?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new xe,this.disableVert=new xe},jn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function i(){var r=e.getBoundingClientRect(),s=n=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function qn(e,t){t||(t=Cr(e));var n=e.display.barWidth,i=e.display.barHeight;Ea(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Xr(e),Ea(e,Cr(e)),n=e.display.barWidth,i=e.display.barHeight}function Ea(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var ka={native:jn,null:wr};function _a(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&se(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ue(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Bn(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Un(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},Gi(e.curOp)}function Fn(e){var t=e.curOp;t&&Wr(t,function(n){for(var i=0;i<n.ops.length;i++)n.ops[i].cm.curOp=null;qs(n)})}function qs(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var i=0;i<t.length;i++)tl(t[i]);for(var r=0;r<t.length;r++)il(t[r]);for(var s=0;s<t.length;s++)nl(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,n=t.display;al(t),e.updateMaxLine&&Fr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Lo(e.cm,e.update)}function il(e){var t=e.cm,n=t.display;e.updatedDisplay&&Xr(t),e.barMeasure=Cr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+nn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Dn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ie();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Oo(t,e.barMeasure),e.selectionChanged&&Eo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&ba(e.cm)}function rl(e){var t=e.cm,n=t.display,i=t.doc;if(e.updatedDisplay&&Ta(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(i,e.scrollToPos.from),o(i,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||ae(s[f],"hide");if(l)for(var p=0;p<l.length;++p)l[p].lines.length&&ae(l[p],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ae(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Oi(e,t){if(e.curOp)return t();Un(e);try{return t()}finally{Fn(e)}}function li(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Un(e);try{return t.apply(e,arguments)}finally{Fn(e)}}}function yi(e){return function(){if(this.curOp)return e.apply(this,arguments);Un(this);try{return e.apply(this,arguments)}finally{Fn(this)}}}function ui(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Un(t);try{return e.apply(this,arguments)}finally{Fn(t)}}}function Sr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,C(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,i=Fe(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(i.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?Hi(t.mode,i.state):null,p=M(e,s,i,!0);f&&(i.state=f),s.styles=p.styles;var m=s.styleClasses,E=p.classes;E?s.styleClasses=E:m&&(s.styleClasses=null);for(var T=!l||l.length!=s.styles.length||m!=E&&(!m||!E||m.bgClass!=E.bgClass||m.textClass!=E.textClass),X=0;!T&&X<l.length;++X)T=l[X]!=s.styles[X];T&&r.push(i.line),s.stateAfter=i.save(),i.nextLine()}else s.text.length<=e.options.maxHighlightLength&&rt(e,s.text,i),s.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return Sr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Oi(e,function(){for(var s=0;s<r.length;s++)xn(e,r[s],"text")})}var $r=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Kr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Dn(e),this.force=n,this.dims=Co(e),this.events=[]};$r.prototype.signal=function(e,t){k(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ae.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=nn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=nn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=ie();if(!t||!_(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&_(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==ie())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Lo(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return Cn(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ga(e)==0)return!1;Ma(e)&&(Cn(e),t.dims=Co(e));var r=i.first+i.size,s=Math.max(t.visible.from-e.options.viewportMargin,i.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(i.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(r,n.viewTo)),Ci&&(s=yn(e.doc,s),l=Ur(e.doc,l));var f=s!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),n.viewOffset=Zi(lt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var p=ga(e);if(!f&&p==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var m=sl(e);return p>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),p>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(m),ke(n.cursorDiv),ke(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,f&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Sr(e,400)),n.updateLineNumbers=null,!0}function Ta(e,t){for(var n=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Dn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+fo(e.display)-po(e),n.top)}),t.visible=Kr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Kr(e.display,e.doc,n));if(!Lo(e,t))break;Xr(e);var r=Cr(e);yr(e),qn(e,r),Oo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Mo(e,t){var n=new $r(e,t);if(Lo(e,n)){Xr(e),Ta(e,n);var i=Cr(e);yr(e),qn(e,i),Oo(e,i),n.finish()}}function ul(e,t,n){var i=e.display,r=e.options.lineNumbers,s=i.lineDiv,l=s.firstChild;function f(ce){var Ee=ce.nextSibling;return K&&Z&&e.display.currentWheelTarget==ce?ce.style.display="none":ce.parentNode.removeChild(ce),Ee}for(var p=i.view,m=i.viewFrom,E=0;E<p.length;E++){var T=p[E];if(!T.hidden)if(!T.node||T.node.parentNode!=s){var X=Is(e,T,m,n);s.insertBefore(X,l)}else{for(;l!=T.node;)l=f(l);var W=r&&t!=null&&t<=m&&T.lineNumber;T.changes&&(ve(T.changes,"gutter")>-1&&(W=!1),Jo(e,T,m,n)),W&&(ke(T.lineNumber),T.lineNumber.appendChild(document.createTextNode(hn(e.options,m)))),l=T.node.nextSibling}m+=T.size}for(;l;)l=f(l)}function Ao(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+nn(e)+"px"}function La(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=wo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=i+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=s),n[l].gutterBackground&&(n[l].gutterBackground.style.left=s));var f=n[l].alignable;if(f)for(var p=0;p<f.length;p++)f[p].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}function Ma(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=hn(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(w("div",[w("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(s,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ao(e.display),!0}return!1}function Ro(e,t){for(var n=[],i=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)i=!0;else continue;n.push({className:s,style:l})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Aa(e){var t=e.gutters,n=e.gutterSpecs;ke(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],s=r.className,l=r.style,f=t.appendChild(w("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ao(e)}function Er(e){Aa(e.display),Ei(e),La(e)}function hl(e,t,n,i){var r=this;this.input=n,r.scrollbarFiller=w("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=w("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=q("div",null,"CodeMirror-code"),r.selectionDiv=w("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=w("div",null,"CodeMirror-cursors"),r.measure=w("div",null,"CodeMirror-measure"),r.lineMeasure=w("div",null,"CodeMirror-measure"),r.lineSpace=q("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=q("div",[r.lineSpace],"CodeMirror-lines");r.mover=w("div",[s],null,"position: relative"),r.sizer=w("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=w("div",null,null,"position: absolute; height: "+Ye+"px; width: 1px;"),r.gutters=w("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=w("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=w("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),D&&$<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!K&&!(Q&&te)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Ro(i.gutters,i.lineNumbers),Aa(r),n.init(r)}var Zr=0,Ui=null;D?Ui=-.53:Q?Ui=15:L?Ui=-.7:ee&&(Ui=-1/3);function Oa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Oa(e);return t.x*=Ui,t.y*=Ui,t}function Ra(e,t){var n=Oa(t),i=n.x,r=n.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,p=l.scrollHeight>l.clientHeight;if(!(i&&f||r&&p))return;if(r&&Z&&K){e:for(var m=t.target,E=s.view;m!=l;m=m.parentNode)for(var T=0;T<E.length;T++)if(E[T].node==m){e.display.currentWheelTarget=m;break e}}if(i&&!Q&&!P&&Ui!=null){r&&p&&xr(e,Math.max(0,l.scrollTop+r*Ui)),Bn(e,Math.max(0,l.scrollLeft+i*Ui)),(!r||r&&p)&&v(t),s.wheelStartX=null;return}if(r&&Ui!=null){var X=r*Ui,W=e.doc.scrollTop,ce=W+s.wrapper.clientHeight;X<0?W=Math.max(0,W+X-50):ce=Math.min(e.doc.height,ce+X+50),Mo(e,{top:W,bottom:ce})}Zr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var Ee=l.scrollLeft-s.wheelStartX,Ne=l.scrollTop-s.wheelStartY,ze=Ne&&s.wheelDY&&Ne/s.wheelDY||Ee&&s.wheelDX&&Ee/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!ze)return;Ui=(Ui*Zr+ze)/(Zr+1),++Zr},200)):(s.wheelDX+=i,s.wheelDY+=r))}var Fi=function(e,t){this.ranges=e,this.primIndex=t};Fi.prototype.primary=function(){return this.ranges[this.primIndex]},Fi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=e.ranges[t];if(!cn(n.anchor,i.anchor)||!cn(n.head,i.head))return!1}return!0},Fi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(Ln(this.ranges[t].anchor),Ln(this.ranges[t].head));return new Fi(e,this.primIndex)},Fi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Fi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(wt(t,i.from())>=0&&wt(e,i.to())<=0)return n}return-1};var Ft=function(e,t){this.anchor=e,this.head=t};Ft.prototype.from=function(){return Mn(this.anchor,this.head)},Ft.prototype.to=function(){return dn(this.anchor,this.head)},Ft.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Qi(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort(function(X,W){return wt(X.from(),W.from())}),n=ve(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],p=wt(f.to(),l.from());if(i&&!l.empty()?p>0:p>=0){var m=Mn(f.from(),l.from()),E=dn(f.to(),l.to()),T=f.empty()?l.from()==l.head:f.from()==f.head;s<=n&&--n,t.splice(--s,2,new Ft(T?E:m,T?m:E))}}return new Fi(t,n)}function wn(e,t){return new Fi([new Ft(e,t||e)],0)}function Sn(e){return e.text?Re(e.from.line+e.text.length-1,Ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(wt(e,t.from)<0)return e;if(wt(e,t.to)<=0)return Sn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Sn(t).ch-t.to.ch),Re(n,i)}function Do(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new Ft(Da(r.anchor,t),Da(r.head,t)))}return Qi(e.cm,n,e.sel.primIndex)}function Pa(e,t,n){return e.line==t.line?Re(n.line,e.ch-t.ch+n.ch):Re(n.line+(e.line-t.line),e.ch)}function dl(e,t,n){for(var i=[],r=Re(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],p=Pa(f.from,r,s),m=Pa(Sn(f),r,s);if(r=f.to,s=m,n=="around"){var E=e.sel.ranges[l],T=wt(E.head,E.anchor)<0;i[l]=new Ft(T?m:p,T?p:m)}else i[l]=new Ft(p,p)}return new Fi(i,e.sel.primIndex)}function Po(e){e.doc.mode=Xi(e.options,e.doc.modeOption),kr(e)}function kr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Sr(e,100),e.state.modeGen++,e.curOp&&Ei(e)}function Na(e,t){return t.from.ch==0&&t.to.ch==0&&Ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function No(e,t,n,i){function r(Qe){return n?n[Qe]:null}function s(Qe,Ge,ot){Zo(Qe,Ge,ot,i),pi(Qe,"change",Qe,t)}function l(Qe,Ge){for(var ot=[],xt=Qe;xt<Ge;++xt)ot.push(new Rn(m[xt],r(xt),i));return ot}var f=t.from,p=t.to,m=t.text,E=lt(e,f.line),T=lt(e,p.line),X=Ie(m),W=r(m.length-1),ce=p.line-f.line;if(t.full)e.insert(0,l(0,m.length)),e.remove(m.length,e.size-m.length);else if(Na(e,t)){var Ee=l(0,m.length-1);s(T,T.text,W),ce&&e.remove(f.line,ce),Ee.length&&e.insert(f.line,Ee)}else if(E==T)if(m.length==1)s(E,E.text.slice(0,f.ch)+X+E.text.slice(p.ch),W);else{var Ne=l(1,m.length-1);Ne.push(new Rn(X+E.text.slice(p.ch),W,i)),s(E,E.text.slice(0,f.ch)+m[0],r(0)),e.insert(f.line+1,Ne)}else if(m.length==1)s(E,E.text.slice(0,f.ch)+m[0]+T.text.slice(p.ch),r(0)),e.remove(f.line+1,ce);else{s(E,E.text.slice(0,f.ch)+m[0],r(0)),s(T,X+T.text.slice(p.ch),W);var ze=l(1,m.length-1);ce>1&&e.remove(f.line+1,ce-1),e.insert(f.line+1,ze)}pi(e,"change",e,t)}function En(e,t,n){function i(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var p=r.linked[f];if(p.doc==s)continue;var m=l&&p.sharedHist;if(n&&!m)continue;t(p.doc,m),i(p.doc,r,m)}}i(e,null,!0)}function Ia(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,So(e),Po(e),Ba(e),e.options.lineWrapping||Fr(e),e.options.mode=t.modeOption,Ei(e)}function Ba(e){(e.doc.direction=="rtl"?me:se)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Oi(e,function(){Ba(e),Ei(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Io(e,t){var n={from:Ln(t.from),to:Sn(t),text:Di(e,t.from,t.to)};return Fa(e,n,t.from.line,t.to.line+1),En(e,function(i){return Fa(i,n,t.from.line,t.to.line+1)},!0),n}function ja(e){for(;e.length;){var t=Ie(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ja(e.done),Ie(e.done);if(e.done.length&&!Ie(e.done).ranges)return Ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ie(e.done)}function Ua(e,t,n,i){var r=e.history;r.undone.length=0;var s=+new Date,l,f;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==i)))f=Ie(l.changes),wt(t.from,t.to)==0&&wt(t.from,f.to)==0?f.to=Sn(t):l.changes.push(Io(e,t));else{var p=Ie(r.done);for((!p||!p.ranges)&&Qr(e.sel,r.done),l={changes:[Io(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,f||ae(e,"historyAdded")}function ml(e,t,n,i){var r=t.charAt(0);return r=="*"||r=="+"&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,i){var r=e.history,s=i&&i.origin;n==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,Ie(r.done),t))?r.done[r.done.length-1]=t:Qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=n,i&&i.clearRedo!==!1&&ja(r.undone)}function Qr(e,t){var n=Ie(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fa(e,t,n,i){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(vl(n[r]));return i}function Wa(e,t){var n=yl(e,t),i=$i(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var s=n[r],l=i[r];if(s&&l){e:for(var f=0;f<l.length;++f){for(var p=l[f],m=0;m<s.length;++m)if(s[m].marker==p.marker)continue e;s.push(p)}}else l&&(n[r]=l)}return n}function er(e,t,n){for(var i=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){i.push(n?Fi.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];i.push({changes:f});for(var p=0;p<l.length;++p){var m=l[p],E=void 0;if(f.push({from:m.from,to:m.to,text:m.text}),t)for(var T in m)(E=T.match(/^spans_(\d+)$/))&&(ve(t,Number(E[1]))>-1&&(Ie(f)[T]=m[T],delete m[T]))}}return i}function Bo(e,t,n,i){if(i){var r=e.anchor;if(n){var s=wt(t,r)<0;s!=wt(n,r)<0?(r=t,t=n):s!=wt(t,n)<0&&(t=n)}return new Ft(r,t)}else return new Ft(n||t,t)}function qr(e,t,n,i,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),gi(e,new Fi([Bo(e.sel.primary(),t,n,r)],0),i)}function Ha(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)i[s]=Bo(e.sel.ranges[s],t[s],null,r);var l=Qi(e.cm,i,e.sel.primIndex);gi(e,l,n)}function jo(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,gi(e,Qi(e.cm,r,e.sel.primIndex),i)}function za(e,t,n,i){gi(e,wn(t,n),i)}function bl(e,t,n){var i={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Ft(o(e,r[s].anchor),o(e,r[s].head))},origin:n&&n.origin};return ae(e,"beforeSelectionChange",e,i),e.cm&&ae(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Qi(e.cm,i.ranges,i.ranges.length-1):t}function Ga(e,t,n){var i=e.history.done,r=Ie(i);r&&r.ranges?(i[i.length-1]=t,eo(e,t,n)):gi(e,t,n)}function gi(e,t,n){eo(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(k(e,"beforeSelectionChange")||e.cm&&k(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var i=n&&n.bias||(wt(t.primary().head,e.sel.primary().head)<0?-1:1);Va(e,Ka(e,t,i,!0)),!(n&&n.scroll===!1)&&e.cm&&Qn(e.cm)}function Va(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,R(e.cm)),pi(e,"cursorActivity",e)}function Xa(e){Va(e,Ka(e,e.sel,null,!1))}function Ka(e,t,n,i){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],p=to(e,l.anchor,f&&f.anchor,n,i),m=to(e,l.head,f&&f.head,n,i);(r||p!=l.anchor||m!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ft(p,m))}return r?Qi(e.cm,r,t.primIndex):t}function tr(e,t,n,i,r){var s=lt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],p=f.marker,m="selectLeft"in p?!p.selectLeft:p.inclusiveLeft,E="selectRight"in p?!p.selectRight:p.inclusiveRight;if((f.from==null||(m?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(E?f.to>=t.ch:f.to>t.ch))){if(r&&(ae(p,"beforeCursorEnter"),p.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!p.atomic)continue;if(n){var T=p.find(i<0?1:-1),X=void 0;if((i<0?E:m)&&(T=Ya(e,T,-i,T&&T.line==t.line?s:null)),T&&T.line==t.line&&(X=wt(T,n))&&(i<0?X<0:X>0))return tr(e,T,t,i,r)}var W=p.find(i<0?-1:1);return(i<0?m:E)&&(W=Ya(e,W,i,W.line==t.line?s:null)),W?tr(e,W,t,i,r):null}}return t}function to(e,t,n,i,r){var s=i||1,l=tr(e,t,n,s,r)||!r&&tr(e,t,n,s,!0)||tr(e,t,n,-s,r)||!r&&tr(e,t,n,-s,!0);return l||(e.cantEdit=!0,Re(e.first,0))}function Ya(e,t,n,i){return n<0&&t.ch==0?t.line>e.first?o(e,Re(t.line-1)):null:n>0&&t.ch==(i||lt(e,t.line)).text.length?t.line<e.first+e.size-1?Re(t.line+1,0):null:new Re(t.line,t.ch+n)}function $a(e){e.setSelection(Re(e.firstLine(),0),Re(e.lastLine()),Ce)}function Za(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(r,s,l,f){r&&(i.from=o(e,r)),s&&(i.to=o(e,s)),l&&(i.text=l),f!==void 0&&(i.origin=f)}),ae(e,"beforeChange",e,i),e.cm&&ae(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ir(e,t,n){if(e.cm){if(!e.cm.curOp)return li(e.cm,ir)(e,t,n);if(e.cm.state.suppressEdits)return}if((k(e,"beforeChange")||e.cm&&k(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var i=zn&&!n&&An(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)Ja(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else Ja(e,t)}function Ja(e,t){if(t.text.length==1&&t.text[0]==""&&wt(t.from,t.to)==0)return;var n=Do(e,t);Ua(e,t,n,e.cm?e.cm.curOp.id:NaN),_r(e,t,n,$i(e,t));var i=[];En(e,function(r,s){!s&&ve(i,r.history)==-1&&(ts(r.history,t),i.push(r.history)),_r(r,t,null,$i(r,t))})}function io(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!n)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,p=t=="undo"?r.undone:r.done,m=0;m<f.length&&!(s=f[m],n?s.ranges&&!s.equals(e.sel):!s.ranges);m++);if(m==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Qr(s,p),n&&!s.equals(e.sel)){gi(e,s,{clearRedo:!1});return}l=s}else if(i){f.push(s);return}else break;var E=[];Qr(l,p),p.push({changes:E,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var T=k(e,"beforeChange")||e.cm&&k(e.cm,"beforeChange"),X=function(Ee){var Ne=s.changes[Ee];if(Ne.origin=t,T&&!Za(e,Ne,!1))return f.length=0,{};E.push(Io(e,Ne));var ze=Ee?Do(e,Ne):Ie(f);_r(e,Ne,ze,Wa(e,Ne)),!Ee&&e.cm&&e.cm.scrollIntoView({from:Ne.from,to:Sn(Ne)});var Qe=[];En(e,function(Ge,ot){!ot&&ve(Qe,Ge.history)==-1&&(ts(Ge.history,Ne),Qe.push(Ge.history)),_r(Ge,Ne,null,Wa(Ge,Ne))})},W=s.changes.length-1;W>=0;--W){var ce=X(W);if(ce)return ce.v}}function Qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Fi(qe(e.sel.ranges,function(r){return new Ft(Re(r.anchor.line+t,r.anchor.ch),Re(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Ei(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)xn(e.cm,i,"gutter")}}function _r(e,t,n,i){if(e.cm&&!e.cm.curOp)return li(e.cm,_r)(e,t,n,i);if(t.to.line<e.first){Qa(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);Qa(e,r),t={from:Re(e.first,0),to:Re(t.to.line+r,t.to.ch),text:[Ie(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Re(s,lt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Di(e,t.from,t.to),n||(n=Do(e,t)),e.cm?xl(e.cm,t,i):No(e,t,i),eo(e,n,Ce),e.cantEdit&&to(e,Re(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,n){var i=e.doc,r=e.display,s=t.from,l=t.to,f=!1,p=s.line;e.options.lineWrapping||(p=Lt(wi(lt(i,s.line))),i.iter(p,l.line+1,function(W){if(W==r.maxLine)return f=!0,!0})),i.sel.contains(t.from,t.to)>-1&&R(e),No(i,t,n,ma(e)),e.options.lineWrapping||(i.iter(p,s.line+t.text.length,function(W){var ce=Kn(W);ce>r.maxLineLength&&(r.maxLine=W,r.maxLineLength=ce,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),zi(i,s.line),Sr(e,400);var m=t.text.length-(l.line-s.line)-1;t.full?Ei(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?xn(e,s.line,"text"):Ei(e,s.line,l.line+1,m);var E=k(e,"changes"),T=k(e,"change");if(T||E){var X={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};T&&pi(e,"change",e,X),E&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(X)}e.display.selForContextMenu=null}function nr(e,t,n,i,r){var s;i||(i=n),wt(i,n)<0&&(s=[i,n],n=s[0],i=s[1]),typeof t=="string"&&(t=e.splitLines(t)),ir(e,{from:n,to:i,text:t,origin:r})}function qa(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function es(e,t,n,i){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var f=0;f<s.ranges.length;f++)qa(s.ranges[f].anchor,t,n,i),qa(s.ranges[f].head,t,n,i);continue}for(var p=0;p<s.changes.length;++p){var m=s.changes[p];if(n<m.from.line)m.from=Re(m.from.line+i,m.from.ch),m.to=Re(m.to.line+i,m.to.ch);else if(t<=m.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ts(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;es(e.done,n,i,r),es(e.undone,n,i,r)}function Tr(e,t,n,i){var r=t,s=t;return typeof t=="number"?s=lt(e,c(e,t)):r=Lt(t),r==null?null:(i(s,r)&&e.cm&&xn(e.cm,r,n),s)}function Lr(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Lr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,ho(r),pi(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}};function Mr(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}Mr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var s=Math.min(t,r-e),l=i.height;if(i.removeInner(e,s),this.height-=l-i.height,r==s&&(this.children.splice(n--,1),i.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Lr))){var f=[];this.collapse(f),this.children=[new Lr(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,f=l;f<r.lines.length;){var p=new Lr(r.lines.slice(f,f+=25));r.height-=p.height,this.children.splice(++i,0,p),p.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Mr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=ve(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Mr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,n))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Ar=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};Ar.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=Lt(n);if(i==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var s=gr(this);xi(n,Math.max(0,n.height-s)),e&&(Oi(e,function(){is(e,n,-s),xn(e,i,"widget")}),pi(e,"lineWidgetCleared",e,this,i))},Ar.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=gr(this)-t;if(!r)return;Ai(this.doc,i)||xi(i,i.height+r),n&&Oi(n,function(){n.curOp.forceUpdate=!0,is(n,i,r),pi(n,"lineWidgetChanged",n,e,Lt(i))})},A(Ar);function is(e,t,n){Zi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&To(e,n)}function Cl(e,t,n,i){var r=new Ar(e,n,i),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Tr(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(r.insertAt==null?f.push(r):f.splice(Math.min(f.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Ai(e,l)){var p=Zi(l)<e.scrollTop;xi(l,l.height+gr(r)),p&&To(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&pi(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Lt(t)),r}var ns=0,kn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ns};kn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Un(e),k(this,"clear")){var n=this.find();n&&pi(this,"clear",n.from,n.to)}for(var i=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=Yi(l.markedSpans,this);e&&!this.collapsed?xn(e,Lt(l),"text"):e&&(f.to!=null&&(r=Lt(l)),f.from!=null&&(i=Lt(l))),l.markedSpans=fn(l.markedSpans,f),f.from==null&&this.collapsed&&!Ai(this.doc,l)&&e&&xi(l,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var p=0;p<this.lines.length;++p){var m=wi(this.lines[p]),E=Kn(m);E>e.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=E,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Ei(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&pi(e,"markerCleared",e,this,i,r),t&&Fn(e),this.parent&&this.parent.clear()},kn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,i,r=0;r<this.lines.length;++r){var s=this.lines[r],l=Yi(s.markedSpans,this);if(l.from!=null&&(n=Re(t?s:Lt(s),l.from),e==-1))return n;if(l.to!=null&&(i=Re(t?s:Lt(s),l.to),e==1))return i}return n&&{from:n,to:i}},kn.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;if(!t||!i)return;Oi(i,function(){var r=t.line,s=Lt(t.line),l=mo(i,s);if(l&&(sa(l),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Ai(n.doc,r)&&n.height!=null){var f=n.height;n.height=null;var p=gr(n)-f;p&&xi(r,r.height+p)}pi(i,"markerChanged",i,e)})},kn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ve(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},kn.prototype.detachLine=function(e){if(this.lines.splice(ve(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},A(kn);function rr(e,t,n,i,r){if(i&&i.shared)return wl(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return li(e.cm,rr)(e,t,n,i,r);var s=new kn(e,r),l=wt(t,n);if(i&&g(i,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=q("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Qt(e,t.line,t,n,s)||t.line!=n.line&&Qt(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Mi()}s.addToHistory&&Ua(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var f=t.line,p=e.cm,m;if(e.iter(f,n.line+1,function(T){p&&s.collapsed&&!p.options.lineWrapping&&wi(T)==p.display.maxLine&&(m=!0),s.collapsed&&f!=t.line&&xi(T,0),en(T,new vn(s,f==t.line?t.ch:null,f==n.line?n.ch:null)),++f}),s.collapsed&&e.iter(t.line,n.line+1,function(T){Ai(e,T)&&xi(T,0)}),s.clearOnEnter&&ue(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Bi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++ns,s.atomic=!0),p){if(m&&(p.curOp.updateMaxLine=!0),s.collapsed)Ei(p,t.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var E=t.line;E<=n.line;E++)xn(p,E,"text");s.atomic&&Xa(p.doc),pi(p,"markerAdded",p,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();pi(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},A(Or);function wl(e,t,n,i,r){i=g(i),i.shared=!1;var s=[rr(e,t,n,i,r)],l=s[0],f=i.widgetNode;return En(e,function(p){f&&(i.widgetNode=f.cloneNode(!0)),s.push(rr(p,o(p,t),o(p,n),i,r));for(var m=0;m<p.linked.length;++m)if(p.linked[m].isParent)return;l=Ie(s)}),new Or(s,l)}function rs(e){return e.findMarks(Re(e.first,0),e.clipPos(Re(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(wt(s,l)){var f=rr(e,s,l,i.primary,i.primary.type);i.markers.push(f),f.parent=i}}}function El(e){for(var t=function(i){var r=e[i],s=[r.primary.doc];En(r.primary.doc,function(p){return s.push(p)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];ve(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},n=0;n<e.length;n++)t(n)}var kl=0,ki=function(e,t,n,i,r){if(!(this instanceof ki))return new ki(e,t,n,i,r);n==null&&(n=0),Mr.call(this,[new Lr([new Rn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var s=Re(n,0);this.sel=wn(s),this.history=new Jr(null),this.id=++kl,this.modeOption=t,this.lineSep=i,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),No(this,{from:s,to:s,text:e}),gi(this,wn(s),Ce)};ki.prototype=Ke(Mr.prototype,{constructor:ki,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=un(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ui(function(e){var t=Re(this.first,0),n=this.first+this.size-1;ir(this,{from:t,to:Re(n,lt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),gi(this,wn(t),Ce)}),replaceRange:function(e,t,n,i){t=o(this,t),n=n?o(this,n):t,nr(this,e,t,n,i)},getRange:function(e,t,n){var i=Di(this,o(this,e),o(this,t));return n===!1?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ki(this,e))return lt(this,e)},getLineNumber:function(e){return Lt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=lt(this,e)),wi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ui(function(e,t,n){za(this,o(this,typeof e=="number"?Re(e,t||0):e),null,n)}),setSelection:ui(function(e,t,n){za(this,o(this,e),o(this,t||e),n)}),extendSelection:ui(function(e,t,n){qr(this,o(this,e),t&&o(this,t),n)}),extendSelections:ui(function(e,t){Ha(this,u(this,e),t)}),extendSelectionsBy:ui(function(e,t){var n=qe(this.sel.ranges,e);Ha(this,u(this,n),t)}),setSelections:ui(function(e,t,n){if(!e.length)return;for(var i=[],r=0;r<e.length;r++)i[r]=new Ft(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),gi(this,Qi(this.cm,i,t),n)}),addSelection:ui(function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new Ft(o(this,e),o(this,t||e))),gi(this,Qi(this.cm,i,i.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,i=0;i<t.length;i++){var r=Di(this,t[i].from(),t[i].to());n=n?n.concat(r):r}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Di(this,n[i].from(),n[i].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:ui(function(e,t,n){for(var i=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];i[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:n}}for(var f=t&&t!="end"&&dl(this,i,t),p=i.length-1;p>=0;p--)ir(this,i[p]);f?Ga(this,f):this.cm&&Qn(this.cm)}),undo:ui(function(){io(this,"undo")}),redo:ui(function(){io(this,"redo")}),undoSelection:ui(function(){io(this,"undo",!0)}),redoSelection:ui(function(){io(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),En(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:ui(function(e,t,n){return Tr(this,e,"gutter",function(i){var r=i.gutterMarkers||(i.gutterMarkers={});return r[t]=n,!n&&Ze(r)&&(i.gutterMarkers=null),!0})}),clearGutter:ui(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Tr(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Ze(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ki(this,e))return null;if(t=e,e=lt(this,e),!e)return null}else if(t=Lt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ui(function(e,t,n){return Tr(this,e,t=="gutter"?"gutter":"class",function(i){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[r])i[r]=n;else{if(H(n).test(i[r]))return!1;i[r]+=" "+n}return!0})}),removeLineClass:ui(function(e,t,n){return Tr(this,e,t=="gutter"?"gutter":"class",function(i){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=i[r];if(s)if(n==null)i[r]=null;else{var l=s.match(H(n));if(!l)return!1;var f=l.index+l[0].length;i[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:ui(function(e,t,n){return Cl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return rr(this,o(this,e),o(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),rr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],n=lt(this,e.line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=o(this,e),t=o(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f<l.length;f++){var p=l[f];!(p.to!=null&&r==e.line&&e.ch>=p.to||p.from==null&&r!=e.line||p.from!=null&&r==t.line&&p.from>=t.ch)&&(!n||n(p.marker))&&i.push(p.marker.parent||p.marker)}++r}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)n[i].from!=null&&e.push(n[i].marker)}),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+i;if(s>e)return t=e,!0;e-=s,++n}),o(this,Re(n,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+n}),t},copy:function(e){var t=new ki(un(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var i=new ki(un(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(i,rs(this)),i},unlinkDoc:function(e){if(e instanceof Yt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),El(rs(this));break}if(e.history==this.history){var i=[e.id];En(e,function(r){return i.push(r.id)},!0),e.history=new Jr(null),e.history.done=er(this.history.done,i),e.history.undone=er(this.history.undone,i)}},iterLinkedDocs:function(e){En(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Et(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:ui(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),ki.prototype.eachLine=ki.prototype.iter;var os=0;function _l(e){var t=this;if(as(t),de(t,e)||pn(t.display,e))return;v(e),D&&(os=+new Date);var n=Nn(t,e,!0),i=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,s=Array(r),l=0,f=function(){++l==r&&li(t,function(){n=o(t.doc,n);var W={from:n,to:n,text:t.doc.splitLines(s.filter(function(ce){return ce!=null}).join(t.doc.lineSeparator())),origin:"paste"};ir(t.doc,W),Ga(t.doc,wn(o(t.doc,n),o(t.doc,Sn(W))))})()},p=function(W,ce){if(t.options.allowDropFileTypes&&ve(t.options.allowDropFileTypes,W.type)==-1){f();return}var Ee=new FileReader;Ee.onerror=function(){return f()},Ee.onload=function(){var Ne=Ee.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ne)){f();return}s[ce]=Ne,f()},Ee.readAsText(W)},m=0;m<i.length;m++)p(i[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var E=e.dataTransfer.getData("Text");if(E){var T;if(t.state.draggingText&&!t.state.draggingText.copy&&(T=t.listSelections()),eo(t.doc,wn(n,n)),T)for(var X=0;X<T.length;++X)nr(t.doc,"",T[X].anchor,T[X].head,"drag");t.replaceSelection(E,"around","paste"),t.display.input.focus()}}catch(W){}}}function Tl(e,t){if(D&&(!e.state.draggingText||+new Date-os<100)){S(t);return}if(de(e,t)||pn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ee){var n=w("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",P&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),P&&n.parentNode.removeChild(n)}}function Ll(e,t){var n=Nn(e,t);if(!n)return;var i=document.createDocumentFragment();ya(e,n,i),e.display.dragCursor||(e.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),re(e.display.dragCursor,i)}function as(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation(function(){for(var s=0;s<n.length;s++)e(n[s])})}var ls=!1;function Ml(){if(ls)return;Al(),ls=!0}function Al(){var e;ue(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ol)},100))}),ue(window,"blur",function(){return ss(Jn)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var _n={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Rr=0;Rr<10;Rr++)_n[Rr+48]=_n[Rr+96]=String(Rr);for(var no=65;no<=90;no++)_n[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)_n[Dr+111]=_n[Dr+63235]="F"+Dr;var mn={};mn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},mn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},mn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},mn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},mn.default=Z?mn.macDefault:mn.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,i,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))n=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}return n&&(e="Alt-"+e),i&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(i=="..."){delete e[n];continue}for(var r=qe(n.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=i):(f=r.slice(0,s+1).join(" "),l="...");var p=t[f];if(!p)t[f]=l;else if(p!=l)throw new Error("Inconsistent bindings for "+f)}delete e[n]}for(var m in t)e[m]=t[m];return e}function or(e,t,n,i){t=ro(t);var r=t.call?t.call(e,i):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&n(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return or(e,t.fallthrough,n,i);for(var s=0;s<t.fallthrough.length;s++){var l=or(e,t.fallthrough[s],n,i);if(l)return l}}}function us(e){var t=typeof e=="string"?e:_n[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,n){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(ne?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(ne?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(P&&e.keyCode==34&&e.char)return!1;var n=_n[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),hs(n,e,t))}function ro(e){return typeof e=="string"?mn[e]:e}function ar(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var s=t(n[r]);i.length&&wt(s.from,Ie(i).to)<=0;){var l=i.pop();if(wt(l.from,s.from)<0){s.from=l.from;break}}i.push(s)}Oi(e,function(){for(var f=i.length-1;f>=0;f--)nr(e.doc,"",i[f].from,i[f].to,"+delete");Qn(e)})}function Uo(e,t,n){var i=Be(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Fo(e,t,n){var i=Uo(e,t.ch,n);return i==null?null:new Re(t.line,i,n<0?"after":"before")}function Wo(e,t,n,i,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=ut(n,t.doc.direction);if(s){var l=r<0?Ie(s):s[0],f=r<0==(l.level==1),p=f?"after":"before",m;if(l.level>0||t.doc.direction=="rtl"){var E=Yn(t,n);m=r<0?n.text.length-1:0;var T=rn(t,E,m).top;m=ft(function(X){return rn(t,E,X).top==T},r<0==(l.level==1)?l.from:l.to-1,m),p=="before"&&(m=Uo(n,m,1))}else m=r<0?l.to:l.from;return new Re(i,m,p)}}return new Re(i,r<0?n.text.length:0,r<0?"before":"after")}function Pl(e,t,n,i){var r=ut(t,e.doc.direction);if(!r)return Fo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var s=et(r,n.ch,n.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(i>0?l.to>n.ch:l.from<n.ch))return Fo(t,n,i);var f=function(ze,Qe){return Uo(t,ze instanceof Re?ze.ch:ze,Qe)},p,m=function(ze){return e.options.lineWrapping?(p=p||Yn(e,t),pa(e,t,p,ze)):{begin:0,end:t.text.length}},E=m(n.sticky=="before"?f(n,-1):n.ch);if(e.doc.direction=="rtl"||l.level==1){var T=l.level==1==i<0,X=f(n,T?1:-1);if(X!=null&&(T?X<=l.to&&X<=E.end:X>=l.from&&X>=E.begin)){var W=T?"before":"after";return new Re(n.line,X,W)}}var ce=function(ze,Qe,Ge){for(var ot=function(Xt,hi){return hi?new Re(n.line,f(Xt,1),"before"):new Re(n.line,Xt,"after")};ze>=0&&ze<r.length;ze+=Qe){var xt=r[ze],pt=Qe>0==(xt.level!=1),_t=pt?Ge.begin:f(Ge.end,-1);if(xt.from<=_t&&_t<xt.to)return ot(_t,pt);if(_t=pt?xt.from:f(xt.to,-1),Ge.begin<=_t&&_t<Ge.end)return ot(_t,pt)}},Ee=ce(s+i,i,E);if(Ee)return Ee;var Ne=i>0?E.end:f(E.begin,-1);return Ne!=null&&!(i>0&&Ne==t.text.length)&&(Ee=ce(i>0?0:r.length-1,i,m(Ne)),Ee)?Ee:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return ar(e,function(t){if(t.empty()){var n=lt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Re(t.head.line+1,0)}:{from:t.head,to:Re(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ar(e,function(t){return{from:Re(t.from().line,0),to:o(e.doc,Re(t.to().line+1,0))}})},delLineLeft:function(e){return ar(e,function(t){return{from:Re(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ar(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return ar(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Re(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Re(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},we)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},we)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?fs(e,t.head):i},we)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var s=n[r].from(),l=V(e.getLine(s.line),s.ch,i);t.push(O(i-l%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Oi(e,function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var r=t[i].head,s=lt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Re(r.line,r.ch-1)),r.ch>0)r=new Re(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Re(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=lt(e.doc,r.line-1).text;l&&(r=new Re(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Re(r.line-1,l.length-1),r,"+transpose"))}}n.push(new Ft(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){return Oi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Qn(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var n=lt(e.doc,t),i=wi(n);return i!=n&&(t=Lt(i)),Wo(!0,e,i,t,1)}function Nl(e,t){var n=lt(e.doc,t),i=Vn(n);return i!=n&&(t=Lt(i)),Wo(!0,e,n,t,-1)}function fs(e,t){var n=ds(e,t.line),i=lt(e.doc,n.line),r=ut(i,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(n.ch,i.text.search(/\S/)),l=t.line==n.line&&t.ch<=s&&t.ch;return Re(n.line,l?0:s,n.sticky)}return n}function oo(e,t,n){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=$e}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function Il(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=or(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&or(t,e.options.extraKeys,n,e)||or(t,e.options.keyMap,n,e)}var Bl=new xe;function Nr(e,t,n,i){var r=e.state.keySeq;if(r){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ps(e,r+" "+t,n,i))return!0}return ps(e,t,n,i)}function ps(e,t,n,i){var r=Il(e,t,i);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&pi(e,"keyHandled",e,t,n),(r=="handled"||r=="multi")&&(v(n),Eo(e)),!!r}function ms(e,t){var n=cs(t,!0);return n?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+n,t,function(i){return oo(e,i,!0)})||Nr(e,n,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return oo(e,i)}):Nr(e,n,t,function(i){return oo(e,i)}):!1}function jl(e,t,n){return Nr(e,"'"+n+"'",t,function(i){return oo(e,i,!0)})}var Ho=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=ie(),de(t,e))return;D&&$<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var i=ms(t,e);P&&(Ho=i?n:null,!i&&n==88&&!Kt&&(Z?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),Q&&!Z&&!i&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;me(t,"CodeMirror-crosshair");function n(i){(i.keyCode==18||!i.altKey)&&(se(t,"CodeMirror-crosshair"),tt(document,"keyup",n),tt(document,"mouseover",n))}ue(document,"keyup",n),ue(document,"mouseover",n)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),de(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pn(t.display,e)||de(t,e)||e.ctrlKey&&!e.altKey||Z&&e.metaKey)return;var n=e.keyCode,i=e.charCode;if(P&&n==Ho){Ho=null,v(e);return}if(P&&(!e.which||e.which<10)&&ms(t,e))return;var r=String.fromCharCode(i==null?n:i);if(r=="\b")return;if(jl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,zo=function(e,t,n){this.time=e,this.pos=t,this.button=n};zo.prototype.compare=function(e,t,n){return this.time+Fl>e&&wt(t,this.pos)==0&&n==this.button};var Ir,Br;function Wl(e,t){var n=+new Date;return Br&&Br.compare(n,e,t)?(Ir=Br=null,"triple"):Ir&&Ir.compare(n,e,t)?(Br=new zo(n,e,t),Ir=null,"double"):(Ir=new zo(n,e,t),Br=null,"single")}function bs(e){var t=this,n=t.display;if(de(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,pn(n,e)){K||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Go(t,e))return;var i=Nn(t,e),r=I(e),s=i?Wl(i,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),i&&Hl(t,r,i,s,e))return;r==1?i?Gl(t,i,s,e):Y(e)==n.scroller&&v(e):r==2?(i&&qr(t.doc,i),setTimeout(function(){return n.input.focus()},20)):r==3&&(Oe?t.display.input.onContextMenu(e):xa(t))}function Hl(e,t,n,i,r){var s="Click";return i=="double"?s="Double"+s:i=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,n)!=$e}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(r.unit==null){var s=Le?n.shiftKey&&n.metaKey:n.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),r.addNew==null&&(r.addNew=Z?n.metaKey:n.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(Z?n.altKey:n.ctrlKey)),r}function Gl(e,t,n,i){D?setTimeout(C(ba,e),0):e.curOp.focus=ie();var r=zl(e,n,i),s=e.doc.sel,l;e.options.dragDrop&&ye&&!e.isReadOnly()&&n=="single"&&(l=s.contains(t))>-1&&(wt((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(wt(l.to(),t)>0||t.xRel<0)?Vl(e,i,t,r):Xl(e,i,t,r)}function Vl(e,t,n,i){var r=e.display,s=!1,l=li(e,function(m){K&&(r.scroller.draggable=!1),e.state.draggingText=!1,tt(r.wrapper.ownerDocument,"mouseup",l),tt(r.wrapper.ownerDocument,"mousemove",f),tt(r.scroller,"dragstart",p),tt(r.scroller,"drop",l),s||(v(m),i.addNew||qr(e.doc,n,null,null,i.extend),K&&!ee||D&&$==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(m){s=s||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},p=function(){return s=!0};K&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ue(r.wrapper.ownerDocument,"mouseup",l),ue(r.wrapper.ownerDocument,"mousemove",f),ue(r.scroller,"dragstart",p),ue(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,n){if(n=="char")return new Ft(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ft(Re(t.line,0),o(e.doc,Re(t.line+1,0)));var i=n(e,t);return new Ft(i.from,i.to)}function Xl(e,t,n,i){var r=e.display,s=e.doc;v(t);var l,f,p=s.sel,m=p.ranges;if(i.addNew&&!i.extend?(f=s.sel.contains(n),f>-1?l=m[f]:l=new Ft(n,n)):(l=s.sel.primary(),f=s.sel.primIndex),i.unit=="rectangle")i.addNew||(l=new Ft(n,n)),n=Nn(e,t,!0,!0),f=-1;else{var E=xs(e,n,i.unit);i.extend?l=Bo(l,E.anchor,E.head,i.extend):l=E}i.addNew?f==-1?(f=m.length,gi(s,Qi(e,m.concat([l]),f),{scroll:!1,origin:"*mouse"})):m.length>1&&m[f].empty()&&i.unit=="char"&&!i.extend?(gi(s,Qi(e,m.slice(0,f).concat(m.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=s.sel):jo(s,f,l,Te):(f=0,gi(s,new Fi([l],0),Te),p=s.sel);var T=n;function X(Ge){if(wt(T,Ge)==0)return;if(T=Ge,i.unit=="rectangle"){for(var ot=[],xt=e.options.tabSize,pt=V(lt(s,n.line).text,n.ch,xt),_t=V(lt(s,Ge.line).text,Ge.ch,xt),Xt=Math.min(pt,_t),hi=Math.max(pt,_t),$t=Math.min(n.line,Ge.line),Ri=Math.min(e.lastLine(),Math.max(n.line,Ge.line));$t<=Ri;$t++){var _i=lt(s,$t).text,ii=_e(_i,Xt,xt);Xt==hi?ot.push(new Ft(Re($t,ii),Re($t,ii))):_i.length>ii&&ot.push(new Ft(Re($t,ii),Re($t,_e(_i,hi,xt))))}ot.length||ot.push(new Ft(n,n)),gi(s,Qi(e,p.ranges.slice(0,f).concat(ot),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ge)}else{var Ti=l,mi=xs(e,Ge,i.unit),ai=Ti.anchor,ni;wt(mi.anchor,ai)>0?(ni=mi.head,ai=Mn(Ti.from(),mi.anchor)):(ni=mi.anchor,ai=dn(Ti.to(),mi.head));var Jt=p.ranges.slice(0);Jt[f]=Kl(e,new Ft(o(s,ai),ni)),gi(s,Qi(e,Jt,f),Te)}}var W=r.wrapper.getBoundingClientRect(),ce=0;function Ee(Ge){var ot=++ce,xt=Nn(e,Ge,!0,i.unit=="rectangle");if(!xt)return;if(wt(xt,T)!=0){e.curOp.focus=ie(),X(xt);var pt=Kr(r,s);(xt.line>=pt.to||xt.line<pt.from)&&setTimeout(li(e,function(){ce==ot&&Ee(Ge)}),150)}else{var _t=Ge.clientY<W.top?-20:Ge.clientY>W.bottom?20:0;_t&&setTimeout(li(e,function(){if(ce!=ot)return;r.scroller.scrollTop+=_t,Ee(Ge)}),50)}}function Ne(Ge){e.state.selectingText=!1,ce=Infinity,Ge&&(v(Ge),r.input.focus()),tt(r.wrapper.ownerDocument,"mousemove",ze),tt(r.wrapper.ownerDocument,"mouseup",Qe),s.history.lastSelOrigin=null}var ze=li(e,function(Ge){Ge.buttons===0||!I(Ge)?Ne(Ge):Ee(Ge)}),Qe=li(e,Ne);e.state.selectingText=Qe,ue(r.wrapper.ownerDocument,"mousemove",ze),ue(r.wrapper.ownerDocument,"mouseup",Qe)}function Kl(e,t){var n=t.anchor,i=t.head,r=lt(e.doc,n.line);if(wt(n,i)==0&&n.sticky==i.sticky)return t;var s=ut(r);if(!s)return t;var l=et(s,n.ch,n.sticky),f=s[l];if(f.from!=n.ch&&f.to!=n.ch)return t;var p=l+(f.from==n.ch==(f.level!=1)?0:1);if(p==0||p==s.length)return t;var m;if(i.line!=n.line)m=(i.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var E=et(s,i.ch,i.sticky),T=E-l||(i.ch-n.ch)*(f.level==1?-1:1);E==p-1||E==p?m=T<0:m=T>0}var X=s[p+(m?-1:0)],W=m==(X.level==1),ce=W?X.from:X.to,Ee=W?"after":"before";return n.ch==ce&&n.sticky==Ee?t:new Ft(new Re(n.line,ce,Ee),i)}function Cs(e,t,n,i){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(X){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&v(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!k(e,n))return x(t);s-=f.top-l.viewOffset;for(var p=0;p<e.display.gutterSpecs.length;++p){var m=l.gutters.childNodes[p];if(m&&m.getBoundingClientRect().right>=r){var E=Pi(e.doc,s),T=e.display.gutterSpecs[p];return ae(e,n,e,E,T.className,t),x(t)}}}function Go(e,t){return Cs(e,t,"gutterClick",!0)}function ws(e,t){if(pn(e.display,t)||Yl(e,t))return;if(de(e,t,"contextmenu"))return;Oe||e.display.input.onContextMenu(t)}function Yl(e,t){return k(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var sr={toString:function(){return"CodeMirror.Init"}},Es={},ao={};function $l(e){var t=e.optionHandlers;function n(i,r,s,l){e.defaults[i]=r,s&&(t[i]=l?function(f,p,m){m!=sr&&s(f,p,m)}:s)}e.defineOption=n,e.Init=sr,n("value","",function(i,r){return i.setValue(r)},!0),n("mode",null,function(i,r){i.doc.modeOption=r,Po(i)},!0),n("indentUnit",2,Po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(i){kr(i),vr(i),Ei(i)},!0),n("lineSeparator",null,function(i,r){if(i.doc.lineSep=r,!r)return;var s=[],l=i.doc.first;i.doc.iter(function(p){for(var m=0;;){var E=p.text.indexOf(r,m);if(E==-1)break;m=E+r.length,s.push(Re(l,E))}l++});for(var f=s.length-1;f>=0;f--)nr(i.doc,r,s[f],Re(s[f].line,s[f].ch+r.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,r,s){i.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=sr&&i.refresh()}),n("specialCharPlaceholder",Bt,function(i){return i.refresh()},!0),n("electricChars",!0),n("inputStyle",te?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(i,r){return i.getInputField().spellcheck=r},!0),n("autocorrect",!1,function(i,r){return i.getInputField().autocorrect=r},!0),n("autocapitalize",!1,function(i,r){return i.getInputField().autocapitalize=r},!0),n("rtlMoveVisually",!Ue),n("wholeLineUpdateBefore",!0),n("theme","default",function(i){Ss(i),Er(i)},!0),n("keyMap","default",function(i,r,s){var l=ro(r),f=s!=sr&&ro(s);f&&f.detach&&f.detach(i,l),l.attach&&l.attach(i,f||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Jl,!0),n("gutters",[],function(i,r){i.display.gutterSpecs=Ro(r,i.options.lineNumbers),Er(i)},!0),n("fixedGutter",!0,function(i,r){i.display.gutters.style.left=r?wo(i.display)+"px":"0",i.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(i){return qn(i)},!0),n("scrollbarStyle","native",function(i){_a(i),qn(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),n("lineNumbers",!1,function(i,r){i.display.gutterSpecs=Ro(i.options.gutters,r),Er(i)},!0),n("firstLineNumber",1,Er,!0),n("lineNumberFormatter",function(i){return i},Er,!0),n("showCursorWhenSelecting",!1,yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(i,r){r=="nocursor"&&(Jn(i),i.display.input.blur()),i.display.input.readOnlyChanged(r)}),n("screenReaderLabel",null,function(i,r){r=r===""?null:r,i.display.input.screenReaderLabelChanged(r)}),n("disableInput",!1,function(i,r){r||i.display.input.reset()},!0),n("dragDrop",!0,Zl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,yr,!0),n("singleCursorHeightPerLine",!0,yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,kr,!0),n("addModeClass",!1,kr,!0),n("pollInterval",100),n("undoDepth",200,function(i,r){return i.doc.history.undoDepth=r}),n("historyEventDelay",1250),n("viewportMargin",10,function(i){return i.refresh()},!0),n("maxHighlightLength",1e4,kr,!0),n("moveInputWithCursor",!0,function(i,r){r||i.display.input.resetPosition()}),n("tabindex",null,function(i,r){return i.display.input.getField().tabIndex=r||""}),n("autofocus",null),n("direction","ltr",function(i,r){return i.doc.setDirection(r)},!0),n("phrases",null)}function Zl(e,t,n){var i=n&&n!=sr;if(!t!=!i){var r=e.display.dragFunctions,s=t?ue:tt;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Jl(e){e.options.lineWrapping?(me(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(se(e.display.wrapper,"CodeMirror-wrap"),Fr(e)),So(e),Ei(e),vr(e),setTimeout(function(){return qn(e)},100)}function Yt(e,t){var n=this;if(!(this instanceof Yt))return new Yt(e,t);this.options=t=t?g(t):{},g(Es,t,!1);var i=t.value;typeof i=="string"?i=new ki(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new Yt.inputStyles[t.inputStyle](this),s=this.display=new hl(e,i,r,t);s.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),_a(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new xe,keySeq:null,specialChars:null},t.autofocus&&!te&&s.input.focus(),D&&$<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ql(this),Ml(),Un(this),this.curOp.forceUpdate=!0,Ia(this,i),t.autofocus&&!te||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ko(n)},20):Jn(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);Ma(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Vo.length;++f)Vo[f](this);Fn(this),K&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Yt.defaults=Es,Yt.optionHandlers=ao;function Ql(e){var t=e.display;ue(t.scroller,"mousedown",li(e,bs)),D&&$<11?ue(t.scroller,"dblclick",li(e,function(p){if(de(e,p))return;var m=Nn(e,p);if(!m||Go(e,p)||pn(e.display,p))return;v(p);var E=e.findWordAt(m);qr(e.doc,E.anchor,E.head)})):ue(t.scroller,"dblclick",function(p){return de(e,p)||v(p)}),ue(t.scroller,"contextmenu",function(p){return ws(e,p)}),ue(t.input.getField(),"contextmenu",function(p){t.scroller.contains(p.target)||ws(e,p)});var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function s(p){if(p.touches.length!=1)return!1;var m=p.touches[0];return m.radiusX<=1&&m.radiusY<=1}function l(p,m){if(m.left==null)return!0;var E=m.left-p.left,T=m.top-p.top;return E*E+T*T>20*20}ue(t.scroller,"touchstart",function(p){if(!de(e,p)&&!s(p)&&!Go(e,p)){t.input.ensurePolled(),clearTimeout(n);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-i.end<=300?i:null},p.touches.length==1&&(t.activeTouch.left=p.touches[0].pageX,t.activeTouch.top=p.touches[0].pageY)}}),ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ue(t.scroller,"touchend",function(p){var m=t.activeTouch;if(m&&!pn(t,p)&&m.left!=null&&!m.moved&&new Date-m.start<300){var E=e.coordsChar(t.activeTouch,"page"),T;!m.prev||l(m,m.prev)?T=new Ft(E,E):!m.prev.prev||l(m,m.prev.prev)?T=e.findWordAt(E):T=new Ft(Re(E.line,0),o(e.doc,Re(E.line+1,0))),e.setSelection(T.anchor,T.head),e.focus(),v(p)}r()}),ue(t.scroller,"touchcancel",r),ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),ae(e,"scroll",e))}),ue(t.scroller,"mousewheel",function(p){return Ra(e,p)}),ue(t.scroller,"DOMMouseScroll",function(p){return Ra(e,p)}),ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(p){de(e,p)||S(p)},over:function(p){de(e,p)||(Ll(e,p),S(p))},start:function(p){return Tl(e,p)},drop:li(e,_l),leave:function(p){de(e,p)||as(e)}};var f=t.input.getField();ue(f,"keyup",function(p){return vs.call(e,p)}),ue(f,"keydown",li(e,gs)),ue(f,"keypress",li(e,ys)),ue(f,"focus",function(p){return ko(e,p)}),ue(f,"blur",function(p){return Jn(e,p)})}var Vo=[];Yt.defineInitHook=function(e){return Vo.push(e)};function jr(e,t,n,i){var r=e.doc,s;n==null&&(n="add"),n=="smart"&&(r.mode.indent?s=Fe(e,t).state:n="prev");var l=e.options.tabSize,f=lt(r,t),p=V(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var m=f.text.match(/^\s*/)[0],E;if(!i&&!/\S/.test(f.text))E=0,n="not";else if(n=="smart"&&(E=r.mode.indent(s,f.text.slice(m.length),f.text),E==$e||E>150)){if(!i)return;n="prev"}n=="prev"?t>r.first?E=V(lt(r,t-1).text,null,l):E=0:n=="add"?E=p+e.options.indentUnit:n=="subtract"?E=p-e.options.indentUnit:typeof n=="number"&&(E=p+n),E=Math.max(0,E);var T="",X=0;if(e.options.indentWithTabs)for(var W=Math.floor(E/l);W;--W)X+=l,T+=" ";if(X<E&&(T+=O(E-X)),T!=m)return nr(r,T,Re(t,0),Re(t,m.length),"+input"),f.stateAfter=null,!0;for(var ce=0;ce<r.sel.ranges.length;ce++){var Ee=r.sel.ranges[ce];if(Ee.head.line==t&&Ee.head.ch<m.length){var Ne=Re(t,m.length);jo(r,ce,new Ft(Ne,Ne));break}}}var qi=null;function so(e){qi=e}function Xo(e,t,n,i,r){var s=e.doc;e.display.shift=!1,i||(i=s.sel);var l=+new Date-200,f=r=="paste"||e.state.pasteIncoming>l,p=Et(t),m=null;if(f&&i.ranges.length>1)if(qi&&qi.text.join(`
`)==t){if(i.ranges.length%qi.text.length==0){m=[];for(var E=0;E<qi.text.length;E++)m.push(s.splitLines(qi.text[E]))}}else p.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(m=qe(p,function(ze){return[ze]}));for(var T=e.curOp.updateInput,X=i.ranges.length-1;X>=0;X--){var W=i.ranges[X],ce=W.from(),Ee=W.to();W.empty()&&(n&&n>0?ce=Re(ce.line,ce.ch-n):e.state.overwrite&&!f?Ee=Re(Ee.line,Math.min(lt(s,Ee.line).text.length,Ee.ch+Ie(p).length)):f&&qi&&qi.lineWise&&qi.text.join(`
`)==p.join(`
`)&&(ce=Ee=Re(ce.line,0)));var Ne={from:ce,to:Ee,text:m?m[X%m.length]:p,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};ir(e.doc,Ne),pi(e,"inputRead",e,Ne)}t&&!f&&_s(e,t),Qn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=T),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Oi(t,function(){return Xo(t,n,0,null,"paste")}),!0}function _s(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=jr(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(lt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=jr(e,r.head.line,"smart")));l&&pi(e,"electricInput",e,r.head.line)}}function Ts(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,s={anchor:Re(r,0),head:Re(r+1,0)};n.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:n}}function Ls(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=w("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=w("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return K?e.style.width="1000px":e.setAttribute("wrap","off"),F&&(e.style.border="1px solid black"),Ls(e),t}function ql(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,r){var s=this.options,l=s[i];if(s[i]==r&&i!="mode")return;s[i]=r,t.hasOwnProperty(i)&&li(this,t[i])(this,r,l),ae(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,r){this.state.keyMaps[r?"push":"unshift"](ro(i))},removeKeyMap:function(i){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==i||r[s].name==i)return r.splice(s,1),!0},addOverlay:yi(function(i,r){var s=i.token?i:e.getMode(this.options,i);if(s.startState)throw new Error("Overlays may not be stateful.");dt(this.state.overlays,{mode:s,modeSpec:i,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Ei(this)}),removeOverlay:yi(function(i){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==i||typeof i=="string"&&l.name==i){r.splice(s,1),this.state.modeGen++,Ei(this);return}}}),indentLine:yi(function(i,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Ki(this.doc,i)&&jr(this,i,r,s)}),indentSelection:yi(function(i){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var f=r[l];if(f.empty())f.head.line>s&&(jr(this,f.head.line,i,!0),s=f.head.line,l==this.doc.sel.primIndex&&Qn(this));else{var p=f.from(),m=f.to(),E=Math.max(s,p.line);s=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var T=E;T<s;++T)jr(this,T,i);var X=this.doc.sel.ranges;p.ch==0&&r.length==X.length&&X[l].from().ch>0&&jo(this.doc,l,new Ft(p,X[l].to()),Ce)}}}),getTokenAt:function(i,r){return Vt(this,i,r)},getLineTokens:function(i,r){return Vt(this,Re(i),r,!0)},getTokenTypeAt:function(i){i=o(this.doc,i);var r=be(this,lt(this.doc,i.line)),s=0,l=(r.length-1)/2,f=i.ch,p;if(f==0)p=r[2];else for(;;){var m=s+l>>1;if((m?r[m*2-1]:0)>=f)l=m;else if(r[m*2+1]<f)s=m+1;else{p=r[m*2+2];break}}var E=p?p.indexOf("overlay "):-1;return E<0?p:E==0?null:p.slice(0,E-1)},getModeAt:function(i){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(i).state).mode:r},getHelper:function(i,r){return this.getHelpers(i,r)[0]},getHelpers:function(i,r){var s=[];if(!n.hasOwnProperty(r))return s;var l=n[r],f=this.getModeAt(i);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var p=0;p<f[r].length;p++){var m=l[f[r][p]];m&&s.push(m)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var E=0;E<l._global.length;E++){var T=l._global[E];T.pred(f,this)&&ve(s,T.val)==-1&&s.push(T.val)}return s},getStateAfter:function(i,r){var s=this.doc;return i=c(s,i==null?s.first+s.size-1:i),Fe(this,i+1,r).state},cursorCoords:function(i,r){var s,l=this.doc.sel.primary();return i==null?s=l.head:typeof i=="object"?s=o(this.doc,i):s=i?l.from():l.to(),Ji(this,s,r||"page")},charCoords:function(i,r){return vo(this,o(this.doc,i),r||"page")},coordsChar:function(i,r){return i=ca(this,i,r||"page"),bo(this,i.left,i.top)},lineAtHeight:function(i,r){return i=ca(this,{top:i,left:0},r||"page").top,Pi(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,r,s){var l=!1,f;if(typeof i=="number"){var p=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>p&&(i=p,l=!0),f=lt(this.doc,i)}else f=i;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Zi(f):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Zn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,r,s,l,f){var p=this.display;i=Ji(this,o(this.doc,i));var m=i.bottom,E=i.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),p.sizer.appendChild(r),l=="over")m=i.top;else if(l=="above"||l=="near"){var T=Math.max(p.wrapper.clientHeight,this.doc.height),X=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);(l=="above"||i.bottom+r.offsetHeight>T)&&i.top>r.offsetHeight?m=i.top-r.offsetHeight:i.bottom+r.offsetHeight<=T&&(m=i.bottom),E+r.offsetWidth>X&&(E=X-r.offsetWidth)}r.style.top=m+"px",r.style.left=r.style.right="",f=="right"?(E=p.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?E=0:f=="middle"&&(E=(p.sizer.clientWidth-r.offsetWidth)/2),r.style.left=E+"px"),s&&Zs(this,{left:E,top:m,right:E+r.offsetWidth,bottom:m+r.offsetHeight})},triggerOnKeyDown:yi(gs),triggerOnKeyPress:yi(ys),triggerOnKeyUp:vs,triggerOnMouseDown:yi(bs),execCommand:function(i){if(Pr.hasOwnProperty(i))return Pr[i].call(null,this)},triggerElectric:yi(function(i){_s(this,i)}),findPosH:function(i,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var p=o(this.doc,i),m=0;m<r&&!(p=Ko(this.doc,p,f,s,l),p.hitSide);++m);return p},moveH:yi(function(i,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Ko(s.doc,l.head,i,r,s.options.rtlMoveVisually):i<0?l.from():l.to()},we)}),deleteH:yi(function(i,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ar(this,function(f){var p=Ko(l,f.head,i,r,!1);return i<0?{from:p,to:f.head}:{from:f.head,to:p}})}),findPosV:function(i,r,s,l){var f=1,p=l;r<0&&(f=-1,r=-r);for(var m=o(this.doc,i),E=0;E<r;++E){var T=Ji(this,m,"div");if(p==null?p=T.left:T.left=p,m=As(this,T,f,s),m.hitSide)break}return m},moveV:yi(function(i,r){var s=this,l=this.doc,f=[],p=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(E){if(p)return i<0?E.from():E.to();var T=Ji(s,E.head,"div");E.goalColumn!=null&&(T.left=E.goalColumn),f.push(T.left);var X=As(s,T,i,r);return r=="page"&&E==l.sel.primary()&&To(s,vo(s,X,"div").top-T.top),X},we),f.length)for(var m=0;m<l.sel.ranges.length;m++)l.sel.ranges[m].goalColumn=f[m]}),findWordAt:function(i){var r=this.doc,s=lt(r,i.line).text,l=i.ch,f=i.ch;if(s){var p=this.getHelper(i,"wordChars");(i.sticky=="before"||f==s.length)&&l?--l:++f;for(var m=s.charAt(l),E=je(m,p)?function(T){return je(T,p)}:/\s/.test(m)?function(T){return/\s/.test(T)}:function(T){return!/\s/.test(T)&&!je(T)};l>0&&E(s.charAt(l-1));)--l;for(;f<s.length&&E(s.charAt(f));)++f}return new Ft(Re(i.line,l),Re(i.line,f))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?me(this.display.cursorDiv,"CodeMirror-overwrite"):se(this.display.cursorDiv,"CodeMirror-overwrite"),ae(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ie()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:yi(function(i,r){br(this,i,r)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-nn(this)-this.display.barHeight,width:i.scrollWidth-nn(this)-this.display.barWidth,clientHeight:po(this),clientWidth:Dn(this)}},scrollIntoView:yi(function(i,r){i==null?(i={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof i=="number"?i={from:Re(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=r||0,i.from.line!=null?Js(this,i):wa(this,i.from,i.to,i.margin)}),setSize:yi(function(i,r){var s=this,l=function(p){return typeof p=="number"||/^\d+$/.test(String(p))?p+"px":p};i!=null&&(this.display.wrapper.style.width=l(i)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&la(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(p){if(p.widgets){for(var m=0;m<p.widgets.length;m++)if(p.widgets[m].noHScroll){xn(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,ae(this,"refresh",this)}),operation:function(i){return Oi(this,i)},startOperation:function(){return Un(this)},endOperation:function(){return Fn(this)},refresh:yi(function(){var i=this.display.cachedTextHeight;Ei(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Ao(this.display),(i==null||Math.abs(i-$n(this.display))>.5||this.options.lineWrapping)&&So(this),ae(this,"refresh",this)}),swapDoc:yi(function(i){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,i),vr(this),this.display.input.reset(),br(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,pi(this,"swapDoc",this,r),r}),phrase:function(i){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,i)?r[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},A(e),e.registerHelper=function(i,r,s){n.hasOwnProperty(i)||(n[i]=e[i]={_global:[]}),n[i][r]=s},e.registerGlobalHelper=function(i,r,s,l){e.registerHelper(i,r,l),n[i]._global.push({pred:s,val:l})}}function Ko(e,t,n,i,r){var s=t,l=n,f=lt(e,t.line),p=r&&e.direction=="rtl"?-n:n;function m(){var Qe=t.line+p;return Qe<e.first||Qe>=e.first+e.size?!1:(t=new Re(Qe,t.ch,t.sticky),f=lt(e,Qe))}function E(Qe){var Ge;if(i=="codepoint"){var ot=f.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(ot)?Ge=null:Ge=new Re(t.line,Math.max(0,Math.min(f.text.length,t.ch+n*(ot>=55296&&ot<56320?2:1))),-n)}else r?Ge=Pl(e.cm,f,t,n):Ge=Fo(f,t,n);if(Ge==null)if(!Qe&&m())t=Wo(r,e.cm,f,t.line,p);else return!1;else t=Ge;return!0}if(i=="char"||i=="codepoint")E();else if(i=="column")E(!0);else if(i=="word"||i=="group")for(var T=null,X=i=="group",W=e.cm&&e.cm.getHelper(t,"wordChars"),ce=!0;!(n<0&&!E(!ce));ce=!1){var Ee=f.text.charAt(t.ch)||`
`,Ne=je(Ee,W)?"w":X&&Ee==`
`?"n":!X||/\s/.test(Ee)?null:"p";if(X&&!ce&&!Ne&&(Ne="s"),T&&T!=Ne){n<0&&(n=1,E(),t.sticky="after");break}if(Ne&&(T=Ne),n>0&&!E(!ce))break}var ze=to(e,t,s,l,!0);return cn(s,ze)&&(ze.hitSide=!0),ze}function As(e,t,n,i){var r=e.doc,s=t.left,l;if(i=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),p=Math.max(f-.5*$n(e.display),3);l=(n>0?t.bottom:t.top)+n*p}else i=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var m;!(m=bo(e,s,l),!m.outside);){if(n<0?l<=0:l>=r.height){m.hitSide=!0;break}l+=n*5}return m}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;Ls(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function s(f){for(var p=f.target;p;p=p.parentNode){if(p==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(p.className))break}return!1}ue(r,"paste",function(f){if(!s(f)||de(i,f)||ks(f,i))return;$<=11&&setTimeout(li(i,function(){return t.updateFromDOM()}),20)}),ue(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),ue(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),ue(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ue(r,"touchstart",function(){return n.forceCompositionEnd()}),ue(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||de(i,f))return;if(i.somethingSelected())so({lineWise:!1,text:i.getSelections()}),f.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var p=Ts(i);so({lineWise:!0,text:p.text}),f.type=="cut"&&i.operation(function(){i.setSelections(p.ranges,0,Ce),i.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var m=qi.text.join(`
`);if(f.clipboardData.setData("Text",m),f.clipboardData.getData("Text")==m){f.preventDefault();return}}var E=Ms(),T=E.firstChild;i.display.lineSpace.insertBefore(E,i.display.lineSpace.firstChild),T.value=qi.text.join(`
`);var X=document.activeElement;Pe(T),setTimeout(function(){i.display.lineSpace.removeChild(E),X.focus(),X==r&&n.showPrimarySelection()},50)}ue(r,"copy",l),ue(r,"cut",l)},zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},zt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),r=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=lo(t,e.anchorNode,e.anchorOffset),l=lo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&wt(Mn(s,l),i)==0&&wt(dn(s,l),r)==0)return;var f=t.display.view,p=i.line>=t.display.viewFrom&&Os(t,i)||{node:f[0].measure.map[2],offset:0},m=r.line<t.display.viewTo&&Os(t,r);if(!m){var E=f[f.length-1].measure,T=E.maps?E.maps[E.maps.length-1]:E.map;m={node:T[T.length-1],offset:T[T.length-2]-T[T.length-3]}}if(!p||!m){e.removeAllRanges();return}var X=e.rangeCount&&e.getRangeAt(0),W;try{W=z(p.node,p.offset,m.offset,m.node)}catch(ce){}W&&(!Q&&t.state.focused?(e.collapse(p.node,p.offset),W.collapsed||(e.removeAllRanges(),e.addRange(W))):(e.removeAllRanges(),e.addRange(W)),X&&e.anchorNode==null?e.addRange(X):Q&&this.startGracePeriod()),this.rememberSelection()},zt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},zt.prototype.showMultipleSelections=function(e){re(this.cm.display.cursorDiv,e.cursors),re(this.cm.display.selectionDiv,e.selection)},zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},zt.prototype.blur=function(){this.div.blur()},zt.prototype.getField=function(){return this.div},zt.prototype.supportsTouch=function(){return!0},zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Oi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(N&&L&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=lo(t,e.anchorNode,e.anchorOffset),i=lo(t,e.focusNode,e.focusOffset);n&&i&&Oi(t,function(){gi(t.doc,wn(n,i),Ce),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},zt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(i.ch==0&&i.line>e.firstLine()&&(i=Re(i.line-1,lt(e.doc,i.line-1).length)),r.ch==lt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Re(r.line+1,0)),i.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;i.line==t.viewFrom||(s=In(e,i.line))==0?(l=Lt(t.view[0].line),f=t.view[0].node):(l=Lt(t.view[s].line),f=t.view[s-1].node.nextSibling);var p=In(e,r.line),m,E;if(p==t.view.length-1?(m=t.viewTo-1,E=t.lineDiv.lastChild):(m=Lt(t.view[p+1].line)-1,E=t.view[p+1].node.previousSibling),!f)return!1;for(var T=e.doc.splitLines(tu(e,f,E,l,m)),X=Di(e.doc,Re(l,0),Re(m,lt(e.doc,m).text.length));T.length>1&&X.length>1;)if(Ie(T)==Ie(X))T.pop(),X.pop(),m--;else if(T[0]==X[0])T.shift(),X.shift(),l++;else break;for(var W=0,ce=0,Ee=T[0],Ne=X[0],ze=Math.min(Ee.length,Ne.length);W<ze&&Ee.charCodeAt(W)==Ne.charCodeAt(W);)++W;for(var Qe=Ie(T),Ge=Ie(X),ot=Math.min(Qe.length-(T.length==1?W:0),Ge.length-(X.length==1?W:0));ce<ot&&Qe.charCodeAt(Qe.length-ce-1)==Ge.charCodeAt(Ge.length-ce-1);)++ce;if(T.length==1&&X.length==1&&l==i.line)for(;W&&W>i.ch&&Qe.charCodeAt(Qe.length-ce-1)==Ge.charCodeAt(Ge.length-ce-1);)W--,ce++;T[T.length-1]=Qe.slice(0,Qe.length-ce).replace(/^\u200b+/,""),T[0]=T[0].slice(W).replace(/\u200b+$/,"");var xt=Re(l,W),pt=Re(m,X.length?Ie(X).length-ce:0);if(T.length>1||T[0]||wt(xt,pt))return nr(e.doc,T,xt,pt,"+input"),!0},zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},zt.prototype.reset=function(){this.forceCompositionEnd()},zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zt.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)},zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Oi(this.cm,function(){return Ei(e.cm)})},zt.prototype.setUneditable=function(e){e.contentEditable="false"},zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||li(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zt.prototype.onContextMenu=function(){},zt.prototype.resetPosition=function(){},zt.prototype.needsContentAttribute=!0;function Os(e,t){var n=mo(e,t.line);if(!n||n.hidden)return null;var i=lt(e.doc,t.line),r=na(n,i,t.line),s=ut(i,e.doc.direction),l="left";if(s){var f=et(s,t.ch);l=f%2?"right":"left"}var p=aa(r.map,t.ch,l);return p.offset=p.collapse=="right"?p.end:p.start,p}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,i,r){var s="",l=!1,f=e.doc.lineSeparator(),p=!1;function m(W){return function(ce){return ce.id==W}}function E(){l&&(s+=f,p&&(s+=f),l=p=!1)}function T(W){W&&(E(),s+=W)}function X(W){if(W.nodeType==1){var ce=W.getAttribute("cm-text");if(ce){T(ce);return}var Ee=W.getAttribute("cm-marker"),Ne;if(Ee){var ze=e.findMarks(Re(i,0),Re(r+1,0),m(+Ee));ze.length&&(Ne=ze[0].find(0))&&T(Di(e.doc,Ne.from,Ne.to).join(f));return}if(W.getAttribute("contenteditable")=="false")return;var Qe=/^(pre|div|p|li|table|br)$/i.test(W.nodeName);if(!/^br$/i.test(W.nodeName)&&W.textContent.length==0)return;Qe&&E();for(var Ge=0;Ge<W.childNodes.length;Ge++)X(W.childNodes[Ge]);/^(pre|p)$/i.test(W.nodeName)&&(p=!0),Qe&&(l=!0)}else W.nodeType==3&&T(W.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(X(t),t==n);)t=t.nextSibling,p=!1;return s}function lo(e,t,n){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[n],!i)return lr(e.clipPos(Re(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==i)return iu(s,t,n)}}function iu(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!_(i,t))return lr(Re(Lt(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var s=e.rest?Ie(e.rest):e.line;return lr(Re(Lt(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,n&&(n=l.nodeValue.length));f.parentNode!=i;)f=f.parentNode;var p=e.measure,m=p.maps;function E(Ne,ze,Qe){for(var Ge=-1;Ge<(m?m.length:0);Ge++)for(var ot=Ge<0?p.map:m[Ge],xt=0;xt<ot.length;xt+=3){var pt=ot[xt+2];if(pt==Ne||pt==ze){var _t=Lt(Ge<0?e.line:e.rest[Ge]),Xt=ot[xt]+Qe;return(Qe<0||pt!=Ne)&&(Xt=ot[xt+(Qe?1:0)]),Re(_t,Xt)}}}var T=E(l,f,n);if(T)return lr(T,r);for(var X=f.nextSibling,W=l?l.nodeValue.length-n:0;X;X=X.nextSibling){if(T=E(X,X.firstChild,0),T)return lr(Re(T.line,T.ch-W),r);W+=X.textContent.length}for(var ce=f.previousSibling,Ee=n;ce;ce=ce.previousSibling){if(T=E(ce,ce.firstChild,-1),T)return lr(Re(T.line,T.ch+Ee),r);Ee+=ce.textContent.length}}var qt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new xe,this.hasSelection=!1,this.composing=null};qt.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),F&&(r.style.width="0px"),ue(r,"input",function(){D&&$>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ue(r,"paste",function(l){if(de(i,l)||ks(l,i))return;i.state.pasteIncoming=+new Date,n.fastPoll()});function s(l){if(de(i,l))return;if(i.somethingSelected())so({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var f=Ts(i);so({lineWise:!0,text:f.text}),l.type=="cut"?i.setSelections(f.ranges,null,Ce):(n.prevInput="",r.value=f.text.join(`
`),Pe(r))}else return;l.type=="cut"&&(i.state.cutIncoming=+new Date)}ue(r,"cut",s),ue(r,"copy",s),ue(e.scroller,"paste",function(l){if(pn(e,l)||de(i,l))return;if(!r.dispatchEvent){i.state.pasteIncoming=+new Date,n.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),ue(e.lineSpace,"selectstart",function(l){pn(e,l)||v(l)}),ue(r,"compositionstart",function(){var l=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:i.markText(l,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ue(r,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},qt.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},qt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=va(e);if(e.options.moveInputWithCursor){var r=Ji(e,n.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return i},qt.prototype.showSelection=function(e){var t=this.cm,n=t.display;re(n.cursorDiv,e.cursors),re(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Pe(this.textarea),D&&$>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",D&&$>=9&&(this.hasSelection=null))},qt.prototype.getField=function(){return this.textarea},qt.prototype.supportsTouch=function(){return!1},qt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!te||ie()!=this.textarea))try{this.textarea.focus()}catch(e){}},qt.prototype.blur=function(){this.textarea.blur()},qt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qt.prototype.receivedFocus=function(){this.slowPoll()},qt.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},qt.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(D&&$>=9&&this.hasSelection===r||Z&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!i&&(i="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,f=Math.min(i.length,r.length);l<f&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Oi(t,function(){Xo(t,r.slice(l),i.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qt.prototype.onKeyPress=function(){D&&$>=9&&(this.hasSelection=null),this.fastPoll()},qt.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Nn(n,e),l=i.scroller.scrollTop;if(!s||P)return;var f=n.options.resetSelectionOnContextMenu;f&&n.doc.sel.contains(s)==-1&&li(n,gi)(n.doc,wn(s),Ce);var p=r.style.cssText,m=t.wrapper.style.cssText,E=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-E.top-5)+"px; left: "+(e.clientX-E.left-5)+`px;
z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var T;K&&(T=window.scrollY),i.input.focus(),K&&window.scrollTo(null,T),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=W,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll);function X(){if(r.selectionStart!=null){var Ee=n.somethingSelected(),Ne="\u200B"+(Ee?r.value:"");r.value="\u21DA",r.value=Ne,t.prevInput=Ee?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ne.length,i.selForContextMenu=n.doc.sel}}function W(){if(t.contextMenuPending!=W)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=m,r.style.cssText=p,D&&$<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=l),r.selectionStart!=null){(!D||D&&$<9)&&X();var Ee=0,Ne=function(){i.selForContextMenu==n.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?li(n,$a)(n):Ee++<10?i.detectingSelectAll=setTimeout(Ne,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Ne,200)}}if(D&&$>=9&&X(),Oe){S(e);var ce=function(){tt(window,"mouseup",ce),setTimeout(W,20)};ue(window,"mouseup",ce)}else setTimeout(W,50)},qt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qt.prototype.setUneditable=function(){},qt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?g(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=ie();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function i(){e.value=f.getValue()}var r;if(e.form&&(ue(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){i(),s.submit=r,s.submit(),s.submit=l}}catch(p){}}t.finishInit=function(p){p.save=i,p.getTextArea=function(){return e},p.toTextArea=function(){p.toTextArea=isNaN,i(),e.parentNode.removeChild(p.getWrapperElement()),e.style.display="",e.form&&(tt(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=Yt(function(p){return e.parentNode.insertBefore(p,e.nextSibling)},t);return f}function ru(e){e.off=tt,e.on=ue,e.wheelEventPixels=cl,e.Doc=ki,e.splitLines=Et,e.countColumn=V,e.findColumn=_e,e.isWordChar=De,e.Pass=$e,e.signal=ae,e.Line=Rn,e.changeEnd=Sn,e.scrollbarModel=ka,e.Pos=Re,e.cmpPos=wt,e.modes=Wt,e.mimeModes=Tt,e.resolveMode=vt,e.getMode=Xi,e.modeExtensions=ri,e.extendMode=di,e.copyState=Hi,e.startState=ln,e.innerMode=sn,e.commands=Pr,e.keyMap=mn,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=Dl,e.StringStream=Dt,e.SharedTextMarker=Or,e.TextMarker=kn,e.LineWidget=Ar,e.e_preventDefault=v,e.e_stopPropagation=y,e.e_stop=S,e.addClass=me,e.contains=_,e.rmClass=se,e.keyNames=_n}$l(Yt),ql(Yt);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in ki.prototype)ki.prototype.hasOwnProperty(uo)&&ve(ou,uo)<0&&(Yt.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ki.prototype[uo]));return A(ki),Yt.inputStyles={textarea:qt,contenteditable:zt},Yt.defineMode=function(e){!Yt.defaults.mode&&e!="null"&&(Yt.defaults.mode=e),Wi.apply(this,arguments)},Yt.defineMIME=an,Yt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yt.defineMIME("text/plain","null"),Yt.defineExtension=function(e,t){Yt.prototype[e]=t},Yt.defineDocExtension=function(e,t){ki.prototype[e]=t},Yt.fromTextArea=nu,ru(Yt),Yt.version="5.58.2",Yt})},Y1PL:function(bt,Xe,b){"use strict";b.r(Xe),b.d(Xe,"ResizableTextArea",function(){return ve});var j=b("wx14"),Ae=b("1OyB"),Q=b("vuIU"),ge=b("Ji7U"),he=b("LK+K"),fe=b("q1tI"),D=b("VTBJ"),$=b("rePB"),K=b("Zm9Q"),le=b("Kwbf"),L=b("c+Xe"),P=b("m+aA"),ee=b("bdgK"),U=new Map;function B(Ce){Ce.forEach(function(Te){var we,_e=Te.target;(we=U.get(_e))===null||we===void 0||we.forEach(function(G){return G(_e)})})}var F=new ee.default(B),N=null,te=null;function Z(Ce,Te){U.has(Ce)||(U.set(Ce,new Set),F.observe(Ce)),U.get(Ce).add(Te)}function Le(Ce,Te){U.has(Ce)&&(U.get(Ce).delete(Te),U.get(Ce).size||(F.unobserve(Ce),U.delete(Ce)))}var Ue=function(Ce){Object(ge.a)(we,Ce);var Te=Object(he.a)(we);function we(){return Object(Ae.a)(this,we),Te.apply(this,arguments)}return Object(Q.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(fe.Component),oe=fe.createContext(null);function ne(Ce){var Te=Ce.children,we=Ce.onBatchResize,_e=fe.useRef(0),G=fe.useRef([]),O=fe.useContext(oe),Ie=fe.useCallback(function(qe,dt,We){_e.current+=1;var Ke=_e.current;G.current.push({size:qe,element:dt,data:We}),Promise.resolve().then(function(){Ke===_e.current&&(we==null||we(G.current),G.current=[])}),O==null||O(qe,dt,We)},[we,O]);return fe.createElement(oe.Provider,{value:Ie},Te)}function Oe(Ce){var Te=Ce.children,we=Ce.disabled,_e=fe.useRef(null),G=fe.useRef(null),O=fe.useContext(oe),Ie=fe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),qe=fe.isValidElement(Te)&&Object(L.c)(Te),dt=qe?Te.ref:null,We=fe.useMemo(function(){return Object(L.a)(dt,_e)},[dt,_e]),Ke=fe.useRef(Ce);Ke.current=Ce;var pe=fe.useCallback(function(De){var je=Ke.current,Ze=je.onResize,He=je.data,Me=De.getBoundingClientRect(),Be=Me.width,ft=Me.height,it=De.offsetWidth,Je=De.offsetHeight,et=Math.floor(Be),gt=Math.floor(ft);if(Ie.current.width!==et||Ie.current.height!==gt||Ie.current.offsetWidth!==it||Ie.current.offsetHeight!==Je){var ut={width:et,height:gt,offsetWidth:it,offsetHeight:Je};Ie.current=ut;var nt=it===Math.round(Be)?Be:it,ue=Je===Math.round(ft)?ft:Je,mt=Object(D.a)(Object(D.a)({},ut),{},{offsetWidth:nt,offsetHeight:ue});O==null||O(mt,De,He),Ze&&Promise.resolve().then(function(){Ze(mt,De)})}},[]);return fe.useEffect(function(){var De=Object(P.a)(_e.current)||Object(P.a)(G.current);return De&&!we&&Z(De,pe),function(){return Le(De,pe)}},[_e.current,we]),fe.createElement(Ue,{ref:G},qe?fe.cloneElement(Te,{ref:We}):Te)}var H="rc-observer-key";function se(Ce){var Te=Ce.children,we=Object(K.a)(Te);return we.map(function(_e,G){var O=(_e==null?void 0:_e.key)||"".concat(H,"-").concat(G);return fe.createElement(Oe,Object(j.a)({},Ce,{key:O}),_e)})}se.Collection=ne;var ke=se,re=b("bT9E"),w=b("TSYQ"),q=b.n(w),z=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],ie={},me;function J(Ce){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(Te&&ie[we])return ie[we];var _e=window.getComputedStyle(Ce),G=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),O=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),Ie=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),qe=_.map(function(We){return"".concat(We,":").concat(_e.getPropertyValue(We))}).join(";"),dt={sizingStyle:qe,paddingSize:O,borderSize:Ie,boxSizing:G};return Te&&we&&(ie[we]=dt),dt}function Pe(Ce){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;me||(me=document.createElement("textarea"),me.setAttribute("tab-index","-1"),me.setAttribute("aria-hidden","true"),document.body.appendChild(me)),Ce.getAttribute("wrap")?me.setAttribute("wrap",Ce.getAttribute("wrap")):me.removeAttribute("wrap");var G=J(Ce,Te),O=G.paddingSize,Ie=G.borderSize,qe=G.boxSizing,dt=G.sizingStyle;me.setAttribute("style","".concat(dt,";").concat(z)),me.value=Ce.value||Ce.placeholder||"";var We=Number.MIN_SAFE_INTEGER,Ke=Number.MAX_SAFE_INTEGER,pe=me.scrollHeight,De;if(qe==="border-box"?pe+=Ie:qe==="content-box"&&(pe-=O),we!==null||_e!==null){me.value=" ";var je=me.scrollHeight-O;we!==null&&(We=je*we,qe==="border-box"&&(We=We+O+Ie),pe=Math.max(We,pe)),_e!==null&&(Ke=je*_e,qe==="border-box"&&(Ke=Ke+O+Ie),De=pe>Ke?"":"hidden",pe=Math.min(Ke,pe))}return{height:pe,minHeight:We,maxHeight:Ke,overflowY:De,resize:"none"}}var C=b("Gytx"),g=b.n(C),V;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(V||(V={}));var xe=function(Ce){Object(ge.a)(we,Ce);var Te=Object(he.a)(we);function we(_e){var G;return Object(Ae.a)(this,we),G=Te.call(this,_e),G.nextFrameActionId=void 0,G.resizeFrameId=void 0,G.textArea=void 0,G.saveTextArea=function(O){G.textArea=O},G.handleResize=function(O){var Ie=G.state.resizeStatus,qe=G.props,dt=qe.autoSize,We=qe.onResize;if(Ie!==V.NONE)return;typeof We=="function"&&We(O),dt&&G.resizeOnNextFrame()},G.resizeOnNextFrame=function(){cancelAnimationFrame(G.nextFrameActionId),G.nextFrameActionId=requestAnimationFrame(G.resizeTextarea)},G.resizeTextarea=function(){var O=G.props.autoSize;if(!O||!G.textArea)return;var Ie=O.minRows,qe=O.maxRows,dt=Pe(G.textArea,!1,Ie,qe);G.setState({textareaStyles:dt,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(G.resizeFrameId),G.resizeFrameId=requestAnimationFrame(function(){G.setState({resizeStatus:V.RESIZED},function(){G.resizeFrameId=requestAnimationFrame(function(){G.setState({resizeStatus:V.NONE}),G.fixFirefoxAutoScroll()})})})})},G.renderTextArea=function(){var O=G.props,Ie=O.prefixCls,qe=Ie===void 0?"rc-textarea":Ie,dt=O.autoSize,We=O.onResize,Ke=O.className,pe=O.disabled,De=G.state,je=De.textareaStyles,Ze=De.resizeStatus,He=Object(re.a)(G.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Me=q()(qe,Ke,Object($.a)({},"".concat(qe,"-disabled"),pe));"value"in He&&(He.value=He.value||"");var Be=Object(D.a)(Object(D.a)(Object(D.a)({},G.props.style),je),Ze===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return fe.createElement(ke,{onResize:G.handleResize,disabled:!(dt||We)},fe.createElement("textarea",Object(j.a)({},He,{className:Me,style:Be,ref:G.saveTextArea})))},G.state={textareaStyles:{},resizeStatus:V.NONE},G}return Object(Q.a)(we,[{key:"componentDidUpdate",value:function(G){(G.value!==this.props.value||!g()(G.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 G=this.textArea.selectionStart,O=this.textArea.selectionEnd;this.textArea.setSelectionRange(G,O)}}catch(Ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(fe.Component),ve=xe,Ye=function(Ce){Object(ge.a)(we,Ce);var Te=Object(he.a)(we);function we(_e){var G;Object(Ae.a)(this,we),G=Te.call(this,_e),G.resizableTextArea=void 0,G.focus=function(){G.resizableTextArea.textArea.focus()},G.saveTextArea=function(Ie){G.resizableTextArea=Ie},G.handleChange=function(Ie){var qe=G.props.onChange;G.setValue(Ie.target.value,function(){G.resizableTextArea.resizeTextarea()}),qe&&qe(Ie)},G.handleKeyDown=function(Ie){var qe=G.props,dt=qe.onPressEnter,We=qe.onKeyDown;Ie.keyCode===13&&dt&&dt(Ie),We&&We(Ie)};var O=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return G.state={value:O},G}return Object(Q.a)(we,[{key:"setValue",value:function(G,O){"value"in this.props||this.setState({value:G},O)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return fe.createElement(ve,Object(j.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(G){return"value"in G?{value:G.value}:null}}]),we}(fe.Component),$e=Xe.default=Ye},ZW9T:function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return Ue});var j=b("k1fw"),Ae=b("miYZ"),Q=b("tsqr"),ge=b("rAM+"),he=b("tJVT"),fe=b("PpiC"),D=b("q1tI"),$=b.n(D),K=b("bdgK");function le(oe,ne,Oe,H,se){var ke=ne.getWordUntilPosition(Oe),re={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},w=H.map(function(q){return{label:q,kind:oe.languages.CompletionItemKind.Keyword,insertText:q,insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:re}});return se.map(function(q){w.push(Object(j.a)(Object(j.a)({},q),{},{range:re}))}),w}var L=function(oe){var ne={label:"ifelse",kind:oe.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet},Oe=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];oe.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(re,w){var q=le(oe,re,w,Oe,[ne]);return{suggestions:q}}});var H=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];oe.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(re,w){var q=[{label:"print",kind:oe.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],z=le(oe,re,w,H,q);return{suggestions:z}}});var se=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];oe.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(re,w){var q=[ne,{label:"main",kind:oe.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:oe.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:oe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],z=le(oe,re,w,se,q);return{suggestions:z}}})},P="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ee=b("LvDl");function U(oe){return/^\d+$/.test(oe)?"".concat(oe,"px"):oe}function B(){}var F=!1,N={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function te(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ne=oe;if(Array.isArray(oe)){for(var Oe=0;Oe<oe.length;Oe++){var H=N[oe[Oe]];if(H)return H}return ne[0]}return N[ne]||ne}var Z=null,Le=Xe.b=function(oe){var ne=oe.width,Oe=ne===void 0?"100%":ne,H=oe.height,se=H===void 0?"100%":H,ke=oe.value,re=oe.language,w=re===void 0?"javascript":re,q=oe.style,z=q===void 0?{}:q,_=oe.options,ie=_===void 0?{}:_,me=oe.overrideServices,J=me===void 0?{}:me,Pe=oe.theme,C=Pe===void 0?"vs-dark":Pe,g=oe.onEditBlur,V=oe.onSave,xe=oe.autoHeight,ve=xe===void 0?!1:xe,Ye=oe.forbidCopy,$e=Ye===void 0?!1:Ye,Ce=oe.onChange,Te=Ce===void 0?B:Ce,we=oe.editorDidMount,_e=we===void 0?B:we,G=oe.onFocus,O=G===void 0?B:G,Ie=oe.filename,qe=Ie===void 0?"educoder.txt":Ie,dt=Object(fe.a)(oe,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),We=Object(D.useRef)(),Ke=Object(D.useRef)({}),pe=Object(D.useRef)(),De=Object(D.useRef)(!1),je=Object(D.useRef)(),Ze=Object(D.useState)(!1),He=Object(he.a)(Ze,2),Me=He[0],Be=He[1];function ft(){var x;return We.current&&(x=new K.default(function(S){var Y=Object(ge.a)(S),I;try{for(Y.s();!(I=Y.n()).done;){var ye=I.value;(ye.target.offsetHeight>0||ye.target.offsetWidth>0)&&Ke.current.instance.layout()}}catch(Ve){Y.e(Ve)}finally{Y.f()}}),x.observe(We.current)),x}function it(){Q.b.warn(decodeURIComponent(P))}var Je=function(){var S=Ke.current.instance;if(ke!=null&&S&&Me){var Y=S.getModel();Y&&ke!==Y.getValue()&&(F=!0,Y.setValue(ke),S.layout(),F=!1)}};Object(D.useEffect)(function(){pe.current&&clearTimeout(pe.current),pe.current=setTimeout(function(){Je()},500)},[ke,Me,Ke.current]);function et(){var x=Ke.current.instance;if(x){var S=x.getSelection(),Y=Ke.current.pastePos||{},I=new Z.Range(Y.startLineNumber||S.endLineNumber,Y.startColumn||S.endColumn,Y.endLineNumber||S.endLineNumber,Y.endColumn||S.endColumn);setTimeout(function(){x.executeEdits("",[{range:I,text:""}])},300)}}function gt(x){(window.navigator.platform.match("Mac")?x.metaKey:x.ctrlKey)&&x.keyCode==83&&(x.preventDefault(),V())}var ut=function(){if(ve&&Ke.current.instance){var S=Ke.current.instance.getContentHeight();v(S<se?se:S)}else v(se)};function nt(x){var S=document.createEvent("MouseEvents");S.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),x.dispatchEvent(S)}function ue(x,S){var Y=window.URL||window.webkitURL||window,I=new Blob([S]),ye=document.createElementNS("http://www.w3.org/1999/xhtml","a");ye.href=Y.createObjectURL(I),ye.download=x,nt(ye)}Object(D.useEffect)(function(){ut()},[ut]),Object(D.useEffect)(function(){We.current&&!Me&&b.e(27).then(b.t.bind(null,"M/lh",7)).then(function(x){try{Z=x,Ke.current.instance=Z.editor.create(We.current,{value:ke,language:te(w),theme:C,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},J);var S=Ke.current.instance;if(_e(S,Z),setTimeout(function(){ut(),Ke.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ue(qe||"educoder.txt",S.getValue())}})},500),Ke.current.subscription=S.onDidChangeModelContent(function(I){De.current?clearTimeout(je.current):(ut(),Te(S.getValue(),I)),je.current=setTimeout(function(){De.current=!1},500)}),window.Monaco||L(Z),$e&&(S.addCommand(Z.KeyMod.CtrlCmd|Z.KeyMod.Shift|Z.KeyCode.KEY_V,function(){return it(),null}),S.addCommand(Z.KeyMod.CtrlCmd|Z.KeyCode.KEY_C,function(){return it(),null})),window.Monaco=Z,g&&S.onDidBlurEditorWidget(function(){g(S.getValue())}),O&&S.onDidFocusEditorText(function(){O(S.getValue())}),$e){S.addCommand(Z.KeyMod.CtrlCmd|Z.KeyCode.KEY_V,function(){return it(),null}),S.onDidPaste(function(I){Ke.current.pastePos=I});try{window.addEventListener("paste",et)}catch(I){}}var Y=ft();return Be(!0),function(){var I=Ke.current.instance;I.dispose();var ye=I.getModel();ye&&ye.dispose(),Ke.current.subscription&&Ke.current.subscription.dispose(),$e&&window.removeEventListener("paste",et),Y.unobserve(We.current)}}catch(I){}})},[]),Object(D.useEffect)(function(){var x=Ke.current.instance;if(x&&Me)return document.addEventListener("keydown",gt,!1),function(){document.removeEventListener("keydown",gt)}},[V,Me]),Object(D.useEffect)(function(){var x=Ke.current.instance;if(x&&Me){var S=te(w);Z.editor.setModelLanguage(x.getModel(),S),console.log("language:",w,x.getModel(),S)}},[w,Me]),Object(D.useEffect)(function(){var x=Ke.current.instance;x&&Me&&Z.editor.setTheme(C)},[C,Me]),Object(D.useEffect)(function(){var x=Ke.current.instance;x&&Me&&(x.updateOptions(Object(j.a)({},ie)),setTimeout(function(){x.getModel().updateOptions(Object(j.a)({},ie))},200))},[JSON.stringify(ie),Me]),Object(D.useEffect)(function(){var x=Ke.current.instance;x&&Me&&x.layout()},[Oe,se,Me]);var mt=Object(D.useState)(U(Oe)),tt=Object(he.a)(mt,2),ae=tt[0],de=tt[1],R=Object(D.useState)(U(se)),k=Object(he.a)(R,2),A=k[0],v=k[1],y=Object(j.a)(Object(j.a)({},z),{},{width:ae,height:A});return $.a.createElement("div",{className:"my-monaco-editor",ref:We,style:y})};function Ue(oe){var ne=oe.width,Oe=ne===void 0?"100%":ne,H=oe.height,se=H===void 0?"100%":H,ke=oe.original,re=oe.modified,w=oe.language,q=oe.options,z=q===void 0?{}:q,_=Object(D.useRef)(),ie=Object(D.useState)(null),me=Object(he.a)(ie,2),J=me[0],Pe=me[1];function C(ve){var Ye;return _.current&&(Ye=new K.default(function($e){var Ce=Object(ge.a)($e),Te;try{for(Ce.s();!(Te=Ce.n()).done;){var we=Te.value;(we.target.offsetHeight>0||we.target.offsetWidth>0)&&ve.layout()}}catch(_e){Ce.e(_e)}finally{Ce.f()}}),Ye.observe(_.current)),Ye}Object(D.useEffect)(function(){_.current&&b.e(27).then(b.t.bind(null,"M/lh",7)).then(function(ve){Z=ve;var Ye=Z.editor.createDiffEditor(_.current,Object(j.a)(Object(j.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},z),{},{wordWrap:!0}));Pe(Ye);var $e=C(Ye);return function(){Ye.dispose();var Ce=Ye.getModel();Ce&&Ce.dispose(),$e.unobserve(_.current)}})},[]),Object(D.useEffect)(function(){J&&J.setModel({original:Z.editor.createModel(ke,w),modified:Z.editor.createModel(re,w)})},[ke,re,w,J]);var g=U(Oe),V=U(se),xe={width:g,height:V};return $.a.createElement("div",{className:"my-diff-editor",ref:_,style:xe})}},ZpRC:function(bt,Xe,b){"use strict";function j(L){return typeof L=="object"&&L!=null&&L.nodeType===1}function Ae(L,P){return(!P||L!=="hidden")&&L!=="visible"&&L!=="clip"}function Q(L,P){if(L.clientHeight<L.scrollHeight||L.clientWidth<L.scrollWidth){var ee=getComputedStyle(L,null);return Ae(ee.overflowY,P)||Ae(ee.overflowX,P)||function(U){var B=function(F){if(!F.ownerDocument||!F.ownerDocument.defaultView)return null;try{return F.ownerDocument.defaultView.frameElement}catch(N){return null}}(U);return!!B&&(B.clientHeight<U.scrollHeight||B.clientWidth<U.scrollWidth)}(L)}return!1}function ge(L,P,ee,U,B,F,N,te){return F<L&&N>P||F>L&&N<P?0:F<=L&&te<=ee||N>=P&&te>=ee?F-L-U:N>P&&te<ee||F<L&&te>ee?N-P+B:0}var he=function(L,P){var ee=window,U=P.scrollMode,B=P.block,F=P.inline,N=P.boundary,te=P.skipOverflowHiddenElements,Z=typeof N=="function"?N:function(je){return je!==N};if(!j(L))throw new TypeError("Invalid target");for(var Le=document.scrollingElement||document.documentElement,Ue=[],oe=L;j(oe)&&Z(oe);){if((oe=oe.parentElement)===Le){Ue.push(oe);break}oe!=null&&oe===document.body&&Q(oe)&&!Q(document.documentElement)||oe!=null&&Q(oe,te)&&Ue.push(oe)}for(var ne=ee.visualViewport?ee.visualViewport.width:innerWidth,Oe=ee.visualViewport?ee.visualViewport.height:innerHeight,H=window.scrollX||pageXOffset,se=window.scrollY||pageYOffset,ke=L.getBoundingClientRect(),re=ke.height,w=ke.width,q=ke.top,z=ke.right,_=ke.bottom,ie=ke.left,me=B==="start"||B==="nearest"?q:B==="end"?_:q+re/2,J=F==="center"?ie+w/2:F==="end"?z:ie,Pe=[],C=0;C<Ue.length;C++){var g=Ue[C],V=g.getBoundingClientRect(),xe=V.height,ve=V.width,Ye=V.top,$e=V.right,Ce=V.bottom,Te=V.left;if(U==="if-needed"&&q>=0&&ie>=0&&_<=Oe&&z<=ne&&q>=Ye&&_<=Ce&&ie>=Te&&z<=$e)return Pe;var we=getComputedStyle(g),_e=parseInt(we.borderLeftWidth,10),G=parseInt(we.borderTopWidth,10),O=parseInt(we.borderRightWidth,10),Ie=parseInt(we.borderBottomWidth,10),qe=0,dt=0,We="offsetWidth"in g?g.offsetWidth-g.clientWidth-_e-O:0,Ke="offsetHeight"in g?g.offsetHeight-g.clientHeight-G-Ie:0;if(Le===g)qe=B==="start"?me:B==="end"?me-Oe:B==="nearest"?ge(se,se+Oe,Oe,G,Ie,se+me,se+me+re,re):me-Oe/2,dt=F==="start"?J:F==="center"?J-ne/2:F==="end"?J-ne:ge(H,H+ne,ne,_e,O,H+J,H+J+w,w),qe=Math.max(0,qe+se),dt=Math.max(0,dt+H);else{qe=B==="start"?me-Ye-G:B==="end"?me-Ce+Ie+Ke:B==="nearest"?ge(Ye,Ce,xe,G,Ie+Ke,me,me+re,re):me-(Ye+xe/2)+Ke/2,dt=F==="start"?J-Te-_e:F==="center"?J-(Te+ve/2)+We/2:F==="end"?J-$e+O+We:ge(Te,$e,ve,_e,O+We,J,J+w,w);var pe=g.scrollLeft,De=g.scrollTop;me+=De-(qe=Math.max(0,Math.min(De+qe,g.scrollHeight-xe+Ke))),J+=pe-(dt=Math.max(0,Math.min(pe+dt,g.scrollWidth-ve+We)))}Pe.push({el:g,top:qe,left:dt})}return Pe};function fe(L){return L===Object(L)&&Object.keys(L).length!==0}function D(L,P){P===void 0&&(P="auto");var ee="scrollBehavior"in document.body.style;L.forEach(function(U){var B=U.el,F=U.top,N=U.left;B.scroll&&ee?B.scroll({top:F,left:N,behavior:P}):(B.scrollTop=F,B.scrollLeft=N)})}function $(L){return L===!1?{block:"end",inline:"nearest"}:fe(L)?L:{block:"start",inline:"nearest"}}function K(L,P){var ee=!L.ownerDocument.documentElement.contains(L);if(fe(P)&&typeof P.behavior=="function")return P.behavior(ee?[]:he(L,P));if(ee)return;var U=$(P);return D(he(L,U),U.behavior)}var le=Xe.a=K},bNIU:function(bt,Xe,b){bt.exports={flex_box_center:"flex_box_center___4ZFPv",flex_space_between:"flex_space_between___1poVp",flex_box_vertical_center:"flex_box_vertical_center___2vHuy",flex_box_center_end:"flex_box_center_end___3AGfr",flex_box_column:"flex_box_column___9QgjS",bg:"bg___2D1BG",flexRow:"flexRow___3qWci",flexJustifyCenter:"flexJustifyCenter___ONt7G",flexAlignEnd:"flexAlignEnd___XXRbD",flexAlingCenter:"flexAlingCenter___3bK98",flexAlignCenter:"flexAlignCenter___2Ct2A",flexColumn:"flexColumn___JTR6P",formWrap:"formWrap___3QUHG",titleWrap:"titleWrap___1MIxp",fieldWrap:"fieldWrap___YXlbk",mdWrap:"mdWrap___ZlPmu",backgroundFa:"backgroundFa___2s4Lu",button:"button___KQ_S9",icons:"icons___zqUcb",navBar:"navBar___3taGH",active:"active____5MwL",tipWrap:"tipWrap___2wfhG",tip:"tip___3fuVl",width300:"width300___1tL-J",popover:"popover___2mWr7",groupWrap:"groupWrap___2zY7s",check:"check___3Eies"}},bT9E:function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return Ae});var j=b("VTBJ");function Ae(Q,ge){var he=Object(j.a)({},Q);return Array.isArray(ge)&&ge.forEach(function(fe){delete he[fe]}),he}},c5Ni:function(bt,Xe,b){},dejd:function(bt,Xe,b){},dmUQ:function(bt,Xe,b){"use strict";var j=b("Ff2n"),Ae=b("rePB"),Q=b("1OyB"),ge=b("vuIU"),he=b("Ji7U"),fe=b("md7G"),D=b("foSv"),$=b("q1tI"),K=b.n($),le=b("TSYQ"),L=b.n(le),P=b("4IlW");function ee(re,w){var q=Object.keys(re);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(re);w&&(z=z.filter(function(_){return Object.getOwnPropertyDescriptor(re,_).enumerable})),q.push.apply(q,z)}return q}function U(re){for(var w=1;w<arguments.length;w++){var q=arguments[w]!=null?arguments[w]:{};w%2?ee(Object(q),!0).forEach(function(z){Object(Ae.a)(re,z,q[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(re,Object.getOwnPropertyDescriptors(q)):ee(Object(q)).forEach(function(z){Object.defineProperty(re,z,Object.getOwnPropertyDescriptor(q,z))})}return re}function B(re){var w=F();return function(){var z=Object(D.a)(re),_;if(w){var ie=Object(D.a)(this).constructor;_=Reflect.construct(z,arguments,ie)}else _=z.apply(this,arguments);return Object(fe.a)(this,_)}}function F(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(re){return!1}}function N(){}function te(re){re.preventDefault()}var Z=function(w){return w.replace(/[^\w.-]+/g,"")},Le=200,Ue=600,oe=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ne=function(w){return w!=null},Oe=function(w,q){return q===w||typeof q=="number"&&typeof w=="number"&&isNaN(q)&&isNaN(w)},H=function(re){Object(he.a)(q,re);var w=B(q);function q(z){var _;Object(Q.a)(this,q),_=w.call(this,z),_.onKeyDown=function(J){var Pe=_.props,C=Pe.onKeyDown,g=Pe.onPressEnter;if(J.keyCode===P.a.UP){var V=_.getRatio(J);_.up(J,V,null),_.stop()}else if(J.keyCode===P.a.DOWN){var xe=_.getRatio(J);_.down(J,xe,null),_.stop()}else J.keyCode===P.a.ENTER&&g&&g(J);if(_.recordCursorPosition(),_.lastKeyCode=J.keyCode,C){for(var ve=arguments.length,Ye=new Array(ve>1?ve-1:0),$e=1;$e<ve;$e++)Ye[$e-1]=arguments[$e];C.apply(void 0,[J].concat(Ye))}},_.onKeyUp=function(J){var Pe=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),Pe){for(var C=arguments.length,g=new Array(C>1?C-1:0),V=1;V<C;V++)g[V-1]=arguments[V];Pe.apply(void 0,[J].concat(g))}},_.onChange=function(J){var Pe=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(J)),_.setState({inputValue:_.rawInput}),Pe(_.toNumber(_.rawInput))},_.onMouseUp=function(){var J=_.props.onMouseUp;_.recordCursorPosition(),J&&J.apply(void 0,arguments)},_.onFocus=function(){var J;_.setState({focused:!0}),(J=_.props).onFocus.apply(J,arguments)},_.onBlur=function(){var J=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var Pe=_.getCurrentValidValue(_.state.inputValue),C=_.setValue(Pe,N);if(J){var g=_.input.value,V=_.getInputDisplayValue({focus:!1,value:C});_.input.value=V&&Number(V),J.apply(void 0,arguments),_.input.value=g}},_.getRatio=function(J){var Pe=1;return J.metaKey||J.ctrlKey?Pe=.1:J.shiftKey&&(Pe=10),Pe},_.getFullNum=function(J){return isNaN(J)?J:/e/i.test(String(J))?Number(J).toFixed(18).replace(/\.?0+$/,""):J},_.getPrecision=function(J){if(ne(_.props.precision))return _.props.precision;var Pe=String(J);if(Pe.indexOf("e-")>=0)return parseInt(Pe.slice(Pe.indexOf("e-")+2),10);var C=0;return Pe.indexOf(".")>=0&&(C=Pe.length-Pe.indexOf(".")-1),C},_.getInputDisplayValue=function(J){var Pe=J||_.state,C=Pe.focused,g=Pe.inputValue,V=Pe.value,xe;C?xe=g:xe=_.toPrecisionAsStep(V),xe==null&&(xe="");var ve=_.formatWrapper(xe);return ne(_.props.decimalSeparator)&&(ve=ve.toString().replace(".",_.props.decimalSeparator)),ve},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(J){}},_.restoreByAfter=function(J){if(J===void 0)return!1;var Pe=_.input.value,C=Pe.lastIndexOf(J);if(C===-1)return!1;var g=_.cursorBefore.length;return _.lastKeyCode===P.a.DELETE&&_.cursorBefore.charAt(g-1)===J[0]?(_.fixCaret(g,g),!0):C+J.length===Pe.length?(_.fixCaret(C,C),!0):!1},_.partRestoreByAfter=function(J){return J===void 0?!1:Array.prototype.some.call(J,function(Pe,C){var g=J.substring(C);return _.restoreByAfter(g)})},_.isNotCompleteNumber=function(J){return isNaN(J)||J===""||J===null||J&&J.toString().indexOf(".")===J.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(J,Pe,C){_.pressingUpOrDown=!0,_.step("down",J,Pe,C)},_.up=function(J,Pe,C){_.pressingUpOrDown=!0,_.step("up",J,Pe,C)},_.saveInput=function(J){_.input=J};var ie=z.value;ie===void 0&&(ie=z.defaultValue),_.state={focused:z.autoFocus};var me=_.getValidValue(_.toNumber(ie));return _.state=U(U({},_.state),{},{inputValue:_.toPrecisionAsStep(me),value:me}),_}return Object(ge.a)(q,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var ie=this.props,me=ie.value,J=ie.onChange,Pe=ie.max,C=ie.min,g=this.state.focused;if(_){if(!Oe(_.value,me)||!Oe(_.max,Pe)||!Oe(_.min,C)){var V=g?me:this.getValidValue(me),xe;this.pressingUpOrDown?xe=V:this.inputting?xe=this.rawInput:xe=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:xe})}var ve="value"in this.props?me:this.state.value;"max"in this.props&&_.max!==Pe&&typeof ve=="number"&&ve>Pe&&J&&J(Pe),"min"in this.props&&_.min!==C&&typeof ve=="number"&&ve<C&&J&&J(C)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ye=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===P.a.BACKSPACE?Ye=this.cursorStart-1:this.lastKeyCode===P.a.DELETE&&(Ye=this.cursorStart):Ye=this.input.value.length,this.fixCaret(Ye,Ye)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case P.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case P.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch($e){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var ie=_;return ie===""?ie="":this.isNotCompleteNumber(parseFloat(ie))?ie=this.state.value:ie=this.getValidValue(ie),this.toNumber(ie)}},{key:"getValueFromEvent",value:function(_){var ie=_.target.value.trim().replace(/。/g,".");return ne(this.props.decimalSeparator)&&(ie=ie.replace(this.props.decimalSeparator,".")),ie}},{key:"getValidValue",value:function(_){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,J=parseFloat(_);return isNaN(J)?_:(J<ie&&(J=ie),J>me&&(J=me),J)}},{key:"setValue",value:function(_,ie){var me=this.props.precision,J=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),Pe=this.state.value,C=Pe===void 0?null:Pe,g=this.state.inputValue,V=g===void 0?null:g,xe=typeof J=="number"?J.toFixed(me):"".concat(J),ve=J!==C||xe!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},ie)):this.setState({value:J,inputValue:this.toPrecisionAsStep(_)},ie),ve&&this.props.onChange(J),J}},{key:"getMaxPrecision",value:function(_){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=this.props,J=me.precision,Pe=me.step;if(ne(J))return J;var C=this.getPrecision(ie),g=this.getPrecision(Pe),V=this.getPrecision(_);return _?Math.max(V,C+g):C+g}},{key:"getPrecisionFactor",value:function(_){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=this.getMaxPrecision(_,ie);return Math.pow(10,me)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var ie=Math.abs(this.getMaxPrecision(_));return isNaN(ie)?_.toString():Number(_).toFixed(ie)}},{key:"toNumber",value:function(_){var ie=this.props.precision,me=this.state.focused,J=_&&_.length>16&&me;return this.isNotCompleteNumber(_)||J?_:ne(ie)?Math.round(_*Math.pow(10,ie))/Math.pow(10,ie):Number(_)}},{key:"upStep",value:function(_,ie){var me=this.props.step,J=this.getPrecisionFactor(_,ie),Pe=Math.abs(this.getMaxPrecision(_,ie)),C=((J*_+J*me*ie)/J).toFixed(Pe);return this.toNumber(C)}},{key:"downStep",value:function(_,ie){var me=this.props.step,J=this.getPrecisionFactor(_,ie),Pe=Math.abs(this.getMaxPrecision(_,ie)),C=((J*_-J*me*ie)/J).toFixed(Pe);return this.toNumber(C)}},{key:"step",value:function(_,ie){var me=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Pe=arguments.length>3?arguments[3]:void 0;this.stop(),ie&&(ie.persist(),ie.preventDefault());var C=this.props;if(C.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var V=this["".concat(_,"Step")](g,J),xe=V>C.max||V<C.min;if(V>C.max?V=C.max:V<C.min&&(V=C.min),this.setValue(V,null),this.setState({focused:!0},function(){me.pressingUpOrDown=!1}),xe)return;this.autoStepTimer=setTimeout(function(){me[_](ie,J,!0)},Pe?Le:Ue)}},{key:"fixCaret",value:function(_,ie){if(_===void 0||ie===void 0||!this.input||!this.input.value)return;try{var me=this.input.selectionStart,J=this.input.selectionEnd;(_!==me||ie!==J)&&this.input.setSelectionRange(_,ie)}catch(Pe){}}},{key:"render",value:function(){var _,ie=this.props,me=ie.prefixCls,J=ie.disabled,Pe=ie.readOnly,C=ie.useTouch,g=ie.autoComplete,V=ie.upHandler,xe=ie.downHandler,ve=ie.className,Ye=ie.max,$e=ie.min,Ce=ie.style,Te=ie.title,we=ie.onMouseEnter,_e=ie.onMouseLeave,G=ie.onMouseOver,O=ie.onMouseOut,Ie=ie.required,qe=ie.onClick,dt=ie.tabIndex,We=ie.type,Ke=ie.placeholder,pe=ie.id,De=ie.inputMode,je=ie.pattern,Ze=ie.step,He=ie.maxLength,Me=ie.autoFocus,Be=ie.name,ft=ie.onPaste,it=ie.onInput,Je=Object(j.a)(ie,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),et=this.state,gt=et.value,ut=et.focused,nt=L()(me,(_={},Object(Ae.a)(_,ve,!!ve),Object(Ae.a)(_,"".concat(me,"-disabled"),J),Object(Ae.a)(_,"".concat(me,"-focused"),ut),_)),ue={};Object.keys(Je).forEach(function(S){(S.substr(0,5)==="data-"||S.substr(0,5)==="aria-"||S==="role")&&(ue[S]=Je[S])});var mt=!Pe&&!J,tt=this.getInputDisplayValue(null),ae=(gt||gt===0)&&(isNaN(gt)||Number(gt)>=Ye),de=(gt||gt===0)&&(isNaN(gt)||Number(gt)<=$e),R=ae||J||Pe,k=de||J||Pe,A=L()("".concat(me,"-handler"),"".concat(me,"-handler-up"),Object(Ae.a)({},"".concat(me,"-handler-up-disabled"),R)),v=L()("".concat(me,"-handler"),"".concat(me,"-handler-down"),Object(Ae.a)({},"".concat(me,"-handler-down-disabled"),k)),y=C?{onTouchStart:R?N:this.up,onTouchEnd:this.stop}:{onMouseDown:R?N:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},x=C?{onTouchStart:k?N:this.down,onTouchEnd:this.stop}:{onMouseDown:k?N:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return K.a.createElement("div",{className:nt,style:Ce,title:Te,onMouseEnter:we,onMouseLeave:_e,onMouseOver:G,onMouseOut:O,onFocus:function(){return null},onBlur:function(){return null}},K.a.createElement("div",{className:"".concat(me,"-handler-wrap")},K.a.createElement("span",Object.assign({unselectable:"on"},y,{role:"button","aria-label":"Increase Value","aria-disabled":R,className:A}),V||K.a.createElement("span",{unselectable:"on",className:"".concat(me,"-handler-up-inner"),onClick:te})),K.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Decrease Value","aria-disabled":k,className:v}),xe||K.a.createElement("span",{unselectable:"on",className:"".concat(me,"-handler-down-inner"),onClick:te}))),K.a.createElement("div",{className:"".concat(me,"-input-wrap")},K.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":$e,"aria-valuemax":Ye,"aria-valuenow":gt,required:Ie,type:We,placeholder:Ke,onPaste:ft,onClick:qe,onMouseUp:this.onMouseUp,className:"".concat(me,"-input"),tabIndex:dt,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:mt?this.onKeyDown:N,onKeyUp:mt?this.onKeyUp:N,autoFocus:Me,maxLength:He,readOnly:Pe,disabled:J,max:Ye,min:$e,step:Ze,name:Be,title:Te,id:pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(tt),pattern:je,inputMode:De,onInput:it},ue))))}}]),q}(K.a.Component);H.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:oe,min:-oe,step:1,style:{},onChange:N,onKeyDown:N,onPressEnter:N,onFocus:N,onBlur:N,parser:Z,required:!1,autoComplete:"off"};var se=H,ke=Xe.a=se},fnXi:function(bt,Xe,b){"use strict";var j=b("2qtc"),Ae=b("kLXV"),Q=b("q1tI"),ge=b.n(Q),he=b("Ty5D"),fe=b("9kvl"),D=b("93VE"),$=b.n(D),K=function(L){var P=L.activeIndex,ee=L.isEdit,U=ee===void 0?!0:ee,B=L.dispatch,F=L.practiceSetting,N=Object(he.i)(),te=N.id,Z=N.challengesId,Le=Object(Q.useMemo)(function(){return[{name:"\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(te,"/edit/").concat(Z,"/editcheckpoint")},{name:"\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(te,"/edit/").concat(Z,"/tab=2")},{name:"\u53C2\u8003\u7B54\u6848",url:"/shixuns/".concat(te,"/edit/").concat(Z,"/tab=3")},{name:"\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(te,"/edit/").concat(Z,"/tab=4")}]},[te,Z]),Ue=function(ne){var Oe,H=function(){fe.d.push(ne),B({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};F!=null&&(Oe=F.sideBar)!==null&&Oe!==void 0&&Oe.confirmLeave?Ae.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){H()}}):H()};return ge.a.createElement("ul",{className:"challenge-nav"},U?Le.map(function(oe,ne){return P===ne?ge.a.createElement("li",{key:oe.url}," ",ge.a.createElement("a",{className:"active"},oe.name)," "):ge.a.createElement("li",{key:oe.url}," ",ge.a.createElement("a",{onClick:function(){return Ue(oe.url)}},oe.name)," ")}):ge.a.createElement("li",{key:Le[0].url}," ",ge.a.createElement("a",{className:"active"},Le[0].name)," "))};Xe.a=Object(fe.a)(function(le){var L=le.globalSetting,P=le.practiceSetting;return{globalSetting:L,practiceSetting:P}})(K)},kSUc:function(bt,Xe,b){},lZu9:function(bt,Xe,b){(function(j){j(b("VrN/"),b("1eCo"),b("8EBN"))})(function(j){"use strict";j.defineMode("markdown",function(Ae,Q){var ge=j.getMode(Ae,"text/html"),he=ge.name=="null";function fe(C){if(j.findModeByName){var g=j.findModeByName(C);g&&(C=g.mime||g.mimes[0])}var V=j.getMode(Ae,C);return V.name=="null"?null:V}Q.highlightFormatting===void 0&&(Q.highlightFormatting=!1),Q.maxBlockquoteDepth===void 0&&(Q.maxBlockquoteDepth=0),Q.taskLists===void 0&&(Q.taskLists=!1),Q.strikethrough===void 0&&(Q.strikethrough=!1),Q.emoji===void 0&&(Q.emoji=!1),Q.fencedCodeBlockHighlighting===void 0&&(Q.fencedCodeBlockHighlighting=!0),Q.fencedCodeBlockDefaultMode===void 0&&(Q.fencedCodeBlockDefaultMode="text/plain"),Q.xml===void 0&&(Q.xml=!0),Q.tokenTypeOverrides===void 0&&(Q.tokenTypeOverrides={});var D={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var $ in D)D.hasOwnProperty($)&&Q.tokenTypeOverrides[$]&&(D[$]=Q.tokenTypeOverrides[$]);var K=/^([*\-_])(?:\s*\1){2,}\s*$/,le=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,L=/^\[(x| )\](?=\s)/i,P=Q.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,U=/^[^#!\[\]*_\\<>` "'(~:]+/,B=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,F=/^\s*\[[^\]]+?\]:.*$/,N=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,te=" ";function Z(C,g,V){return g.f=g.inline=V,V(C,g)}function Le(C,g,V){return g.f=g.block=V,V(C,g)}function Ue(C){return!C||!/\S/.test(C.string)}function oe(C){if(C.linkTitle=!1,C.linkHref=!1,C.linkText=!1,C.em=!1,C.strong=!1,C.strikethrough=!1,C.quote=0,C.indentedCode=!1,C.f==Oe){var g=he;if(!g){var V=j.innerMode(ge,C.htmlState);g=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}g&&(C.f=re,C.block=ne,C.htmlState=null)}return C.trailingSpace=0,C.trailingSpaceNewLine=!1,C.prevLine=C.thisLine,C.thisLine={stream:null},null}function ne(C,g){var V=C.column()===g.indentation,xe=Ue(g.prevLine.stream),ve=g.indentedCode,Ye=g.prevLine.hr,$e=g.list!==!1,Ce=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Te=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,$e)){for(g.list=null;Te<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Te-g.listStack[g.listStack.length-1])}var we=!xe&&!Ye&&!g.prevLine.header&&(!$e||!ve)&&!g.prevLine.fencedCodeEnd,_e=(g.list===!1||Ye||xe)&&g.indentation<=Ce&&C.match(K),G=null;if(g.indentationDiff>=4&&(ve||g.prevLine.fencedCodeEnd||g.prevLine.header||xe))return C.skipToEnd(),g.indentedCode=!0,D.code;if(C.eatSpace())return null;if(V&&g.indentation<=Ce&&(G=C.match(P))&&G[1].length<=6)return g.quote=0,g.header=G[1].length,g.thisLine.header=!0,Q.highlightFormatting&&(g.formatting="header"),g.f=g.inline,se(g);if(g.indentation<=Ce&&C.eat(">"))return g.quote=V?1:g.quote+1,Q.highlightFormatting&&(g.formatting="quote"),C.eatSpace(),se(g);if(!_e&&!g.setext&&V&&g.indentation<=Ce&&(G=C.match(le))){var O=G[1]?"ol":"ul";return g.indentation=Te+C.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,Q.taskLists&&C.match(L,!1)&&(g.taskList=!0),g.f=g.inline,Q.highlightFormatting&&(g.formatting=["list","list-"+O]),se(g)}else{if(V&&g.indentation<=Ce&&(G=C.match(B,!0)))return g.quote=0,g.fencedEndRE=new RegExp(G[1]+"+ *$"),g.localMode=Q.fencedCodeBlockHighlighting&&fe(G[2]||Q.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=j.startState(g.localMode)),g.f=g.block=H,Q.highlightFormatting&&(g.formatting="code-block"),g.code=-1,se(g);if(g.setext||(!we||!$e)&&!g.quote&&g.list===!1&&!g.code&&!_e&&!F.test(C.string)&&(G=C.lookAhead(1))&&(G=G.match(ee)))return g.setext?(g.header=g.setext,g.setext=0,C.skipToEnd(),Q.highlightFormatting&&(g.formatting="header")):(g.header=G[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,se(g);if(_e)return C.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,D.hr;if(C.peek()==="[")return Z(C,g,ie)}return Z(C,g,g.inline)}function Oe(C,g){var V=ge.token(C,g.htmlState);if(!he){var xe=j.innerMode(ge,g.htmlState);(xe.mode.name=="xml"&&xe.state.tagStart===null&&!xe.state.context&&xe.state.tokenize.isInText||g.md_inside&&C.current().indexOf(">")>-1)&&(g.f=re,g.block=ne,g.htmlState=null)}return V}function H(C,g){var V=g.listStack[g.listStack.length-1]||0,xe=g.indentation<V,ve=V+3;if(g.fencedEndRE&&g.indentation<=ve&&(xe||C.match(g.fencedEndRE))){Q.highlightFormatting&&(g.formatting="code-block");var Ye;return xe||(Ye=se(g)),g.localMode=g.localState=null,g.block=ne,g.f=re,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,xe?Le(C,g,g.block):Ye}else return g.localMode?g.localMode.token(C,g.localState):(C.skipToEnd(),D.code)}function se(C){var g=[];if(C.formatting){g.push(D.formatting),typeof C.formatting=="string"&&(C.formatting=[C.formatting]);for(var V=0;V<C.formatting.length;V++)g.push(D.formatting+"-"+C.formatting[V]),C.formatting[V]==="header"&&g.push(D.formatting+"-"+C.formatting[V]+"-"+C.header),C.formatting[V]==="quote"&&(!Q.maxBlockquoteDepth||Q.maxBlockquoteDepth>=C.quote?g.push(D.formatting+"-"+C.formatting[V]+"-"+C.quote):g.push("error"))}if(C.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(C.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(C.linkHref?g.push(D.linkHref,"url"):(C.strong&&g.push(D.strong),C.em&&g.push(D.em),C.strikethrough&&g.push(D.strikethrough),C.emoji&&g.push(D.emoji),C.linkText&&g.push(D.linkText),C.code&&g.push(D.code),C.image&&g.push(D.image),C.imageAltText&&g.push(D.imageAltText,"link"),C.imageMarker&&g.push(D.imageMarker)),C.header&&g.push(D.header,D.header+"-"+C.header),C.quote&&(g.push(D.quote),!Q.maxBlockquoteDepth||Q.maxBlockquoteDepth>=C.quote?g.push(D.quote+"-"+C.quote):g.push(D.quote+"-"+Q.maxBlockquoteDepth)),C.list!==!1){var xe=(C.listStack.length-1)%3;xe?xe===1?g.push(D.list2):g.push(D.list3):g.push(D.list1)}return C.trailingSpaceNewLine?g.push("trailing-space-new-line"):C.trailingSpace&&g.push("trailing-space-"+(C.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function ke(C,g){return C.match(U,!0)?se(g):void 0}function re(C,g){var V=g.text(C,g);if(typeof V!="undefined")return V;if(g.list)return g.list=null,se(g);if(g.taskList){var xe=C.match(L,!0)[1]===" ";return xe?g.taskOpen=!0:g.taskClosed=!0,Q.highlightFormatting&&(g.formatting="task"),g.taskList=!1,se(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&C.match(/^#+$/,!0))return Q.highlightFormatting&&(g.formatting="header"),se(g);var ve=C.next();if(g.linkTitle){g.linkTitle=!1;var Ye=ve;ve==="("&&(Ye=")"),Ye=(Ye+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var $e="^\\s*(?:[^"+Ye+"\\\\]+|\\\\\\\\|\\\\.)"+Ye;if(C.match(new RegExp($e),!0))return D.linkHref}if(ve==="`"){var Ce=g.formatting;Q.highlightFormatting&&(g.formatting="code"),C.eatWhile("`");var Te=C.current().length;if(g.code==0&&(!g.quote||Te==1))return g.code=Te,se(g);if(Te==g.code){var we=se(g);return g.code=0,we}else return g.formatting=Ce,se(g)}else if(g.code)return se(g);if(ve==="\\"&&(C.next(),Q.highlightFormatting)){var _e=se(g),G=D.formatting+"-escape";return _e?_e+" "+G:G}if(ve==="!"&&C.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,Q.highlightFormatting&&(g.formatting="image"),se(g);if(ve==="["&&g.imageMarker&&C.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,Q.highlightFormatting&&(g.formatting="image"),se(g);if(ve==="]"&&g.imageAltText){Q.highlightFormatting&&(g.formatting="image");var _e=se(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=q,_e}if(ve==="["&&!g.image)return g.linkText&&C.match(/^.*?\]/)||(g.linkText=!0,Q.highlightFormatting&&(g.formatting="link")),se(g);if(ve==="]"&&g.linkText){Q.highlightFormatting&&(g.formatting="link");var _e=se(g);return g.linkText=!1,g.inline=g.f=C.match(/\(.*?\)| ?\[.*?\]/,!1)?q:re,_e}if(ve==="<"&&C.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=w,Q.highlightFormatting&&(g.formatting="link");var _e=se(g);return _e?_e+=" ":_e="",_e+D.linkInline}if(ve==="<"&&C.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=w,Q.highlightFormatting&&(g.formatting="link");var _e=se(g);return _e?_e+=" ":_e="",_e+D.linkEmail}if(Q.xml&&ve==="<"&&C.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var O=C.string.indexOf(">",C.pos);if(O!=-1){var Ie=C.string.substring(C.start,O);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ie)&&(g.md_inside=!0)}return C.backUp(1),g.htmlState=j.startState(ge),Le(C,g,Oe)}if(Q.xml&&ve==="<"&&C.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ve==="*"||ve==="_"){for(var qe=1,dt=C.pos==1?" ":C.string.charAt(C.pos-2);qe<3&&C.eat(ve);)qe++;var We=C.peek()||" ",Ke=!/\s/.test(We)&&(!N.test(We)||/\s/.test(dt)||N.test(dt)),pe=!/\s/.test(dt)&&(!N.test(dt)||/\s/.test(We)||N.test(We)),De=null,je=null;if(qe%2&&(!g.em&&Ke&&(ve==="*"||!pe||N.test(dt))?De=!0:g.em==ve&&pe&&(ve==="*"||!Ke||N.test(We))&&(De=!1)),qe>1&&(!g.strong&&Ke&&(ve==="*"||!pe||N.test(dt))?je=!0:g.strong==ve&&pe&&(ve==="*"||!Ke||N.test(We))&&(je=!1)),je!=null||De!=null){Q.highlightFormatting&&(g.formatting=De==null?"strong":je==null?"em":"strong em"),De===!0&&(g.em=ve),je===!0&&(g.strong=ve);var we=se(g);return De===!1&&(g.em=!1),je===!1&&(g.strong=!1),we}}else if(ve===" "&&(C.eat("*")||C.eat("_"))){if(C.peek()===" ")return se(g);C.backUp(1)}if(Q.strikethrough){if(ve==="~"&&C.eatWhile(ve)){if(g.strikethrough){Q.highlightFormatting&&(g.formatting="strikethrough");var we=se(g);return g.strikethrough=!1,we}else if(C.match(/^[^\s]/,!1))return g.strikethrough=!0,Q.highlightFormatting&&(g.formatting="strikethrough"),se(g)}else if(ve===" "&&C.match(/^~~/,!0)){if(C.peek()===" ")return se(g);C.backUp(2)}}if(Q.emoji&&ve===":"&&C.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,Q.highlightFormatting&&(g.formatting="emoji");var Ze=se(g);return g.emoji=!1,Ze}return ve===" "&&(C.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),se(g)}function w(C,g){var V=C.next();if(V===">"){g.f=g.inline=re,Q.highlightFormatting&&(g.formatting="link");var xe=se(g);return xe?xe+=" ":xe="",xe+D.linkInline}return C.match(/^[^>]+/,!0),D.linkInline}function q(C,g){if(C.eatSpace())return null;var V=C.next();return V==="("||V==="["?(g.f=g.inline=_(V==="("?")":"]"),Q.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,se(g)):"error"}var z={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(C){return function(g,V){var xe=g.next();if(xe===C){V.f=V.inline=re,Q.highlightFormatting&&(V.formatting="link-string");var ve=se(V);return V.linkHref=!1,ve}return g.match(z[C]),V.linkHref=!0,se(V)}}function ie(C,g){return C.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=me,C.next(),Q.highlightFormatting&&(g.formatting="link"),g.linkText=!0,se(g)):Z(C,g,re)}function me(C,g){if(C.match(/^\]:/,!0)){g.f=g.inline=J,Q.highlightFormatting&&(g.formatting="link");var V=se(g);return g.linkText=!1,V}return C.match(/^([^\]\\]|\\.)+/,!0),D.linkText}function J(C,g){return C.eatSpace()?null:(C.match(/^[^\s]+/,!0),C.peek()===void 0?g.linkTitle=!0:C.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=re,D.linkHref+" url")}var Pe={startState:function(){return{f:ne,prevLine:{stream:null},thisLine:{stream:null},block:ne,htmlState:null,indentation:0,inline:re,text:ke,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(C){return{f:C.f,prevLine:C.prevLine,thisLine:C.thisLine,block:C.block,htmlState:C.htmlState&&j.copyState(ge,C.htmlState),indentation:C.indentation,localMode:C.localMode,localState:C.localMode?j.copyState(C.localMode,C.localState):null,inline:C.inline,text:C.text,formatting:!1,linkText:C.linkText,linkTitle:C.linkTitle,linkHref:C.linkHref,code:C.code,em:C.em,strong:C.strong,strikethrough:C.strikethrough,emoji:C.emoji,header:C.header,setext:C.setext,hr:C.hr,taskList:C.taskList,list:C.list,listStack:C.listStack.slice(0),quote:C.quote,indentedCode:C.indentedCode,trailingSpace:C.trailingSpace,trailingSpaceNewLine:C.trailingSpaceNewLine,md_inside:C.md_inside,fencedEndRE:C.fencedEndRE}},token:function(C,g){if(g.formatting=!1,C!=g.thisLine.stream){if(g.header=0,g.hr=!1,C.match(/^\s*$/,!0))return oe(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:C},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=Oe)){var V=C.match(/^\s*/,!0)[0].replace(/\t/g,te).length;if(g.indentation=V,g.indentationDiff=null,V>0)return null}}return g.f(C,g)},innerMode:function(C){return C.block==Oe?{state:C.htmlState,mode:ge}:C.localState?{state:C.localState,mode:C.localMode}:{state:C,mode:Pe}},indent:function(C,g,V){return C.block==Oe&&ge.indent?ge.indent(C.htmlState,g,V):C.localState&&C.localMode.indent?C.localMode.indent(C.localState,g,V):j.Pass},blankLine:oe,getType:se,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Pe},"xml"),j.defineMIME("text/markdown","markdown"),j.defineMIME("text/x-markdown","markdown")})},nuEh:function(bt,Xe,b){"use strict";var j=b("T2oS"),Ae=b("W9HT"),Q=b("q1tI"),ge=b.n(Q),he=b("F8wB"),fe=b.n(he),D=function(K){var le=K.loading;return le?ge.a.createElement("div",{className:fe.a.loading},ge.a.createElement(Ae.a,null)):ge.a.createElement(ge.a.Fragment,null)};Xe.a=D},osHv:function(bt,Xe,b){(function(j){j(b("VrN/"))})(function(j){"use strict";var Ae=j.Pos;function Q(N,te){return N.line-te.line||N.ch-te.ch}var ge="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",he=ge+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",fe=new RegExp("<(/?)(["+ge+"]["+he+"]*)","g");function D(N,te,Z,Le){this.line=te,this.ch=Z,this.cm=N,this.text=N.getLine(te),this.min=Le?Math.max(Le.from,N.firstLine()):N.firstLine(),this.max=Le?Math.min(Le.to-1,N.lastLine()):N.lastLine()}function $(N,te){var Z=N.cm.getTokenTypeAt(Ae(N.line,te));return Z&&/\btag\b/.test(Z)}function K(N){return N.line>=N.max?void 0:(N.ch=0,N.text=N.cm.getLine(++N.line),!0)}function le(N){return N.line<=N.min?void 0:(N.text=N.cm.getLine(--N.line),N.ch=N.text.length,!0)}function L(N){for(;;){var te=N.text.indexOf(">",N.ch);if(te==-1){if(K(N))continue;return}if(!$(N,te+1)){N.ch=te+1;continue}var Z=N.text.lastIndexOf("/",te),Le=Z>-1&&!/\S/.test(N.text.slice(Z+1,te));return N.ch=te+1,Le?"selfClose":"regular"}}function P(N){for(;;){var te=N.ch?N.text.lastIndexOf("<",N.ch-1):-1;if(te==-1){if(le(N))continue;return}if(!$(N,te+1)){N.ch=te;continue}fe.lastIndex=te,N.ch=te;var Z=fe.exec(N.text);if(Z&&Z.index==te)return Z}}function ee(N){for(;;){fe.lastIndex=N.ch;var te=fe.exec(N.text);if(!te){if(K(N))continue;return}if(!$(N,te.index+1)){N.ch=te.index+1;continue}return N.ch=te.index+te[0].length,te}}function U(N){for(;;){var te=N.ch?N.text.lastIndexOf(">",N.ch-1):-1;if(te==-1){if(le(N))continue;return}if(!$(N,te+1)){N.ch=te;continue}var Z=N.text.lastIndexOf("/",te),Le=Z>-1&&!/\S/.test(N.text.slice(Z+1,te));return N.ch=te+1,Le?"selfClose":"regular"}}function B(N,te){for(var Z=[];;){var Le=ee(N),Ue,oe=N.line,ne=N.ch-(Le?Le[0].length:0);if(!Le||!(Ue=L(N)))return;if(Ue=="selfClose")continue;if(Le[1]){for(var Oe=Z.length-1;Oe>=0;--Oe)if(Z[Oe]==Le[2]){Z.length=Oe;break}if(Oe<0&&(!te||te==Le[2]))return{tag:Le[2],from:Ae(oe,ne),to:Ae(N.line,N.ch)}}else Z.push(Le[2])}}function F(N,te){for(var Z=[];;){var Le=U(N);if(!Le)return;if(Le=="selfClose"){P(N);continue}var Ue=N.line,oe=N.ch,ne=P(N);if(!ne)return;if(ne[1])Z.push(ne[2]);else{for(var Oe=Z.length-1;Oe>=0;--Oe)if(Z[Oe]==ne[2]){Z.length=Oe;break}if(Oe<0&&(!te||te==ne[2]))return{tag:ne[2],from:Ae(N.line,N.ch),to:Ae(Ue,oe)}}}}j.registerHelper("fold","xml",function(N,te){for(var Z=new D(N,te.line,0);;){var Le=ee(Z);if(!Le||Z.line!=te.line)return;var Ue=L(Z);if(!Ue)return;if(!Le[1]&&Ue!="selfClose"){var oe=Ae(Z.line,Z.ch),ne=B(Z,Le[2]);return ne&&Q(ne.from,oe)>0?{from:oe,to:ne.from}:null}}}),j.findMatchingTag=function(N,te,Z){var Le=new D(N,te.line,te.ch,Z);if(Le.text.indexOf(">")==-1&&Le.text.indexOf("<")==-1)return;var Ue=L(Le),oe=Ue&&Ae(Le.line,Le.ch),ne=Ue&&P(Le);if(!Ue||!ne||Q(Le,te)>0)return;var Oe={from:Ae(Le.line,Le.ch),to:oe,tag:ne[2]};return Ue=="selfClose"?{open:Oe,close:null,at:"open"}:ne[1]?{open:F(Le,ne[2]),close:Oe,at:"close"}:(Le=new D(N,oe.line,oe.ch,Z),{open:Oe,close:B(Le,ne[2]),at:"open"})},j.findEnclosingTag=function(N,te,Z,Le){for(var Ue=new D(N,te.line,te.ch,Z);;){var oe=F(Ue,Le);if(!oe)break;var ne=new D(N,te.line,te.ch,Z),Oe=B(ne,oe.tag);if(Oe)return{open:oe,close:Oe}}},j.scanForClosingTag=function(N,te,Z,Le){var Ue=new D(N,te.line,te.ch,Le?{from:0,to:Le}:null);return B(Ue,Z)}})},p5ED:function(bt,Xe,b){"use strict";var j=b("+L6B"),Ae=b("2/Rp"),Q=b("5Dmo"),ge=b("3S7+"),he=b("k1fw"),fe=b("9og8"),D=b("tJVT"),$=b("WmNS"),K=b.n($),le=b("q1tI"),L=b.n(le),P=b("vHTk"),ee=b.n(P),U=b("yEEn"),B=b("ZW9T"),F=b("1vsH"),N=b("V0Rq"),te=b("m3rI"),Z=function(Ue){var oe=Ue.name,ne=Ue.data,Oe=Ue.theme,H=Ue.type,se=Ue.filename,ke=Ue.monacoEditor,re=Ue.className,w=Ue.style,q=Ue.close,z=Ue.onClose,_=Ue.hasMask,ie=Ue.otherData,me=ie===void 0?{}:ie,J=Object(le.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Pe=Object(D.a)(J,2),C=Pe[0],g=Pe[1],V=Object(le.useState)(""),xe=Object(D.a)(V,2),ve=xe[0],Ye=xe[1],$e=Object(le.useState)(),Ce=Object(D.a)($e,2),Te=Ce[0],we=Ce[1],_e=window.ENV==="build"?"/react/build/office.html":"/office.html",G,O=1024*1024,Ie=10*O,qe=Object(le.useRef)();H==="office"&&(G=Object(F.R)(ne).filesize,G>Ie&&(H="other")),se&&(ke.filename=se),Object(le.useEffect)(function(){var pe,De,je=(pe=document.cookie)===null||pe===void 0||((De=pe.replace(/\s/g,""))===null||De===void 0)?void 0:De.split(";");je==null||je.map(function(Ze){var He=Ze.split("=");He[0]==="_educoder_session"&&Ye(He[1])})},[]),Object(le.useEffect)(function(){H==="office"&&dt()},[H]);var dt=function(){var pe=Object(fe.a)(K.a.mark(function De(){var je,Ze,He;return K.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return console.log("data:",ne),je=ne,ne.startsWith("http")||(je=location.origin+je),Ze=new URL(je).pathname.split("/").pop(),Be.next=6,Object(N.U)({attachment_id:Ze});case 6:He=Be.sent,we(He);case 8:case"end":return Be.stop()}},De)}));return function(){return pe.apply(this,arguments)}}(),We=function(){if(ne.startsWith("http")||ne.startsWith("/api")||ne.startsWith("blob:")){Ke();return}Object(F.x)(se||"educoder",ne,se||"educoder")},Ke=function(){Object(F.v)(se||"educoder",decodeURIComponent(ne))};return L.a.createElement("div",{style:Object(he.a)({},w||{}),className:"".concat(_&&ee.a.bgBlack," ").concat(H?ee.a.wrp:"hide")},q&&L.a.createElement("div",{className:ee.a.close,ref:qe},L.a.createElement(ge.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return qe.current}},L.a.createElement("span",{onClick:Ke},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(ge.a,{title:"\u5173\u95ED",getPopupContainer:function(){return qe.current}},L.a.createElement("span",{className:"",onClick:function(){z(),we(null)}},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(ee.a[re]," ").concat(re," ").concat(ee.a.monaco," ").concat(H==="txt"?"show":"hide")},H==="txt"&&L.a.createElement(B.b,ke)),H==="audio"&&L.a.createElement("audio",{src:"".concat((ne==null?void 0:ne.indexOf("http://"))>-1||(ne==null?void 0:ne.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(ne),autoPlay:!0}),H==="video"&&L.a.createElement(L.a.Fragment,null,(ne==null?void 0:ne.indexOf("/api"))>-1?L.a.createElement("video",{controls:!0,src:"".concat(ne),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(ne),autoPlay:!0})),H==="office"&&Te&&L.a.createElement("iframe",{src:"".concat(_e,"?key=").concat(Te.key,"&url=").concat(te.a.API_SERVER+Te.url,"&callbackUrl=").concat(te.a.API_SERVER+Te.callbackUrl,"&fileType=").concat(Te.fileType,"&title=").concat(Te.title,"&model=view")}),(H==="xlsx"||H==="doc"||H==="pptx"||H==="docx")&&L.a.createElement("iframe",{src:"".concat(_e,"?key=").concat(me.key,"&url=").concat(te.a.API_SERVER+me.url,"&callbackUrl=").concat(te.a.API_SERVER+me.callbackUrl,"&fileType=").concat(me.fileType,"&title=").concat(me.title,"&model=").concat(me.model)}),H==="html"&&L.a.createElement("iframe",{src:ne+"&disposition=inline"}),H==="pdf"&&L.a.createElement("embed",{className:ee.a.embed,src:ne,type:"application/pdf"}),H==="image"&&L.a.createElement("img",{src:"".concat((ne==null?void 0:ne.indexOf("http://"))>-1||(ne==null?void 0:ne.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(ne)}),H==="other"&&L.a.createElement("div",null,L.a.createElement(Ae.a,{type:"primary",size:"large",onClick:We},L.a.createElement(U.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),H==="download"&&L.a.createElement(Ae.a,{type:"primary",size:"large",onClick:We},L.a.createElement(U.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Xe.a=Z},"p77/":function(bt,Xe,b){},"rAM+":function(bt,Xe,b){"use strict";b.d(Xe,"a",function(){return Ae});var j=b("Qw5x");function Ae(Q,ge){var he;if(typeof Symbol=="undefined"||Q[Symbol.iterator]==null){if(Array.isArray(Q)||(he=Object(j.a)(Q))||ge&&Q&&typeof Q.length=="number"){he&&(Q=he);var fe=0,D=function(){};return{s:D,n:function(){return fe>=Q.length?{done:!0}:{done:!1,value:Q[fe++]}},e:function(P){throw P},f:D}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var $=!0,K=!1,le;return{s:function(){he=Q[Symbol.iterator]()},n:function(){var P=he.next();return $=P.done,P},e:function(P){K=!0,le=P},f:function(){try{!$&&he.return!=null&&he.return()}finally{if(K)throw le}}}}},rUJ1:function(bt,Xe){const b=/[&<>"']/,j=/[&<>"']/g,Ae=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},he=H=>ge[H];function fe(H,se){if(se){if(b.test(H))return H.replace(j,he)}else if(Ae.test(H))return H.replace(Q,he);return H}const D=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function $(H){return H.replace(D,(se,ke)=>(ke=ke.toLowerCase(),ke==="colon"?":":ke.charAt(0)==="#"?ke.charAt(1)==="x"?String.fromCharCode(parseInt(ke.substring(2),16)):String.fromCharCode(+ke.substring(1)):""))}const K=/(^|[^\[])\^/g;function le(H,se){H=H.source||H,se=se||"";const ke={replace:(re,w)=>(w=w.source||w,w=w.replace(K,"$1"),H=H.replace(re,w),ke),getRegex:()=>new RegExp(H,se)};return ke}const L=/[^\w:]/g,P=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ee(H,se,ke){if(H){let re;try{re=decodeURIComponent($(ke)).replace(L,"").toLowerCase()}catch(w){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}se&&!P.test(ke)&&(ke=te(se,ke));try{ke=encodeURI(ke).replace(/%25/g,"%")}catch(re){return null}return ke}const U={},B=/^[^:]+:\/*[^/]*$/,F=/^([^:]+:)[\s\S]*$/,N=/^([^:]+:\/*[^/]*)[\s\S]*$/;function te(H,se){U[" "+H]||(B.test(H)?U[" "+H]=H+"/":U[" "+H]=oe(H,"/",!0)),H=U[" "+H];const ke=H.indexOf(":")===-1;return se.substring(0,2)==="//"?ke?se:H.replace(F,"$1")+se:se.charAt(0)==="/"?ke?se:H.replace(N,"$1")+se:H+se}const Z={exec:function(){}};function Le(H){let se=1,ke,re;for(;se<arguments.length;se++){ke=arguments[se];for(re in ke)Object.prototype.hasOwnProperty.call(ke,re)&&(H[re]=ke[re])}return H}function Ue(H,se){const ke=H.replace(/\|/g,(q,z,_)=>{let ie=!1,me=z;for(;--me>=0&&_[me]==="\\";)ie=!ie;return ie?"|":" |"}),re=ke.split(/ \|/);let w=0;if(re.length>se)re.splice(se);else for(;re.length<se;)re.push("");for(;w<re.length;w++)re[w]=re[w].trim().replace(/\\\|/g,"|");return re}function oe(H,se,ke){const re=H.length;if(re===0)return"";let w=0;for(;w<re;){const q=H.charAt(re-w-1);if(q===se&&!ke)w++;else if(q!==se&&ke)w++;else break}return H.substr(0,re-w)}function ne(H,se){if(H.indexOf(se[1])===-1)return-1;const ke=H.length;let re=0,w=0;for(;w<ke;w++)if(H[w]==="\\")w++;else if(H[w]===se[0])re++;else if(H[w]===se[1]&&(re--,re<0))return w;return-1}function Oe(H){H&&H.sanitize&&!H.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}bt.exports={escape:fe,unescape:$,edit:le,cleanUrl:ee,resolveUrl:te,noopTest:Z,merge:Le,splitCells:Ue,rtrim:oe,findClosingBracket:ne,checkSanitizeDeprecation:Oe}},vHTk:function(bt,Xe,b){bt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);