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__Paperlibrary__Random__Ad...

345 lines
743 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[179,7,8],{"+NIl":function(it,Ie,l){(function(oe){oe(l("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(Le,ge){"use strict";function Te(Z,z){Z.cmdState.push(z)}function Oe(Z){return Z.cmdState.length>0?Z.cmdState[Z.cmdState.length-1]:null}function Re(Z){var z=Z.cmdState.pop();z&&z.closeBracket()}function ee(Z){for(var z=Z.cmdState,$=z.length-1;$>=0;$--){var U=z[$];if(U.name=="DEFAULT")continue;return U}return{styleIdentifier:function(){return null}}}function B(Z,z,$){return function(){this.name=Z,this.bracketNo=0,this.style=z,this.styles=$,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var F={};F.importmodule=B("importmodule","tag",["string","builtin"]),F.documentclass=B("documentclass","tag",["","atom"]),F.usepackage=B("usepackage","tag",["atom"]),F.begin=B("begin","tag",["atom"]),F.end=B("end","tag",["atom"]),F.label=B("label","tag",["atom"]),F.ref=B("ref","tag",["atom"]),F.eqref=B("eqref","tag",["atom"]),F.cite=B("cite","tag",["atom"]),F.bibitem=B("bibitem","tag",["atom"]),F.Bibitem=B("Bibitem","tag",["atom"]),F.RBibitem=B("RBibitem","tag",["atom"]),F.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function X(Z,z){Z.f=z}function W(Z,z){var $;if(Z.match(/^\\[a-zA-Z@]+/)){var U=Z.current().slice(1);return $=F.hasOwnProperty(U)?F[U]:F.DEFAULT,$=new $,Te(z,$),X(z,le),$.style}if(Z.match(/^\\[$&%#{}_]/))return"tag";if(Z.match(/^\\[,;!\/\\]/))return"tag";if(Z.match("\\["))return X(z,function(E,me){return V(E,me,"\\]")}),"keyword";if(Z.match("\\("))return X(z,function(E,me){return V(E,me,"\\)")}),"keyword";if(Z.match("$$"))return X(z,function(E,me){return V(E,me,"$$")}),"keyword";if(Z.match("$"))return X(z,function(E,me){return V(E,me,"$")}),"keyword";var te=Z.next();if(te=="%")return Z.skipToEnd(),"comment";if(te=="}"||te=="]"){if($=Oe(z),$)$.closeBracket(te),X(z,le);else return"error";return"bracket"}else return te=="{"||te=="["?($=F.DEFAULT,$=new $,Te(z,$),"bracket"):/\d/.test(te)?(Z.eatWhile(/[\w.%]/),"atom"):(Z.eatWhile(/[\w\-_]/),$=ee(z),$.name=="begin"&&($.argument=Z.current()),$.styleIdentifier())}function V(Z,z,$){if(Z.eatSpace())return null;if($&&Z.match($))return X(z,W),"keyword";if(Z.match(/^\\[a-zA-Z@]+/))return"tag";if(Z.match(/^[a-zA-Z]+/))return"variable-2";if(Z.match(/^\\[$&%#{}_]/))return"tag";if(Z.match(/^\\[,;!\/]/))return"tag";if(Z.match(/^[\^_&]/))return"tag";if(Z.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Z.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var U=Z.next();return U=="{"||U=="}"||U=="["||U=="]"||U=="("||U==")"?"bracket":U=="%"?(Z.skipToEnd(),"comment"):"error"}function le(Z,z){var $=Z.peek(),U;return $=="{"||$=="["?(U=Oe(z),U.openBracket($),Z.eat($),X(z,W),"bracket"):/[ \t\r]/.test($)?(Z.eat($),null):(X(z,W),Re(z),W(Z,z))}return{startState:function(){var Z=ge.inMathMode?function(z,$){return V(z,$)}:W;return{cmdState:[],f:Z}},copyState:function(Z){return{cmdState:Z.cmdState.slice(),f:Z.f}},token:function(Z,z){return z.f(Z,z)},blankLine:function(Z){Z.f=W,Z.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+RXH":function(it,Ie,l){it.exports=l.p+"static/shu.a39bf729.svg"},"+yhJ":function(it,Ie,l){it.exports=l.p+"static/xixi.d492fb65.svg"},"0eGx":function(it,Ie,l){it.exports=l.p+"static/zhong.c1924b73.svg"},"19Vz":function(it,Ie,l){(function(oe){oe(l("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(B,F,X){var W=X&&X!=oe.Init;if(F&&!W)B.on("blur",Oe),B.on("change",Re),B.on("swapDoc",Re),oe.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){Te(B)}),Re(B);else if(!F&&W){B.off("blur",Oe),B.off("change",Re),B.off("swapDoc",Re),oe.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),Le(B);var V=B.getWrapperElement();V.className=V.className.replace(" CodeMirror-empty","")}F&&!B.hasFocus()&&Oe(B)});function Le(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function ge(B){Le(B);var F=B.state.placeholder=document.createElement("pre");F.style.cssText="height: 0; overflow: visible",F.style.direction=B.getOption("direction"),F.className="CodeMirror-placeholder CodeMirror-line-like";var X=B.getOption("placeholder");typeof X=="string"&&(X=document.createTextNode(X)),F.appendChild(X),B.display.lineSpace.insertBefore(F,B.display.lineSpace.firstChild)}function Te(B){setTimeout(function(){var F=!1,X=B.getInputField();X.nodeName=="TEXTAREA"?F=!X.value:B.lineCount()==1&&(F=!/[^\u200b]/.test(X.querySelector(".CodeMirror-line").textContent)),F?ge(B):Le(B)},20)}function Oe(B){ee(B)&&ge(B)}function Re(B){var F=B.getWrapperElement(),X=ee(B);F.className=F.className.replace(" CodeMirror-empty","")+(X?" CodeMirror-empty":""),X?ge(B):Le(B)}function ee(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1ZF9":function(it,Ie,l){it.exports=l.p+"static/Authorize.cc9c212f.png"},"1eCo":function(it,Ie,l){(function(oe){oe(l("VrN/"))})(function(oe){"use strict";var Le={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},ge={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(Te,Oe){var Re=Te.indentUnit,ee={},B=Oe.htmlMode?Le:ge;for(var F in B)ee[F]=B[F];for(var F in Oe)ee[F]=Oe[F];var X,W;function V(b,N){function T(ye){return N.tokenize=ye,ye(b,N)}var y=b.next();if(y=="<")return b.eat("!")?b.eat("[")?b.match("CDATA[")?T(z("atom","]]>")):null:b.match("--")?T(z("comment","-->")):b.match("DOCTYPE",!0,!0)?(b.eatWhile(/[\w\._\-]/),T($(1))):null:b.eat("?")?(b.eatWhile(/[\w\._\-]/),N.tokenize=z("meta","?>"),"meta"):(X=b.eat("/")?"closeTag":"openTag",N.tokenize=le,"tag bracket");if(y=="&"){var J;return b.eat("#")?b.eat("x")?J=b.eatWhile(/[a-fA-F\d]/)&&b.eat(";"):J=b.eatWhile(/[\d]/)&&b.eat(";"):J=b.eatWhile(/[\w\.\-:]/)&&b.eat(";"),J?"atom":"error"}else return b.eatWhile(/[^&<]/),null}V.isInText=!0;function le(b,N){var T=b.next();if(T==">"||T=="/"&&b.eat(">"))return N.tokenize=V,X=T==">"?"endTag":"selfcloseTag","tag bracket";if(T=="=")return X="equals",null;if(T=="<"){N.tokenize=V,N.state=me,N.tagName=N.tagStart=null;var y=N.tokenize(b,N);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(T)?(N.tokenize=Z(T),N.stringStartCol=b.column(),N.tokenize(b,N)):(b.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Z(b){var N=function(T,y){for(;!T.eol();)if(T.next()==b){y.tokenize=le;break}return"string"};return N.isInAttribute=!0,N}function z(b,N){return function(T,y){for(;!T.eol();){if(T.match(N)){y.tokenize=V;break}T.next()}return b}}function $(b){return function(N,T){for(var y;(y=N.next())!=null;){if(y=="<")return T.tokenize=$(b+1),T.tokenize(N,T);if(y==">")if(b==1){T.tokenize=V;break}else return T.tokenize=$(b-1),T.tokenize(N,T)}return"meta"}}function U(b,N,T){this.prev=b.context,this.tagName=N,this.indent=b.indented,this.startOfLine=T,(ee.doNotIndent.hasOwnProperty(N)||b.context&&b.context.noIndent)&&(this.noIndent=!0)}function te(b){b.context&&(b.context=b.context.prev)}function E(b,N){for(var T;;){if(!b.context)return;if(T=b.context.tagName,!ee.contextGrabbers.hasOwnProperty(T)||!ee.contextGrabbers[T].hasOwnProperty(N))return;te(b)}}function me(b,N,T){return b=="openTag"?(T.tagStart=N.column(),Ce):b=="closeTag"?de:me}function Ce(b,N,T){return b=="word"?(T.tagName=N.current(),W="tag",Q):ee.allowMissingTagName&&b=="endTag"?(W="tag bracket",Q(b,N,T)):(W="error",Ce)}function de(b,N,T){if(b=="word"){var y=N.current();return T.context&&T.context.tagName!=y&&ee.implicitlyClosed.hasOwnProperty(T.context.tagName)&&te(T),T.context&&T.context.tagName==y||ee.matchClosing===!1?(W="tag",I):(W="tag error",g)}else return ee.allowMissingTagName&&b=="endTag"?(W="tag bracket",I(b,N,T)):(W="error",g)}function I(b,N,T){return b!="endTag"?(W="error",I):(te(T),me)}function g(b,N,T){return W="error",I(b,N,T)}function Q(b,N,T){if(b=="word")return W="attribute",S;if(b=="endTag"||b=="selfcloseTag"){var y=T.tagName,J=T.tagStart;return T.tagName=T.tagStart=null,b=="selfcloseTag"||ee.autoSelfClosers.hasOwnProperty(y)?E(T,y):(E(T,y),T.context=new U(T,y,J==T.indented)),me}return W="error",Q}function S(b,N,T){return b=="equals"?A:(ee.allowMissing||(W="error"),Q(b,N,T))}function A(b,N,T){return b=="string"?x:b=="word"&&ee.allowUnquoted?(W="string",Q):(W="error",Q(b,N,T))}function x(b,N,T){return b=="string"?x:Q(b,N,T)}return{startState:function(b){var N={tokenize:V,state:me,indented:b||0,tagName:null,tagStart:null,context:null};return b!=null&&(N.baseIndent=b),N},token:function(b,N){if(!N.tagName&&b.sol()&&(N.indented=b.indentation()),b.eatSpace())return null;X=null;var T=N.tokenize(b,N);return(T||X)&&T!="comment"&&(W=null,N.state=N.state(X||T,b,N),W&&(T=W=="error"?T+" error":W)),T},indent:function(b,N,T){var y=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+Re;if(y&&y.noIndent)return oe.Pass;if(b.tokenize!=le&&b.tokenize!=V)return T?T.match(/^(\s*)/)[0].length:0;if(b.tagName)return ee.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+Re*(ee.multilineTagIndentFactor||1);if(ee.alignCDATA&&/<!\[CDATA\[/.test(N))return 0;var J=N&&/^<(\/)?([\w_:\.-]*)/.exec(N);if(J&&J[1])for(;y;)if(y.tagName==J[2]){y=y.prev;break}else if(ee.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(J)for(;y;){var ye=ee.contextGrabbers[y.tagName];if(ye&&ye.hasOwnProperty(J[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+Re:b.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:ee.htmlMode?"html":"xml",helperType:ee.htmlMode?"html":"xml",skipAttribute:function(b){b.state==A&&(b.state=Q)},xmlCurrentTag:function(b){return b.tagName?{name:b.tagName,close:b.type=="closeTag"}:null},xmlCurrentContext:function(b){for(var N=[],T=b.context;T;T=T.prev)T.tagName&&N.push(T.tagName);return N.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2sxD":function(it,Ie,l){it.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB":function(it,Ie,l){it.exports=l.p+"static/sc.c1696770.svg"},"55Ip":function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return E}),l.d(Ie,"b",function(){return Q});var oe=l("Ty5D"),Le=l("dI71"),ge=l("q1tI"),Te=l.n(ge),Oe=l("YS25"),Re=l("17x9"),ee=l.n(Re),B=l("wx14"),F=l("zLVn"),X=l("9R94"),W=function(A){Object(Le.a)(x,A);function x(){for(var N,T=arguments.length,y=new Array(T),J=0;J<T;J++)y[J]=arguments[J];return N=A.call.apply(A,[this].concat(y))||this,N.history=Object(Oe.a)(N.props),N}var b=x.prototype;return b.render=function(){return Te.a.createElement(oe.c,{history:this.history,children:this.props.children})},x}(Te.a.Component),V=function(A){Object(Le.a)(x,A);function x(){for(var N,T=arguments.length,y=new Array(T),J=0;J<T;J++)y[J]=arguments[J];return N=A.call.apply(A,[this].concat(y))||this,N.history=Object(Oe.b)(N.props),N}var b=x.prototype;return b.render=function(){return Te.a.createElement(oe.c,{history:this.history,children:this.props.children})},x}(Te.a.Component),le=function(x,b){return typeof x=="function"?x(b):x},Z=function(x,b){return typeof x=="string"?Object(Oe.c)(x,null,null,b):x},z=function(x){return x},$=Te.a.forwardRef;typeof $=="undefined"&&($=z);function U(A){return!!(A.metaKey||A.altKey||A.ctrlKey||A.shiftKey)}var te=$(function(A,x){var b=A.innerRef,N=A.navigate,T=A.onClick,y=Object(F.a)(A,["innerRef","navigate","onClick"]),J=y.target,ye=Object(B.a)({},y,{onClick:function(_e){try{T&&T(_e)}catch(k){throw _e.preventDefault(),k}!_e.defaultPrevented&&_e.button===0&&(!J||J==="_self")&&!U(_e)&&(_e.preventDefault(),N())}});return z!==$?ye.ref=x||b:ye.ref=b,Te.a.createElement("a",ye)}),E=$(function(A,x){var b=A.component,N=b===void 0?te:b,T=A.replace,y=A.to,J=A.innerRef,ye=Object(F.a)(A,["component","replace","to","innerRef"]);return Te.a.createElement(oe.e.Consumer,null,function(q){q||Object(X.a)(!1);var _e=q.history,k=Z(le(y,q.location),q.location),f=k?_e.createHref(k):"",R=Object(B.a)({},ye,{href:f,navigate:function(){var se=le(y,q.location),Se=T?_e.replace:_e.push;Se(se)}});return z!==$?R.ref=x||J:R.innerRef=J,Te.a.createElement(N,R)})});if(!1)var me,Ce;var de=function(x){return x},I=Te.a.forwardRef;typeof I=="undefined"&&(I=de);function g(){for(var A=arguments.length,x=new Array(A),b=0;b<A;b++)x[b]=arguments[b];return x.filter(function(N){return N}).join(" ")}var Q=I(function(A,x){var b=A["aria-current"],N=b===void 0?"page":b,T=A.activeClassName,y=T===void 0?"active":T,J=A.activeStyle,ye=A.className,q=A.exact,_e=A.isActive,k=A.location,f=A.sensitive,R=A.strict,ue=A.style,se=A.to,Se=A.innerRef,fe=Object(F.a)(A,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Te.a.createElement(oe.e.Consumer,null,function(pe){pe||Object(X.a)(!1);var j=k||pe.location,M=Z(le(se,j),j),re=M.pathname,P=re&&re.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),_=P?Object(oe.f)(j.pathname,{path:P,exact:q,sensitive:f,strict:R}):null,he=!!(_e?_e(_,j):_),Pe=he?g(ye,y):ye,Je=he?Object(B.a)({},ue,{},J):ue,Me=Object(B.a)({"aria-current":he&&N||null,className:Pe,style:Je,to:M},fe);return de!==I?Me.ref=x||Se:Me.innerRef=Se,Te.a.createElement(E,Me)})});if(!1)var S},"5MlY":function(it,Ie,l){it.exports=l.p+"static/sm.8ccb50bf.svg"},"6+eU":function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return I});var oe=l("wx14"),Le=l("rePB"),ge=l("VTBJ"),Te=l("1OyB"),Oe=l("vuIU"),Re=l("Ji7U"),ee=l("LK+K"),B=l("q1tI"),F=l.n(B),X=l("TSYQ"),W=l.n(X),V=function(Q){var S,A="".concat(Q.rootPrefixCls,"-item"),x=W()(A,"".concat(A,"-").concat(Q.page),(S={},Object(Le.a)(S,"".concat(A,"-active"),Q.active),Object(Le.a)(S,Q.className,!!Q.className),Object(Le.a)(S,"".concat(A,"-disabled"),!Q.page),S)),b=function(){Q.onClick(Q.page)},N=function(y){Q.onKeyPress(y,Q.onClick,Q.page)};return F.a.createElement("li",{title:Q.showTitle?Q.page:null,className:x,onClick:b,onKeyPress:N,tabIndex:"0"},Q.itemRender(Q.page,"page",F.a.createElement("a",{rel:"nofollow"},Q.page)))},le=V,Z={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},z=function(g){Object(Re.a)(S,g);var Q=Object(ee.a)(S);function S(){var A;Object(Te.a)(this,S);for(var x=arguments.length,b=new Array(x),N=0;N<x;N++)b[N]=arguments[N];return A=Q.call.apply(Q,[this].concat(b)),A.state={goInputText:""},A.buildOptionText=function(T){return"".concat(T," ").concat(A.props.locale.items_per_page)},A.changeSize=function(T){A.props.changeSize(Number(T))},A.handleChange=function(T){A.setState({goInputText:T.target.value})},A.handleBlur=function(T){var y=A.props,J=y.goButton,ye=y.quickGo,q=y.rootPrefixCls,_e=A.state.goInputText;if(J||_e==="")return;if(T.relatedTarget&&(T.relatedTarget.className.indexOf("".concat(q,"-prev"))>=0||T.relatedTarget.className.indexOf("".concat(q,"-next"))>=0))return;A.setState({goInputText:""}),ye(A.getValidValue())},A.go=function(T){var y=A.state.goInputText;if(y==="")return;(T.keyCode===Z.ENTER||T.type==="click")&&(A.setState({goInputText:""}),A.props.quickGo(A.getValidValue()))},A}return Object(Oe.a)(S,[{key:"getValidValue",value:function(){var x=this.state,b=x.goInputText,N=x.current;return!b||isNaN(b)?N:Number(b)}},{key:"getPageSizeOptions",value:function(){var x=this.props,b=x.pageSize,N=x.pageSizeOptions;return N.some(function(T){return T.toString()===b.toString()})?N:N.concat([b.toString()]).sort(function(T,y){var J=isNaN(Number(T))?0:Number(T),ye=isNaN(Number(y))?0:Number(y);return J-ye})}},{key:"render",value:function(){var x=this,b=this.props,N=b.pageSize,T=b.locale,y=b.rootPrefixCls,J=b.changeSize,ye=b.quickGo,q=b.goButton,_e=b.selectComponentClass,k=b.buildOptionText,f=b.selectPrefixCls,R=b.disabled,ue=this.state.goInputText,se="".concat(y,"-options"),Se=_e,fe=null,pe=null,j=null;if(!J&&!ye)return null;var M=this.getPageSizeOptions();if(J&&Se){var re=M.map(function(P,_){return F.a.createElement(Se.Option,{key:_,value:P.toString()},(k||x.buildOptionText)(P))});fe=F.a.createElement(Se,{disabled:R,prefixCls:f,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(N||M[0]).toString(),onChange:this.changeSize,getPopupContainer:function(_){return _.parentNode}},re)}return ye&&(q&&(j=typeof q=="boolean"?F.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:R,className:"".concat(se,"-quick-jumper-button")},T.jump_to_confirm):F.a.createElement("span",{onClick:this.go,onKeyUp:this.go},q)),pe=F.a.createElement("div",{className:"".concat(se,"-quick-jumper")},T.jump_to,F.a.createElement("input",{disabled:R,type:"text",value:ue,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),T.page,j)),F.a.createElement("li",{className:"".concat(se)},fe,pe)}}]),S}(F.a.Component);z.defaultProps={pageSizeOptions:["10","20","50","100"]};var $=z,U=l("N2Kk");function te(){}function E(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function me(g,Q,S){return S}function Ce(g,Q,S){var A=typeof g=="undefined"?Q.pageSize:g;return Math.floor((S.total-1)/A)+1}var de=function(g){Object(Re.a)(S,g);var Q=Object(ee.a)(S);function S(A){var x;Object(Te.a)(this,S),x=Q.call(this,A),x.getJumpPrevPage=function(){return Math.max(1,x.state.current-(x.props.showLessItems?3:5))},x.getJumpNextPage=function(){return Math.min(Ce(void 0,x.state,x.props),x.state.current+(x.props.showLessItems?3:5))},x.getItemIcon=function(J,ye){var q=x.props.prefixCls,_e=J||F.a.createElement("button",{type:"button","aria-label":ye,className:"".concat(q,"-item-link")});return typeof J=="function"&&(_e=F.a.createElement(J,Object(ge.a)({},x.props))),_e},x.savePaginationNode=function(J){x.paginationNode=J},x.isValid=function(J){return E(J)&&J!==x.state.current},x.shouldDisplayQuickJumper=function(){var J=x.props,ye=J.showQuickJumper,q=J.pageSize,_e=J.total;return _e<=q?!1:ye},x.handleKeyDown=function(J){(J.keyCode===Z.ARROW_UP||J.keyCode===Z.ARROW_DOWN)&&J.preventDefault()},x.handleKeyUp=function(J){var ye=x.getValidValue(J),q=x.state.currentInputValue;ye!==q&&x.setState({currentInputValue:ye}),J.keyCode===Z.ENTER?x.handleChange(ye):J.keyCode===Z.ARROW_UP?x.handleChange(ye-1):J.keyCode===Z.ARROW_DOWN&&x.handleChange(ye+1)},x.changePageSize=function(J){var ye=x.state.current,q=Ce(J,x.state,x.props);ye=ye>q?q:ye,q===0&&(ye=x.state.current),typeof J=="number"&&("pageSize"in x.props||x.setState({pageSize:J}),"current"in x.props||x.setState({current:ye,currentInputValue:ye})),x.props.onShowSizeChange(ye,J),"onChange"in x.props&&x.props.onChange&&x.props.onChange(ye,J)},x.handleChange=function(J){var ye=x.props.disabled,q=J;if(x.isValid(q)&&!ye){var _e=Ce(void 0,x.state,x.props);q>_e?q=_e:q<1&&(q=1),"current"in x.props||x.setState({current:q,currentInputValue:q});var k=x.state.pageSize;return x.props.onChange(q,k),q}return x.state.current},x.prev=function(){x.hasPrev()&&x.handleChange(x.state.current-1)},x.next=function(){x.hasNext()&&x.handleChange(x.state.current+1)},x.jumpPrev=function(){x.handleChange(x.getJumpPrevPage())},x.jumpNext=function(){x.handleChange(x.getJumpNextPage())},x.hasPrev=function(){return x.state.current>1},x.hasNext=function(){return x.state.current<Ce(void 0,x.state,x.props)},x.runIfEnter=function(J,ye){if(J.key==="Enter"||J.charCode===13){for(var q=arguments.length,_e=new Array(q>2?q-2:0),k=2;k<q;k++)_e[k-2]=arguments[k];ye.apply(void 0,_e)}},x.runIfEnterPrev=function(J){x.runIfEnter(J,x.prev)},x.runIfEnterNext=function(J){x.runIfEnter(J,x.next)},x.runIfEnterJumpPrev=function(J){x.runIfEnter(J,x.jumpPrev)},x.runIfEnterJumpNext=function(J){x.runIfEnter(J,x.jumpNext)},x.handleGoTO=function(J){(J.keyCode===Z.ENTER||J.type==="click")&&x.handleChange(x.state.currentInputValue)};var b=A.onChange!==te,N="current"in A;N&&!b&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var T=A.defaultCurrent;"current"in A&&(T=A.current);var y=A.defaultPageSize;return"pageSize"in A&&(y=A.pageSize),T=Math.min(T,Ce(y,void 0,A)),x.state={current:T,currentInputValue:T,pageSize:y},x}return Object(Oe.a)(S,[{key:"componentDidUpdate",value:function(x,b){var N=this.props.prefixCls;if(b.current!==this.state.current&&this.paginationNode){var T=this.paginationNode.querySelector(".".concat(N,"-item-").concat(b.current));T&&document.activeElement===T&&T.blur()}}},{key:"getValidValue",value:function(x){var b=x.target.value,N=Ce(void 0,this.state,this.props),T=this.state.currentInputValue,y;return b===""?y=b:isNaN(Number(b))?y=T:b>=N?y=N:y=Number(b),y}},{key:"getShowSizeChanger",value:function(){var x=this.props,b=x.showSizeChanger,N=x.total,T=x.totalBoundaryShowSizeChanger;return typeof b!="undefined"?b:N>T}},{key:"renderPrev",value:function(x){var b=this.props,N=b.prevIcon,T=b.itemRender,y=T(x,"prev",this.getItemIcon(N,"prev page")),J=!this.hasPrev();return Object(B.isValidElement)(y)?Object(B.cloneElement)(y,{disabled:J}):y}},{key:"renderNext",value:function(x){var b=this.props,N=b.nextIcon,T=b.itemRender,y=T(x,"next",this.getItemIcon(N,"next page")),J=!this.hasNext();return Object(B.isValidElement)(y)?Object(B.cloneElement)(y,{disabled:J}):y}},{key:"render",value:function(){var x=this,b=this.props,N=b.prefixCls,T=b.className,y=b.style,J=b.disabled,ye=b.hideOnSinglePage,q=b.total,_e=b.locale,k=b.showQuickJumper,f=b.showLessItems,R=b.showTitle,ue=b.showTotal,se=b.simple,Se=b.itemRender,fe=b.showPrevNextJumpers,pe=b.jumpPrevIcon,j=b.jumpNextIcon,M=b.selectComponentClass,re=b.selectPrefixCls,P=b.pageSizeOptions,_=this.state,he=_.current,Pe=_.pageSize,Je=_.currentInputValue;if(ye===!0&&q<=Pe)return null;var Me=Ce(void 0,this.state,this.props),We=[],Ee=null,De=null,Ve=null,et=null,at=null,Ye=k&&k.goButton,He=f?1:2,St=he-1>0?he-1:0,ft=he+1<Me?he+1:Me,bt=Object.keys(this.props).reduce(function(w,O){return(O.substr(0,5)==="data-"||O.substr(0,5)==="aria-"||O==="role")&&(w[O]=x.props[O]),w},{});if(se)return Ye&&(typeof Ye=="boolean"?at=F.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},_e.jump_to_confirm):at=F.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ye),at=F.a.createElement("li",{title:R?"".concat(_e.jump_to).concat(he,"/").concat(Me):null,className:"".concat(N,"-simple-pager")},at)),F.a.createElement("ul",Object(oe.a)({className:W()(N,"".concat(N,"-simple"),Object(Le.a)({},"".concat(N,"-disabled"),J),T),style:y,ref:this.savePaginationNode},bt),F.a.createElement("li",{title:R?_e.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:W()("".concat(N,"-prev"),Object(Le.a)({},"".concat(N,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(St)),F.a.createElement("li",{title:R?"".concat(he,"/").concat(Me):null,className:"".concat(N,"-simple-pager")},F.a.createElement("input",{type:"text",value:Je,disabled:J,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),F.a.createElement("span",{className:"".concat(N,"-slash")},"/"),Me),F.a.createElement("li",{title:R?_e.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:W()("".concat(N,"-next"),Object(Le.a)({},"".concat(N,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ft)),at);if(Me<=3+He*2){var dt={locale:_e,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:R,itemRender:Se};Me||We.push(F.a.createElement(le,Object(oe.a)({},dt,{key:"noPager",page:Me,className:"".concat(N,"-disabled")})));for(var Dt=1;Dt<=Me;Dt+=1){var Ot=he===Dt;We.push(F.a.createElement(le,Object(oe.a)({},dt,{key:Dt,page:Dt,active:Ot})))}}else{var _t=f?_e.prev_3:_e.prev_5,Ue=f?_e.next_3:_e.next_5;fe&&(Ee=F.a.createElement("li",{title:R?_t:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:W()("".concat(N,"-jump-prev"),Object(Le.a)({},"".concat(N,"-jump-prev-custom-icon"),!!pe))},Se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(pe,"prev page"))),De=F.a.createElement("li",{title:R?Ue:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:W()("".concat(N,"-jump-next"),Object(Le.a)({},"".concat(N,"-jump-next-custom-icon"),!!j))},Se(this.getJumpNextPage(),"jump-next",this.getItemIcon(j,"next page")))),et=F.a.createElement(le,{locale:_e,last:!0,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Me,page:Me,active:!1,showTitle:R,itemRender:Se}),Ve=F.a.createElement(le,{locale:_e,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:R,itemRender:Se});var It=Math.max(1,he-He),kt=Math.min(he+He,Me);he-1<=He&&(kt=1+He*2),Me-he<=He&&(It=Me-He*2);for(var Be=It;Be<=kt;Be+=1){var Ke=he===Be;We.push(F.a.createElement(le,{locale:_e,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Be,page:Be,active:Ke,showTitle:R,itemRender:Se}))}he-1>=He*2&&he!==1+2&&(We[0]=Object(B.cloneElement)(We[0],{className:"".concat(N,"-item-after-jump-prev")}),We.unshift(Ee)),Me-he>=He*2&&he!==Me-2&&(We[We.length-1]=Object(B.cloneElement)(We[We.length-1],{className:"".concat(N,"-item-before-jump-next")}),We.push(De)),It!==1&&We.unshift(Ve),kt!==Me&&We.push(et)}var K=null;ue&&(K=F.a.createElement("li",{className:"".concat(N,"-total-text")},ue(q,[q===0?0:(he-1)*Pe+1,he*Pe>q?q:he*Pe])));var G=!this.hasPrev()||!Me,H=!this.hasNext()||!Me;return F.a.createElement("ul",Object(oe.a)({className:W()(N,T,Object(Le.a)({},"".concat(N,"-disabled"),J)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},bt),K,F.a.createElement("li",{title:R?_e.prev_page:null,onClick:this.prev,tabIndex:G?null:0,onKeyPress:this.runIfEnterPrev,className:W()("".concat(N,"-prev"),Object(Le.a)({},"".concat(N,"-disabled"),G)),"aria-disabled":G},this.renderPrev(St)),We,F.a.createElement("li",{title:R?_e.next_page:null,onClick:this.next,tabIndex:H?null:0,onKeyPress:this.runIfEnterNext,className:W()("".concat(N,"-next"),Object(Le.a)({},"".concat(N,"-disabled"),H)),"aria-disabled":H},this.renderNext(ft)),F.a.createElement($,{disabled:J,locale:_e,rootPrefixCls:N,selectComponentClass:M,selectPrefixCls:re,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:he,pageSize:Pe,pageSizeOptions:P,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ye}))}}],[{key:"getDerivedStateFromProps",value:function(x,b){var N={};if("current"in x&&(N.current=x.current,x.current!==b.current&&(N.currentInputValue=N.current)),"pageSize"in x&&x.pageSize!==b.pageSize){var T=b.current,y=Ce(x.pageSize,b,x);T=T>y?y:T,"current"in x||(N.current=T,N.currentInputValue=T),N.pageSize=x.pageSize}return N}}]),S}(F.a.Component);de.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:te,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:te,locale:U.a,style:{},itemRender:me,totalBoundaryShowSizeChanger:50};var I=de},"6K3P":function(it,Ie,l){it.exports=l.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(it,Ie,l){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Le=new Uint8Array(16);function ge(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(Le)}var Te=/^(?:[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 Oe(le){return typeof le=="string"&&Te.test(le)}for(var Re=Oe,ee=[],B=0;B<256;++B)ee.push((B+256).toString(16).substr(1));function F(le){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=(ee[le[Z+0]]+ee[le[Z+1]]+ee[le[Z+2]]+ee[le[Z+3]]+"-"+ee[le[Z+4]]+ee[le[Z+5]]+"-"+ee[le[Z+6]]+ee[le[Z+7]]+"-"+ee[le[Z+8]]+ee[le[Z+9]]+"-"+ee[le[Z+10]]+ee[le[Z+11]]+ee[le[Z+12]]+ee[le[Z+13]]+ee[le[Z+14]]+ee[le[Z+15]]).toLowerCase();if(!Re(z))throw TypeError("Stringified UUID is invalid");return z}var X=F;function W(le,Z,z){le=le||{};var $=le.random||(le.rng||ge)();if($[6]=$[6]&15|64,$[8]=$[8]&63|128,Z){z=z||0;for(var U=0;U<16;++U)Z[z+U]=$[U];return Z}return X($)}var V=Ie.a=W},"7ahc":function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return Ce});var oe=l("k1fw"),Le=l("0Owb"),ge=l("+L6B"),Te=l("2/Rp"),Oe=l("y8nQ"),Re=l("Vl3Y"),ee=l("tJVT"),B=l("OaEy"),F=l("2fM7"),X=l("q1tI"),W=l.n(X),V=l("VrN/"),le=l.n(V),Z=l("p77/"),z=l.n(Z),$=l("c5Ni"),U=l.n($),te=F.a.Option,E={labelCol:{span:4},wrapperCol:{span:20}},me={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"]};Ie.b=function(de){var I=de.callback,g=de.onCancel,Q=Object(X.useState)("python"),S=Object(ee.a)(Q,2),A=S[0],x=S[1];function b(T){x(me[T][1])}function N(T){I(T)}return W.a.createElement(Re.a,Object(Le.a)({},E,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:N}),W.a.createElement(Re.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},W.a.createElement(F.a,{onChange:b},Object.keys(me).map(function(T){return W.a.createElement(te,{key:T,value:T},me[T][0])}))),W.a.createElement(Re.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},W.a.createElement(Ce,{mode:A})),W.a.createElement("div",{className:"flex-container flex-end"},W.a.createElement(Te.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),W.a.createElement(Te.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function Ce(de){var I=de.value,g=de.onChange,Q=de.mode,S=de.options,A=S===void 0?{}:S,x=Object(X.useRef)(),b=Object(X.useState)(),N=Object(ee.a)(b,2),T=N[0],y=N[1];return Object(X.useEffect)(function(){if(T){function J(ye){var q=ye.getValue();g&&g(q)}return T.on("change",J),function(){T.off("change",J)}}},[T,g]),Object(X.useEffect)(function(){T&&T.setOption("mode",Q)},[T,Q]),Object(X.useEffect)(function(){T&&((I!==T.getValue()||I==="")&&setTimeout(function(){T.setValue(I||" ")},300))},[T,I]),Object(X.useEffect)(function(){if(x.current&&!T){var J=le.a.fromTextArea(x.current,Object(oe.a)({mode:Q,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},A));y(J)}},[x.current,T]),W.a.createElement("div",{className:"my-codemirror-container"},W.a.createElement("textarea",{ref:x}))}},"7ixt":function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return ge});var oe={adjustX:1,adjustY:1},Le=[0,0],ge={left:{points:["cr","cl"],overflow:oe,offset:[-4,0],targetOffset:Le},right:{points:["cl","cr"],overflow:oe,offset:[4,0],targetOffset:Le},top:{points:["bc","tc"],overflow:oe,offset:[0,-4],targetOffset:Le},bottom:{points:["tc","bc"],overflow:oe,offset:[0,4],targetOffset:Le},topLeft:{points:["bl","tl"],overflow:oe,offset:[0,-4],targetOffset:Le},leftTop:{points:["tr","tl"],overflow:oe,offset:[-4,0],targetOffset:Le},topRight:{points:["br","tr"],overflow:oe,offset:[0,-4],targetOffset:Le},rightTop:{points:["tl","tr"],overflow:oe,offset:[4,0],targetOffset:Le},bottomRight:{points:["tr","br"],overflow:oe,offset:[0,4],targetOffset:Le},rightBottom:{points:["bl","br"],overflow:oe,offset:[4,0],targetOffset:Le},bottomLeft:{points:["tl","bl"],overflow:oe,offset:[0,4],targetOffset:Le},leftBottom:{points:["br","bl"],overflow:oe,offset:[-4,0],targetOffset:Le}},Te=ge},"7qnI":function(it,Ie,l){"use strict";var oe=l("5Dmo"),Le=l("3S7+"),ge=l("fWQN"),Te=l("mtLc"),Oe=l("yKVA"),Re=l("879j"),ee=l("5NDa"),B=l("5rEg"),F=l("q1tI"),X=l.n(F),W=l("O2Wb"),V=l.n(W),le=B.a.TextArea,Z=function(z){Object(Oe.a)(U,z);var $=Object(Re.a)(U);function U(){return Object(ge.a)(this,U),$.apply(this,arguments)}return Object(Te.a)(U,[{key:"render",value:function(){var E=this,me=this.props,Ce=me.index,de=me.onAnswerChange,I=me.addChildAnswer,g=me.exerciseIsPublish,Q=me.answers,S=me.activeOptionErrorIndex,A=me.flex,x=A===void 0?"0 0 1000px":A;return X.a.createElement("div",{className:V.a.flex},X.a.createElement("div",{className:"".concat(V.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Ce+1,"):"),X.a.createElement("div",{className:"".concat(V.a.flex," ").concat(V.a.flex1),style:{flexDirection:"column"}},Q.map(function(b,N){var T="".concat(Ce,"-").concat(N);return X.a.createElement("div",{className:"".concat(V.a.flex," ").concat(V.a.flex1),key:N},X.a.createElement("div",{className:V.a.flex1,style:{flex:x}},X.a.createElement("div",null,X.a.createElement(le,{className:T===S?V.a.error:"",spellCheck:!1,rows:4,value:b||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(N==0?"":"(\u53EF\u9009)"),onChange:function(J){return de(Ce,N,J.target.value)},style:{minHeight:95}}))),!g&&X.a.createElement(X.a.Fragment,null,N!=0&&X.a.createElement(Le.a,{title:"\u5220\u9664"},X.a.createElement("i",{className:"".concat(V.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return E.props.deleteChildAnswer(Ce,N)},style:{float:"right"}})),N===0&&X.a.createElement(Le.a,{title:"\u5220\u9664"},X.a.createElement("i",{className:"".concat(V.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return E.props.deleteChildAnswermain(Ce,N)},style:{float:"right"}})),X.a.createElement(Le.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},X.a.createElement("i",{className:"".concat(V.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return I(Ce)},style:{float:"right",visibility:N==Q.length-1?"":"hidden"}}))))})))}}]),U}(F.Component);Ie.a=Z},"815F":function(it,Ie,l){"use strict";l.d(Ie,"e",function(){return ee}),l.d(Ie,"c",function(){return F}),l.d(Ie,"d",function(){return X}),l.d(Ie,"a",function(){return V}),l.d(Ie,"f",function(){return le}),l.d(Ie,"b",function(){return Z});var oe=l("KQm4"),Le=l("VTBJ"),ge=l("Ff2n"),Te=l("Zm9Q"),Oe=l("Kwbf"),Re=l("OZM5");function ee(z,$){return z!=null?z:$}function B(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=new Map;function U(te){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(te||[]).forEach(function(me){var Ce=me.key,de=me.children;Object(Oe.a)(Ce!=null,"Tree node must have a certain key: [".concat(E).concat(Ce,"]"));var I=String(Ce);Object(Oe.a)(!$.has(I)||Ce===null||Ce===void 0,"Same 'key' exist in the Tree: ".concat(I)),$.set(I,!0),U(de,"".concat(E).concat(I," > "))})}U(z)}function F(z){function $(U){var te=Object(Te.a)(U);return te.map(function(E){if(!Object(Re.i)(E))return Object(Oe.a)(!E,"Tree/TreeNode can only accept TreeNode as children."),null;var me=E.key,Ce=E.props,de=Ce.children,I=Object(ge.a)(Ce,["children"]),g=Object(Le.a)({key:me},I),Q=$(de);return Q.length&&(g.children=Q),g}).filter(function(E){return E})}return $(z)}function X(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],U=new Set($===!0?[]:$),te=[];function E(me){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return me.map(function(de,I){var g=Object(Re.h)(Ce?Ce.pos:"0",I),Q=ee(de.key,g),S=Object(Le.a)(Object(Le.a)({},de),{},{parent:Ce,pos:g,children:null,data:de,isStart:[].concat(Object(oe.a)(Ce?Ce.isStart:[]),[I===0]),isEnd:[].concat(Object(oe.a)(Ce?Ce.isEnd:[]),[I===me.length-1])});return te.push(S),$===!0||U.has(Q)?S.children=E(de.children||[],S):S.children=[],S})}return E(z),te}function W(z,$,U){var te;U?typeof U=="string"?te=function(Ce){return Ce[U]}:typeof U=="function"&&(te=function(Ce){return U(Ce)}):te=function(Ce,de){return ee(Ce.key,de)};function E(me,Ce,de){var I=me?me.children:z,g=me?Object(Re.h)(de.pos,Ce):"0";if(me){var Q=te(me,g),S={node:me,index:Ce,pos:g,key:Q,parentPos:de.node?de.pos:null,level:de.level+1};$(S)}I&&I.forEach(function(A,x){E(A,x,{node:me,pos:g,level:de?de.level+1:-1})})}E(null)}function V(z){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=$.initWrapper,te=$.processEntity,E=$.onProcessFinished,me=arguments.length>2?arguments[2]:void 0,Ce={},de={},I={posEntities:Ce,keyEntities:de};return U&&(I=U(I)||I),W(z,function(g){var Q=g.node,S=g.index,A=g.pos,x=g.key,b=g.parentPos,N=g.level,T={node:Q,index:S,key:x,pos:A,level:N},y=ee(x,A);Ce[A]=T,de[y]=T,T.parent=Ce[b],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),te&&te(T,I)},me),E&&E(I),I}function le(z,$){var U=$.expandedKeys,te=$.selectedKeys,E=$.loadedKeys,me=$.loadingKeys,Ce=$.checkedKeys,de=$.halfCheckedKeys,I=$.dragOverNodeKey,g=$.dropPosition,Q=$.keyEntities,S=Q[z],A={eventKey:z,expanded:U.indexOf(z)!==-1,selected:te.indexOf(z)!==-1,loaded:E.indexOf(z)!==-1,loading:me.indexOf(z)!==-1,checked:Ce.indexOf(z)!==-1,halfChecked:de.indexOf(z)!==-1,pos:String(S?S.pos:""),dragOver:I===z&&g===0,dragOverGapTop:I===z&&g===-1,dragOverGapBottom:I===z&&g===1};return A}function Z(z){var $=z.data,U=z.expanded,te=z.selected,E=z.checked,me=z.loaded,Ce=z.loading,de=z.halfChecked,I=z.dragOver,g=z.dragOverGapTop,Q=z.dragOverGapBottom,S=z.pos,A=z.active,x=Object(Le.a)(Object(Le.a)({},$),{},{expanded:U,selected:te,checked:E,loaded:me,loading:Ce,halfChecked:de,dragOver:I,dragOverGapTop:g,dragOverGapBottom:Q,pos:S,active:A});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(Oe.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),z}}),x}},"8EBN":function(it,Ie,l){(function(oe){oe(l("VrN/"))})(function(oe){"use strict";oe.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 Le=0;Le<oe.modeInfo.length;Le++){var ge=oe.modeInfo[Le];ge.mimes&&(ge.mime=ge.mimes[0])}oe.findModeByMIME=function(Te){Te=Te.toLowerCase();for(var Oe=0;Oe<oe.modeInfo.length;Oe++){var Re=oe.modeInfo[Oe];if(Re.mime==Te)return Re;if(Re.mimes){for(var ee=0;ee<Re.mimes.length;ee++)if(Re.mimes[ee]==Te)return Re}}if(/\+xml$/.test(Te))return oe.findModeByMIME("application/xml");if(/\+json$/.test(Te))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(Te){Te=Te.toLowerCase();for(var Oe=0;Oe<oe.modeInfo.length;Oe++){var Re=oe.modeInfo[Oe];if(Re.ext){for(var ee=0;ee<Re.ext.length;ee++)if(Re.ext[ee]==Te)return Re}}},oe.findModeByFileName=function(Te){for(var Oe=0;Oe<oe.modeInfo.length;Oe++){var Re=oe.modeInfo[Oe];if(Re.file&&Re.file.test(Te))return Re}var ee=Te.lastIndexOf("."),B=ee>-1&&Te.substring(ee+1,Te.length);if(B)return oe.findModeByExtension(B)},oe.findModeByName=function(Te){Te=Te.toLowerCase();for(var Oe=0;Oe<oe.modeInfo.length;Oe++){var Re=oe.modeInfo[Oe];if(Re.name.toLowerCase()==Te)return Re;if(Re.alias){for(var ee=0;ee<Re.alias.length;ee++)if(Re.alias[ee].toLowerCase()==Te)return Re}}}})},"8hTe":function(it,Ie,l){it.exports={button:"button___1wy9m"}},"9Bee":function(it,Ie,l){"use strict";var oe=l("DYRE"),Le=l("zeV3"),ge=l("+L6B"),Te=l("2/Rp"),Oe=l("k1fw"),Re=l("9og8"),ee=l("tJVT"),B=l("WmNS"),F=l.n(B),X=l("q1tI"),W=l.n(X),V=l("vg9a"),le=l("DlQD"),Z=l.n(le),z=l("rUJ1");function $(h,o){var r=h.match(/^(\s+)(?:```)/);if(r===null)return o;var c=r[1];return o.split(`
`).map(function(p){var d=p.match(/^\s+/);if(d===null)return p;var ie=Object(ee.a)(d,1),Qe=ie[0];return Qe.length>=c.length?p.slice(c.length):p}).join(`
`)}var U=[],te=["<ul>"],E=new Z.a.Renderer,me=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ce(){U.length=0,te=["<ul>"]}var de={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function I(h,o,r,c){if(o>=h.length||h[o].level<=r)return o;var p=h[o];c.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var d=[];return o=I(h,o,p.level,d),d.length>0&&(c.push("<ul>"),d.forEach(function(ie){c.push(ie)}),c.push("</ul>")),c.push("</li>"),o=I(h,o,r,c),o}function g(){return I(U,0,0,te),te.push("</ul>"),te.join("")}var Q={heading:function(o){var r=me.exec(o);if(r)return{type:"heading",raw:r[0],depth:r[1].length,text:r[2]}},fences:function(o){var r=this.rules.block.fences.exec(o);if(r){var c=r[0],p=$(c,r[3]||""),d=r[2]?r[2].trim():r[2];if(["latex","katex","math"].indexOf(d)>=0){var ie=x(),Qe=p;p=ie,b[ie]={type:"block",expression:Qe}}return{type:"code",raw:c,lang:d,text:p}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,A=0,x=function(){return"__special_katext_id_".concat(A++,"__")},b={};function N(){return b}function T(){A=0,b={}}function y(h){return h=h.replace(S,function(o,r){var c=x();return b[c]={type:"inline",expression:r},c}),h}var J=E.listitem;E.listitem=function(h){return J(y(h))};var ye=E.paragraph;E.paragraph=function(h){return ye(y(h))};var q=E.tablecell;E.tablecell=function(h,o){return q(y(h),o)},E.code=function(h,o,r){var c=(o||"").match(/\S*/)[0];return c?["latex","katex","math"].indexOf(c)>=0?"<p class='editormd-tex'>".concat(h,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(r?h:Object(z.escape)(h,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(r?h:Object(z.escape)(h,!0))+"</code></pre>"},E.heading=function(h,o,r){var c=this.options.headerPrefix+r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return U.push({anchor:c,level:o,text:h}),"<h"+o+' id="'+c+'">'+h+"</h"+o+">"},Z.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Z.a.use({tokenizer:Q,renderer:E});var _e=Z.a,k=l("SJMd"),f=l("ulZh"),R=l.n(f),ue=l("m3rI"),se=l("Oy/b"),Se=l("p5ED"),fe=l("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var pe=function(h,o){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,c){r.__proto__=c}||function(r,c){for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(r[p]=c[p])})(h,o)};function j(h,o){function r(){this.constructor=h}pe(h,o),h.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}function M(h,o,r,c){return new(r||(r=Promise))(function(p,d){function ie(Mt){try{Ct(c.next(Mt))}catch(tt){d(tt)}}function Qe(Mt){try{Ct(c.throw(Mt))}catch(tt){d(tt)}}function Ct(Mt){var tt;Mt.done?p(Mt.value):(tt=Mt.value,tt instanceof r?tt:new r(function(Ze){Ze(tt)})).then(ie,Qe)}Ct((c=c.apply(h,o||[])).next())})}function re(h,o){var r,c,p,d,ie={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return d={next:Qe(0),throw:Qe(1),return:Qe(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function Qe(Ct){return function(Mt){return function(tt){if(r)throw new TypeError("Generator is already executing.");for(;ie;)try{if(r=1,c&&(p=2&tt[0]?c.return:tt[0]?c.throw||((p=c.return)&&p.call(c),0):c.next)&&!(p=p.call(c,tt[1])).done)return p;switch(c=0,p&&(tt=[2&tt[0],p.value]),tt[0]){case 0:case 1:p=tt;break;case 4:return ie.label++,{value:tt[1],done:!1};case 5:ie.label++,c=tt[1],tt=[0];continue;case 7:tt=ie.ops.pop(),ie.trys.pop();continue;default:if(!(p=ie.trys,(p=p.length>0&&p[p.length-1])||tt[0]!==6&&tt[0]!==2)){ie=0;continue}if(tt[0]===3&&(!p||tt[1]>p[0]&&tt[1]<p[3])){ie.label=tt[1];break}if(tt[0]===6&&ie.label<p[1]){ie.label=p[1],p=tt;break}if(p&&ie.label<p[2]){ie.label=p[2],ie.ops.push(tt);break}p[2]&&ie.ops.pop(),ie.trys.pop();continue}tt=o.call(h,ie)}catch(Ze){tt=[6,Ze],c=0}finally{r=p=0}if(5&tt[0])throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}([Ct,Mt])}}}function P(){for(var h=0,o=0,r=arguments.length;o<r;o++)h+=arguments[o].length;var c=Array(h),p=0;for(o=0;o<r;o++)for(var d=arguments[o],ie=0,Qe=d.length;ie<Qe;ie++,p++)c[p]=d[ie];return c}var _=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,r){for(var c=0,p=r;c<p.length;c++){var d=p[c],ie=d[0],Qe=d[1];o.setAttribute(ie,Qe)}},h.createRect=function(o,r,c){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",r.toString()),c&&h.setAttributes(p,c),p},h.createLine=function(o,r,c,p,d){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",o.toString()),ie.setAttribute("y1",r.toString()),ie.setAttribute("x2",c.toString()),ie.setAttribute("y2",p.toString()),d&&h.setAttributes(ie,d),ie},h.createPolygon=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","polygon");return c.setAttribute("points",o),r&&h.setAttributes(c,r),c},h.createCircle=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","circle");return c.setAttribute("cx",(o/2).toString()),c.setAttribute("cy",(o/2).toString()),c.setAttribute("r",o.toString()),r&&h.setAttributes(c,r),c},h.createEllipse=function(o,r,c){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(r/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(r/2).toString()),c&&h.setAttributes(p,c),p},h.createGroup=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(r,o),r},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,r,c,p,d,ie,Qe){var Ct=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(Ct,[["id",o],["orient",r],["markerWidth",c.toString()],["markerHeight",p.toString()],["refX",d.toString()],["refY",ie.toString()]]),Ct.appendChild(Qe),Ct},h.createText=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x","0"),r.setAttribute("y","0"),o&&h.setAttributes(r,o),r},h.createTSpan=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");return c.textContent=o,r&&h.setAttributes(c,r),c},h.createImage=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(r,o),r},h.createPoint=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return c.x=o,c.y=r,c},h.createPath=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",o),r&&h.setAttributes(c,r),c},h}(),he=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),Pe=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,r,c){var p=this;return new Promise(function(d){var ie=c!==void 0?c:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var Qe=document.createElementNS("http://www.w3.org/2000/svg","svg");Qe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Qe.setAttribute("width",r.width.baseVal.valueAsString),Qe.setAttribute("height",r.height.baseVal.valueAsString),Qe.setAttribute("viewBox","0 0 "+r.viewBox.baseVal.width.toString()+" "+r.viewBox.baseVal.height.toString()),Qe.innerHTML=r.innerHTML,p.naturalSize===!0?(Qe.width.baseVal.value=o.naturalWidth,Qe.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(Qe.width.baseVal.value=p.width,Qe.height.baseVal.value=p.height),ie.width=Qe.width.baseVal.value,ie.height=Qe.height.baseVal.value;var Ct=Qe.outerHTML,Mt=ie.getContext("2d");p.markersOnly!==!0&&Mt.drawImage(o,0,0,ie.width,ie.height);var tt=window.URL,Ze=new Image(ie.width,ie.height);Ze.setAttribute("crossOrigin","anonymous");var ce=new Blob([Ct],{type:"image/svg+xml"}),nt=tt.createObjectURL(ce);Ze.onload=function(){Mt.drawImage(Ze,0,0),tt.revokeObjectURL(nt);var Xt=ie.toDataURL(p.imageType,p.imageQuality);d(Xt)},Ze.src=nt})},h}(),Je=function(){},Me=function(){function h(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),h.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},h.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)},h.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 We("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new We("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new We("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ee("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ee("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),We=function(h,o){this.selector=h,this.style=o},Ee=function(h,o){this.localName=h,this.style=o},De=function(){function h(o,r,c,p,d){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=r,this.markerItems=c,this.uiStyleSettings=p,this.styles=d,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return h.prototype.show=function(o){var r=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 c=document.createElement("div");c.className=this.toolbarBlockStyleClass.name,c.style.whiteSpace="nowrap",this.uiContainer.appendChild(c),this.addActionButton(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(d){var ie=document.createElement("div");ie.className=""+r.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",d.typeName),ie.innerHTML=d.icon,ie.addEventListener("click",function(){r.markerToolbarButtonClicked(ie,d)}),r.buttons.push(ie),r.markerButtons.push(ie)}),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 p=document.createElement("div");p.className=this.toolbarBlockStyleClass.name,p.style.whiteSpace="nowrap",p.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(p),this.addActionButton(p,'<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(p,'<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()},h.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},h.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},h.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},h.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 r=0;r<this.markerButtons.length;r++)r<o||r===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[r]):(r===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[r]))}},h.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")},h.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(r){r.className=r.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),r.className=r.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),r.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},h.prototype.addActionButton=function(o,r,c){var p=this,d=document.createElement("div");switch(d.className=""+this.toolbarButtonStyleClass.name,d.innerHTML=r,d.setAttribute("data-action",c),d.addEventListener("click",function(){p.actionToolbarButtonClicked(d,c)}),c){case"select":d.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":d.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":d.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":d.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":d.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(d),this.buttons.push(d)},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ee("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new We("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new We("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},h.prototype.markerToolbarButtonClicked=function(o,r){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(c){return c("marker",r)}),this.markerButtonOverflowBlock.style.display="none"},h.prototype.actionToolbarButtonClicked=function(o,r){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(c){return c("action",r)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},h.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)},h.prototype.setActiveMarkerButton=function(o){var r=this.markerButtons.find(function(c){return c.getAttribute("data-type-name")===o});r&&this.setActiveButton(r)},h.prototype.setCurrentMarker=function(o){var r=this;this.currentMarker=o,this.buttons.filter(function(c){return/delete|notes/.test(c.getAttribute("data-action"))}).forEach(function(c){r.currentMarker===void 0?(c.style.fillOpacity="0.4",c.style.pointerEvents="none"):(c.style.fillOpacity="1",c.style.pointerEvents="all")})},h}(),Ve=function(){function h(o,r,c,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=r,this.uiStyleSettings=c,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var r=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ee("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ee("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ee("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*r)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*r)+`px;
padding: `+r+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new We("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new We("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},h.prototype.show=function(o){var r;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((r=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&r!==void 0?r:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},h.prototype.setPanelButtons=function(o){var r,c,p=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((r=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&r!==void 0?r:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((c=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&c!==void 0?c:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(d){var ie;d.uiStyleSettings=p.uiStyleSettings;var Qe=document.createElement("div");Qe.className=p.toolboxButtonStyleClass.name+" "+((ie=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:p.toolboxButtonStyleColorsClass.name),Qe.innerHTML=d.icon,Qe.title=d.title,Qe.addEventListener("click",function(){p.panelButtonClick(d)}),p.panelButtons.push(Qe),p.buttonRow.appendChild(Qe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},h.prototype.panelButtonClick=function(o){var r=this,c=-1;if(o!==this.activePanel){c=this.panels.indexOf(o),this.panelRow.innerHTML="";var p=o.getUi();p.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(p),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(){r.displayMode==="inline"?r.panelRow.style.display="none":r.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(d,ie){var Qe,Ct;d.className=r.toolboxButtonStyleClass.name+" "+(ie===c?""+((Qe=r.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Qe!==void 0?Qe:r.toolboxActiveButtonStyleColorsClass.name):""+((Ct=r.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ct!==void 0?Ct:r.toolboxButtonStyleColorsClass.name))})},h}(),et=function(h,o){this.title=h,this.icon=o},at=function(h){function o(r,c,p,d){var ie=h.call(this,r,d||'<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 ie.colors=[],ie.addTransparent=!1,ie.colorBoxes=[],ie.colors=c,ie.currentColor=p,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return j(o,h),o.prototype.getUi=function(){var r=this,c=document.createElement("div");return c.style.overflow="hidden",c.style.whiteSpace="nowrap",this.colors.forEach(function(p){var d=r.getColorBox(p);c.appendChild(d),r.colorBoxes.push(d)}),c},o.prototype.getColorBox=function(r){var c=this,p=this.uiStyleSettings.toolbarHeight/4,d=this.uiStyleSettings.toolbarHeight-p,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=d-2+"px",ie.style.height=d-2+"px",ie.style.padding="1px",ie.style.marginRight="2px",ie.style.marginBottom="2px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderRadius=(d+2)/2+"px",ie.style.borderColor=r===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){c.setCurrentColor(r,ie)});var Qe=document.createElement("div");return Qe.style.display="inline-block",Qe.style.width=d-2+"px",Qe.style.height=d-2+"px",Qe.style.backgroundColor=r,Qe.style.borderRadius=d/2+"px",r==="transparent"&&(Qe.style.fill=this.uiStyleSettings.toolboxAccentColor,Qe.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>`),ie.appendChild(Qe),ie},o.prototype.setCurrentColor=function(r,c){var p=this;this.currentColor=r,this.colorBoxes.forEach(function(d){d.style.borderColor=d===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(r)},o}(et),Ye=function(){function h(o,r,c){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=r,this.globalSettings=c,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(h.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(o){return!1},Object.defineProperty(h.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),h.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},h.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},h.prototype.pointerDown=function(o,r){},h.prototype.dblClick=function(o,r){},h.prototype.manipulate=function(o){},h.prototype.pointerUp=function(o){this.stateChanged()},h.prototype.dispose=function(){},h.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},h.prototype.getState=function(){return{typeName:h.typeName,state:this.state,notes:this.notes}},h.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},h.prototype.scale=function(o,r){},h.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},h.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},h.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)}},h.typeName="MarkerBase",h}(),He=function(){function h(){this.findGripByVisual=this.findGripByVisual.bind(this)}return h.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},h}(),St=function(){function h(){this.GRIP_SIZE=10,this.visual=_.createGroup(),this.visual.appendChild(_.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h}(),ft=function(){function h(){}return h.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},h.toSVGMatrix=function(o,r){return o.a=r.a,o.b=r.b,o.c=r.c,o.d=r.d,o.e=r.e,o.f=r.f,o},h}(),bt=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.left=0,d.top=0,d.width=0,d.height=0,d.defaultSize={x:50,y:20},d.offsetX=0,d.offsetY=0,d.rotationAngle=0,d.CB_DISTANCE=10,d._suppressMarkerCreateEvent=!1,d.container.transform.baseVal.appendItem(_.createTransform()),d.setupControlBox(),d}return j(o,h),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(r){this._visual=r;var c=_.createTransform();this._visual.transform.baseVal.appendItem(c)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(r){return!!h.prototype.ownsTarget.call(this,r)||!!(this.controlGrips.findGripByVisual(r)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(r))},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.state==="new"&&(this.left=r.x,this.top=r.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var p=this.unrotatePoint(r);if(this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.offsetX=p.x-this.left,this.offsetY=p.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(c),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(c)){this.activeGrip=this.rotatorGrip;var d=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=d.x-this.width/2,this.top=d.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ie=this.container.transform.baseVal.getItem(0);ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(r){var c=this.state;h.prototype.pointerUp.call(this,r),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(r),this._state="select",c==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(r){this.visual.style.transform="translate("+r.x+"px, "+r.y+"px)"},o.prototype.manipulate=function(r){var c=this.unrotatePoint(r);this.state==="creating"?this.resize(r):this.state==="move"?(this.left=this.manipulationStartLeft+(c.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(c.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(c):this.state==="rotate"&&this.rotate(r)},o.prototype.resize=function(r){var c=this.manipulationStartLeft,p=this.manipulationStartWidth,d=this.manipulationStartTop,ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:c=this.manipulationStartLeft+r.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-c;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:p=this.manipulationStartWidth+r.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:d=this.manipulationStartTop+r.y-this.manipulationStartY,ie=this.manipulationStartHeight+this.manipulationStartTop-d;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+r.y-this.manipulationStartY}p>=0?(this.left=c,this.width=p):(this.left=c+p,this.width=-p),ie>=0?(this.top=d,this.height=ie):(this.top=d+ie,this.height=-ie),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(r){if(Math.abs(r.x-this.centerX)>.1){var c=Math.sign(r.x-this.centerX);this.rotationAngle=180*Math.atan((r.y-this.centerY)/(r.x-this.centerX))/Math.PI+90*c,this.applyRotation()}},o.prototype.applyRotation=function(){var r=this.container.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(r,0)},o.prototype.rotatePoint=function(r){if(this.rotationAngle===0)return r;var c=this.container.getCTM(),p=_.createPoint(r.x,r.y);return{x:(p=p.matrixTransform(c)).x,y:p.y}},o.prototype.unrotatePoint=function(r){if(this.rotationAngle===0)return r;var c=this.container.getCTM();c=c.inverse();var p=_.createPoint(r.x,r.y);return{x:(p=p.matrixTransform(c)).x,y:p.y}},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=_.createGroup();var r=_.createTransform();r.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(r),this.container.appendChild(this.controlBox),this.controlRect=_.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=_.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new He,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var r=this.controlBox.transform.baseVal.getItem(0);r.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(r,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 r=new St;return r.visual.transform.baseVal.appendItem(_.createTransform()),this.controlBox.appendChild(r.visual),r},o.prototype.positionGrips=function(){var r=this.controlGrips.topLeft.GRIP_SIZE,c=-r/2,p=c,d=(this.width+this.CB_DISTANCE)/2-r/2,ie=(this.height+this.CB_DISTANCE)/2-r/2,Qe=this.height+this.CB_DISTANCE-r/2,Ct=this.width+this.CB_DISTANCE-r/2;this.positionGrip(this.controlGrips.topLeft.visual,c,p),this.positionGrip(this.controlGrips.topCenter.visual,d,p),this.positionGrip(this.controlGrips.topRight.visual,Ct,p),this.positionGrip(this.controlGrips.centerLeft.visual,c,ie),this.positionGrip(this.controlGrips.centerRight.visual,Ct,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,c,Qe),this.positionGrip(this.controlGrips.bottomCenter.visual,d,Qe),this.positionGrip(this.controlGrips.bottomRight.visual,Ct,Qe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,d,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(r,c,p){var d=r.transform.baseVal.getItem(0);d.setTranslate(c,p),r.transform.baseVal.replaceItem(d,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:ft.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ft.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},h.prototype.getState.call(this))},o.prototype.restoreState=function(r){h.prototype.restoreState.call(this,r);var c=r;this.left=c.left,this.top=c.top,this.width=c.width,this.height=c.height,this.rotationAngle=c.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ft.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,c.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ft.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,c.containerTransformMatrix))},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c);var p=this.rotatePoint({x:this.left,y:this.top}),d=this.unrotatePoint({x:p.x*r,y:p.y*c});this.left=d.x,this.top=d.y,this.width=this.width*r,this.height=this.height*c,this.adjustControlBox()},o}(Ye),dt=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.fillColor="transparent",d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.opacity=1,d.setStrokeColor=d.setStrokeColor.bind(d),d.setFillColor=d.setFillColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.createVisual=d.createVisual.bind(d),d}return j(o,h),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.visual)},o.prototype.createVisual=function(){this.visual=_.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.manipulate=function(r){h.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){h.prototype.resize.call(this,r),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(r){h.prototype.pointerUp.call(this,r),this.setSize()},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.visual&&_.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(r),this.stateChanged()},o.prototype.setFillColor=function(r){this.fillColor=r,this.visual&&_.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.visual&&_.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.visual&&_.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this))},o.prototype.restoreState=function(r){var c=r;this.fillColor=c.fillColor,this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.strokeDasharray,this.opacity=c.opacity,this.createVisual(),h.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c),this.setSize()},o.title="Rectangle marker",o}(bt),Dt=function(h){function o(r,c,p,d){var ie=h.call(this,r,d||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ie.widths=[],ie.widthBoxes=[],ie.widths=c,ie.currentWidth=p,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return j(o,h),o.prototype.getUi=function(){var r=this,c=document.createElement("div");return c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2",this.widths.forEach(function(p){var d=document.createElement("div");d.style.display="flex",d.style.flexGrow="2",d.style.alignItems="center",d.style.justifyContent="space-between",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.borderColor=p===r.currentWidth?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentWidth(p,d)}),c.appendChild(d);var ie=document.createElement("div");ie.innerText=p.toString(),ie.style.marginRight="5px",d.appendChild(ie);var Qe=document.createElement("div");Qe.style.minHeight="20px",Qe.style.flexGrow="2",Qe.style.display="flex",Qe.style.alignItems="center";var Ct=document.createElement("hr");Ct.style.minWidth="20px",Ct.style.border="0px",Ct.style.borderTop=p+"px solid "+r.uiStyleSettings.toolboxColor,Ct.style.flexGrow="2",Qe.appendChild(Ct),d.appendChild(Qe),r.widthBoxes.push(d)}),c},o.prototype.setCurrentWidth=function(r,c){var p=this;this.currentWidth=r,this.widthBoxes.forEach(function(d){d.style.borderColor=d===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(et),Ot=function(h){function o(r,c,p,d){var ie=h.call(this,r,d||'<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 ie.styles=[],ie.styleBoxes=[],ie.styles=c,ie.currentStyle=p,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return j(o,h),o.prototype.getUi=function(){var r=this,c=document.createElement("div");return c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2",this.styles.forEach(function(p){var d=document.createElement("div");d.style.display="flex",d.style.alignItems="center",d.style.justifyContent="space-between",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.overflow="hidden",d.style.maxWidth=100/r.styles.length-5+"%",d.style.borderColor=p===r.currentStyle?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentStyle(p,d)}),c.appendChild(d);var ie=document.createElement("div");ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.overflow="hidden";var Qe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+r.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(p!==""?'stroke-dasharray="'+p+'"':"")+` />
</svg>`;ie.innerHTML=Qe,d.appendChild(ie),r.styleBoxes.push(d)}),c},o.prototype.setCurrentStyle=function(r,c){var p=this;this.currentStyle=r,this.styleBoxes.forEach(function(d){d.style.borderColor=d===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(et),_t=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.strokeColor=p.defaultColor,d.strokeWidth=p.defaultStrokeWidth,d.strokeDasharray=p.defaultStrokeDasharray,d.strokePanel=new at("Line color",p.defaultColorSet,p.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.strokeWidthPanel=new Dt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d}return j(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=h.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(dt),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},It=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.x1=0,d.y1=0,d.x2=0,d.y2=0,d.defaultLength=50,d.manipulationStartX=0,d.manipulationStartY=0,d.manipulationStartX1=0,d.manipulationStartY1=0,d.manipulationStartX2=0,d.manipulationStartY2=0,d.setupControlBox(),d}return j(o,h),o.prototype.ownsTarget=function(r){return!!h.prototype.ownsTarget.call(this,r)||!(!this.grip1.ownsTarget(r)&&!this.grip2.ownsTarget(r))},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.manipulationStartX=r.x,this.manipulationStartY=r.y,this.state==="new"&&(this.x1=r.x,this.y1=r.y,this.x2=r.x,this.y2=r.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(c)?this.activeGrip=this.grip1:this.grip2.ownsTarget(c)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(r){var c=this.state;h.prototype.pointerUp.call(this,r),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(r),this._state="select",c==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(r){this.state==="creating"?this.resize(r):this.state==="move"?(this.x1=this.manipulationStartX1+r.x-this.manipulationStartX,this.y1=this.manipulationStartY1+r.y-this.manipulationStartY,this.x2=this.manipulationStartX2+r.x-this.manipulationStartX,this.y2=this.manipulationStartY2+r.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(r)},o.prototype.resize=function(r){switch(this.activeGrip){case this.grip1:this.x1=r.x,this.y1=r.y;break;case this.grip2:case void 0:this.x2=r.x,this.y2=r.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=_.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var r=new St;return r.visual.transform.baseVal.appendItem(_.createTransform()),this.controlBox.appendChild(r.visual),r},o.prototype.positionGrips=function(){var r=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-r/2,this.y1-r/2),this.positionGrip(this.grip2.visual,this.x2-r/2,this.y2-r/2)},o.prototype.positionGrip=function(r,c,p){var d=r.transform.baseVal.getItem(0);d.setTranslate(c,p),r.transform.baseVal.replaceItem(d,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},h.prototype.getState.call(this))},o.prototype.restoreState=function(r){h.prototype.restoreState.call(this,r);var c=r;this.x1=c.x1,this.y1=c.y1,this.x2=c.x2,this.y2=c.y2},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c),this.x1=this.x1*r,this.y1=this.y1*c,this.x2=this.x2*r,this.y2=this.y2*c,this.adjustVisual(),this.adjustControlBox()},o}(Ye),kt=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.setStrokeColor=d.setStrokeColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.strokeColor=p.defaultColor,d.strokeWidth=p.defaultStrokeWidth,d.strokeDasharray=p.defaultStrokeDasharray,d.strokePanel=new at("Line color",p.defaultColorSet,p.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.strokeWidthPanel=new Dt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d}return j(o,h),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.selectorLine&&r!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.selectorLine=_.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),_.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.adjustVisual(),this.colorChanged(r)},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.adjustVisual()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,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 r=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){h.prototype.restoreState.call(this,r);var c=r;this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.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}(It),Be=function(h){function o(r,c,p,d){var ie=h.call(this,r,d||'<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 ie.fonts=[],ie.fontBoxes=[],ie.fonts=c,ie.currentFont=p,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return j(o,h),o.prototype.getUi=function(){var r=this,c=document.createElement("div");return c.style.overflow="hidden",c.style.flexGrow="2",this.fonts.forEach(function(p){var d=document.createElement("div");d.style.display="inline-block",d.style.alignItems="center",d.style.justifyContent="space-between",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.overflow="hidden",d.style.maxWidth=100/r.fonts.length-5+"%",d.style.borderColor=p===r.currentFont?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentFont(p,d)}),c.appendChild(d);var ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=p,ie.style.overflow="hidden";var Qe=document.createElement("div");Qe.style.whiteSpace="nowrap",Qe.style.overflow="hidden",Qe.style.textOverflow="ellipsis",Qe.innerHTML="The quick brown fox jumps over the lazy dog",ie.appendChild(Qe),d.appendChild(ie),r.fontBoxes.push(d)}),c},o.prototype.setCurrentFont=function(r,c){var p=this;this.currentFont=r,this.fontBoxes.forEach(function(d){d.style.borderColor=d===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(et),Ke=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.color="transparent",d.padding=5,d.DEFAULT_TEXT="your text here",d.text=d.DEFAULT_TEXT,d.isMoved=!1,d.color=p.defaultColor,d.fontFamily=p.defaultFontFamily,d.defaultSize={x:100,y:30},d.setColor=d.setColor.bind(d),d.setFont=d.setFont.bind(d),d.renderText=d.renderText.bind(d),d.sizeText=d.sizeText.bind(d),d.textEditDivClicked=d.textEditDivClicked.bind(d),d.showTextEditor=d.showTextEditor.bind(d),d.setSize=d.setSize.bind(d),d.positionTextEditor=d.positionTextEditor.bind(d),d.colorPanel=new at("Color",p.defaultColorSet,p.defaultColor),d.colorPanel.onColorChanged=d.setColor,d.fontFamilyPanel=new Be("Font",p.defaultFontFamilies,p.defaultFontFamily),d.fontFamilyPanel.onFontChanged=d.setFont,d}return j(o,h),o.prototype.ownsTarget=function(r){if(h.prototype.ownsTarget.call(this,r)||r===this.visual||r===this.textElement||r===this.bgRectangle)return!0;var c=!1;return this.textElement.childNodes.forEach(function(p){p===r&&(c=!0)}),c},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.bgRectangle=_.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_.createTransform()),this.textElement.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.isMoved=!1,this.pointerDownPoint=r,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.renderText=function(){var r=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(c){r.textElement.appendChild(_.createTSpan(c.trim()===""?" ":c.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var r=this.textElement.getBBox(),c=1;if(r.width>0&&r.height>0){var p=(1*this.width-this.width*this.padding*2/100)/r.width,d=(1*this.height-this.height*this.padding*2/100)/r.height;c=Math.min(p,d)}return c},o.prototype.getTextPosition=function(r){var c=this.textElement.getBBox(),p=0,d=0;return c.width>0&&c.height>0&&(p=(this.width-c.width*r)/2,d=this.height/2-c.height*r/2),{x:p,y:d}},o.prototype.sizeText=function(){var r=this.textElement.getBBox(),c=this.getTextScale(),p=this.getTextPosition(c);p.y-=r.y*c,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+c+", "+c+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(c,c))},o.prototype.manipulate=function(r){h.prototype.manipulate.call(this,r),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(r.x-this.pointerDownPoint.x)>5||Math.abs(r.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(r){h.prototype.resize.call(this,r),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){h.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(r){var c=this.state;c==="creating"&&(this._suppressMarkerCreateEvent=!0),h.prototype.pointerUp.call(this,r),this.setSize(),(c==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var r=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(c){c.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var c=Number.parseFloat(r.textEditor.style.fontSize);r.textEditor.clientWidth>=Number.parseInt(r.textEditor.style.maxWidth)&&c>.9;)c-=.1,r.textEditor.style.fontSize=Math.max(c,.9)+"em"}),this.textEditor.addEventListener("keyup",function(c){c.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(c){if(c.clipboardData){var p=c.clipboardData.getData("text"),d=window.getSelection();if(!d.rangeCount)return!1;d.deleteFromDocument(),d.getRangeAt(0).insertNode(document.createTextNode(p)),c.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){r.textEditDivClicked(r.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 r=this.getTextScale(),c=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),p=this.textElement.getBBox(),d={x:p.width*r,y:p.height*r};c.x-=d.x/2,c.y-=d.y/2,this.textEditor.style.top=c.y+"px",this.textEditor.style.left=c.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-c.x+"px",this.textEditor.style.fontSize=Math.max(16*r,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(r){this.text=r.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){h.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),h.prototype.deselect.call(this)},o.prototype.dblClick=function(r,c){h.prototype.dblClick.call(this,r,c),this.showTextEditor()},o.prototype.setColor=function(r){this.textElement&&_.setAttributes(this.textElement,[["fill",r]]),this.color=r,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(r)},o.prototype.setFont=function(r){this.textElement&&_.setAttributes(this.textElement,[["font-family",r]]),this.fontFamily=r,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 r=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var c=r;this.color=c.color,this.fontFamily=c.fontFamily,this.padding=c.padding,this.text=c.text,this.createVisual(),h.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c),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}(bt),K=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.color="transparent",d.lineWidth=3,d.drawing=!1,d.pixelRatio=1,d.color=p.defaultColor,d.lineWidth=p.defaultStrokeWidth,d.pixelRatio=p.freehandPixelRatio,d.setColor=d.setColor.bind(d),d.addCanvas=d.addCanvas.bind(d),d.finishCreation=d.finishCreation.bind(d),d.setLineWidth=d.setLineWidth.bind(d),d.colorPanel=new at("Color",p.defaultColorSet,p.defaultColor),d.colorPanel.onColorChanged=d.setColor,d.lineWidthPanel=new Dt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),d.lineWidthPanel.onWidthChanged=d.setLineWidth,d}return j(o,h),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.drawingImage=_.createImage(),this.visual.appendChild(this.drawingImage);var r=_.createTransform();this.visual.transform.baseVal.appendItem(r),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,c){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(r.x,r.y),this.drawing=!0):h.prototype.pointerDown.call(this,r,c)},o.prototype.manipulate=function(r){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(r.x,r.y),this.canvasContext.stroke()):h.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){h.prototype.resize.call(this,r),_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(r){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):h.prototype.pointerUp.call(this,r)},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(),h.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),h.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var r=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),c=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],p=c[0],d=c[1],ie=c[2],Qe=c[3],Ct=!1,Mt=0;Mt<this.canvasElement.height;Mt++)for(var tt=0;tt<this.canvasElement.width;tt++)r.data[Mt*this.canvasElement.width*4+4*tt+3]>0&&(Ct=!0,Mt<d&&(d=Mt),tt<p&&(p=tt),Mt>Qe&&(Qe=Mt),tt>ie&&(ie=tt));if(Ct){this.left=p/this.pixelRatio,this.top=d/this.pixelRatio,this.width=(ie-p)/this.pixelRatio,this.height=(Qe-d)/this.pixelRatio;var Ze=document.createElement("canvas");Ze.width=ie-p,Ze.height=Qe-d,Ze.getContext("2d").putImageData(this.canvasContext.getImageData(p,d,ie-p,Qe-d),0,0),this.drawingImgUrl=Ze.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){_.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(r){this.color=r,this.colorChanged(r)},o.prototype.setLineWidth=function(r){this.lineWidth=r},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 r=Object.assign({drawingImgUrl:this.drawingImgUrl},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){this.createVisual(),h.prototype.restoreState.call(this,r),this.drawingImgUrl=r.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c),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}(bt),G=function(h){function o(r,c,p){var d=h.call(this,r,p||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return d.typeBoxes=[],d.currentType=c,d.setCurrentType=d.setCurrentType.bind(d),d}return j(o,h),o.prototype.getUi=function(){var r=this,c=document.createElement("div");c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2";for(var p=function(Qe){var Ct="both";switch(Qe){case 0:Ct="both";break;case 1:Ct="start";break;case 2:Ct="end";break;case 3:Ct="none"}var Mt=document.createElement("div");if(Mt.style.display="flex",Mt.style.flexGrow="2",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=Ct===d.currentType?d.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){r.setCurrentType(Ct,Mt)}),c.appendChild(Mt),Ct==="both"||Ct==="start"){var tt=document.createElement("div");tt.style.display="flex",tt.style.alignItems="center",tt.style.minHeight="20px",tt.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="`+(d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,tt.style.marginLeft="5px",Mt.appendChild(tt)}var Ze=document.createElement("div");Ze.style.display="flex",Ze.style.alignItems="center",Ze.style.minHeight="20px",Ze.style.flexGrow="2";var ce=document.createElement("hr");if(ce.style.minWidth="20px",ce.style.border="0px",ce.style.borderTop="3px solid "+(d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxColor:"#eeeeee"),ce.style.flexGrow="2",Ze.appendChild(ce),Mt.appendChild(Ze),Ct==="both"||Ct==="end"){var nt=document.createElement("div");nt.style.display="flex",nt.style.alignItems="center",nt.style.minHeight="20px",nt.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="`+(d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,nt.style.marginRight="5px",Mt.appendChild(nt)}d.typeBoxes.push(Mt)},d=this,ie=0;ie<4;ie++)p(ie);return c},o.prototype.setCurrentType=function(r,c){var p=this;this.currentType=r,this.typeBoxes.forEach(function(d){d.style.borderColor=d===c?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(et),H=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.arrowType="end",d.arrowBaseHeight=10,d.arrowBaseWidth=10,d.getArrowPoints=d.getArrowPoints.bind(d),d.setArrowType=d.setArrowType.bind(d),d.arrowTypePanel=new G("Arrow type","end"),d.arrowTypePanel.onArrowTypeChanged=d.setArrowType,d}return j(o,h),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.arrow1&&r!==this.arrow2)},o.prototype.getArrowPoints=function(r,c){var p=this.arrowBaseWidth+2*this.strokeWidth,d=this.arrowBaseHeight+2*this.strokeWidth;return r-p/2+","+(c+d/2)+" "+r+","+(c-d/2)+" "+(r+p/2)+","+(c+d/2)},o.prototype.createTips=function(){this.arrow1=_.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",_.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var r=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),c=this.arrow1.transform.baseVal.getItem(0);c.setRotate(r,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(c,0);var p=this.arrow2.transform.baseVal.getItem(0);p.setRotate(r+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(p,0)}},o.prototype.setArrowType=function(r){this.arrowType=r,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 r=Object.assign({arrowType:this.arrowType},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){h.prototype.restoreState.call(this,r);var c=r;this.arrowType=c.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}(kt),w=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.fillColor=p.defaultFillColor,d.strokeWidth=0,d.fillPanel=new at("Color",p.defaultColorSet,p.defaultFillColor),d.fillPanel.onColorChanged=d.setFillColor,d}return j(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=h.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(dt),O=function(h){function o(r,c,p,d){var ie=h.call(this,r,d||'<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 ie.opacities=[],ie.opacityBoxes=[],ie.opacities=c,ie.currentOpacity=p,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return j(o,h),o.prototype.getUi=function(){var r=this,c=document.createElement("div");return c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2",c.style.justifyContent="space-between",this.opacities.forEach(function(p){var d=document.createElement("div");d.style.display="flex",d.style.alignItems="center",d.style.justifyContent="center",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.borderColor=p===r.currentOpacity?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentOpacity(p,d)}),c.appendChild(d);var ie=document.createElement("div");ie.innerText=100*p+"%",d.appendChild(ie),r.opacityBoxes.push(d)}),c},o.prototype.setCurrentOpacity=function(r,c){var p=this;this.currentOpacity=r,this.opacityBoxes.forEach(function(d){d.style.borderColor=d===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(et),L=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.setOpacity=d.setOpacity.bind(d),d.fillColor=p.defaultHighlightColor,d.strokeWidth=0,d.opacity=p.defaultHighlightOpacity,d.fillPanel=new at("Color",p.defaultColorSet,d.fillColor),d.fillPanel.onColorChanged=d.setFillColor,d.opacityPanel=new O("Opacity",p.defaultOpacitySteps,d.opacity),d.opacityPanel.onOpacityChanged=d.setOpacity,d}return j(o,h),o.prototype.setOpacity=function(r){this.opacity=r,this.visual&&_.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=h.prototype.getState.call(this);return r.typeName=o.typeName,r},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}(w),D='<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>',ve=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.bgColor="transparent",d.tipPosition={x:0,y:0},d.tipBase1Position={x:0,y:0},d.tipBase2Position={x:0,y:0},d.tipMoving=!1,d.color=p.defaultStrokeColor,d.bgColor=p.defaultFillColor,d.fontFamily=p.defaultFontFamily,d.defaultSize={x:100,y:30},d.setBgColor=d.setBgColor.bind(d),d.getTipPoints=d.getTipPoints.bind(d),d.positionTip=d.positionTip.bind(d),d.setTipPoints=d.setTipPoints.bind(d),d.colorPanel=new at("Text color",p.defaultColorSet,d.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>'),d.colorPanel.onColorChanged=d.setColor,d.bgColorPanel=new at("Fill color",p.defaultColorSet,d.bgColor,D),d.bgColorPanel.onColorChanged=d.setBgColor,d.fontFamilyPanel=new Be("Font",p.defaultFontFamilies,p.defaultFontFamily),d.fontFamilyPanel.onFontChanged=d.setFont,d.tipGrip=new St,d.tipGrip.visual.transform.baseVal.appendItem(_.createTransform()),d.controlBox.appendChild(d.tipGrip.visual),d}return j(o,h),o.prototype.ownsTarget=function(r){return h.prototype.ownsTarget.call(this,r)||this.tipGrip.ownsTarget(r)||this.tip===r},o.prototype.createTip=function(){_.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(r,c){this.state==="new"&&h.prototype.pointerDown.call(this,r,c),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(c)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):h.prototype.pointerDown.call(this,r,c)},o.prototype.pointerUp=function(r){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,h.prototype.pointerUp.call(this,r);else{var c=this.state==="creating";h.prototype.pointerUp.call(this,r),this.setTipPoints(c),this.positionTip()}},o.prototype.manipulate=function(r){if(this.tipMoving){var c=this.unrotatePoint(r);this.tipPosition={x:c.x-this.manipulationStartLeft,y:c.y-this.manipulationStartTop},this.positionTip()}else h.prototype.manipulate.call(this,r)},o.prototype.setBgColor=function(r){this.bgRectangle&&this.tip&&(_.setAttributes(this.bgRectangle,[["fill",r]]),_.setAttributes(this.tip,[["fill",r]])),this.bgColor=r,this.fillColorChanged(r)},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(r){r===void 0&&(r=!1);var c=Math.min(this.height/2,15),p=this.height/5;r&&(this.tipPosition={x:c+p/2,y:this.height+20});var d=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?d<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:c,y:0},this.tipBase2Position={x:c+p,y:0}):(this.tipBase1Position={x:0,y:c},this.tipBase2Position={x:0,y:c+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?d<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-c-p,y:0},this.tipBase2Position={x:this.width-c,y:0}):(this.tipBase1Position={x:this.width,y:c},this.tipBase2Position={x:this.width,y:c+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?d<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-c-p,y:this.height},this.tipBase2Position={x:this.width-c,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-c-p},this.tipBase2Position={x:this.width,y:this.height-c}):d<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:c,y:this.height},this.tipBase2Position={x:c+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-c},this.tipBase2Position={x:0,y:this.height-c-p})},o.prototype.resize=function(r){h.prototype.resize.call(this,r),this.positionTip()},o.prototype.positionTip=function(){_.setAttributes(this.tip,[["points",this.getTipPoints()]]);var r=this.tipGrip.visual.transform.baseVal.getItem(0);r.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(r,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(),h.prototype.select.call(this)},o.prototype.getState=function(){var r=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var c=r;this.bgColor=c.bgColor,this.tipPosition=c.tipPosition,h.prototype.restoreState.call(this,r),this.createTip(),this.setTipPoints()},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c),this.tipPosition={x:this.tipPosition.x*r,y:this.tipPosition.y*c},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}(Ke),ne=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.fillColor="transparent",d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.opacity=1,d.strokeColor=p.defaultColor,d.strokeWidth=p.defaultStrokeWidth,d.strokeDasharray=p.defaultStrokeDasharray,d.fillColor=p.defaultFillColor,d.setStrokeColor=d.setStrokeColor.bind(d),d.setFillColor=d.setFillColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.setOpacity=d.setOpacity.bind(d),d.createVisual=d.createVisual.bind(d),d.strokePanel=new at("Line color",P(p.defaultColorSet,["transparent"]),p.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.fillPanel=new at("Fill color",P(p.defaultColorSet,["transparent"]),d.fillColor,D),d.fillPanel.onColorChanged=d.setFillColor,d.strokeWidthPanel=new Dt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d.opacityPanel=new O("Opacity",p.defaultOpacitySteps,d.opacity),d.opacityPanel.onOpacityChanged=d.setOpacity,d}return j(o,h),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.visual)},o.prototype.createVisual=function(){this.visual=_.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.manipulate=function(r){h.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){h.prototype.resize.call(this,r),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),_.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(r){h.prototype.pointerUp.call(this,r),this.setSize()},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.visual&&_.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(r),this.stateChanged()},o.prototype.setFillColor=function(r){this.fillColor=r,this.visual&&_.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(r),this.stateChanged()},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.visual&&_.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.visual&&_.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(r){this.opacity=r,this.visual&&_.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var c=r;this.fillColor=c.fillColor,this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.strokeDasharray,this.opacity=c.opacity,this.createVisual(),h.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,c){h.prototype.scale.call(this,r,c),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}(bt),xe=function(h){function o(r,c,p){return h.call(this,r,c,p)||this}return j(o,h),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.tip1&&r!==this.tip2)},o.prototype.createTips=function(){this.tip1=_.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(_.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var r=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),c=this.tip1.transform.baseVal.getItem(0);c.setRotate(r,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(c,0);var p=this.tip2.transform.baseVal.getItem(0);p.setRotate(r+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(p,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=h.prototype.getState.call(this);return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){h.prototype.restoreState.call(this,r),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}(kt),qe=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.strokePanel.colors=p.defaultColorSet,d.fillColor="transparent",d}return j(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=h.prototype.getState.call(this);return r.typeName=o.typeName,r},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}(ne),ht=function(){function h(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),h.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))},h.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},h.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},h.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}},h.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},h}(),Fe=function(h){function o(r,c,p){var d=h.call(this,r,c,p)||this;return d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.curveX=0,d.curveY=0,d.manipulationStartCurveX=0,d.manipulationStartCurveY=0,d.setStrokeColor=d.setStrokeColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.positionGrips=d.positionGrips.bind(d),d.addControlGrips=d.addControlGrips.bind(d),d.adjustVisual=d.adjustVisual.bind(d),d.setupControlBox=d.setupControlBox.bind(d),d.resize=d.resize.bind(d),d.strokeColor=p.defaultColor,d.strokeWidth=p.defaultStrokeWidth,d.strokeDasharray=p.defaultStrokeDasharray,d.strokePanel=new at("Line color",p.defaultColorSet,p.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.strokeWidthPanel=new Dt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d}return j(o,h),o.prototype.ownsTarget=function(r){return!(!h.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.selectorCurve&&r!==this.visibleCurve&&!this.curveGrip.ownsTarget(r))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.selectorCurve=_.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,c){h.prototype.pointerDown.call(this,r,c),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=r.x,this.curveY=r.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(c)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=_.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,h.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){h.prototype.positionGrips.call(this);var r=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-r/2,this.curveY-r/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(r){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+r.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+r.y-this.manipulationStartY),h.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){this.activeGrip===this.curveGrip&&(this.curveX=r.x,this.curveY=r.y),h.prototype.resize.call(this,r),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(r){this.strokeColor=r,this.adjustVisual(),this.colorChanged(r)},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.adjustVisual()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.adjustVisual()},o.prototype.scale=function(r,c){this.curveX=this.curveX*r,this.curveY=this.curveY*c,h.prototype.scale.call(this,r,c)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},h.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){h.prototype.restoreState.call(this,r);var c=r;this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.strokeDasharray,this.curveX=c.curveX,this.curveY=c.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}(It),Xe=function(){function h(o,r){r===void 0&&(r=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=r}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),Rt=function(h){function o(r,c,p){var d=h.call(this,r,!1)||this;return d.dataUrl=c,d.state=p,d}return j(o,h),o}(Xe),Ne=function(h){function o(r,c,p){p===void 0&&(p=!1);var d=h.call(this,r,p)||this;return d.marker=c,d}return j(o,h),o}(Xe),jt=function(){function h(){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 h.prototype.addEventListener=function(o,r){this[o].push(r)},h.prototype.removeEventListener=function(o,r){var c=this[o].indexOf(r);c>-1&&this[o].splice(c,1)},h}(),Ft=function(){function h(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 jt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.instanceCounter++,this.styles=new Me(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(h.prototype,"ALL_MARKER_TYPES",{get:function(){return[_t,K,H,Ke,qe,ne,L,ve,xe,w,kt,Fe]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[_t,K,H,Ke,ne,L,ve]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[_t,K,H,Ke,L]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var r=this;this._availableMarkerTypes.splice(0),o.forEach(function(c){if(typeof c=="string"){var p=r.ALL_MARKER_TYPES.find(function(d){return d.typeName===c});p!==void 0&&r._availableMarkerTypes.push(p)}else r._availableMarkerTypes.push(c)})},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),he.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&Je.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Je.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(r){return r(new Xe(o))})},h.prototype.render=function(){return M(this,void 0,void 0,function(){var o;return re(this,function(r){switch(r.label){case 0:return this.setCurrentMarker(),(o=new Pe).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 r.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,r.sent()]}})})},h.prototype.close=function(o){var r=this;if(o===void 0&&(o=!1),this.isOpen){var c=!1;o||this.eventListeners.beforeclose.forEach(function(p){var d=new Xe(r,!0);p(d),d.defaultPrevented&&(c=!0)}),c||(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(p){return p(new Xe(r))}),this.detachEvents(),this._isOpen=!1)}},h.prototype.addMarkersToToolbar=function(){for(var o,r=[],c=0;c<arguments.length;c++)r[c]=arguments[c];(o=this._availableMarkerTypes).push.apply(o,r)},h.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(r){o(r.dataUrl,r.state)})},h.prototype.removeRenderEventListener=function(o){},h.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},h.prototype.removeCloseEventListener=function(o){},h.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))},h.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,r=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,c=r<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(r,c)},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.resize=function(o,r){this._isResizing=!0;var c=o/this.imageWidth,p=r/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(r),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(c,p),this._isResizing=!1},h.prototype.scaleMarkers=function(o,r){var c,p=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(o,r):(c=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(d){d!==p._currentMarker&&d.scale(o,r)}),c!==void 0&&this.setCurrentMarker(c)},h.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"},h.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),r=this.editorCanvas.getBoundingClientRect();this.left=o.left-r.left,this.top=o.top-r.top},h.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)},h.prototype.addDefs=function(){for(var o,r=[],c=0;c<arguments.length;c++)r[c]=arguments[c];this.defs=_.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,r)},h.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},h.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)},h.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},h.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},h.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)},h.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},h.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)},h.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()},h.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")},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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 Ve(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},h.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},h.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())},h.prototype.toolbarButtonClicked=function(o,r){if(o==="marker"&&r!==void 0)this.createNewMarker(r);else if(o==="action")switch(r){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()}},h.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var r=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var d=new Ne(o,o._currentMarker,!0);p(d),d.defaultPrevented&&(r=!0)}),!r){var c=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(p){return p(new Ne(o,c))})}}},h.prototype.clear=function(){var o=this,r=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Qe=new Ne(o,void 0,!0);ie(Qe),Qe.defaultPrevented&&(r=!0)}),!r)){this.setCurrentMarker();for(var c=function(ie){var Qe=p.markers[ie];p.setCurrentMarker(p.markers[ie]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(Ct){return Ct(new Ne(o,Qe))})},p=this,d=this.markers.length-1;d>=0;d--)c(d);this.addUndoStep()}},Object.defineProperty(h.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),h.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))},h.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)},h.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},h.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var r=this.getState(),c=this.undoRedoManager.getLastUndoStep();if(!c||c.width===r.width&&c.height===r.height){var p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(r),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(d){return d(new Xe(o))})}else this.undoRedoManager.replaceLastUndoStep(r),this.eventListeners.statechange.forEach(function(d){return d(new Xe(o))})}},h.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},h.prototype.undoStep=function(){var o=this,r=this.undoRedoManager.undo();r!==void 0&&(this.restoreState(r),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(c){return c(new Xe(o))}))},h.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},h.prototype.redoStep=function(){var o=this,r=this.undoRedoManager.redo();r!==void 0&&(this.restoreState(r),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(c){return c(new Xe(o))}))},h.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},h.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},h.prototype.startRenderAndClose=function(){return M(this,void 0,void 0,function(){var o,r,c=this;return re(this,function(p){switch(p.label){case 0:return[4,this.render()];case 1:return o=p.sent(),r=this.getState(),this.eventListeners.render.forEach(function(d){return d(new Rt(c,o,r))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var r={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(c){return r.markers.push(c.getState())}),r},h.prototype.restoreState=function(o){var r=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(c){var p=r._availableMarkerTypes.find(function(ie){return ie.typeName===c.typeName});if(p!==void 0){var d=r.addNewMarker(p);d.restoreState(c),r.markers.push(d)}}),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(c){return c(new Xe(r))})},h.prototype.addNewMarker=function(o){var r=_.createGroup();return this.markerImage.appendChild(r),new o(r,this.overlayContainer,this.settings)},h.prototype.createNewMarker=function(o){var r,c=this;(r=typeof o=="string"?this._availableMarkerTypes.find(function(p){return p.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(r),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(r.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(p){return p(new Ne(c,c._currentMarker))}))},h.prototype.markerCreated=function(o){var r=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof K&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(K):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(c){return c(new Ne(r,r._currentMarker))})},h.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},h.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},h.prototype.markerStateChanged=function(o){var r=this;this.eventListeners.markerchange.forEach(function(c){return c(new Ne(r,o))})},h.prototype.setCurrentMarker=function(o){var r=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(c){return c(new Ne(r,r._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(c){return c(new Ne(r,r._currentMarker))}))},h.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 r=this.markers.find(function(c){return c.ownsTarget(o.target)});r!==void 0?(this.setCurrentMarker(r),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))},h.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var r=this.markers.find(function(c){return c.ownsTarget(o.target)});r!==void 0&&r!==this._currentMarker&&this.setCurrentMarker(r),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},h.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}))},h.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()},h.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},h.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},h.prototype.clientToLocalCoordinates=function(o,r){var c=this.markerImage.getBoundingClientRect();return{x:(o-c.left)/this.zoomLevel,y:(r-c.top)/this.zoomLevel}},h.prototype.onWindowResize=function(){this.positionUI()},h.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()},h.prototype.addLicenseKey=function(o){he.addKey(o)},h.prototype.addEventListener=function(o,r){this.eventListeners.addEventListener(o,r)},h.prototype.removeEventListener=function(o,r){this.eventListeners.removeEventListener(o,r)},h.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(h.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),h.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(r){return r(new Xe(o))}))},h.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(r){return r(new Xe(o))}))},h.instanceCounter=0,h}();/* **********************************
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 we=function(h,o){return(we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,c){r.__proto__=c}||function(r,c){for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(r[p]=c[p])})(h,o)};function vt(h,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=h}we(h,o),h.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}function lt(h,o,r,c){return new(r||(r=Promise))(function(p,d){function ie(Mt){try{Ct(c.next(Mt))}catch(tt){d(tt)}}function Qe(Mt){try{Ct(c.throw(Mt))}catch(tt){d(tt)}}function Ct(Mt){var tt;Mt.done?p(Mt.value):(tt=Mt.value,tt instanceof r?tt:new r(function(Ze){Ze(tt)})).then(ie,Qe)}Ct((c=c.apply(h,o||[])).next())})}function Ut(h,o){var r,c,p,d,ie={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return d={next:Qe(0),throw:Qe(1),return:Qe(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function Qe(Ct){return function(Mt){return function(tt){if(r)throw new TypeError("Generator is already executing.");for(;ie;)try{if(r=1,c&&(p=2&tt[0]?c.return:tt[0]?c.throw||((p=c.return)&&p.call(c),0):c.next)&&!(p=p.call(c,tt[1])).done)return p;switch(c=0,p&&(tt=[2&tt[0],p.value]),tt[0]){case 0:case 1:p=tt;break;case 4:return ie.label++,{value:tt[1],done:!1};case 5:ie.label++,c=tt[1],tt=[0];continue;case 7:tt=ie.ops.pop(),ie.trys.pop();continue;default:if(!(p=ie.trys,(p=p.length>0&&p[p.length-1])||tt[0]!==6&&tt[0]!==2)){ie=0;continue}if(tt[0]===3&&(!p||tt[1]>p[0]&&tt[1]<p[3])){ie.label=tt[1];break}if(tt[0]===6&&ie.label<p[1]){ie.label=p[1],p=tt;break}if(p&&ie.label<p[2]){ie.label=p[2],ie.ops.push(tt);break}p[2]&&ie.ops.pop(),ie.trys.pop();continue}tt=o.call(h,ie)}catch(Ze){tt=[6,Ze],c=0}finally{r=p=0}if(5&tt[0])throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}([Ct,Mt])}}}var Nt=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),Ge=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,r){for(var c=0,p=r;c<p.length;c++){var d=p[c],ie=d[0],Qe=d[1];o.setAttribute(ie,Qe)}},h.createRect=function(o,r,c){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",r.toString()),c&&h.setAttributes(p,c),p},h.createLine=function(o,r,c,p,d){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",o.toString()),ie.setAttribute("y1",r.toString()),ie.setAttribute("x2",c.toString()),ie.setAttribute("y2",p.toString()),d&&h.setAttributes(ie,d),ie},h.createPolygon=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","polygon");return c.setAttribute("points",o),r&&h.setAttributes(c,r),c},h.createCircle=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","circle");return c.setAttribute("cx",(o/2).toString()),c.setAttribute("cy",(o/2).toString()),c.setAttribute("r",o.toString()),r&&h.setAttributes(c,r),c},h.createEllipse=function(o,r,c){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(r/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(r/2).toString()),c&&h.setAttributes(p,c),p},h.createGroup=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(r,o),r},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,r,c,p,d,ie,Qe){var Ct=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(Ct,[["id",o],["orient",r],["markerWidth",c.toString()],["markerHeight",p.toString()],["refX",d.toString()],["refY",ie.toString()]]),Ct.appendChild(Qe),Ct},h.createText=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x","0"),r.setAttribute("y","0"),o&&h.setAttributes(r,o),r},h.createTSpan=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");return c.textContent=o,r&&h.setAttributes(c,r),c},h.createImage=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(r,o),r},h.createPoint=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return c.x=o,c.y=r,c},h.createPath=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",o),r&&h.setAttributes(c,r),c},h.createElement=function(o,r){var c=document.createElementNS("http://www.w3.org/2000/svg",o);return r&&h.setAttributes(c,r),c},h.getHollowRectanglePath=function(o,r,c,p,d,ie,Qe,Ct){return"M"+o+","+r+"V"+(r+p)+"H"+(o+c)+"V"+r+"H"+d+"V"+ie+"H"+(d+Qe)+"V"+(ie+Ct)+"H"+d+"V"+r+"Z"},h}(),ut=function(){function h(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),h.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},h.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)},h.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 ot("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ot("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ot("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ct("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ct("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),ot=function(h,o){this.selector=h,this.style=o},ct=function(h,o){this.localName=h,this.style=o},Yt=function(){function h(){this.blocks=[],this.display=""}return h.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},h.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},h.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(r){return o.appendChild(r.getUI())}),o},h}(),Ht=function(){function h(){}return h.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},h}(),an=function(h){function o(){var r=h!==null&&h.apply(this,arguments)||this;return r.buttons=[],r}return vt(o,h),o.prototype.addButton=function(r){r.className=this.buttonClassName,r.colorsClassName=this.buttonColorsClassName,r.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(r)},o.prototype.getUI=function(){var r=h.prototype.getUI.call(this);return this.buttons.forEach(function(c){return r.appendChild(c.getUI())}),r},o}(Ht),Qt=function(){function h(o,r){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=r,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(h.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),h.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},h.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,"")))},h.prototype.hide=function(){this._isHidden=!0},h}(),xt=function(h){function o(){var r=h!==null&&h.apply(this,arguments)||this;return r.elements=[],r}return vt(o,h),o.prototype.addElement=function(r){this.elements.push(r)},o.prototype.getUI=function(){var r=h.prototype.getUI.call(this);return this.elements.forEach(function(c){return r.appendChild(c)}),r},o}(Ht),nn=function(){function h(o,r){this.horizontal=o,this.vertical=r}return Object.defineProperty(h.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),h.prototype.getVerticalLength=function(o){return o/this.ratio},h.prototype.getHorizontalLength=function(o){return o*this.ratio},h}(),zt=function(){function h(){}return h.getIcon=function(o,r){if(o>0&&r>0){var c=new nn(o,r),p=c.ratio>=1?20:c.getHorizontalLength(20),d=c.ratio<1?20:c.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var Qe=Ge.createDefs();ie.appendChild(Qe);var Ct=Ge.createElement("clipPath",[["id","text-bg-clip"]]);Qe.appendChild(Ct);var Mt=Ge.createPath(Ge.getHollowRectanglePath((24-p)/2,(24-d)/2,p,d,(24-p)/2+2,(24-d)/2+2,p-4,d-4));ie.appendChild(Mt);var tt=Ge.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);tt.appendChild(Ge.createTSpan(o+":"+r)),ie.appendChild(tt);var Ze=tt.getBBox();Ge.setAttributes(tt,[["x",((24-Ze.width)/2).toString()],["y",((24-Ze.height)/2-Ze.y).toString()]]);var ce=Ge.createPath(Ge.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ze.width))/2,(24-Math.ceil(Ze.height))/2,Math.ceil(Ze.width),Math.ceil(Ze.height)));return Ct.appendChild(ce),Ge.setAttributes(Mt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.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>'},h}(),on=function(h){function o(r,c,p){var d=h.call(this,r,c)||this;return d.isDropdownOpen=!1,d.onClick=d.dropdownButtonClicked,d.dropdownButtons=p,d}return vt(o,h),o.prototype.setupDropdown=function(){var r=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(c){c.className=r.className,c.colorsClassName=r.colorsClassName,r.dropdownBlock.appendChild(c.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}(Qt),Gt=function(){function h(o,r){this.GRIP_SIZE=10,this.color=o,this.fillColor=r,this.visual=Ge.createGroup(),this.visual.appendChild(Ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ge.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h.prototype.setCenter=function(o,r){this.visual.childNodes.forEach(function(c){return Ge.setAttributes(c,[["cx",o.toString()],["cy",r.toString()]])})},h}(),Dn=function(){function h(o,r,c,p){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=r,this.margin=c,this.container=p,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(h.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(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&Ge.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),h.prototype.open=function(){var o=this;this.cropShadeElement=Ge.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ge.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var r=0;r<this.numberOfGridLines;r++)this.horizontalGridLines.push(Ge.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ge.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(c){return o.gridContainer.appendChild(c)}),this.verticalGridLines.forEach(function(c){return o.gridContainer.appendChild(c)}),this.cropRectElement=Ge.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},h.prototype.setCropRectangle=function(o){this.cropRect=o;var r=Object.assign({},this.cropRect);this.zoomFactor!==1&&(r.width=this.cropRect.width*this.zoomFactor,r.height=this.cropRect.height*this.zoomFactor,r.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-r.width/2,r.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-r.height/2),Ge.setAttributes(this.cropRectElement,[["x",r.x.toString()],["y",r.y.toString()],["width",r.width.toString()],["height",r.height.toString()]]);var c=r.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(d,ie){var Qe=r.y+c*(ie+1);Ge.setAttributes(d,[["x1",""+r.x],["y1",""+Qe],["x2",""+(r.x+r.width)],["y2",""+Qe]])});var p=r.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(d,ie){var Qe=r.x+p*(ie+1);Ge.setAttributes(d,[["x1",""+Qe],["y1",""+r.y],["x2",""+Qe],["y2",""+(r.y+r.height)]])}),Ge.setAttributes(this.cropShadeElement,[["d",Ge.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,r.x,r.y,r.width,r.height)]]),this.topLeftGrip.setCenter(r.x,r.y),this.topRightGrip.setCenter(r.x+r.width,r.y),this.bottomLeftGrip.setCenter(r.x,r.y+r.height),this.bottomRightGrip.setCenter(r.x+r.width,r.y+r.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},h.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)},h.prototype.clientToLocalCoordinates=function(o,r){var c=this.container.getBoundingClientRect();return{x:o-c.left+this.margin,y:r-c.top+this.margin}},h.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)},h.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var r=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(r)}o.preventDefault()},h.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},h.prototype.move=function(o){var r=o.x-this.previousPoint.x,c=o.y-this.previousPoint.y;this.zoomFactor!==1&&(r=-r/this.zoomFactor,c=-c/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+r),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+c),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},h.prototype.resize=function(o){var r=Object.assign({},this.cropRect),c=o.x-this.previousPoint.x,p=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:r.x+c<this.margin&&(c=this.margin-r.x),r.x+=c,r.width=this.cropRect.x+this.cropRect.width-r.x;break;case this.bottomRightGrip:case this.topRightGrip:r.width+c>this.canvasWidth*this.zoomFactor&&(c=this.canvasWidth*this.zoomFactor-r.width),r.width+=c}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(r.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(c),r.height=this.aspectRatio.getVerticalLength(r.width)):(r.y+=p,r.height=this.cropRect.y+this.cropRect.height-r.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?r.height=this.aspectRatio.getVerticalLength(r.width):r.height+=p}r.width<10&&(r.x=this.cropRect.x,r.width=10),r.height<10&&(r.y=this.cropRect.y,r.height=10),this.previousPoint=o,r.x>=this.margin&&r.y>=this.margin&&r.x-this.margin+r.width<=this.canvasWidth&&r.y-this.margin+r.height<=this.canvasHeight&&(this.cropRect=r,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},h.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,r=this.cropRect.y+this.cropRect.height/2,c=this.aspectRatio.getHorizontalLength(this.cropRect.height),p=this.aspectRatio.getVerticalLength(this.cropRect.width);c/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=c:this.cropRect.height=p,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=r-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)}},h.prototype.getRescaledRect=function(o,r,c,p,d,ie){var Qe=c/o,Ct=p/r;return{x:(d.x-ie)*Qe+ie,y:(d.y-ie)*Ct+ie,width:d.width*Qe,height:d.height*Ct}},h.prototype.scaleCanvas=function(o,r){var c=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,r,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=r,this.onCropChange&&this.onCropChange(c),this.setCropRectangle(c)},h}(),Nn=function(){function h(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(h.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),h.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},h.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},h.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},h.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},h.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();Ge.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},h.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)}},h.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 r="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,c=1;c<=this.width/5+10;c++){var p=c%5==0?this.height/3:this.height/6;r+="h4v"+-p+"h1v"+p}r+="v1H0Z",this.scaleShape=Ge.createPath(r);var d=Ge.createTransform();this.scaleShape.transform.baseVal.appendItem(d),o.appendChild(this.scaleShape),this.angleLabelElement=Ge.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ge.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=Ge.createTSpan("");return ie.innerHTML="&deg;",this.angleLabelElement.appendChild(ie),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),Gn=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,r,c,p,d,ie,Qe){var Ct=this;return new Promise(function(Mt){var tt=document.createElement("canvas");tt.width=o.width.baseVal.value-2*p,tt.height=o.height.baseVal.value-2*p;var Ze=1,ce=1;Ct.naturalSize===!0?(Ze=r.naturalWidth/(o.width.baseVal.value-2*p)/ie,ce=r.naturalHeight/(o.height.baseVal.value-2*p)/Qe,tt.width=r.naturalWidth/ie,tt.height=r.naturalHeight/Qe):Ct.width!==void 0&&Ct.height!==void 0&&(Ze=Ct.width/c.width,ce=Ct.height/c.height,tt.width*=Ze,tt.height*=ce);var nt=tt.getContext("2d");nt.translate(tt.width/2,tt.height/2),nt.rotate(d*Math.PI/180),nt.scale(ie,Qe),nt.translate(-tt.width/2,-tt.height/2),nt.drawImage(r,0,0,tt.width,tt.height);var Xt=document.createElement("canvas");Xt.width=c.width*Ze,Xt.height=c.height*ce,Xt.getContext("2d").putImageData(nt.getImageData((c.x-p)*Ze,(c.y-p)*ce,c.width*Ze,c.height*ce),0,0),Mt(Xt.toDataURL(Ct.imageType,Ct.imageQuality))})},h}(),je=function(){function h(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=h.instanceCounter++,this.styles=new ut(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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.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(h.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(h.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.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}),h.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},h.prototype.show=function(){this.showUI(),this.open()},h.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(r){return r()}),this._isOpen=!1)},h.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},h.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},h.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},h.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},h.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))},h.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,r=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,c=r+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(r,c)}},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.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",Ge.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},h.prototype.resize=function(o,r){this.imageWidth=Math.round(o),this.imageHeight=Math.round(r),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()},h.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 r=o.toDataURL();Ge.setAttributes(this.editingTarget,[["href",r]]),this.setEditingTargetSize()},h.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),r=this.editorCanvas.getBoundingClientRect();this.left=o.left-r.left-this.CANVAS_MARGIN,this.top=o.top-r.top-this.CANVAS_MARGIN},h.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=Ge.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ge.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ge.createGroup(),this.editingTargetRotationScaleContainer=Ge.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=Ge.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var r=Ge.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(r),this.editingTargetContainer=Ge.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)},h.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},h.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ge.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Dn(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()},h.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,r=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 "+r+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-r+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},h.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)},h.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},h.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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,r=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=r+"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},h.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},h.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Yt,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 r=new an;r.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(r);var c=[];this.aspectRatios.forEach(function(ce){var nt=new Qt(zt.getIcon(ce.horizontal,ce.vertical),ce.horizontal===0&&ce.vertical===0?"FREE":ce.horizontal+":"+ce.vertical);nt.onClick=function(){return o.ratioButtonClicked(ce)},c.push(nt)}),this.aspectRatioButton=new on(zt.getIcon(0,0),"Aspect ratio",c),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,r.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var p=new Qt('<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");p.isActive=this.isGridVisible,p.onClick=function(){o.isGridVisible=!o.isGridVisible,p.isActive=o.isGridVisible},r.addButton(p);var d=new Qt('<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(d.isActive=this.zoomToCropEnabled,d.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,d.isActive=o.zoomToCropEnabled},r.addButton(d),!Nt.isLicensed){var ie=new xt;this.topToolbar.addElementBlock(ie);var Qe=document.createElement("div");Qe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ct=document.createElement("a");Ct.style.color="currentColor",Ct.href="https://markerjs.com/products/cropro",Ct.target="_blank",Ct.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>',Qe.appendChild(Ct),ie.addElement(Qe)}var Mt=new an;Mt.minWidth=3*this.toolbarHeight+"px",Mt.contentAlign="end",this.topToolbar.addButtonBlock(Mt);var tt=new Qt('<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");tt.onClick=this.startRenderAndClose,Mt.addButton(tt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(tt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ze=new Qt('<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");Ze.onClick=this.close,Mt.addButton(Ze),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ze.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Yt,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 r=new an;r.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(r);var c=new Qt('<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");c.onClick=this.rotateLeftButtonClicked,r.addButton(c);var p=new Qt('<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");p.onClick=this.rotateRightButtonClicked,r.addButton(p);var d=new xt;d.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(d),this.straightener=new Nn("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(Mt){o.rotateBy(Mt),o.straightener.angle=o.rotationAngle},d.addElement(this.straightener.getUI());var ie=new an;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var Qe=new Qt('<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");Qe.onClick=this.flipHorizontallyButtonClicked,ie.addButton(Qe);var Ct=new Qt('<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");Ct.onClick=this.flipVerticallyButtonClicked,ie.addButton(Ct)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=zt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},h.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new nn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},h.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},h.prototype.restoreState=function(o){if(o){var r=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(r),this.cropRectChanged(r),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},h.prototype.clientToLocalCoordinates=function(o,r){var c=this.cropImage.getBoundingClientRect();return{x:o-c.left,y:r-c.top}},h.prototype.onWindowResize=function(){this.positionUI()},h.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()},h.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)},h.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)},h.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},h.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},h.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 r=this.editingTargetRotationContainer.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(r,0);var c=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/c.width,this.imageHeight/c.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},h.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},h.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},h.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},h.prototype.startRenderAndClose=function(){return lt(this,void 0,void 0,function(){var o,r;return Ut(this,function(c){switch(c.label){case 0:return[4,this.render()];case 1:return o=c.sent(),r=this.getState(),this.renderEventListeners.forEach(function(p){return p(o,r)}),this.close(!0),[2]}})})},h.prototype.render=function(){return lt(this,void 0,void 0,function(){var o;return Ut(this,function(r){switch(r.label){case 0:return(o=new Gn).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),Ge.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 r.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,r.sent()]}})})},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ct("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 ct("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ct("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ct("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 ct("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ct("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new ot("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new ot("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ct("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 ct("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ct("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 ct("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 ct("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},h.instanceCounter=0,h}(),Et=l("8hTe"),sn=l.n(Et),mn=/<pre[^>]*>/g;function Pn(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var jn=Ie.a=function(h){var o=h.value,r=o===void 0?"":o,c=h.edit,p=c===void 0?!1:c,d=h.className,ie=h.showTextOnly,Qe=h.showLines,Ct=h.replaces,Mt=h.zoomImg,tt=h.hasMask,Ze=h.style,ce=Ze===void 0?{}:Ze,nt=h.stylesPrev,Xt=nt===void 0?{}:nt,Lt=String(r),wt=Object(X.useRef)(),Wt=Object(X.useRef)(),xn=Object(X.useState)(""),hn=Object(ee.a)(xn,2),Tn=hn[0],vn=hn[1],Zn=Object(X.useState)("office"),Rn=Object(ee.a)(Zn,2),hi=Rn[0],xi=Rn[1],vi=function(){var gn=new je(Wt.current);gn.displayMode="popup",gn.addRenderEventListener(function(){var fi=Object(Re.a)(F.a.mark(function fn(Qn){var yn;return F.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return wt.current.style.display="none",An.next=3,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn}});case 3:yn=An.sent,yn!=null&&yn.id&&Ct(Wt.current.getAttribute("src").replace(ue.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 5:case"end":return An.stop()}},fn)}));return function(fn){return fi.apply(this,arguments)}}()),gn.show()},Xn=function(){var gn=new Ft(Wt.current);gn.settings.displayMode="popup",gn.addEventListener("render",function(){var fi=Object(Re.a)(F.a.mark(function fn(Qn){var yn;return F.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if(wt.current.style.display="none",!Wt.current){An.next=6;break}return An.next=4,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn.dataUrl}});case 4:yn=An.sent,yn!=null&&yn.id&&Ct(Wt.current.getAttribute("src").replace(ue.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 6:case"end":return An.stop()}},fn)}));return function(fn){return fi.apply(this,arguments)}}()),gn.show(),window.markerArea=gn},Si=Object(X.useMemo)(function(){try{var Kn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,gn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,fi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Lt=Lt.replace(Kn,"("+ue.a.API_SERVER+"/api/attachments/").replace(gn,'"'+ue.a.API_SERVER+"/api/attachments/").replace(fi,'"'+ue.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,`
`),Lt=Lt.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(Yi){}var fn=_e(Lt),Qn=N();if(Lt.match(/\[TOC\]/)&&(fn=fn.replace("<p>[TOC]</p>",g()),Ce()),fn=fn.replace(/(__special_katext_id_\d+__)/g,function(Yi,An){var ki=Qn[An],sa=ki.type,da=ki.expression;return Object(se.renderToString)(Pn(da)||"",{displayMode:sa==="block",throwOnError:!1,output:"html"})}),fn=fn.replace(/▁/g,"\u2581\u2581\u2581"),T(),ie){var yn=document.createElement("div");return yn.innerHTML=fn,yn.innerText}return setTimeout(function(){return Wi()},500),fn},[Lt]),pi=Object(X.useRef)();de.WebkitLineClamp=Qe,Qe&&(ce=Object(Oe.a)(Object(Oe.a)({},ce),de));function Hn(Kn){var gn=Kn.target;if(gn.tagName.toUpperCase()==="IMG"){if(Mt){var fi=gn.getAttribute("src");vn(fi),xi("image")}}else if(gn.tagName.toUpperCase()==="A"){var fn=gn.getAttribute("href");if(fn.indexOf("office")>-1)Kn.preventDefault(),vn(fn),xi("office");else if(fn.indexOf("application/pdf")>-1)Kn.preventDefault(),vn(fn),xi("pdf");else if(fn.indexOf("type=text")>-1)Kn.preventDefault(),vn(fn),xi("html");else if(fn.startsWith("#")){Kn.preventDefault();var Qn=document.getElementById(fn.replace("#",""));Qn&&Qn.scrollIntoView(!0)}}}var Wi=function(){var gn,fi=(gn=pi.current)===null||gn===void 0?void 0:gn.querySelectorAll("video");fi==null||fi.forEach(function(fn){if(fn.oncontextmenu=function(){return!1},fn.src.indexOf(".m3u8")>-1&&!fn.canPlayType("application/vnd.apple.mpegurl")){if(R.a.isSupported()){var Qn=new R.a;Qn.loadSource(fn.src),Qn.attachMedia(fn)}}})};Object(X.useEffect)(function(){if(pi.current&&Si&&(Si.match(mn)&&window.PR.prettyPrint()),pi.current)return pi.current.addEventListener("click",Hn),function(){pi.current.removeEventListener("click",Hn),T(),Ce()}},[Si,pi.current,Hn]);var Sa=function(gn){if(!p)return;gn.target.nodeName==="IMG"?(wt.current.style.display="flex",wt.current.style.width=gn.target.clientWidth+"px",wt.current.style.height=gn.target.clientHeight+"px",wt.current.style.top=gn.target.offsetTop+"px",wt.current.style.left=gn.target.offsetLeft+"px",Wt.current.src=gn.target.getAttribute("src")):wt.current.style.display="none"};return W.a.createElement("div",{style:{position:"relative"}},W.a.createElement("div",{ref:pi,style:Object(Oe.a)({},ce),className:"".concat(d||""," markdown-body ").concat(sn.a.mdBody),onMouseOver:Sa,dangerouslySetInnerHTML:{__html:Si}}),W.a.createElement("div",{ref:wt,className:sn.a.button},W.a.createElement(Le.a,null,W.a.createElement(Te.a,{onClick:function(){return vi()}},"\u88C1\u526A"),W.a.createElement(Te.a,{onClick:function(){return Xn()}},"\u7F16\u8F91"))),W.a.createElement("img",{ref:Wt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),W.a.createElement(Se.a,{close:!0,data:Tn,hasMask:tt,type:Tn!=null&&Tn.length?hi:"",style:Object(Oe.a)({},Xt),onClose:function(){return vn("")}}))}},"9VGf":function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return ge});var oe=l("q1tI"),Le=l.n(oe);function ge(Te,Oe){var Re=Object(oe.useRef)();Object(oe.useEffect)(function(){Re.current=Te}),Object(oe.useEffect)(function(){function ee(){Re.current()}if(Oe!==null){var B=setInterval(ee,Oe);return function(){return clearInterval(B)}}},[Oe])}},"A+k2":function(it,Ie,l){it.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(it,Ie,l){(function(oe){oe(l("VrN/"),l("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(F,X,W){if(W!=oe.Init&&W&&F.removeKeyMap("autoCloseTags"),!X)return;var V={name:"autoCloseTags"};(typeof X!="object"||X.whenClosing!==!1)&&(V["'/'"]=function(le){return Re(le)}),(typeof X!="object"||X.whenOpening!==!1)&&(V["'>'"]=function(le){return Te(le)}),F.addKeyMap(V)});var Le=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ge=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Te(F){if(F.getOption("disableInput"))return oe.Pass;for(var X=F.listSelections(),W=[],V=F.getOption("autoCloseTags"),le=0;le<X.length;le++){if(!X[le].empty())return oe.Pass;var Z=X[le].head,z=F.getTokenAt(Z),$=oe.innerMode(F.getMode(),z.state),U=$.state,te=$.mode.xmlCurrentTag&&$.mode.xmlCurrentTag(U),E=te&&te.name;if(!E)return oe.Pass;var me=$.mode.configuration=="html",Ce=typeof V=="object"&&V.dontCloseTags||me&&Le,de=typeof V=="object"&&V.indentTags||me&&ge;z.end>Z.ch&&(E=E.slice(0,E.length-z.end+Z.ch));var I=E.toLowerCase();if(!E||z.type=="string"&&(z.end!=Z.ch||!/[\"\']/.test(z.string.charAt(z.string.length-1))||z.string.length==1)||z.type=="tag"&&te.close||z.string.indexOf("/")==Z.ch-z.start-1||Ce&&ee(Ce,I)>-1||B(F,$.mode.xmlCurrentContext&&$.mode.xmlCurrentContext(U)||[],E,Z,!0))return oe.Pass;var g=typeof V=="object"&&V.emptyTags;if(g&&ee(g,E)>-1){W[le]={text:"/>",newPos:oe.Pos(Z.line,Z.ch+2)};continue}var Q=de&&ee(de,I)>-1;W[le]={indent:Q,text:">"+(Q?`
`:"")+"</"+E+">",newPos:Q?oe.Pos(Z.line+1,0):oe.Pos(Z.line,Z.ch+1)}}for(var S=typeof V=="object"&&V.dontIndentOnAutoClose,le=X.length-1;le>=0;le--){var A=W[le];F.replaceRange(A.text,X[le].head,X[le].anchor,"+insert");var x=F.listSelections().slice(0);x[le]={head:A.newPos,anchor:A.newPos},F.setSelections(x),!S&&A.indent&&(F.indentLine(A.newPos.line,null,!0),F.indentLine(A.newPos.line+1,null,!0))}}function Oe(F,X){for(var W=F.listSelections(),V=[],le=X?"/":"</",Z=F.getOption("autoCloseTags"),z=typeof Z=="object"&&Z.dontIndentOnSlash,$=0;$<W.length;$++){if(!W[$].empty())return oe.Pass;var U=W[$].head,te=F.getTokenAt(U),E=oe.innerMode(F.getMode(),te.state),me=E.state;if(X&&(te.type=="string"||te.string.charAt(0)!="<"||te.start!=U.ch-1))return oe.Pass;var Ce,de=E.mode.name!="xml"&&F.getMode().name=="htmlmixed";if(de&&E.mode.name=="javascript")Ce=le+"script";else if(de&&E.mode.name=="css")Ce=le+"style";else{var I=E.mode.xmlCurrentContext&&E.mode.xmlCurrentContext(me);if(!I||I.length&&B(F,I,I[I.length-1],U))return oe.Pass;Ce=le+I[I.length-1]}F.getLine(U.line).charAt(te.end)!=">"&&(Ce+=">"),V[$]=Ce}if(F.replaceSelections(V),W=F.listSelections(),!z)for(var $=0;$<W.length;$++)($==W.length-1||W[$].head.line<W[$+1].head.line)&&F.indentLine(W[$].head.line)}function Re(F){return F.getOption("disableInput")?oe.Pass:Oe(F,!0)}oe.commands.closeTag=function(F){return Oe(F)};function ee(F,X){if(F.indexOf)return F.indexOf(X);for(var W=0,V=F.length;W<V;++W)if(F[W]==X)return W;return-1}function B(F,X,W,V,le){if(!oe.scanForClosingTag)return!1;var Z=Math.min(F.lastLine()+1,V.line+500),z=oe.scanForClosingTag(F,V,null,Z);if(!z||z.tag!=W)return!1;for(var $=le?1:0,U=X.length-1;U>=0&&X[U]==W;U--)++$;V=z.to;for(var U=1;U<$;U++){var te=oe.scanForClosingTag(F,V,null,Z);if(!te||te.tag!=W)return!1;V=te.to}return!0}})},BdwD:function(it,Ie,l){"use strict";var oe=l("+L6B"),Le=l("2/Rp"),ge=l("0Owb"),Te=l("k1fw"),Oe=l("q1tI"),Re=l.n(Oe),ee=l("FOrL"),B=l.n(ee),F=function(W){var V=W.img,le=W.buttonProps,Z=le===void 0?{}:le,z=W.styles,$=z===void 0?{}:z,U=W.customText,te=W.ButtonText,E=W.ButtonClick,me=W.Buttonclass,Ce=W.ButtonTwo;return Re.a.createElement("section",{className:"tc animated fadeIn",style:Object(Te.a)(Object(Te.a)({},{color:"#999",margin:"200px auto"}),$)},Re.a.createElement("img",{src:V||B.a}),Re.a.createElement("p",{className:"mt20 font14"},U||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),te&&Re.a.createElement(Le.a,Object(ge.a)({className:me,onClick:E},Z),te),Ce&&Ce)};Ie.a=F},BjJ7:function(it,Ie,l){"use strict";l.d(Ie,"d",function(){return Le}),l.d(Ie,"c",function(){return ge}),l.d(Ie,"e",function(){return Te}),l.d(Ie,"b",function(){return Oe}),l.d(Ie,"a",function(){return ee});var oe=l("m3rI");function Le(B){var F=!0;if(B.length>0){for(var X=0;X<B.length;X++)if(B[X].compile_success==0||!B[X].compile_success){F=!1;break}}else F=!1;return F}function ge(B){for(var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",X=[],W=0;W<B.length;W++){var V=B[W],le=F?"".concat(F,"/").concat(V.name):"".concat(V.name);X.push({title:V.name,isLeaf:!(V.type==="tree"),key:le})}return X}function Te(B,F,X){for(var W=0;W<B.length;W++){var V=B[W];if(V.key===F){V.children=X;break}V.children&&Te(V.children,F,X)}return B}function Oe(B,F,X){var W;return function(){var V=this,le=arguments,Z=function(){W=null,X||B.apply(V,le)},z=X&&!W;clearTimeout(W),W=setTimeout(Z,F),z&&B.apply(V,le)}}var Re=!0,ee=oe.a.API_SERVER},"C+DQ":function(it,Ie,l){},DlQD:function(it,Ie,l){(function(oe,Le){it.exports=Le()})(this,function(){"use strict";function oe(K,G){for(var H=0;H<G.length;H++){var w=G[H];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(K,w.key,w)}}function Le(K,G,H){return G&&oe(K.prototype,G),H&&oe(K,H),K}function ge(K,G){if(!K)return;if(typeof K=="string")return Te(K,G);var H=Object.prototype.toString.call(K).slice(8,-1);if(H==="Object"&&K.constructor&&(H=K.constructor.name),H==="Map"||H==="Set")return Array.from(K);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return Te(K,G)}function Te(K,G){(G==null||G>K.length)&&(G=K.length);for(var H=0,w=new Array(G);H<G;H++)w[H]=K[H];return w}function Oe(K,G){var H;if(typeof Symbol=="undefined"||K[Symbol.iterator]==null){if(Array.isArray(K)||(H=ge(K))||G&&K&&typeof K.length=="number"){H&&(K=H);var w=0;return function(){return w>=K.length?{done:!0}:{done:!1,value:K[w++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return H=K[Symbol.iterator](),H.next.bind(H)}function Re(K,G){return G={exports:{}},K(G,G.exports),G.exports}var ee=Re(function(K){function G(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function H(w){K.exports.defaults=w}K.exports={defaults:G(),getDefaults:G,changeDefaults:H}}),B=ee.defaults,F=ee.getDefaults,X=ee.changeDefaults,W=/[&<>"']/,V=/[&<>"']/g,le=/[<>"']|&(?!#?\w+;)/,Z=/[<>"']|&(?!#?\w+;)/g,z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$=function(G){return z[G]};function U(K,G){if(G){if(W.test(K))return K.replace(V,$)}else if(le.test(K))return K.replace(Z,$);return K}var te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function E(K){return K.replace(te,function(G,H){return H=H.toLowerCase(),H==="colon"?":":H.charAt(0)==="#"?H.charAt(1)==="x"?String.fromCharCode(parseInt(H.substring(2),16)):String.fromCharCode(+H.substring(1)):""})}var me=/(^|[^\[])\^/g;function Ce(K,G){K=K.source||K,G=G||"";var H={replace:function(O,L){return L=L.source||L,L=L.replace(me,"$1"),K=K.replace(O,L),H},getRegex:function(){return new RegExp(K,G)}};return H}var de=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(K,G,H){if(K){var w;try{w=decodeURIComponent(E(H)).replace(de,"").toLowerCase()}catch(O){return null}if(w.indexOf("javascript:")===0||w.indexOf("vbscript:")===0||w.indexOf("data:")===0)return null}G&&!I.test(H)&&(H=b(G,H));try{H=encodeURI(H).replace(/%25/g,"%")}catch(O){return null}return H}var Q={},S=/^[^:]+:\/*[^/]*$/,A=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(K,G){Q[" "+K]||(S.test(K)?Q[" "+K]=K+"/":Q[" "+K]=J(K,"/",!0)),K=Q[" "+K];var H=K.indexOf(":")===-1;return G.substring(0,2)==="//"?H?G:K.replace(A,"$1")+G:G.charAt(0)==="/"?H?G:K.replace(x,"$1")+G:K+G}var N={exec:function(){}};function T(K){for(var G=1,H,w;G<arguments.length;G++){H=arguments[G];for(w in H)Object.prototype.hasOwnProperty.call(H,w)&&(K[w]=H[w])}return K}function y(K,G){var H=K.replace(/\|/g,function(L,D,ve){for(var ne=!1,xe=D;--xe>=0&&ve[xe]==="\\";)ne=!ne;return ne?"|":" |"}),w=H.split(/ \|/),O=0;if(w.length>G)w.splice(G);else for(;w.length<G;)w.push("");for(;O<w.length;O++)w[O]=w[O].trim().replace(/\\\|/g,"|");return w}function J(K,G,H){var w=K.length;if(w===0)return"";for(var O=0;O<w;){var L=K.charAt(w-O-1);if(L===G&&!H)O++;else if(L!==G&&H)O++;else break}return K.substr(0,w-O)}function ye(K,G){if(K.indexOf(G[1])===-1)return-1;for(var H=K.length,w=0,O=0;O<H;O++)if(K[O]==="\\")O++;else if(K[O]===G[0])w++;else if(K[O]===G[1]&&(w--,w<0))return O;return-1}function q(K){K&&K.sanitize&&!K.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 _e={escape:U,unescape:E,edit:Ce,cleanUrl:g,resolveUrl:b,noopTest:N,merge:T,splitCells:y,rtrim:J,findClosingBracket:ye,checkSanitizeDeprecation:q},k=ee.defaults,f=_e.rtrim,R=_e.splitCells,ue=_e.escape,se=_e.findClosingBracket;function Se(K,G,H){var w=G.href,O=G.title?ue(G.title):null,L=K[1].replace(/\\([\[\]])/g,"$1");return K[0].charAt(0)!=="!"?{type:"link",raw:H,href:w,title:O,text:L}:{type:"image",raw:H,href:w,title:O,text:ue(L)}}function fe(K,G){var H=K.match(/^(\s+)(?:```)/);if(H===null)return G;var w=H[1];return G.split(`
`).map(function(O){var L=O.match(/^\s+/);if(L===null)return O;var D=L[0];return D.length>=w.length?O.slice(w.length):O}).join(`
`)}var pe=function(){function K(H){this.options=H||k}var G=K.prototype;return G.space=function(w){var O=this.rules.block.newline.exec(w);if(O)return O[0].length>1?{type:"space",raw:O[0]}:{raw:`
`}},G.code=function(w,O){var L=this.rules.block.code.exec(w);if(L){var D=O[O.length-1];if(D&&D.type==="paragraph")return{raw:L[0],text:L[0].trimRight()};var ve=L[0].replace(/^ {4}/gm,"");return{type:"code",raw:L[0],codeBlockStyle:"indented",text:this.options.pedantic?ve:f(ve,`
`)}}},G.fences=function(w){var O=this.rules.block.fences.exec(w);if(O){var L=O[0],D=fe(L,O[3]||"");return{type:"code",raw:L,lang:O[2]?O[2].trim():O[2],text:D}}},G.heading=function(w){var O=this.rules.block.heading.exec(w);if(O)return{type:"heading",raw:O[0],depth:O[1].length,text:O[2]}},G.nptable=function(w){var O=this.rules.block.nptable.exec(w);if(O){var L={type:"table",header:R(O[1].replace(/^ *| *\| *$/g,"")),align:O[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:O[3]?O[3].replace(/\n$/,"").split(`
`):[],raw:O[0]};if(L.header.length===L.align.length){var D=L.align.length,ve;for(ve=0;ve<D;ve++)/^ *-+: *$/.test(L.align[ve])?L.align[ve]="right":/^ *:-+: *$/.test(L.align[ve])?L.align[ve]="center":/^ *:-+ *$/.test(L.align[ve])?L.align[ve]="left":L.align[ve]=null;for(D=L.cells.length,ve=0;ve<D;ve++)L.cells[ve]=R(L.cells[ve],L.header.length);return L}}},G.hr=function(w){var O=this.rules.block.hr.exec(w);if(O)return{type:"hr",raw:O[0]}},G.blockquote=function(w){var O=this.rules.block.blockquote.exec(w);if(O){var L=O[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:O[0],text:L}}},G.list=function(w){var O=this.rules.block.list.exec(w);if(O){for(var L=O[0],D=O[2],ve=D.length>1,ne=D[D.length-1]===")",xe={type:"list",raw:L,ordered:ve,start:ve?+D.slice(0,-1):"",loose:!1,items:[]},qe=O[0].match(this.rules.block.item),ht=!1,Fe,Xe,Rt,Ne,jt,Ft,we,vt=qe.length,lt=0;lt<vt;lt++)Fe=qe[lt],L=Fe,Xe=Fe.length,Fe=Fe.replace(/^ *([*+-]|\d+[.)]) */,""),~Fe.indexOf(`
`)&&(Xe-=Fe.length,Fe=this.options.pedantic?Fe.replace(/^ {1,4}/gm,""):Fe.replace(new RegExp("^ {1,"+Xe+"}","gm"),"")),lt!==vt-1&&(Rt=this.rules.block.bullet.exec(qe[lt+1])[0],(ve?Rt.length===1||!ne&&Rt[Rt.length-1]===")":Rt.length>1||this.options.smartLists&&Rt!==D)&&(Ne=qe.slice(lt+1).join(`
`),xe.raw=xe.raw.substring(0,xe.raw.length-Ne.length),lt=vt-1)),jt=ht||/\n\n(?!\s*$)/.test(Fe),lt!==vt-1&&(ht=Fe.charAt(Fe.length-1)===`
`,jt||(jt=ht)),jt&&(xe.loose=!0),Ft=/^\[[ xX]\] /.test(Fe),we=void 0,Ft&&(we=Fe[1]!==" ",Fe=Fe.replace(/^\[[ xX]\] +/,"")),xe.items.push({type:"list_item",raw:L,task:Ft,checked:we,loose:jt,text:Fe});return xe}},G.html=function(w){var O=this.rules.block.html.exec(w);if(O)return{type:this.options.sanitize?"paragraph":"html",raw:O[0],pre:!this.options.sanitizer&&(O[1]==="pre"||O[1]==="script"||O[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(O[0]):ue(O[0]):O[0]}},G.def=function(w){var O=this.rules.block.def.exec(w);if(O){O[3]&&(O[3]=O[3].substring(1,O[3].length-1));var L=O[1].toLowerCase().replace(/\s+/g," ");return{tag:L,raw:O[0],href:O[2],title:O[3]}}},G.table=function(w){var O=this.rules.block.table.exec(w);if(O){var L={type:"table",header:R(O[1].replace(/^ *| *\| *$/g,"")),align:O[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:O[3]?O[3].replace(/\n$/,"").split(`
`):[]};if(L.header.length===L.align.length){L.raw=O[0];var D=L.align.length,ve;for(ve=0;ve<D;ve++)/^ *-+: *$/.test(L.align[ve])?L.align[ve]="right":/^ *:-+: *$/.test(L.align[ve])?L.align[ve]="center":/^ *:-+ *$/.test(L.align[ve])?L.align[ve]="left":L.align[ve]=null;for(D=L.cells.length,ve=0;ve<D;ve++)L.cells[ve]=R(L.cells[ve].replace(/^ *\| *| *\| *$/g,""),L.header.length);return L}}},G.lheading=function(w){var O=this.rules.block.lheading.exec(w);if(O)return{type:"heading",raw:O[0],depth:O[2].charAt(0)==="="?1:2,text:O[1]}},G.paragraph=function(w){var O=this.rules.block.paragraph.exec(w);if(O)return{type:"paragraph",raw:O[0],text:O[1].charAt(O[1].length-1)===`
`?O[1].slice(0,-1):O[1]}},G.text=function(w,O){var L=this.rules.block.text.exec(w);if(L){var D=O[O.length-1];return D&&D.type==="text"?{raw:L[0],text:L[0]}:{type:"text",raw:L[0],text:L[0]}}},G.escape=function(w){var O=this.rules.inline.escape.exec(w);if(O)return{type:"escape",raw:O[0],text:ue(O[1])}},G.tag=function(w,O,L){var D=this.rules.inline.tag.exec(w);if(D)return!O&&/^<a /i.test(D[0])?O=!0:O&&/^<\/a>/i.test(D[0])&&(O=!1),!L&&/^<(pre|code|kbd|script)(\s|>)/i.test(D[0])?L=!0:L&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(D[0])&&(L=!1),{type:this.options.sanitize?"text":"html",raw:D[0],inLink:O,inRawBlock:L,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(D[0]):ue(D[0]):D[0]}},G.link=function(w){var O=this.rules.inline.link.exec(w);if(O){var L=se(O[2],"()");if(L>-1){var D=O[0].indexOf("!")===0?5:4,ve=D+O[1].length+L;O[2]=O[2].substring(0,L),O[0]=O[0].substring(0,ve).trim(),O[3]=""}var ne=O[2],xe="";if(this.options.pedantic){var qe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ne);qe?(ne=qe[1],xe=qe[3]):xe=""}else xe=O[3]?O[3].slice(1,-1):"";ne=ne.trim().replace(/^<([\s\S]*)>$/,"$1");var ht=Se(O,{href:ne&&ne.replace(this.rules.inline._escapes,"$1"),title:xe&&xe.replace(this.rules.inline._escapes,"$1")},O[0]);return ht}},G.reflink=function(w,O){var L;if((L=this.rules.inline.reflink.exec(w))||(L=this.rules.inline.nolink.exec(w))){var D=(L[2]||L[1]).replace(/\s+/g," ");if(D=O[D.toLowerCase()],!D||!D.href){var ve=L[0].charAt(0);return{type:"text",raw:ve,text:ve}}var ne=Se(L,D,L[0]);return ne}},G.strong=function(w,O,L){L===void 0&&(L="");var D=this.rules.inline.strong.start.exec(w);if(D&&(!D[1]||D[1]&&(L===""||this.rules.inline.punctuation.exec(L)))){O=O.slice(-1*w.length);var ve=D[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ve.lastIndex=0;for(var ne;(D=ve.exec(O))!=null;)if(ne=this.rules.inline.strong.middle.exec(O.slice(0,D.index+3)),ne)return{type:"strong",raw:w.slice(0,ne[0].length),text:w.slice(2,ne[0].length-2)}}},G.em=function(w,O,L){L===void 0&&(L="");var D=this.rules.inline.em.start.exec(w);if(D&&(!D[1]||D[1]&&(L===""||this.rules.inline.punctuation.exec(L)))){O=O.slice(-1*w.length);var ve=D[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ve.lastIndex=0;for(var ne;(D=ve.exec(O))!=null;)if(ne=this.rules.inline.em.middle.exec(O.slice(0,D.index+2)),ne)return{type:"em",raw:w.slice(0,ne[0].length),text:w.slice(1,ne[0].length-1)}}},G.codespan=function(w){var O=this.rules.inline.code.exec(w);if(O){var L=O[2].replace(/\n/g," "),D=/[^ ]/.test(L),ve=L.startsWith(" ")&&L.endsWith(" ");return D&&ve&&(L=L.substring(1,L.length-1)),L=ue(L,!0),{type:"codespan",raw:O[0],text:L}}},G.br=function(w){var O=this.rules.inline.br.exec(w);if(O)return{type:"br",raw:O[0]}},G.del=function(w){var O=this.rules.inline.del.exec(w);if(O)return{type:"del",raw:O[0],text:O[1]}},G.autolink=function(w,O){var L=this.rules.inline.autolink.exec(w);if(L){var D,ve;return L[2]==="@"?(D=ue(this.options.mangle?O(L[1]):L[1]),ve="mailto:"+D):(D=ue(L[1]),ve=D),{type:"link",raw:L[0],text:D,href:ve,tokens:[{type:"text",raw:D,text:D}]}}},G.url=function(w,O){var L;if(L=this.rules.inline.url.exec(w)){var D,ve;if(L[2]==="@")D=ue(this.options.mangle?O(L[0]):L[0]),ve="mailto:"+D;else{var ne;do ne=L[0],L[0]=this.rules.inline._backpedal.exec(L[0])[0];while(ne!==L[0]);D=ue(L[0]),L[1]==="www."?ve="http://"+D:ve=D}return{type:"link",raw:L[0],text:D,href:ve,tokens:[{type:"text",raw:D,text:D}]}}},G.inlineText=function(w,O,L){var D=this.rules.inline.text.exec(w);if(D){var ve;return O?ve=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(D[0]):ue(D[0]):D[0]:ve=ue(this.options.smartypants?L(D[0]):D[0]),{type:"text",raw:D[0],text:ve}}},K}(),j=_e.noopTest,M=_e.edit,re=_e.merge,P={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:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};P._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,P._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,P.def=M(P.def).replace("label",P._label).replace("title",P._title).getRegex(),P.bullet=/(?:[*+-]|\d{1,9}[.)])/,P.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,P.item=M(P.item,"gm").replace(/bull/g,P.bullet).getRegex(),P.list=M(P.list).replace(/bull/g,P.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+P.def.source+")").getRegex(),P._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",P._comment=/<!--(?!-?>)[\s\S]*?-->/,P.html=M(P.html,"i").replace("comment",P._comment).replace("tag",P._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),P.paragraph=M(P._paragraph).replace("hr",P.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",P._tag).getRegex(),P.blockquote=M(P.blockquote).replace("paragraph",P.paragraph).getRegex(),P.normal=re({},P),P.gfm=re({},P.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*|$)"}),P.gfm.nptable=M(P.gfm.nptable).replace("hr",P.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",P._tag).getRegex(),P.gfm.table=M(P.gfm.table).replace("hr",P.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",P._tag).getRegex(),P.pedantic=re({},P.normal,{html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",P._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:j,paragraph:M(P.normal._paragraph).replace("hr",P.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",P.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,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:j,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};_._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",_.punctuation=M(_.punctuation).replace(/punctuation/g,_._punctuation).getRegex(),_._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_.em.start=M(_.em.start).replace(/punctuation/g,_._punctuation).getRegex(),_.em.middle=M(_.em.middle).replace(/punctuation/g,_._punctuation).replace(/overlapSkip/g,_._overlapSkip).getRegex(),_.em.endAst=M(_.em.endAst,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.em.endUnd=M(_.em.endUnd,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.strong.start=M(_.strong.start).replace(/punctuation/g,_._punctuation).getRegex(),_.strong.middle=M(_.strong.middle).replace(/punctuation/g,_._punctuation).replace(/blockSkip/g,_._blockSkip).getRegex(),_.strong.endAst=M(_.strong.endAst,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.strong.endUnd=M(_.strong.endUnd,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.blockSkip=M(_._blockSkip,"g").getRegex(),_.overlapSkip=M(_._overlapSkip,"g").getRegex(),_._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,_.autolink=M(_.autolink).replace("scheme",_._scheme).replace("email",_._email).getRegex(),_._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_.tag=M(_.tag).replace("comment",P._comment).replace("attribute",_._attribute).getRegex(),_._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_.link=M(_.link).replace("label",_._label).replace("href",_._href).replace("title",_._title).getRegex(),_.reflink=M(_.reflink).replace("label",_._label).getRegex(),_.reflinkSearch=M(_.reflinkSearch,"g").replace("reflink",_.reflink).replace("nolink",_.nolink).getRegex(),_.normal=re({},_),_.pedantic=re({},_.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:M(/^!?\[(label)\]\((.*?)\)/).replace("label",_._label).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_._label).getRegex()}),_.gfm=re({},_.normal,{escape:M(_.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),_.gfm.url=M(_.gfm.url,"i").replace("email",_.gfm._extended_email).getRegex(),_.breaks=re({},_.gfm,{br:M(_.br).replace("{2,}","*").getRegex(),text:M(_.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var he={block:P,inline:_},Pe=ee.defaults,Je=he.block,Me=he.inline;function We(K){return K.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 Ee(K){var G="",H,w,O=K.length;for(H=0;H<O;H++)w=K.charCodeAt(H),Math.random()>.5&&(w="x"+w.toString(16)),G+="&#"+w+";";return G}var De=function(){function K(H){this.tokens=[],this.tokens.links=Object.create(null),this.options=H||Pe,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var w={block:Je.normal,inline:Me.normal};this.options.pedantic?(w.block=Je.pedantic,w.inline=Me.pedantic):this.options.gfm&&(w.block=Je.gfm,this.options.breaks?w.inline=Me.breaks:w.inline=Me.gfm),this.tokenizer.rules=w}K.lex=function(w,O){var L=new K(O);return L.lex(w)};var G=K.prototype;return G.lex=function(w){return w=w.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(w,this.tokens,!0),this.inline(this.tokens),this.tokens},G.blockTokens=function(w,O,L){O===void 0&&(O=[]),L===void 0&&(L=!0),w=w.replace(/^ +$/gm,"");for(var D,ve,ne,xe;w;){if(D=this.tokenizer.space(w)){w=w.substring(D.raw.length),D.type&&O.push(D);continue}if(D=this.tokenizer.code(w,O)){w=w.substring(D.raw.length),D.type?O.push(D):(xe=O[O.length-1],xe.raw+=`
`+D.raw,xe.text+=`
`+D.text);continue}if(D=this.tokenizer.fences(w)){w=w.substring(D.raw.length),O.push(D);continue}if(D=this.tokenizer.heading(w)){w=w.substring(D.raw.length),O.push(D);continue}if(D=this.tokenizer.nptable(w)){w=w.substring(D.raw.length),O.push(D);continue}if(D=this.tokenizer.hr(w)){w=w.substring(D.raw.length),O.push(D);continue}if(D=this.tokenizer.blockquote(w)){w=w.substring(D.raw.length),D.tokens=this.blockTokens(D.text,[],L),O.push(D);continue}if(D=this.tokenizer.list(w)){for(w=w.substring(D.raw.length),ne=D.items.length,ve=0;ve<ne;ve++)D.items[ve].tokens=this.blockTokens(D.items[ve].text,[],!1);O.push(D);continue}if(D=this.tokenizer.html(w)){w=w.substring(D.raw.length),O.push(D);continue}if(L&&(D=this.tokenizer.def(w))){w=w.substring(D.raw.length),this.tokens.links[D.tag]||(this.tokens.links[D.tag]={href:D.href,title:D.title});continue}if(D=this.tokenizer.table(w)){w=w.substring(D.raw.length),O.push(D);continue}if(D=this.tokenizer.lheading(w)){w=w.substring(D.raw.length),O.push(D);continue}if(L&&(D=this.tokenizer.paragraph(w))){w=w.substring(D.raw.length),O.push(D);continue}if(D=this.tokenizer.text(w,O)){w=w.substring(D.raw.length),D.type?O.push(D):(xe=O[O.length-1],xe.raw+=`
`+D.raw,xe.text+=`
`+D.text);continue}if(w){var qe="Infinite loop on byte: "+w.charCodeAt(0);if(this.options.silent){console.error(qe);break}else throw new Error(qe)}}return O},G.inline=function(w){var O,L,D,ve,ne,xe,qe=w.length;for(O=0;O<qe;O++){xe=w[O];switch(xe.type){case"paragraph":case"text":case"heading":{xe.tokens=[],this.inlineTokens(xe.text,xe.tokens);break}case"table":{for(xe.tokens={header:[],cells:[]},ve=xe.header.length,L=0;L<ve;L++)xe.tokens.header[L]=[],this.inlineTokens(xe.header[L],xe.tokens.header[L]);for(ve=xe.cells.length,L=0;L<ve;L++)for(ne=xe.cells[L],xe.tokens.cells[L]=[],D=0;D<ne.length;D++)xe.tokens.cells[L][D]=[],this.inlineTokens(ne[D],xe.tokens.cells[L][D]);break}case"blockquote":{this.inline(xe.tokens);break}case"list":{for(ve=xe.items.length,L=0;L<ve;L++)this.inline(xe.items[L].tokens);break}}}return w},G.inlineTokens=function(w,O,L,D,ve){O===void 0&&(O=[]),L===void 0&&(L=!1),D===void 0&&(D=!1),ve===void 0&&(ve="");var ne,xe=w,qe;if(this.tokens.links){var ht=Object.keys(this.tokens.links);if(ht.length>0)for(;(qe=this.tokenizer.rules.inline.reflinkSearch.exec(xe))!=null;)ht.includes(qe[0].slice(qe[0].lastIndexOf("[")+1,-1))&&(xe=xe.slice(0,qe.index)+"["+"a".repeat(qe[0].length-2)+"]"+xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(qe=this.tokenizer.rules.inline.blockSkip.exec(xe))!=null;)xe=xe.slice(0,qe.index)+"["+"a".repeat(qe[0].length-2)+"]"+xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;w;){if(ne=this.tokenizer.escape(w)){w=w.substring(ne.raw.length),O.push(ne);continue}if(ne=this.tokenizer.tag(w,L,D)){w=w.substring(ne.raw.length),L=ne.inLink,D=ne.inRawBlock,O.push(ne);continue}if(ne=this.tokenizer.link(w)){w=w.substring(ne.raw.length),ne.type==="link"&&(ne.tokens=this.inlineTokens(ne.text,[],!0,D)),O.push(ne);continue}if(ne=this.tokenizer.reflink(w,this.tokens.links)){w=w.substring(ne.raw.length),ne.type==="link"&&(ne.tokens=this.inlineTokens(ne.text,[],!0,D)),O.push(ne);continue}if(ne=this.tokenizer.strong(w,xe,ve)){w=w.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],L,D),O.push(ne);continue}if(ne=this.tokenizer.em(w,xe,ve)){w=w.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],L,D),O.push(ne);continue}if(ne=this.tokenizer.codespan(w)){w=w.substring(ne.raw.length),O.push(ne);continue}if(ne=this.tokenizer.br(w)){w=w.substring(ne.raw.length),O.push(ne);continue}if(ne=this.tokenizer.del(w)){w=w.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],L,D),O.push(ne);continue}if(ne=this.tokenizer.autolink(w,Ee)){w=w.substring(ne.raw.length),O.push(ne);continue}if(!L&&(ne=this.tokenizer.url(w,Ee))){w=w.substring(ne.raw.length),O.push(ne);continue}if(ne=this.tokenizer.inlineText(w,D,We)){w=w.substring(ne.raw.length),ve=ne.raw.slice(-1),O.push(ne);continue}if(w){var Fe="Infinite loop on byte: "+w.charCodeAt(0);if(this.options.silent){console.error(Fe);break}else throw new Error(Fe)}}return O},Le(K,null,[{key:"rules",get:function(){return{block:Je,inline:Me}}}]),K}(),Ve=ee.defaults,et=_e.cleanUrl,at=_e.escape,Ye=function(){function K(H){this.options=H||Ve}var G=K.prototype;return G.code=function(w,O,L){var D=(O||"").match(/\S*/)[0];if(this.options.highlight){var ve=this.options.highlight(w,D);ve!=null&&ve!==w&&(L=!0,w=ve)}return D?'<pre><code class="'+this.options.langPrefix+at(D,!0)+'">'+(L?w:at(w,!0))+`</code></pre>
`:"<pre><code>"+(L?w:at(w,!0))+`</code></pre>
`},G.blockquote=function(w){return`<blockquote>
`+w+`</blockquote>
`},G.html=function(w){return w},G.heading=function(w,O,L,D){return this.options.headerIds?"<h"+O+' id="'+this.options.headerPrefix+D.slug(L)+'">'+w+"</h"+O+`>
`:"<h"+O+">"+w+"</h"+O+`>
`},G.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},G.list=function(w,O,L){var D=O?"ol":"ul",ve=O&&L!==1?' start="'+L+'"':"";return"<"+D+ve+`>
`+w+"</"+D+`>
`},G.listitem=function(w){return"<li>"+w+`</li>
`},G.checkbox=function(w){return"<input "+(w?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},G.paragraph=function(w){return"<p>"+w+`</p>
`},G.table=function(w,O){return O&&(O="<tbody>"+O+"</tbody>"),`<table>
<thead>
`+w+`</thead>
`+O+`</table>
`},G.tablerow=function(w){return`<tr>
`+w+`</tr>
`},G.tablecell=function(w,O){var L=O.header?"th":"td",D=O.align?"<"+L+' align="'+O.align+'">':"<"+L+">";return D+w+"</"+L+`>
`},G.strong=function(w){return"<strong>"+w+"</strong>"},G.em=function(w){return"<em>"+w+"</em>"},G.codespan=function(w){return"<code>"+w+"</code>"},G.br=function(){return this.options.xhtml?"<br/>":"<br>"},G.del=function(w){return"<del>"+w+"</del>"},G.link=function(w,O,L){if(w=et(this.options.sanitize,this.options.baseUrl,w),w===null)return L;var D='<a href="'+at(w)+'"';return O&&(D+=' title="'+O+'"'),D+=">"+L+"</a>",D},G.image=function(w,O,L){if(w=et(this.options.sanitize,this.options.baseUrl,w),w===null)return L;var D='<img src="'+w+'" alt="'+L+'"';return O&&(D+=' title="'+O+'"'),D+=this.options.xhtml?"/>":">",D},G.text=function(w){return w},K}(),He=function(){function K(){}var G=K.prototype;return G.strong=function(w){return w},G.em=function(w){return w},G.codespan=function(w){return w},G.del=function(w){return w},G.html=function(w){return w},G.text=function(w){return w},G.link=function(w,O,L){return""+L},G.image=function(w,O,L){return""+L},G.br=function(){return""},K}(),St=function(){function K(){this.seen={}}var G=K.prototype;return G.slug=function(w){var O=w.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(O)){var L=O;do this.seen[L]++,O=L+"-"+this.seen[L];while(this.seen.hasOwnProperty(O))}return this.seen[O]=0,O},K}(),ft=ee.defaults,bt=_e.unescape,dt=function(){function K(H){this.options=H||ft,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new St}K.parse=function(w,O){var L=new K(O);return L.parse(w)};var G=K.prototype;return G.parse=function(w,O){O===void 0&&(O=!0);var L="",D,ve,ne,xe,qe,ht,Fe,Xe,Rt,Ne,jt,Ft,we,vt,lt,Ut,Nt,Ge,ut=w.length;for(D=0;D<ut;D++){Ne=w[D];switch(Ne.type){case"space":continue;case"hr":{L+=this.renderer.hr();continue}case"heading":{L+=this.renderer.heading(this.parseInline(Ne.tokens),Ne.depth,bt(this.parseInline(Ne.tokens,this.textRenderer)),this.slugger);continue}case"code":{L+=this.renderer.code(Ne.text,Ne.lang,Ne.escaped);continue}case"table":{for(Xe="",Fe="",xe=Ne.header.length,ve=0;ve<xe;ve++)Fe+=this.renderer.tablecell(this.parseInline(Ne.tokens.header[ve]),{header:!0,align:Ne.align[ve]});for(Xe+=this.renderer.tablerow(Fe),Rt="",xe=Ne.cells.length,ve=0;ve<xe;ve++){for(ht=Ne.tokens.cells[ve],Fe="",qe=ht.length,ne=0;ne<qe;ne++)Fe+=this.renderer.tablecell(this.parseInline(ht[ne]),{header:!1,align:Ne.align[ne]});Rt+=this.renderer.tablerow(Fe)}L+=this.renderer.table(Xe,Rt);continue}case"blockquote":{Rt=this.parse(Ne.tokens),L+=this.renderer.blockquote(Rt);continue}case"list":{for(jt=Ne.ordered,Ft=Ne.start,we=Ne.loose,xe=Ne.items.length,Rt="",ve=0;ve<xe;ve++)lt=Ne.items[ve],Ut=lt.checked,Nt=lt.task,vt="",lt.task&&(Ge=this.renderer.checkbox(Ut),we?lt.tokens.length>0&&lt.tokens[0].type==="text"?(lt.tokens[0].text=Ge+" "+lt.tokens[0].text,lt.tokens[0].tokens&&lt.tokens[0].tokens.length>0&&lt.tokens[0].tokens[0].type==="text"&&(lt.tokens[0].tokens[0].text=Ge+" "+lt.tokens[0].tokens[0].text)):lt.tokens.unshift({type:"text",text:Ge}):vt+=Ge),vt+=this.parse(lt.tokens,we),Rt+=this.renderer.listitem(vt,Nt,Ut);L+=this.renderer.list(Rt,jt,Ft);continue}case"html":{L+=this.renderer.html(Ne.text);continue}case"paragraph":{L+=this.renderer.paragraph(this.parseInline(Ne.tokens));continue}case"text":{for(Rt=Ne.tokens?this.parseInline(Ne.tokens):Ne.text;D+1<ut&&w[D+1].type==="text";)Ne=w[++D],Rt+=`
`+(Ne.tokens?this.parseInline(Ne.tokens):Ne.text);L+=O?this.renderer.paragraph(Rt):Rt;continue}default:{var ot='Token with "'+Ne.type+'" type was not found.';if(this.options.silent){console.error(ot);return}else throw new Error(ot)}}}return L},G.parseInline=function(w,O){O=O||this.renderer;var L="",D,ve,ne=w.length;for(D=0;D<ne;D++){ve=w[D];switch(ve.type){case"escape":{L+=O.text(ve.text);break}case"html":{L+=O.html(ve.text);break}case"link":{L+=O.link(ve.href,ve.title,this.parseInline(ve.tokens,O));break}case"image":{L+=O.image(ve.href,ve.title,ve.text);break}case"strong":{L+=O.strong(this.parseInline(ve.tokens,O));break}case"em":{L+=O.em(this.parseInline(ve.tokens,O));break}case"codespan":{L+=O.codespan(ve.text);break}case"br":{L+=O.br();break}case"del":{L+=O.del(this.parseInline(ve.tokens,O));break}case"text":{L+=O.text(ve.text);break}default:{var xe='Token with "'+ve.type+'" type was not found.';if(this.options.silent){console.error(xe);return}else throw new Error(xe)}}}return L},K}(),Dt=_e.merge,Ot=_e.checkSanitizeDeprecation,_t=_e.escape,Ue=ee.getDefaults,It=ee.changeDefaults,kt=ee.defaults;function Be(K,G,H){if(typeof K=="undefined"||K===null)throw new Error("marked(): input parameter is undefined or null");if(typeof K!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(K)+", string expected");if(typeof G=="function"&&(H=G,G=null),G=Dt({},Be.defaults,G||{}),Ot(G),H){var w=G.highlight,O;try{O=De.lex(K,G)}catch(ne){return H(ne)}var L=function(xe){var qe;if(!xe)try{qe=dt.parse(O,G)}catch(ht){xe=ht}return G.highlight=w,xe?H(xe):H(null,qe)};if(!w||w.length<3)return L();if(delete G.highlight,!O.length)return L();var D=0;Be.walkTokens(O,function(ne){ne.type==="code"&&(D++,setTimeout(function(){w(ne.text,ne.lang,function(xe,qe){if(xe)return L(xe);qe!=null&&qe!==ne.text&&(ne.text=qe,ne.escaped=!0),D--,D===0&&L()})},0))}),D===0&&L();return}try{var ve=De.lex(K,G);return G.walkTokens&&Be.walkTokens(ve,G.walkTokens),dt.parse(ve,G)}catch(ne){if(ne.message+=`
Please report this to https://github.com/markedjs/marked.`,G.silent)return"<p>An error occurred:</p><pre>"+_t(ne.message+"",!0)+"</pre>";throw ne}}Be.options=Be.setOptions=function(K){return Dt(Be.defaults,K),It(Be.defaults),Be},Be.getDefaults=Ue,Be.defaults=kt,Be.use=function(K){var G=Dt({},K);if(K.renderer&&function(){var w=Be.defaults.renderer||new Ye,O=function(ve){var ne=w[ve];w[ve]=function(){for(var xe=arguments.length,qe=new Array(xe),ht=0;ht<xe;ht++)qe[ht]=arguments[ht];var Fe=K.renderer[ve].apply(w,qe);return Fe===!1&&(Fe=ne.apply(w,qe)),Fe}};for(var L in K.renderer)O(L);G.renderer=w}(),K.tokenizer&&function(){var w=Be.defaults.tokenizer||new pe,O=function(ve){var ne=w[ve];w[ve]=function(){for(var xe=arguments.length,qe=new Array(xe),ht=0;ht<xe;ht++)qe[ht]=arguments[ht];var Fe=K.tokenizer[ve].apply(w,qe);return Fe===!1&&(Fe=ne.apply(w,qe)),Fe}};for(var L in K.tokenizer)O(L);G.tokenizer=w}(),K.walkTokens){var H=Be.defaults.walkTokens;G.walkTokens=function(w){K.walkTokens(w),H&&H(w)}}Be.setOptions(G)},Be.walkTokens=function(K,G){for(var H=Oe(K),w;!(w=H()).done;){var O=w.value;G(O);switch(O.type){case"table":{for(var L=Oe(O.tokens.header),D;!(D=L()).done;){var ve=D.value;Be.walkTokens(ve,G)}for(var ne=Oe(O.tokens.cells),xe;!(xe=ne()).done;)for(var qe=xe.value,ht=Oe(qe),Fe;!(Fe=ht()).done;){var Xe=Fe.value;Be.walkTokens(Xe,G)}break}case"list":{Be.walkTokens(O.items,G);break}default:O.tokens&&Be.walkTokens(O.tokens,G)}}},Be.Parser=dt,Be.parser=dt.parse,Be.Renderer=Ye,Be.TextRenderer=He,Be.Lexer=De,Be.lexer=De.lex,Be.Tokenizer=pe,Be.Slugger=St,Be.parse=Be;var Ke=Be;return Ke})},"Dvv+":function(it,Ie,l){"use strict";l.r(Ie);var oe=l("cWXX"),Le=l("/ezw"),ge=l("+L6B"),Te=l("2/Rp"),Oe=l("7Kak"),Re=l("9yH6"),ee=l("giR+"),B=l("fyUT"),F=l("9og8"),X=l("k1fw"),W=l("y8nQ"),V=l("Vl3Y"),le=l("tJVT"),Z=l("5NDa"),z=l("5rEg"),$=l("WmNS"),U=l.n($),te=l("q1tI"),E=l.n(te),me=l("Ty5D"),Ce=l("9kvl"),de=l("m3fD"),I=l.n(de),g=l("A+k2"),Q=l.n(g),S=function(ne){var xe=ne.value,qe=xe===void 0?[]:xe,ht=ne.onChange,Fe=ne.className,Xe=Fe===void 0?"":Fe;return E.a.createElement("div",{className:"".concat(Q.a.tabs," ").concat(Xe," ")},E.a.createElement("div",{onClick:function(){return ht(0)},className:qe===0?Q.a.active:""},E.a.createElement("div",null,"1"),E.a.createElement("div",null,"\u5F55\u5165\u4FE1\u606F")," "),E.a.createElement("div",{onClick:function(){return ht(1)},className:qe===1?Q.a.active:""},E.a.createElement("div",null,"2"),E.a.createElement("div",null,"\u914D\u7F6E\u7EC4\u5377")))},A=S,x=l("2qtc"),b=l("kLXV"),N=l("sRBo"),T=l("kaz8"),y=l("5Dmo"),J=l("3S7+"),ye=l("miYZ"),q=l("tsqr"),_e=l("oBTY"),k=l("IlMy"),f=l.n(k),R=l("WCUW"),ue=l("QSKd"),se=l.n(ue),Se=l("Hfvn"),fe=l.n(Se),pe=l("HPRh"),j=l.n(pe),M=l("+RXH"),re=l.n(M),P=l("+yhJ"),_=l.n(P),he=l("RZ/O"),Pe=l.n(he),Je=l("exQ7"),Me=l.n(Je),We=l("HG2Q"),Ee=l.n(We),De=l("k4n4"),Ve=l("eS0+"),et=l("PpiC"),at=l("K5AI"),Ye=l.n(at),He=l("LvDl"),St=T.a.Group,ft=function(ne){var xe=ne.value,qe=xe===void 0?[]:xe,ht=ne.onChange,Fe=ne.options,Xe=ne.search,Rt=Object(et.a)(ne,["value","onChange","options","search"]),Ne=E.a.useState(!1),jt=Object(le.a)(Ne,2),Ft=jt[0],we=jt[1];Object(te.useEffect)(function(){var Ge,ut=Fe==null||((Ge=Fe.tag_disciplines)===null||Ge===void 0)?void 0:Ge.map(function(ct){return ct.id}),ot=qe==null?void 0:qe.filter(function(ct){return ut.includes(ct)});we(ot.length===(ut==null?void 0:ut.length))},[qe]);var vt=function(ut){var ot,ct,Yt=Fe==null||((ot=Fe.tag_disciplines)===null||ot===void 0)?void 0:ot.map(function(xt){return xt.id}),Ht=qe==null?void 0:qe.filter(function(xt){return Yt.includes(xt)}),an=Object(He.uniq)([].concat(Object(_e.a)(qe),Object(_e.a)(ut)));if(Ht.length>ut.length){var Qt=Object(He.xor)(Ht,ut);console.log(Qt,"newLevel"),an=an.filter(function(xt){return!Qt.includes(xt)})}ht(an),we(ut.length===(Fe==null||((ct=Fe.tag_disciplines)===null||ct===void 0)?void 0:ct.length))},lt=function(ut){var ot,ct=Fe==null||((ot=Fe.tag_disciplines)===null||ot===void 0)?void 0:ot.map(function(Yt){return Yt.id});ht(ut.target.checked?Object(He.uniq)([].concat(Object(_e.a)(qe),Object(_e.a)(ct))):qe==null?void 0:qe.filter(function(Yt){return!ct.includes(Yt)})),we(ut.target.checked)};console.log(Fe,"options");var Ut=function(){var ut,ot,ct=(Fe==null?void 0:Fe.tag_disciplines)||[];if(Xe){var Yt;ct=(Yt=ct)===null||Yt===void 0?void 0:Yt.filter(function(Ht){var an;return Ht==null||((an=Ht.name)===null||an===void 0)?void 0:an.includes(Xe)})}return ct=(ut=ct)===null||ut===void 0?void 0:ut.map(function(Ht){return Object(X.a)(Object(X.a)({},Ht),{},{label:"".concat(Ht.name,"(".concat(Ht==null?void 0:Ht.item_count,")")),value:Ht.id})}),ct=(ot=ct)===null||ot===void 0?void 0:ot.filter(function(Ht){return Ht.item_count!==0}),ct},Nt=function(){var ut=!1;if(!Xe)ut=!0;else{var ot;(ot=Fe.tag_disciplines)===null||ot===void 0||ot.forEach(function(ct){if(!ut){var Yt;ut=((Yt=ct.name)===null||Yt===void 0?void 0:Yt.includes(Xe))&&ct.item_count!==0}})}return ut};return(Fe==null?void 0:Fe.item_count)===0||!Nt()?E.a.createElement(E.a.Fragment,null):E.a.createElement("div",{className:Ye.a.cInput},E.a.createElement("div",{className:Ye.a.cl},E.a.createElement(T.a,{checked:Ft,onChange:lt},E.a.createElement("span",{className:Ye.a.box},E.a.createElement("span",{className:"font14 c-light-primary"},E.a.createElement("span",{title:Fe==null?void 0:Fe.name,className:Ye.a.box1}," ",Fe==null?void 0:Fe.name),E.a.createElement("span",null," ","(".concat(Fe==null?void 0:Fe.item_count,")"))),E.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),E.a.createElement("div",{className:Ye.a.cr},E.a.createElement(St,{options:Ut(),value:qe,onChange:vt})))},bt=ft,dt=l("ErOA"),Dt=l("ozfa"),Ot=l("MJZm"),_t=l("0Owb"),Ue=l("tmPe"),It=l.n(Ue),kt=function(ne){var xe=ne.value,qe=ne.onChange,ht=ne.defaultValue,Fe=ne.treeData,Xe=Fe===void 0?[]:Fe,Rt=Object(et.a)(ne,["value","onChange","defaultValue","treeData"]);return E.a.createElement("div",{className:It.a.customTree},E.a.createElement(Ot.a,Object(_t.a)({multiple:!0,showIcon:!0,selectedKeys:xe,defaultExpandedKeys:ht,treeData:Xe,onSelect:qe},Rt)))},Be=kt,Ke=l("sbIO"),K=l("nwOs"),G=z.a.Search,H=function(ne){var xe,qe=ne.formValue,ht=ne.setFatherTabs,Fe=ne.tabs,Xe=ne.editData,Rt=ne.dispatch,Ne=Object(me.i)().id,jt=Object(te.useState)(["mine"]),Ft=Object(le.a)(jt,2),we=Ft[0],vt=Ft[1],lt=Object(te.useState)(!0),Ut=Object(le.a)(lt,2),Nt=Ut[0],Ge=Ut[1],ut=Object(te.useState)(!1),ot=Object(le.a)(ut,2),ct=ot[0],Yt=ot[1],Ht=Object(te.useState)(!1),an=Object(le.a)(Ht,2),Qt=an[0],xt=an[1],nn=Object(te.useState)(""),zt=Object(le.a)(nn,2),on=zt[0],Gt=zt[1],Dn=Object(te.useState)(!1),Nn=Object(le.a)(Dn,2),Gn=Nn[0],je=Nn[1],Et=Object(te.useState)(!1),sn=Object(le.a)(Et,2),mn=sn[0],Pn=sn[1],jn=Object(te.useState)({}),h=Object(le.a)(jn,2),o=h[0],r=h[1],c=Object(te.useState)([]),p=Object(le.a)(c,2),d=p[0],ie=p[1],Qe=Object(te.useState)([]),Ct=Object(le.a)(Qe,2),Mt=Ct[0],tt=Ct[1],Ze=Object(te.useState)([]),ce=Object(le.a)(Ze,2),nt=ce[0],Xt=ce[1],Lt=Object(te.useState)([]),wt=Object(le.a)(Lt,2),Wt=wt[0],xn=wt[1],hn=Object(te.useState)(null),Tn=Object(le.a)(hn,2),vn=Tn[0],Zn=Tn[1],Rn=Object(te.useRef)([]),hi=Object(te.useState)(!1),xi=Object(le.a)(hi,2),vi=xi[0],Xn=xi[1],Si=Object(te.useState)([]),pi=Object(le.a)(Si,2),Hn=pi[0],Wi=pi[1],Sa=Object(te.useState)([0]),Kn=Object(le.a)(Sa,2),gn=Kn[0],fi=Kn[1],fn=Object(te.useState)([]),Qn=Object(le.a)(fn,2),yn=Qn[0],Yi=Qn[1],An=Object(te.useRef)([]),ki=Object(te.useState)(!1),sa=Object(le.a)(ki,2),da=sa[0],Ji=sa[1],Na=Object(te.useState)([]),Ri=Object(le.a)(Na,2),Fn=Ri[0],Oi=Ri[1],ha=Object(te.useState)([]),ka=Object(le.a)(ha,2),zi=ka[0],Oo=ka[1],oa=Object(te.useRef)([]),$t=Object(te.useState)([]),en=Object(le.a)($t,2),Jt=en[0],ln=en[1],bn=Object(te.useState)(!1),wn=Object(le.a)(bn,2),pn=wn[0],ti=wn[1],gi=Object(te.useRef)([]),cn=Object(te.useState)(0),qi=Object(le.a)(cn,2),En=qi[0],$n=qi[1],Pi=yn==null?void 0:yn.filter(function(pt){return Hn==null?void 0:Hn.includes(pt.id)}),Hi=zi==null?void 0:zi.filter(function(pt){return Fn==null?void 0:Fn.includes(pt.id)}),ja=Object(te.useState)([]),pa=Object(le.a)(ja,2),Wn=pa[0],no=pa[1],Po=Object(te.useState)(!1),fa=Object(le.a)(Po,2),tr=fa[0],io=fa[1],nr=Object(te.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"myshixuns_count",no_jupyter:1}),Ua=Object(le.a)(nr,2),Ra=Ua[0],Lr=Ua[1],To=function(){var pt=Object(F.a)(U.a.mark(function st(ze){var Ae,mt,yt,Pt;return U.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:if(!ze){tn.next=8;break}return Ae=Object(X.a)(Object(X.a)({},Ra),{},{shixun_ids:Wn}),Ra.sort==="recommend"&&(Ae.sort="myshixuns_count"),mt=Object(X.a)({},Ae),tn.next=6,Rt({type:"classroomList/getShixunLists",payload:mt});case 6:tn.next=13;break;case 8:return yt=Object(X.a)({},Ra),Ra.sort==="recommend"&&(yt.sort="myshixuns_count"),Pt=Object(X.a)({},yt),tn.next=13,Rt({type:"classroomList/getShixunLists",payload:Pt});case 13:case"end":return tn.stop()}},st)}));return function(ze){return pt.apply(this,arguments)}}();Object(te.useEffect)(function(){ir()},[]),Object(te.useEffect)(function(){return Fe===1&&(Rt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Rt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){Rt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Rt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[Fe]),Object(te.useEffect)(function(){Ne?Xe&&Oa():(ma(we),Ia(),Ge(!1))},[Xe]),Object(te.useEffect)(function(){on&&Ao()},[on]);var Ao=function(){var st=null;Mt==null||Mt.forEach(function(ze){var Ae;(Ae=ze.sub_disciplines)===null||Ae===void 0||Ae.forEach(function(mt){var yt;(yt=mt.tag_disciplines)===null||yt===void 0||yt.forEach(function(Pt){var Vt,tn=((Vt=Pt.name)===null||Vt===void 0?void 0:Vt.includes(on))&&Pt.item_count!==0;tn&&!st&&(st=ze.id)})})}),st&&Zn(st)},Mo=function(st){function ze(Ae){var mt=Ae.children,yt=Array.isArray(mt)&&mt.length>0,Pt=Ae==null?void 0:Ae.group_id;return gi.current.push({name:Ae==null?void 0:Ae.name,id:Pt,count:Ae==null?void 0:Ae.count}),{title:E.a.createElement("div",{title:Ae==null?void 0:Ae.name,className:f.a.name},Ae==null?void 0:Ae.name,"\uFF08".concat(Ae==null?void 0:Ae.count,"\uFF09")),value:Pt,name:Ae==null?void 0:Ae.name,key:Pt,count:Ae==null?void 0:Ae.count,id:Pt,icon:E.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:yt?mt==null?void 0:mt.map(function(Vt){return ze(Vt)}):[]}}return st==null?void 0:st.map(function(Ae){return ze(Ae)})},ir=function(){var pt=Object(F.a)(U.a.mark(function st(){var ze,Ae;return U.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(R.y)({});case 2:ze=yt.sent,gi.current=[{id:0,name:"\u6839\u76EE\u5F55",count:ze==null?void 0:ze.root_count}],ze!=null&&ze.data&&(Ae=[{title:E.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:f.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((ze==null?void 0:ze.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:ze==null?void 0:ze.root_count,name:"\u6839\u76EE\u5F55",icon:E.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Mo(ze.data||[])}],Yi(gi.current),ln(Ae));case 5:case"end":return yt.stop()}},st)}));return function(){return pt.apply(this,arguments)}}(),Oa=function(){var pt=Object(F.a)(U.a.mark(function st(){var ze,Ae,mt,yt,Pt,Vt,tn,kn,Cn,Mn,Sn,ni,li,ii,Ti,In,qn,ai;return U.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return Mn=Xe==null||((ze=Xe.tag_disciplines)===null||ze===void 0)?void 0:ze.map(function(dn){return dn.tag_discipline_id}),Sn=Xe==null||((Ae=Xe.groups)===null||Ae===void 0)?void 0:Ae.map(function(dn){return dn.id}),ni={source:Xe==null||((mt=Xe.examination_bank)===null||mt===void 0)?void 0:mt.source,group_ids:Sn,tag_discipline_ids:Mn,teach_group_ids:Xe==null?void 0:Xe.teach_group_ids,exam_id:Ne},rn.next=5,Object(dt.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ni});case 5:if(li=rn.sent,!((li==null?void 0:li.status)===-1)){rn.next=8;break}return rn.abrupt("return");case 8:no(Xe==null?void 0:Xe.shixun_ids),ii=li==null?void 0:li.filter(function(dn){var zn;return!!(dn!=null&&(zn=dn.item_banks)!==null&&zn!==void 0&&zn.length)}),ii=ii.map(function(dn){return Object(X.a)(Object(X.a)({},dn),{},{scoreTotal:0,score:0,questionTotal:0})}),ii=(yt=ii)===null||yt===void 0?void 0:yt.map(function(dn,zn){var oi,Vn,Un;return Object(X.a)(Object(X.a)({},dn),{},{score:(Xe==null||((oi=Xe.score_settings)===null||oi===void 0||((Vn=oi.find(function(ui){return ui.item_type===(dn==null?void 0:dn.item_type)}))===null||Vn===void 0))?void 0:Vn.score)||0,item_banks:dn==null||((Un=dn.item_banks)===null||Un===void 0)?void 0:Un.map(function(ui){var _n;return Object(X.a)(Object(X.a)({},ui),{},{tag_disciplines:ui==null||((_n=ui.tag_disciplines)===null||_n===void 0)?void 0:_n.map(function(Yn){var yi;return Object(X.a)(Object(X.a)({},Yn),{},{difficulties:Yn==null||((yi=Yn.difficulties)===null||yi===void 0)?void 0:yi.map(function(Qi){var Mi=Xe==null?void 0:Xe.contents.find(function(na){return na.item_type===dn.item_type&&na.sub_discipline_id===ui.sub_discipline_id&&na.tag_discipline_id===Yn.tag_discipline_id&&na.difficulty===Qi.difficulty});return Mi?Object(X.a)(Object(X.a)({},Qi),{},{num:Mi==null?void 0:Mi.quanlity}):Object(X.a)({},Qi)})})})})})})}),Ti=va(ii),In=Ti.panel,qn=Ti.score_num_item,ii=(Pt=ii)===null||Pt===void 0?void 0:Pt.map(function(dn,zn){var oi,Vn=(In==null||((oi=In[zn])===null||oi===void 0)?void 0:oi.reduce(function(Un,ui){return Un+ui},0))||0;return Object(X.a)(Object(X.a)({},dn),{},{scoreTotal:Vn*(qn[zn]||0),questionTotal:Vn})}),ai=[],Xe==null||((Vt=Xe.sort_by_item_type)===null||Vt===void 0)||Vt.forEach(function(dn){var zn=ii.find(function(oi){var Vn,Un=(Vn=ga.find(function(ui){return ui.type===(oi==null?void 0:oi.item_type)}))===null||Vn===void 0?void 0:Vn.name;return Un===dn});ai.push(zn)}),ai=Object(He.compact)(ai),ma(Xe==null||((tn=Xe.examination_bank)===null||tn===void 0)?void 0:tn.source),Ia(),vt(Xe==null||((kn=Xe.examination_bank)===null||kn===void 0)?void 0:kn.source),xn(Mn),Rn.current=Mn,Wi(Sn),Oi((Xe==null?void 0:Xe.teach_group_ids)||[]),$n(Xe==null||((Cn=Xe.groups)===null||Cn===void 0)?void 0:Cn.map(function(dn){return dn.count}).reduce(function(dn,zn){return dn+zn},0)),An.current=Sn,fi(Sn!=null&&Sn.length?Sn:[0]),ie(Object(He.cloneDeep)(ai)),Ge(!1);case 30:case"end":return rn.stop()}},st)}));return function(){return pt.apply(this,arguments)}}(),ea=function(){var pt=Object(F.a)(U.a.mark(function st(){var ze;return U.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:ze={source:we,group_ids:Hn,tag_discipline_ids:Wt,teach_group_ids:Fn,shixun_ids:Wn},ta(ze),Rn.current=Wt,je(!1);case 4:case"end":return mt.stop()}},st)}));return function(){return pt.apply(this,arguments)}}(),ma=function(){var pt=Object(F.a)(U.a.mark(function st(ze){var Ae,mt,yt,Pt,Vt,tn;return U.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Object(dt.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:ze}});case 2:yt=Cn.sent,Pt=[],yt==null||((Ae=yt.disciplines)===null||Ae===void 0)||Ae.forEach(function(Mn){var Sn;Mn==null||((Sn=Mn.sub_disciplines)===null||Sn===void 0)||Sn.forEach(function(ni){Pt=Pt.concat((ni==null?void 0:ni.tag_disciplines)||[])})}),Vt=null,tn=yt==null||((mt=yt.disciplines)===null||mt===void 0)?void 0:mt.map(function(Mn){var Sn,ni=Mn==null||((Sn=Mn.sub_disciplines)===null||Sn===void 0)?void 0:Sn.reduce(function(li,ii){return li+ii.item_count},0);return!Vt&&ni!==0&&(Vt=Mn.id),Object(X.a)(Object(X.a)({},Mn),{},{item_count:ni})}),tt(tn),Xt(Pt),Zn(Vt);case 10:case"end":return Cn.stop()}},st)}));return function(ze){return pt.apply(this,arguments)}}(),Ia=function(){var pt=Object(F.a)(U.a.mark(function st(){var ze;return U.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(dt.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:ze=mt.sent,Oo((ze==null?void 0:ze.groups)||[]);case 4:case"end":return mt.stop()}},st)}));return function(){return pt.apply(this,arguments)}}(),ta=function(){var pt=Object(F.a)(U.a.mark(function st(ze){var Ae,mt;return U.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Ge(!0),Pt.next=3,Object(dt.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ze});case 3:Ae=Pt.sent,Ae&&(Ae.forEach(function(Vt){Vt.item_type==="PRACTICAL"&&no(Wn)}),Rt({type:"classroomList/setActionTabs",payload:{key:""}})),mt=Ae==null?void 0:Ae.filter(function(Vt){var tn;return!!(Vt!=null&&(tn=Vt.item_banks)!==null&&tn!==void 0&&tn.length)}),mt=mt.map(function(Vt){return Object(X.a)(Object(X.a)({},Vt),{},{scoreTotal:0,score:0,questionTotal:0})}),ie(mt),Ge(!1);case 9:case"end":return Pt.stop()}},st)}));return function(ze){return pt.apply(this,arguments)}}(),Zi=function(){xn(Rn.current),je(!1),Gt("")},la=function(st){xn(st)},ao=function(){for(var st=nt==null?void 0:nt.filter(function(kn){return Wt==null?void 0:Wt.includes(kn.id)}),ze=Object(_e.a)(st),Ae=0,mt=[],yt=0;yt<ze.length;yt++){for(var Pt="",Vt=0;Vt<mt.length;Vt++)if(mt[Vt][0].parent_name==ze[yt].parent_name){Ae=1,Pt=Vt;break}if(Ae==1)mt[Pt].push(ze[yt]),Ae=0;else if(Ae==0){var tn=new Array;tn.push(ze[yt]),mt.push(tn)}}return mt},ar=function(st,ze){var Ae,mt,yt=Object(He.cloneDeep)(d);yt[ze]=st;var Pt=va([yt[ze]]),Vt=Pt==null||((Ae=Pt.panel)===null||Ae===void 0||((mt=Ae[0])===null||mt===void 0))?void 0:mt.reduce(function(kn,Cn){return kn+Cn},0);yt[ze].questionTotal=Vt,ie(yt);var tn=document.getElementsByClassName("customError");tn==null||tn.forEach(function(kn){var Cn;kn==null||((Cn=kn.classList)===null||Cn===void 0)||Cn.remove("customError")})},va=function(st){var ze={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return st==null||st.forEach(function(Ae,mt){var yt,Pt,Vt;ze.panel.push([]),ze.score_num_item.push(Ae==null?void 0:Ae.score),ze.score_total.push(Ae==null?void 0:Ae.scoreTotal),(yt=ze.error_tips)===null||yt===void 0||yt.push({name:(Pt=ga.find(function(tn){return tn.type===(Ae==null?void 0:Ae.item_type)}))===null||Pt===void 0?void 0:Pt.name,score:(Ae==null?void 0:Ae.score)||0,scoreTotal:Ae==null?void 0:Ae.scoreTotal,item_type:Ae==null?void 0:Ae.item_type}),Ae==null||((Vt=Ae.item_banks)===null||Vt===void 0)||Vt.forEach(function(tn){var kn;tn==null||((kn=tn.tag_disciplines)===null||kn===void 0)||kn.forEach(function(Cn){var Mn;Cn==null||((Mn=Cn.difficulties)===null||Mn===void 0)||Mn.forEach(function(Sn){Sn.num&&(ze.panel[mt].push(Sn.num),ze.contents.push({difficulty:Sn.difficulty,item_type:Ae.item_type,items_count:Sn.num,sub_discipline_id:tn.sub_discipline_id,tag_discipline_id:Cn.tag_discipline_id,shixun_ids:Wn}))})})})}),ze},Lo=function(){var pt=Object(F.a)(U.a.mark(function st(ze){var Ae,mt,yt,Pt,Vt,tn,kn,Cn,Mn,Sn,ni,li,ii,Ti,In,qn,ai;return U.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:if(!(!Hn.length&&!Wt.length&&!Fn.length)){rn.next=3;break}return q.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),rn.abrupt("return");case 3:Ae=[],mt=[],yt=va(d),Pt=0;case 7:if(!(Pt<yt.error_tips.length)){rn.next=23;break}if(kn=yt==null||((Vt=yt.panel)===null||Vt===void 0||((tn=Vt[Pt])===null||tn===void 0))?void 0:tn.reduce(function(dn,zn){return dn+zn},0),!(yt.error_tips[Pt].score===0&&kn!==0)){rn.next=14;break}return Mn=document.getElementById("".concat((Cn=yt.error_tips[Pt])===null||Cn===void 0?void 0:Cn.item_type,"_score")),Mn.classList.add("customError"),Mn.scrollIntoView({block:"start",behavior:"smooth"}),rn.abrupt("return");case 14:if(!(yt.error_tips[Pt].score!==0&&kn===0)){rn.next=19;break}return ni=document.getElementById("".concat((Sn=yt.error_tips[Pt])===null||Sn===void 0?void 0:Sn.item_type,"_sum")),ni.classList.add("customError"),ni.scrollIntoView({block:"start",behavior:"smooth"}),rn.abrupt("return");case 19:yt.error_tips[Pt].score!==0&&kn!==0&&(Ae==null||Ae.push({item_type:(li=yt.error_tips[Pt])===null||li===void 0?void 0:li.item_type,score:((ii=yt.error_tips[Pt])===null||ii===void 0?void 0:ii.score)||0}),mt.push(yt.error_tips[Pt].name));case 20:Pt++,rn.next=7;break;case 23:if(!(Ae.length===0)){rn.next=26;break}return q.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),rn.abrupt("return");case 26:if(Yt(!0),Ti=Object(X.a)({contents:yt.contents,group_ids:Hn,teach_group_ids:Fn,score_settings:Ae,source:we,sub_discipline_id:0,sort_by_item_type:mt,tag_discipline_ids:Wt},qe),!ze){rn.next=36;break}return In=Object(X.a)(Object(X.a)({},Ti),ze),rn.next=32,Object(dt.a)("/api/examination_banks/save_question_list.json",{method:"post",body:In});case 32:return qn=rn.sent,qn.status===0&&q.b.success("\u4FDD\u5B58\u6210\u529F"),Yt(!1),rn.abrupt("return");case 36:if(ai={},!Xe){rn.next=43;break}return rn.next=40,Object(dt.a)("/api/examination_banks/".concat(Xe==null?void 0:Xe.id,"/update_random_exam.json"),{method:"post",body:Ti});case 40:ai=rn.sent,rn.next=46;break;case 43:return rn.next=45,Object(dt.a)("/api/examination_banks/create_random_exam.json",{method:"post",body:Ti});case 45:ai=rn.sent;case 46:ai.status===0&&(q.b.success("\u64CD\u4F5C\u6210\u529F"),Ce.d.push("/paperlibrary?defaultActiveKey=0")),Yt(!1);case 48:case"end":return rn.stop()}},st)}));return function(ze){return pt.apply(this,arguments)}}(),oo=function(){var pt=Object(F.a)(U.a.mark(function st(ze,Ae){var mt,yt,Pt,Vt,tn,kn,Cn,Mn,Sn,ni,li,ii,Ti,In,qn,ai,Ai,rn,dn,zn,oi,Vn,Un;return U.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(!(!Hn.length&&!Wt.length&&!Fn.length)){_n.next=3;break}return q.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),_n.abrupt("return");case 3:mt=[],yt=[],Pt=va(d),Vt=0;case 7:if(!(Vt<Pt.error_tips.length)){_n.next=23;break}if(Cn=Pt==null||((tn=Pt.panel)===null||tn===void 0||((kn=tn[Vt])===null||kn===void 0))?void 0:kn.reduce(function(Yn,yi){return Yn+yi},0),!(Pt.error_tips[Vt].score===0&&Cn!==0)){_n.next=14;break}return Sn=document.getElementById("".concat((Mn=Pt.error_tips[Vt])===null||Mn===void 0?void 0:Mn.item_type,"_score")),Sn.classList.add("customError"),Sn.scrollIntoView({block:"start",behavior:"smooth"}),_n.abrupt("return");case 14:if(!(Pt.error_tips[Vt].score!==0&&Cn===0)){_n.next=19;break}return li=document.getElementById("".concat((ni=Pt.error_tips[Vt])===null||ni===void 0?void 0:ni.item_type,"_sum")),li.classList.add("customError"),li.scrollIntoView({block:"start",behavior:"smooth"}),_n.abrupt("return");case 19:Pt.error_tips[Vt].score!==0&&Cn!==0&&(mt==null||mt.push({item_type:(ii=Pt.error_tips[Vt])===null||ii===void 0?void 0:ii.item_type,score:((Ti=Pt.error_tips[Vt])===null||Ti===void 0?void 0:Ti.score)||0}),yt.push(Pt.error_tips[Vt].name));case 20:Vt++,_n.next=7;break;case 23:if(!(mt.length===0)){_n.next=26;break}return q.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),_n.abrupt("return");case 26:if(xt(!0),In=Object(X.a)({contents:Pt.contents,group_ids:Hn,teach_group_ids:Fn,score_settings:mt,sort_by_item_type:yt,tag_discipline_ids:Wt,source:we,sub_discipline_id:0},qe),(Ae==null?void 0:Ae.type)==="PRACTICAL"&&(In.is_shixun=!0),!(ze!==void 0&&!(ze!=null&&ze.single_question_id))){_n.next=37;break}return In.seleted_item_bank_ids=ze==null?void 0:ze.seleted_item_bank_ids,_n.next=33,Object(dt.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:In});case 33:return qn=_n.sent,qn!=null&&qn.questions&&(Ai=Object(He.cloneDeep)(o),Ai.questionList=Ai==null||((ai=Ai.questionList)===null||ai===void 0)?void 0:ai.map(function(Yn){if(Yn.type===Ae.type){var yi;return Object(X.a)(Object(X.a)({},Yn),{},{questions:(qn==null||((yi=qn.questions)===null||yi===void 0)?void 0:yi.questions)||[]})}return Yn}),r(Ai)),xt(!1),_n.abrupt("return");case 37:if(!(ze!=null&&ze!==void 0&&ze.single_question_id)){_n.next=46;break}return In.seleted_item_bank_ids=ze==null?void 0:ze.seleted_item_bank_ids,In.single_question_id=ze==null?void 0:ze.single_question_id,_n.next=42,Object(dt.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:In});case 42:return rn=_n.sent,rn&&(zn=Object(He.cloneDeep)(o),zn.questionList=zn==null||((dn=zn.questionList)===null||dn===void 0)?void 0:dn.map(function(Yn){if(Yn.type===Ae.type){var yi,Qi,Mi=Object(He.cloneDeep)(Yn==null?void 0:Yn.questions);return Mi.splice(Ae.index,1,rn==null||((yi=rn.questions)===null||yi===void 0||((Qi=yi.questions)===null||Qi===void 0))?void 0:Qi[0]),Object(X.a)(Object(X.a)({},Yn),{},{questions:Mi})}return Yn}),r(zn)),xt(!1),_n.abrupt("return");case 46:return _n.next=48,Object(dt.a)("/api/examination_banks/preview_random_questions.json",{method:"post",body:In});case 48:oi=_n.sent,oi.exam&&(Vn=or(oi),Un=[],yt==null||yt.forEach(function(Yn){var yi,Qi=Vn==null||((yi=Vn.questionList)===null||yi===void 0)?void 0:yi.find(function(Mi){var na,jo=(na=ga.find(function(Wa){return Wa.type===(Mi==null?void 0:Mi.type)}))===null||na===void 0?void 0:na.name;return jo===Yn});Un.push(Qi)}),Un=Object(He.compact)(Un),Vn.questionList=Un,r(Object(X.a)({},Vn)),console.log(JSON.stringify(Vn)),Pn(!0),document.body.scrollIntoView()),xt(!1);case 51:case"end":return _n.stop()}},st)}));return function(ze,Ae){return pt.apply(this,arguments)}}(),ga=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"PROGRAM",name:"\u7A0B\u5E8F\u8BBE\u8BA1\u9898"},{type:"PROGRAM_CORRECTION",name:"\u7A0B\u5E8F\u6539\u9519\u9898"},{type:"PROGRAM_COMPLETION",name:"\u7A0B\u5E8F\u586B\u7A7A\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],ya=function(){var st=va(d),ze=st.panel,Ae=st.score_total;return Ae=Ae.reduce(function(mt,yt){return mt+yt},0),ze=Object(He.flatten)(ze).reduce(function(mt,yt){return mt+yt},0),E.a.createElement("div",{className:f.a.total},E.a.createElement("div",null,E.a.createElement("img",{src:_.a}),E.a.createElement("span",null,"\u9898\u6570(\u9053)"),E.a.createElement("aside",null,ze)),E.a.createElement("aside",null),E.a.createElement("div",null,E.a.createElement("img",{src:Pe.a}),E.a.createElement("span",null,"\u603B\u5206(\u5206)"),E.a.createElement("aside",null,Ae)))},Gi=function(st,ze,Ae){return st[ze]=st.splice(Ae,1,st[ze])[0],st},Do=function(st){var ze=[],Ae=Object(He.cloneDeep)(d);Ae.length>1&&st!==0&&(ze=Gi(Ae,st,st-1)),ie(ze)},No=function(st){var ze=[],Ae=Object(He.cloneDeep)(d);Ae.length>1&&st!==Ae.length-1&&(ze=Gi(Ae,st,st+1)),ie(ze)},ro=function(){var pt=Object(F.a)(U.a.mark(function st(ze){var Ae,mt,yt,Pt;return U.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:if(yt=Object(_e.a)(we),we.includes(ze)?yt=yt.filter(function(kn){return kn!==ze}):yt.push(ze),!(yt.length===0)){tn.next=5;break}return q.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),tn.abrupt("return");case 5:(Ae=yt)!==null&&Ae!==void 0&&Ae.includes("mine")||(Wi([]),An.current=[]),(mt=yt)!==null&&mt!==void 0&&mt.includes("teach_groups")||(Oi([]),oa.current=[]),vt(yt),ma(yt),xn([]),Rn.current=[],Pt={source:yt,group_ids:An.current,tag_discipline_ids:[],teach_group_ids:oa.current},ta(Pt);case 13:case"end":return tn.stop()}},st)}));return function(ze){return pt.apply(this,arguments)}}(),or=function(st){var ze={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!st)return;var Ae=st||{},mt=Ae.exam,yt=Ae.single_questions,Pt=Ae.multiple_questions,Vt=Ae.judgement_questions,tn=Ae.program_questions,kn=Ae.program_correction_questions,Cn=Ae.program_completion_questions,Mn=Ae.completion_questions,Sn=Ae.subjective_questions,ni=Ae.practical_questions,li=Ae.combination_questions,ii=[Object(X.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},yt),Object(X.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},Pt),Object(X.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Mn),Object(X.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Vt),Object(X.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},Sn),Object(X.a)({type:"PROGRAM",name:"\u7A0B\u5E8F\u8BBE\u8BA1\u9898"},tn),Object(X.a)({type:"PROGRAM_CORRECTION",name:"\u7A0B\u5E8F\u6539\u9519\u9898"},kn),Object(X.a)({type:"PROGRAM_COMPLETION",name:"\u7A0B\u5E8F\u586B\u7A7A\u9898"},Cn),Object(X.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},ni),Object(X.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},li)],Ti=[],In=0,qn=0,ai=ii.filter(function(Ai){return Ai.questions_count>0}).map(function(Ai,rn){var dn;return(dn=Ai.questions)===null||dn===void 0||dn.forEach(function(zn){Ti.push(zn.id),In=In+Number(zn.score),qn=qn+1}),Object(X.a)(Object(X.a)({},Ai),{number:ze[rn+1]})});return{all_questions_count:qn,all_score:In,questionList:ai,ids:Ti,exam:mt}},rr=function(st){var ze,Ae,mt=Object(He.cloneDeep)(o),yt=Object(He.cloneDeep)(d);mt.questionList=mt==null||((ze=mt.questionList)===null||ze===void 0)?void 0:ze.map(function(Pt){return Pt.type===st.type?Object(X.a)(Object(X.a)({},Pt),{},{questions_score:st.scoreTotal}):Pt}),yt=(Ae=yt)===null||Ae===void 0?void 0:Ae.map(function(Pt){return Pt.item_type===st.type?Object(X.a)(Object(X.a)({},Pt),{},{score:st.score,scoreTotal:st.scoreTotal}):Pt}),ie(yt),r(mt),console.log(st,o,d)},Ba=Mt==null||((xe=Mt.find(function(pt){return pt.id===vn}))===null||xe===void 0)?void 0:xe.sub_disciplines,Fa=ao();return mn?E.a.createElement(Ke.a,{loading:ct,submit:Lo,goBack:function(){return Pn(!1)},data:o,onTypeScore:rr,onExchange:oo}):E.a.createElement("section",{className:f.a.wrap,style:{display:Fe?"flex":"none"}},E.a.createElement(K.a,{configPaper:!0,setshiXunIds:no,shiXunIds:Wn,getList:ta,source:we,group_ids:Hn,tag_discipline_ids:Wt,teach_group_ids:Fn,setisPreview:io,isPreview:tr}),E.a.createElement("div",{id:"id_left",className:f.a.left,onMouseEnter:function(st){var ze=document.getElementById("id_left");ze.style.overflowY="auto"},onMouseLeave:function(st){var ze=document.getElementById("id_left");ze.style.overflowY="hidden"}},E.a.createElement(Le.a,{loading:Nt,active:!0,paragraph:{rows:5}},d.map(function(pt,st){var ze;return E.a.createElement("div",{className:f.a.list,key:st},E.a.createElement("div",{className:f.a.name},E.a.createElement("b",null),E.a.createElement("span",null,(ze=ga.find(function(Ae){return Ae.type===(pt==null?void 0:pt.item_type)}))===null||ze===void 0?void 0:ze.name)),E.a.createElement("aside",null,E.a.createElement("div",null,"\u5171",E.a.createElement("span",{className:f.a.b},pt.questionTotal),"\u9898",E.a.createElement("span",{className:f.a.l},"|"),"\u5171",E.a.createElement("span",{className:f.a.r},pt.scoreTotal),"\u5206"),E.a.createElement("div",null,st>0?E.a.createElement(J.a,{getPopupContainer:function(mt){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},E.a.createElement("span",{onClick:function(){return Do(st)},className:"mb20",style:{transform:"rotate(270deg)"}}," ",E.a.createElement("i",{className:"icon-jiantou1"}))):E.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}}," ",E.a.createElement("i",{className:"icon-jiantou1"})),st<d.length-1?E.a.createElement(J.a,{getPopupContainer:function(mt){return document.getElementById("id_left")},title:"\u4E0B\u79FB"},E.a.createElement("span",{onClick:function(){return No(st)},style:{transform:"rotate(90deg)"}}," ",E.a.createElement("i",{className:"icon-jiantou1"}))):E.a.createElement("span",{style:{transform:"rotate(90deg)",cursor:"not-allowed"}}," ",E.a.createElement("i",{className:"icon-jiantou1"})))))})),ya()),E.a.createElement("div",{className:f.a.right},E.a.createElement(A,{className:f.a.tabs,value:1,onChange:function(){return ht(0)}}),E.a.createElement("section",{className:f.a.topWarp},E.a.createElement("div",{className:f.a.title},E.a.createElement("b",null),E.a.createElement("span",null,"\u62BD\u9898\u7EC4\u5377"),E.a.createElement("div",null,"STEP2")," "),E.a.createElement("div",{style:{margin:"20px 0"}},E.a.createElement("span",{style:{marginRight:"72px"}},"\u5B9E\u8BAD\u9898\u9009\u62E9"),E.a.createElement(Te.a,{onClick:function(){Rt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",params:{}}}),To(!1)},style:{background:"#169bd5",color:"white",borderRadius:"5px"}},"\u9009\u62E9\u5B9E\u8BAD\u9898"),console.log(Xe,"-----------editData"),E.a.createElement("span",{style:{margin:"0 10px"}},"\u5DF2\u9009\u62E9 ",Wn?Wn.length:(Xe==null?void 0:Xe.shixuns_count)||0," \u4E2A\u5B9E\u8BAD\u9898"),E.a.createElement("span",{style:{color:"#0000ff",cursor:"pointer"},onClick:Object(F.a)(U.a.mark(function pt(){return U.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:io(!0),Rt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),To(!0);case 3:case"end":return ze.stop()}},pt)}))},"\u67E5\u770B")),E.a.createElement("div",{className:f.a.source},E.a.createElement("b",null,"*"),E.a.createElement("span",null,"\u8BD5\u9898\u6765\u6E90"),E.a.createElement("aside",null,E.a.createElement("div",{onClick:function(){return ro("mine")}}," ",E.a.createElement(T.a,{checked:we==null?void 0:we.includes("mine")}),E.a.createElement("span",{style:{color:we!=null&&we.includes("mine")?"#007DFE":"#666666"}},"\u4EC5\u6211\u521B\u5EFA\u7684")),E.a.createElement("div",{className:"mb20",onClick:function(){return ro("teach_groups")}}," ",E.a.createElement(T.a,{checked:we==null?void 0:we.includes("teach_groups")}),E.a.createElement("span",{style:{color:we!=null&&we.includes("teach_groups")?"#007DFE":"#666666"}},"\u6559\u7814\u5171\u4EAB")),E.a.createElement("div",{onClick:function(){return ro("public")}},E.a.createElement(T.a,{checked:we==null?void 0:we.includes("public")}),E.a.createElement("span",{style:{color:we!=null&&we.includes("public")?"#007DFE":"#666666"}},"\u516C\u5171\u9898\u5E93"))),E.a.createElement("aside",null,(we==null?void 0:we.includes("mine"))&&E.a.createElement("div",{style:{marginBottom:14},className:f.a.folder,onClick:function(){ti(!0),Xn(!0),An.current=Hn,$n((Pi==null?void 0:Pi.map(function(st){return st.count}).reduce(function(st,ze){return st+ze},0))||0)}},E.a.createElement("img",{src:fe.a}),E.a.createElement("span",null,"\u9009\u62E9\u8BD5\u9898\u6587\u4EF6\u5939"),E.a.createElement(J.a,{title:"\u9009\u4E2D\u9879\u4EC5\u5305\u62EC\u8BE5\u6587\u4EF6\u5939\u4E0B\u7684\u8BD5\u9898\uFF0C\u4E0D\u5305\u62EC\u5B50\u6587\u4EF6\u5939\uFF0C\u4E14\u7CFB\u7EDF\u53D6\u60A8\u9009\u4E2D\u7684\u6587\u4EF6\u5939\u548C\u8003\u67E5\u8303\u56F4\u4E2D\u7684\u8BD5\u9898\u7684\u5E76\u96C6\u4F5C\u4E3A\u968F\u673A\u5BF9\u8C61\u3002"},E.a.createElement("img",{src:se.a}))),(we==null?void 0:we.includes("teach_groups"))&&E.a.createElement("div",{className:f.a.folder,onClick:function(){Ji(!0),oa.current=Fn}},E.a.createElement("img",{src:Me.a}),E.a.createElement("span",null,"\u9009\u62E9\u6559\u7814\u56E2\u961F")))),(we==null?void 0:we.includes("mine"))&&E.a.createElement("div",{className:f.a.choice},E.a.createElement("div",{className:f.a.name},E.a.createElement("b",null),E.a.createElement("span",null,"\u5DF2\u9009\u6587\u4EF6\u5939")),E.a.createElement(De.a,{type:2,value:Pi,onChange:function(st){var ze=Hn.filter(function(mt){return mt!==st}),Ae={source:we,group_ids:ze,tag_discipline_ids:Wt,teach_group_ids:Fn};ta(Ae),Wi(ze),An.current=ze}})),(we==null?void 0:we.includes("teach_groups"))&&E.a.createElement("div",{className:f.a.choice},E.a.createElement("div",{className:f.a.name},E.a.createElement("b",null),E.a.createElement("span",null,"\u5DF2\u9009\u6559\u7814\u56E2\u961F")),E.a.createElement(De.a,{icon:Ee.a,type:2,value:Hi,onChange:function(st){var ze=Fn.filter(function(mt){return mt!==st}),Ae={source:we,group_ids:Hn,tag_discipline_ids:Wt,teach_group_ids:ze};ta(Ae),Oi(ze),oa.current=ze}})),E.a.createElement("div",{className:f.a.range},E.a.createElement("div",{className:f.a.name},E.a.createElement("b",null),E.a.createElement("span",null,"\u8003\u5BDF\u8303\u56F4")),E.a.createElement("div",{onClick:function(){if(vn===null){q.b.warn("\u8003\u5BDF\u8303\u56F4\u6CA1\u6709\u77E5\u8BC6\u70B9\u53EF\u4EE5\u9009\u62E9");return}Rn.current=Wt,je(!0)},className:f.a.btn},E.a.createElement("img",{src:j.a})," \u9009\u62E9\u8303\u56F4"),E.a.createElement("div",{className:f.a.name},E.a.createElement("b",{className:f.a.num}),E.a.createElement("span",null,"\u5DF2\u9009\u77E5\u8BC6\u70B9")),E.a.createElement("div",{className:f.a.knWarp},Fa==null?void 0:Fa.map(function(pt,st){return E.a.createElement(E.a.Fragment,{key:st},E.a.createElement("div",{className:f.a.kn},E.a.createElement("span",null,st+1)," ",E.a.createElement("span",null,pt==null?void 0:pt[0].parent_name)),E.a.createElement(De.a,{type:1,value:pt==null?void 0:pt.filter(function(ze){return!!ze.item_count}),onChange:function(Ae){var mt=Wt.filter(function(Pt){return Pt!==Ae}),yt={source:we,group_ids:Hn,tag_discipline_ids:mt,teach_group_ids:Fn};ta(yt),xn(mt),Rn.current=mt}}))})))),E.a.createElement(Le.a,{loading:Nt,active:!0,paragraph:{rows:5}},d.map(function(pt,st){return E.a.createElement(Ve.a,{key:st,value:pt,onChange:function(Ae){return ar(Ae,st)}})}),E.a.createElement("div",{className:f.a.btns},E.a.createElement(Te.a,{onClick:function(){ht(0),document.body.scrollIntoView()}},"\u4E0A\u4E00\u6B65"),E.a.createElement(Te.a,{loading:ct,onClick:function(){return Lo()}},"\u63D0\u4EA4"),E.a.createElement(Te.a,{loading:Qt,onClick:function(){return oo()},type:"primary"},"\u9884\u89C8")))),E.a.createElement(b.a,{centered:!0,closable:!1,destroyOnClose:!0,className:f.a.modal,visible:Gn,title:null,width:"1200px",onOk:ea,onCancel:Zi},E.a.createElement("div",{className:f.a.modalBody},E.a.createElement("div",{className:f.a.left},E.a.createElement("div",{className:f.a.title},E.a.createElement("img",{src:re.a}),E.a.createElement("span",null,"\u8BD5\u9898\u8303\u56F4")),E.a.createElement("div",{className:f.a.l},Mt==null?void 0:Mt.map(function(pt){var st=null,ze=!1;if(!on)ze=!0;else{var Ae;(Ae=pt.sub_disciplines)===null||Ae===void 0||Ae.forEach(function(mt){var yt;(yt=mt.tag_disciplines)===null||yt===void 0||yt.forEach(function(Pt){if(!ze){var Vt;ze=((Vt=Pt.name)===null||Vt===void 0?void 0:Vt.includes(on))&&Pt.item_count!==0}})})}return E.a.createElement(E.a.Fragment,{key:pt.id},!!pt.item_count&&ze&&E.a.createElement("div",{onClick:function(){return Zn(pt.id)},className:"".concat(f.a.name," ").concat(pt.id===vn?f.a.active:"")},E.a.createElement("b",null),E.a.createElement("span",null,pt.name)))}))),E.a.createElement("div",{className:f.a.right},E.a.createElement("div",{className:f.a.inputWarp},E.a.createElement(G,{onChange:function(st){return Gt(st.target.value)},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9",value:on})),E.a.createElement("div",{className:f.a.l},Ba==null?void 0:Ba.map(function(pt,st){var ze,Ae=Object(X.a)(Object(X.a)({},pt),{},{tag_disciplines:pt==null||((ze=pt.tag_disciplines)===null||ze===void 0)?void 0:ze.filter(function(mt){return mt.item_count!==0})});return E.a.createElement(bt,{search:on,onChange:la,key:pt.id,value:Wt,options:Ae})}))))),E.a.createElement(b.a,{centered:!0,title:"\u9009\u62E9\u6587\u4EF6\u5939",visible:vi,width:718,destroyOnClose:!0,onCancel:function(){Wi(An.current),Xn(!1),$n(0)},footer:E.a.createElement("div",{style:{display:"flex",alignItems:"center"}},E.a.createElement("span",{style:{flex:"1",textAlign:"left"}},"\u5DF2\u9009",Hn.length||0,"\u4E2A\u6587\u4EF6\u5939\uFF0C\u5171\uFF08",En||0,"\uFF09\u9053\u9898"),E.a.createElement(Te.a,{onClick:function(){Wi(An.current),$n(0),Xn(!1)}},"\u53D6\u6D88"),E.a.createElement(Te.a,{type:"primary",onClick:function(){var st={source:we,group_ids:Hn,tag_discipline_ids:Wt,teach_group_ids:Fn,shixun_ids:Wn};ta(st),An.current=Hn,Xn(!1)}},"\u786E\u8BA4"))},E.a.createElement("aside",{className:f.a.exportModal},pn&&E.a.createElement(Be,{treeData:Jt,defaultValue:gn,value:Hn,onChange:function(st,ze){var Ae;$n((Ae=ze.selectedNodes)===null||Ae===void 0?void 0:Ae.map(function(mt){return mt.count}).reduce(function(mt,yt){return mt+yt},0)),Wi(st)}}))),E.a.createElement(b.a,{centered:!0,title:"\u9009\u62E9\u6559\u7814\u56E2\u961F",visible:da,width:718,destroyOnClose:!0,onCancel:function(){Oi(oa.current),Ji(!1)},onOk:function(){var st={source:we,group_ids:Hn,tag_discipline_ids:Wt,teach_group_ids:Fn};ta(st),oa.current=Fn,Ji(!1)}},E.a.createElement("aside",{className:f.a.teachModal},E.a.createElement("div",{className:f.a.head},E.a.createElement("div",{className:f.a.li}),E.a.createElement("div",{className:f.a.li},"\u56E2\u961F\u540D\u79F0"),E.a.createElement("div",{className:f.a.li},"\u5171\u4EAB\u9898\u76EE\u6570\u91CF")),E.a.createElement("div",{className:f.a.wraps},zi==null?void 0:zi.map(function(pt){return E.a.createElement("div",{key:pt.id,className:f.a.body},E.a.createElement("div",{className:f.a.li},E.a.createElement(T.a,{onChange:function(){var ze=pt.id,Ae=Object(_e.a)(Fn);Fn.includes(ze)?Ae=Ae.filter(function(mt){return mt!==ze}):Ae.push(ze),Oi(Ae)},checked:Fn==null?void 0:Fn.includes(pt.id)})),E.a.createElement("div",{title:pt.name,className:f.a.li},pt.name),E.a.createElement("div",{className:f.a.li},pt.item_bank_count))})))))},w=H,O=z.a.TextArea,L=function(ne){var xe=ne.paperlibrary,qe=ne.user,ht=ne.globalSetting,Fe=ne.dispatch,Xe=Object(te.useState)(0),Rt=Object(le.a)(Xe,2),Ne=Rt[0],jt=Rt[1],Ft=V.a.useForm(),we=Object(le.a)(Ft,1),vt=we[0],lt=Object(te.useState)({}),Ut=Object(le.a)(lt,2),Nt=Ut[0],Ge=Ut[1],ut=Object(te.useState)(!0),ot=Object(le.a)(ut,2),ct=ot[0],Yt=ot[1],Ht=Object(te.useState)(null),an=Object(le.a)(Ht,2),Qt=an[0],xt=an[1],nn=Object(me.i)().id;Object(te.useEffect)(function(){return Fe({type:"globalSetting/footerToggle",payload:!1}),function(){Fe({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(te.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var zt=function(Gn){Ge(Object(X.a)({},vt.getFieldsValue()))};Object(te.useEffect)(function(){if(nn){on();return}Yt(!1)},[nn]);var on=function(){var Nn=Object(F.a)(U.a.mark(function Gn(){var je,Et,sn,mn,Pn,jn;return U.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object(dt.a)("/api/examination_banks/".concat(nn,"/edit_random_exam.json"),{method:"get",params:{}});case 2:je=o.sent,je!=null&&je.examination_bank&&(jn={difficulty:je==null||((Et=je.examination_bank)===null||Et===void 0)?void 0:Et.difficulty,exam_notes:je==null||((sn=je.examination_bank)===null||sn===void 0)?void 0:sn.exam_notes,name:je==null||((mn=je.examination_bank)===null||mn===void 0)?void 0:mn.name,time:je==null||((Pn=je.examination_bank)===null||Pn===void 0)?void 0:Pn.time},Yt(!1),Ge(Object(X.a)({},jn)),vt.setFieldsValue(Object(X.a)({},jn)),xt(Object(X.a)(Object(X.a)({},je),{},{id:nn})));case 4:case"end":return o.stop()}},Gn)}));return function(){return Nn.apply(this,arguments)}}(),Gt=function(){var Nn=Object(F.a)(U.a.mark(function Gn(je){return U.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:if(!(je===0)){sn.next=3;break}return jt(je),sn.abrupt("return");case 3:return sn.next=5,vt.validateFields();case 5:jt(je);case 6:case"end":return sn.stop()}},Gn)}));return function(je){return Nn.apply(this,arguments)}}(),Dn=function(Gn){var je=parseInt(Gn);return Object(He.isNaN)(je)?"":je};return E.a.createElement("section",{className:I.a.wrap},E.a.createElement(Le.a,{loading:ct,active:!0,paragraph:{rows:5}},E.a.createElement("div",{className:I.a.crumbs},E.a.createElement("b",null),E.a.createElement("span",{className:"current",onClick:function(){return Ce.d.push("/")}},"\u9996\u9875>"),E.a.createElement("span",{className:"current",onClick:function(){return Ce.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),E.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),Ne===0&&E.a.createElement(A,{value:Ne,onChange:Gt}),Ne===0&&E.a.createElement("section",{className:I.a.oneWrap},E.a.createElement("div",{className:I.a.title},E.a.createElement("b",null),E.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),E.a.createElement("div",null,"STEP1")," "),E.a.createElement(V.a,{className:I.a.formWrap,form:vt,layout:"horizontal",onValuesChange:zt},E.a.createElement(V.a.Item,{label:"\u8BD5\u5377\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^(?!(\s+$))/,message:"\u8F93\u5165\u6846\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C"}]},E.a.createElement(z.a,{className:I.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),E.a.createElement("div",{style:{position:"relative"}},E.a.createElement(V.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},E.a.createElement(B.a,{min:1,parser:Dn,max:9999,placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F",style:{width:190}})),E.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),E.a.createElement(V.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},E.a.createElement(Re.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},E.a.createElement(Re.a.Button,{className:I.a.rb,value:1},"\u7B80\u5355"),E.a.createElement(Re.a.Button,{className:I.a.rb,value:2},"\u9002\u4E2D"),E.a.createElement(Re.a.Button,{className:I.a.rb,value:3},"\u56F0\u96BE"))),E.a.createElement(V.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},E.a.createElement(O,{placeholder:"\u8003\u751F\u5FC5\u987B\u4E25\u683C\u9075\u5B88\u8003\u573A\u7EAA\u5F8B\uFF0C\u4E0D\u51C6\u5192\u540D\u9876\u66FF\uFF0C\u4E0D\u51C6\u6709\u4EFB\u4F55\u4F5C\u5F0A\u884C\u4E3A\u3002\u5982\u53D1\u73B0\u8FDD\u7EAA\uFF0C\u5E76\u7ED9\u4E88\u4E25\u5389\u5904\u5206\u3002",rows:4,maxLength:300}))),E.a.createElement("div",{className:I.a.btns},E.a.createElement(Te.a,{className:"mr40",onClick:function(){return Ce.d.push("/paperlibrary")}},"\u8FD4\u56DE"),E.a.createElement(Te.a,{type:"primary",onClick:Object(F.a)(U.a.mark(function Nn(){return U.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,vt.validateFields();case 2:jt(1);case 3:case"end":return je.stop()}},Nn)}))},"\u4E0B\u4E00\u6B65"))),E.a.createElement(w,{tabs:Ne,dispatch:Fe,editData:Qt,setFatherTabs:jt,formValue:Nt})))},D=Ie.default=Object(Ce.a)(function(ve){var ne=ve.paperlibrary,xe=ve.user,qe=ve.globalSetting;return{paperlibrary:ne,user:xe,globalSetting:qe}})(L)},"E/GV":function(it,Ie,l){it.exports=l.p+"static/swenjianjia.1640bf70.svg"},ELLl:function(it,Ie,l){(function(oe){oe(l("VrN/"))})(function(oe){var Le={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ge=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(z,$,U){U&&U!=oe.Init&&(z.removeKeyMap(Oe),z.state.closeBrackets=null),$&&(Re(Te($,"pairs")),z.state.closeBrackets=$,z.addKeyMap(Oe))});function Te(z,$){return $=="pairs"&&typeof z=="string"?z:typeof z=="object"&&z[$]!=null?z[$]:Le[$]}var Oe={Backspace:F,Enter:X};function Re(z){for(var $=0;$<z.length;$++){var U=z.charAt($),te="'"+U+"'";Oe[te]||(Oe[te]=ee(U))}}Re(Le.pairs+"`");function ee(z){return function($){return V($,z)}}function B(z){var $=z.state.closeBrackets;if(!$||$.override)return $;var U=z.getModeAt(z.getCursor());return U.closeBrackets||$}function F(z){var $=B(z);if(!$||z.getOption("disableInput"))return oe.Pass;for(var U=Te($,"pairs"),te=z.listSelections(),E=0;E<te.length;E++){if(!te[E].empty())return oe.Pass;var me=le(z,te[E].head);if(!me||U.indexOf(me)%2!=0)return oe.Pass}for(var E=te.length-1;E>=0;E--){var Ce=te[E].head;z.replaceRange("",ge(Ce.line,Ce.ch-1),ge(Ce.line,Ce.ch+1),"+delete")}}function X(z){var $=B(z),U=$&&Te($,"explode");if(!U||z.getOption("disableInput"))return oe.Pass;for(var te=z.listSelections(),E=0;E<te.length;E++){if(!te[E].empty())return oe.Pass;var me=le(z,te[E].head);if(!me||U.indexOf(me)%2!=0)return oe.Pass}z.operation(function(){var Ce=z.lineSeparator()||`
`;z.replaceSelection(Ce+Ce,null),z.execCommand("goCharLeft"),te=z.listSelections();for(var de=0;de<te.length;de++){var I=te[de].head.line;z.indentLine(I,null,!0),z.indentLine(I+1,null,!0)}})}function W(z){var $=oe.cmpPos(z.anchor,z.head)>0;return{anchor:new ge(z.anchor.line,z.anchor.ch+($?-1:1)),head:new ge(z.head.line,z.head.ch+($?1:-1))}}function V(z,$){var U=B(z);if(!U||z.getOption("disableInput"))return oe.Pass;var te=Te(U,"pairs"),E=te.indexOf($);if(E==-1)return oe.Pass;for(var me=Te(U,"closeBefore"),Ce=Te(U,"triples"),de=te.charAt(E+1)==$,I=z.listSelections(),g=E%2==0,Q,S=0;S<I.length;S++){var A=I[S],x=A.head,b,N=z.getRange(x,ge(x.line,x.ch+1));if(g&&!A.empty())b="surround";else if((de||!g)&&N==$)de&&Z(z,x)?b="both":Ce.indexOf($)>=0&&z.getRange(x,ge(x.line,x.ch+3))==$+$+$?b="skipThree":b="skip";else if(de&&x.ch>1&&Ce.indexOf($)>=0&&z.getRange(ge(x.line,x.ch-2),x)==$+$){if(x.ch>2&&/\bstring/.test(z.getTokenTypeAt(ge(x.line,x.ch-2))))return oe.Pass;b="addFour"}else if(de){var T=x.ch==0?" ":z.getRange(ge(x.line,x.ch-1),x);if(!oe.isWordChar(N)&&T!=$&&!oe.isWordChar(T))b="both";else return oe.Pass}else if(g&&(N.length===0||/\s/.test(N)||me.indexOf(N)>-1))b="both";else return oe.Pass;if(!Q)Q=b;else if(Q!=b)return oe.Pass}var y=E%2?te.charAt(E-1):$,J=E%2?$:te.charAt(E+1);z.operation(function(){if(Q=="skip")z.execCommand("goCharRight");else if(Q=="skipThree")for(var ye=0;ye<3;ye++)z.execCommand("goCharRight");else if(Q=="surround"){for(var q=z.getSelections(),ye=0;ye<q.length;ye++)q[ye]=y+q[ye]+J;z.replaceSelections(q,"around"),q=z.listSelections().slice();for(var ye=0;ye<q.length;ye++)q[ye]=W(q[ye]);z.setSelections(q)}else Q=="both"?(z.replaceSelection(y+J,null),z.triggerElectric(y+J),z.execCommand("goCharLeft")):Q=="addFour"&&(z.replaceSelection(y+y+y+y,"before"),z.execCommand("goCharRight"))})}function le(z,$){var U=z.getRange(ge($.line,$.ch-1),ge($.line,$.ch+1));return U.length==2?U:null}function Z(z,$){var U=z.getTokenAt(ge($.line,$.ch+1));return/\bstring/.test(U.type)&&U.start==$.ch&&($.ch==0||!/\bstring/.test(z.getTokenTypeAt($)))}})},FOrL:function(it,Ie,l){it.exports=l.p+"static/nodata.a6b3f948.png"},FTkQ:function(it,Ie){it.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx:function(it,Ie){it.exports=function(oe,Le,ge,Te){var Oe=ge?ge.call(Te,oe,Le):void 0;if(Oe!==void 0)return!!Oe;if(oe===Le)return!0;if(typeof oe!="object"||!oe||typeof Le!="object"||!Le)return!1;var Re=Object.keys(oe),ee=Object.keys(Le);if(Re.length!==ee.length)return!1;for(var B=Object.prototype.hasOwnProperty.bind(Le),F=0;F<Re.length;F++){var X=Re[F];if(!B(X))return!1;var W=oe[X],V=Le[X];if(Oe=ge?ge.call(Te,W,V,X):void 0,Oe===!1||Oe===void 0&&W!==V)return!1}return!0}},HG2Q:function(it,Ie,l){it.exports=l.p+"static/sren.1cbce50b.svg"},HPRh:function(it,Ie,l){it.exports=l.p+"static/median.766cb706.svg"},Hfvn:function(it,Ie,l){it.exports=l.p+"static/wenjian.ea3b4170.svg"},HmJG:function(it,Ie,l){},IlMy:function(it,Ie,l){it.exports={flex_box_center:"flex_box_center___1Rd7-",flex_space_between:"flex_space_between___1qdJI",flex_box_vertical_center:"flex_box_vertical_center___3PScB",flex_box_center_end:"flex_box_center_end___gmzWk",flex_box_column:"flex_box_column___qhFY7",wrap:"wrap___2CDxR",left:"left___21M_k",list:"list___ahv58",name:"name___3cBep",b:"b___1CRFh",r:"r___2F_9I",l:"l___3XCXI",total:"total___2VTdV",topWarp:"topWarp___y9feY",right:"right___U2Z5M",tabs:"tabs___3eZK5",title:"title___3iKxF",source:"source___3rkh5",folder:"folder___AxGOK",choice:"choice___1AdWh",range:"range___23nFr",btn:"btn___1QiCj",knWarp:"knWarp___3eQQ5",kn:"kn___1OLj0",btns:"btns___26z5C",modalBody:"modalBody___1b2lK",active:"active___kELz6",inputWarp:"inputWarp___1leis",modal:"modal___1Ehn0",exportModal:"exportModal___1Vsj-",teachModal:"teachModal___CwfeZ",head:"head___2_Y6a",wraps:"wraps___3-f7m",body:"body___2Jb5Z"}},K5AI:function(it,Ie,l){it.exports={cInput:"cInput___2BJRi",cl:"cl___AbKoK",box:"box___3gRA9",box1:"box1___S3u_s",cr:"cr___16yEi"}},LdHM:function(it,Ie,l){"use strict";l.d(Ie,"b",function(){return me}),l.d(Ie,"a",function(){return de});var oe=l("1OyB"),Le=l("vuIU"),ge=l("Ji7U"),Te=l("LK+K"),Oe=l("q1tI"),Re=l("rePB"),ee=l("Ff2n"),B=l("ODXe"),F=l("4IlW"),X=l("bX4T"),W=l("YrtM"),V=l("TSYQ"),le=l.n(V),Z=l("+nKL"),z=l("8OUc"),$=function(R,ue){var se=R.prefixCls,Se=R.id,fe=R.flattenOptions,pe=R.childrenAsData,j=R.values,M=R.searchValue,re=R.multiple,P=R.defaultActiveFirstOption,_=R.height,he=R.itemHeight,Pe=R.notFoundContent,Je=R.open,Me=R.menuItemSelectedIcon,We=R.virtual,Ee=R.onSelect,De=R.onToggleOpen,Ve=R.onActiveValue,et=R.onScroll,at=R.onMouseEnter,Ye="".concat(se,"-item"),He=Object(W.a)(function(){return fe},[Je,fe],function(Ke,K){return K[0]&&Ke[1]!==K[1]}),St=Oe.useRef(null),ft=function(K){K.preventDefault()},bt=function(K){St.current&&St.current.scrollTo({index:K})},dt=function(K){for(var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=He.length,w=0;w<H;w+=1){var O=(K+w*G+H)%H,L=He[O],D=L.group,ve=L.data;if(!D&&!ve.disabled)return O}return-1},Dt=Oe.useState(function(){return dt(0)}),Ot=Object(B.a)(Dt,2),_t=Ot[0],Ue=Ot[1],It=function(K){Ue(K);var G=He[K];if(!G){Ve(null,-1);return}Ve(G.data.value,K)};Oe.useEffect(function(){It(P!==!1?dt(0):-1)},[He.length,M]),Oe.useEffect(function(){var Ke=setTimeout(function(){if(!re&&Je&&j.size===1){var K=Array.from(j)[0],G=He.findIndex(function(H){var w=H.data;return w.value===K});It(G),bt(G)}});return function(){return clearTimeout(Ke)}},[Je]);var kt=function(K){K!==void 0&&Ee(K,{selected:!j.has(K)}),re||De(!1)};if(Oe.useImperativeHandle(ue,function(){return{onKeyDown:function(K){var G=K.which;switch(G){case F.a.UP:case F.a.DOWN:{var H=0;if(G===F.a.UP?H=-1:G===F.a.DOWN&&(H=1),H!==0){var w=dt(_t+H,H);bt(w),It(w)}break}case F.a.ENTER:{var O=He[_t];O&&!O.data.disabled?kt(O.data.value):kt(void 0),Je&&K.preventDefault();break}case F.a.ESC:De(!1)}},onKeyUp:function(){},scrollTo:function(K){bt(K)}}}),He.length===0)return Oe.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),className:"".concat(Ye,"-empty"),onMouseDown:ft},Pe);function Be(Ke){var K=He[Ke];if(!K)return null;var G=K.data||{},H=G.value,w=G.label,O=G.children,L=Object(X.a)(G,!0),D=pe?O:w;return K?Oe.createElement("div",Object.assign({"aria-label":typeof D=="string"?D:null},L,{key:Ke,role:"option",id:"".concat(Se,"_list_").concat(Ke),"aria-selected":j.has(H)}),H):null}return Oe.createElement(Oe.Fragment,null,Oe.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),style:{height:0,width:0,overflow:"hidden"}},Be(_t-1),Be(_t),Be(_t+1)),Oe.createElement(Z.a,{itemKey:"key",ref:St,data:He,height:_,itemHeight:he,fullHeight:!1,onMouseDown:ft,onScroll:et,virtual:We,onMouseEnter:at},function(Ke,K){var G,H=Ke.group,w=Ke.groupOption,O=Ke.data,L=O.label,D=O.key;if(H)return Oe.createElement("div",{className:le()(Ye,"".concat(Ye,"-group"))},L!==void 0?L:D);var ve=O.disabled,ne=O.value,xe=O.title,qe=O.children,ht=O.style,Fe=O.className,Xe=Object(ee.a)(O,["disabled","value","title","children","style","className"]),Rt=j.has(ne),Ne="".concat(Ye,"-option"),jt=le()(Ye,Ne,Fe,(G={},Object(Re.a)(G,"".concat(Ne,"-grouped"),w),Object(Re.a)(G,"".concat(Ne,"-active"),_t===K&&!ve),Object(Re.a)(G,"".concat(Ne,"-disabled"),ve),Object(Re.a)(G,"".concat(Ne,"-selected"),Rt),G)),Ft=pe?qe:L,we=!Me||typeof Me=="function"||Rt;return Oe.createElement("div",Object.assign({},Xe,{"aria-selected":Rt,className:jt,title:xe,onMouseMove:function(){if(_t===K||ve)return;It(K)},onClick:function(){ve||kt(ne)},style:ht}),Oe.createElement("div",{className:"".concat(Ne,"-content")},Ft||ne),Oe.isValidElement(Me)||Rt,we&&Oe.createElement(z.a,{className:"".concat(Ye,"-option-state"),customizeIcon:Me,customizeIconProps:{isSelected:Rt}},Rt?"\u2713":null))}))},U=Oe.forwardRef($);U.displayName="OptionList";var te=U,E=function(){return null};E.isSelectOption=!0;var me=E,Ce=function(){return null};Ce.isSelectOptGroup=!0;var de=Ce,I=l("VTBJ"),g=l("Zm9Q");function Q(f){var R=f.key,ue=f.props,se=ue.children,Se=ue.value,fe=Object(ee.a)(ue,["children","value"]);return Object(I.a)({key:R,value:Se!==void 0?Se:R,children:se},fe)}function S(f){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(f).map(function(ue,se){if(!Oe.isValidElement(ue)||!ue.type)return null;var Se=ue.type.isSelectOptGroup,fe=ue.key,pe=ue.props,j=pe.children,M=Object(ee.a)(pe,["children"]);return R||!Se?Q(ue):Object(I.a)(Object(I.a)({key:"__RC_SELECT_GRP__".concat(fe===null?se:fe,"__"),label:fe},M),{},{options:S(j)})}).filter(function(ue){return ue})}var A=l("2Qr1"),x=l("qNPg"),b=l("U8pU"),N=l("Kwbf"),T=l("WKfj");function y(f){var R=f.mode,ue=f.options,se=f.children,Se=f.backfill,fe=f.allowClear,pe=f.placeholder,j=f.getInputElement,M=f.showSearch,re=f.onSearch,P=f.defaultOpen,_=f.autoFocus,he=f.labelInValue,Pe=f.value,Je=f.inputValue,Me=f.optionLabelProp,We=R==="multiple"||R==="tags",Ee=M!==void 0?M:We||R==="combobox",De=ue||S(se);if(Object(N.a)(R!=="tags"||De.every(function(Ye){return!Ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),R==="tags"||R==="combobox"){var Ve=De.some(function(Ye){return Ye.options?Ye.options.some(function(He){return typeof("value"in He?He.value:He.key)=="number"}):typeof("value"in Ye?Ye.value:Ye.key)=="number"});Object(N.a)(!Ve,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(N.a)(R!=="combobox"||!Me,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(N.a)(R==="combobox"||!Se,"`backfill` only works with `combobox` mode."),Object(N.a)(R==="combobox"||!j,"`getInputElement` only work with `combobox` mode."),Object(N.b)(R!=="combobox"||!j||!fe||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),re&&!Ee&&R!=="combobox"&&R!=="tags"&&Object(N.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(N.b)(!P||_,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Pe!=null){var et=Object(T.d)(Pe);Object(N.a)(!he||et.every(function(Ye){return Object(b.a)(Ye)==="object"&&("key"in Ye||"value"in Ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(N.a)(!We||Array.isArray(Pe),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var at=null;Object(g.a)(se).some(function(Ye){if(!Oe.isValidElement(Ye)||!Ye.type)return!1;var He=Ye.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var St=Object(g.a)(Ye.props.children).every(function(ft){return!Oe.isValidElement(ft)||!Ye.type||ft.type.isSelectOption?!0:(at=ft.type,!1)});return!St}return at=He,!0}),at&&Object(N.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(at.displayName||at.name||at,"`.")),Object(N.a)(Je===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var J=y,ye=Object(x.a)({prefixCls:"rc-select",components:{optionList:te},convertChildrenToData:S,flattenOptions:A.d,getLabeledValue:A.e,filterOptions:A.b,isValueDisabled:A.g,findValueOption:A.c,warningProps:J,fillOptionsWithMissingValue:A.a}),q=function(f){Object(ge.a)(ue,f);var R=Object(Te.a)(ue);function ue(){var se;return Object(oe.a)(this,ue),se=R.apply(this,arguments),se.selectRef=Oe.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(Le.a)(ue,[{key:"render",value:function(){return Oe.createElement(ye,Object.assign({ref:this.selectRef},this.props))}}]),ue}(Oe.Component);q.Option=me,q.OptGroup=de;var _e=q,k=Ie.c=_e},M8RZ:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return F});var oe=l("fWQN"),Le=l("mtLc"),ge=l("yKVA"),Te=l("879j"),Oe=l("q1tI"),Re=l.n(Oe),ee=l("i8i4"),B=l.n(ee),F=function(X){Object(ge.a)(V,X);var W=Object(Te.a)(V);function V(le){var Z;Object(oe.a)(this,V),Z=W.call(this,le);var z=window.document;return Z.node=z.createElement("div"),z.body.appendChild(Z.node),Z}return Object(Le.a)(V,[{key:"render",value:function(){var Z=this.props.children;return Object(ee.createPortal)(Z,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),V}(Re.a.Component)},NLgs:function(it,Ie,l){"use strict";l.d(Ie,"e",function(){return Ce}),l.d(Ie,"f",function(){return de}),l.d(Ie,"d",function(){return g}),l.d(Ie,"c",function(){return Q}),l.d(Ie,"a",function(){return S}),l.d(Ie,"b",function(){return A});var oe=l("miYZ"),Le=l("tsqr"),ge=l("9og8"),Te=l("2qtc"),Oe=l("kLXV"),Re=l("WmNS"),ee=l.n(Re),B=l("q1tI"),F=l.n(B),X=l("9kvl"),W=l("xKgJ"),V=l("1vsH"),le=l("RCxd"),Z=l("mOS8"),z=l.n(Z),$=l("1ZF9"),U=l.n($),te=l("WdTA"),E=l.n(te),me=l("m3rI"),Ce=function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(de(b)&&I(N))},de=function(b){return Object(W.q)()?!0:(b({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},I=function(){var b,N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,T=Object(X.c)()._store.getState(),y=T.user;return(b=y.userInfo)!==null&&b!==void 0&&b.profile_completed?!0:(Oe.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:N?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){X.d.push("/account/profile/edit")}}),!1)},g=function(){var b,N=Object(X.c)()._store.getState(),T=N.user;return(b=T.userInfo)!==null&&b!==void 0&&b.professional_certification?!0:(Oe.a.confirm({title:"\u63D0\u793A",centered:!0,content:F.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(V.O)("/account/certification")}}),!1)},Q=function(){return Object(W.b)()?!0:(Oe.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:F.a.createElement("div",{className:"tc",style:{marginLeft:-38}},F.a.createElement("p",null,"\u60A8\u53EF\u4EE5\u626B\u7801\u52A0\u7FA4@\u7FA4\u7BA1\u7406\u5458\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650\u54E6\uFF01"),F.a.createElement("img",{src:Object(W.u)()?E.a:"".concat(me.a.IMG_SERVER,"/images/educoder/qqqun20191230.png"),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},S=function(b,N){return b?!0:(Oe.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:F.a.createElement("div",null,F.a.createElement("p",null,N||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),F.a.createElement("div",{style:{marginLeft:"110px"}},F.a.createElement("img",{src:U.a,width:200}),F.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(V.O)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},A=function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",T=Object(X.c)()._store.getState(),y=T.shixunsDetail.detail;return(y==null?void 0:y.public)===2||(y==null?void 0:y.public)===1||(y==null?void 0:y.shixun_status)===3?(Oe.a.info({centered:!0,icon:F.a.createElement(le.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:F.a.createElement("div",{className:"tc",style:{marginLeft:-38}},F.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},F.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(y==null?void 0:y.public)===2?"\u5DF2\u516C\u5F00":(y==null?void 0:y.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",N,"\u3002"),F.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),F.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:z.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(y==null?void 0:y.shixun_status)===2?(Oe.a.confirm({centered:!0,icon:F.a.createElement(le.a,null),title:"\u63D0\u793A",content:F.a.createElement("div",null,F.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",N,"\u3002"),F.a.createElement("br",null),F.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){Oe.a.confirm({width:440,centered:!0,icon:F.a.createElement(le.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var ye=Object(ge.a)(ee.a.mark(function _e(){var k;return ee.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,b({type:"shixunsDetail/cancelRelease",payload:{id:y==null?void 0:y.identifier}});case 2:k=R.sent,k.status!==401&&(Le.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),b({type:"shixunsDetail/getShixunsDetail",payload:{id:y==null?void 0:y.identifier}}),b({type:"practiceSetting/getCommonData",payload:{id:y==null?void 0:y.identifier}}));case 4:case"end":return R.stop()}},_e)}));function q(){return ye.apply(this,arguments)}return q}()})}}),!0):!1}},NvD2:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return Re});var oe=l("Kwbf");function Le(ee,B){var F=new Set;return ee.forEach(function(X){B.has(X)||F.add(X)}),F}function ge(ee){var B=ee||{},F=B.disabled,X=B.disableCheckbox,W=B.checkable;return!!(F||X)||W===!1}function Te(ee,B,F,X){for(var W=new Set(ee),V=new Set,le=0;le<=F;le+=1){var Z=B.get(le)||new Set;Z.forEach(function(te){var E=te.key,me=te.node,Ce=te.children,de=Ce===void 0?[]:Ce;W.has(E)&&!X(me)&&de.filter(function(I){return!X(I.node)}).forEach(function(I){W.add(I.key)})})}for(var z=new Set,$=F;$>=0;$-=1){var U=B.get($)||new Set;U.forEach(function(te){var E=te.parent,me=te.node;if(X(me)||!te.parent||z.has(te.parent.key))return;if(X(te.parent.node)){z.add(E.key);return}var Ce=!0,de=!1;(E.children||[]).filter(function(I){return!X(I.node)}).forEach(function(I){var g=I.key,Q=W.has(g);Ce&&!Q&&(Ce=!1),!de&&(Q||V.has(g))&&(de=!0)}),Ce&&W.add(E.key),de&&V.add(E.key),z.add(E.key)})}return{checkedKeys:Array.from(W),halfCheckedKeys:Array.from(Le(V,W))}}function Oe(ee,B,F,X,W){for(var V=new Set(ee),le=new Set(B),Z=0;Z<=X;Z+=1){var z=F.get(Z)||new Set;z.forEach(function(E){var me=E.key,Ce=E.node,de=E.children,I=de===void 0?[]:de;!V.has(me)&&!le.has(me)&&!W(Ce)&&I.filter(function(g){return!W(g.node)}).forEach(function(g){V.delete(g.key)})})}le=new Set;for(var $=new Set,U=X;U>=0;U-=1){var te=F.get(U)||new Set;te.forEach(function(E){var me=E.parent,Ce=E.node;if(W(Ce)||!E.parent||$.has(E.parent.key))return;if(W(E.parent.node)){$.add(me.key);return}var de=!0,I=!1;(me.children||[]).filter(function(g){return!W(g.node)}).forEach(function(g){var Q=g.key,S=V.has(Q);de&&!S&&(de=!1),!I&&(S||le.has(Q))&&(I=!0)}),de||V.delete(me.key),I&&le.add(me.key),$.add(me.key)})}return{checkedKeys:Array.from(V),halfCheckedKeys:Array.from(Le(le,V))}}function Re(ee,B,F,X){var W=[],V;X?V=X:V=ge;var le=new Set(ee.filter(function(U){var te=!!F[U];return te||W.push(U),te})),Z=new Map,z=0;Object.keys(F).forEach(function(U){var te=F[U],E=te.level,me=Z.get(E);me||(me=new Set,Z.set(E,me)),me.add(te),z=Math.max(z,E)}),Object(oe.a)(!W.length,"Tree missing follow keys: ".concat(W.slice(0,100).map(function(U){return"'".concat(U,"'")}).join(", ")));var $;return B===!0?$=Te(le,Z,z,V):$=Oe(le,B.halfCheckedKeys,Z,z,V),$}},O2Wb:function(it,Ie,l){it.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(it,Ie,l){"use strict";var oe=l("U8pU"),Le=l("VTBJ"),ge=l("Ff2n"),Te=l("q1tI"),Oe=l("uciX"),Re=l("7ixt"),ee=function(le){var Z=le.overlay,z=le.prefixCls,$=le.id,U=le.overlayInnerStyle;return Te.createElement("div",{className:"".concat(z,"-inner"),id:$,role:"tooltip",style:U},typeof Z=="function"?Z():Z)},B=ee,F=function(le,Z){var z=le.overlayClassName,$=le.trigger,U=$===void 0?["hover"]:$,te=le.mouseEnterDelay,E=te===void 0?0:te,me=le.mouseLeaveDelay,Ce=me===void 0?.1:me,de=le.overlayStyle,I=le.prefixCls,g=I===void 0?"rc-tooltip":I,Q=le.children,S=le.onVisibleChange,A=le.afterVisibleChange,x=le.transitionName,b=le.animation,N=le.placement,T=N===void 0?"right":N,y=le.align,J=y===void 0?{}:y,ye=le.destroyTooltipOnHide,q=ye===void 0?!1:ye,_e=le.defaultVisible,k=le.getTooltipContainer,f=le.overlayInnerStyle,R=Object(ge.a)(le,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ue=Object(Te.useRef)(null);Object(Te.useImperativeHandle)(Z,function(){return ue.current});var se=Object(Le.a)({},R);"visible"in le&&(se.popupVisible=le.visible);var Se=function(){var re=le.arrowContent,P=re===void 0?null:re,_=le.overlay,he=le.id;return[Te.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},P),Te.createElement(B,{key:"content",prefixCls:g,id:he,overlay:_,overlayInnerStyle:f})]},fe=!1,pe=!1;if(typeof q=="boolean")fe=q;else if(q&&Object(oe.a)(q)==="object"){var j=q.keepParent;fe=j===!0,pe=j===!1}return Te.createElement(Oe.a,Object.assign({popupClassName:z,prefixCls:g,popup:Se,action:U,builtinPlacements:Re.a,popupPlacement:T,ref:ue,popupAlign:J,getPopupContainer:k,onPopupVisibleChange:S,afterPopupVisibleChange:A,popupTransitionName:x,popupAnimation:b,defaultPopupVisible:_e,destroyPopupOnHide:fe,autoDestroy:pe,mouseLeaveDelay:Ce,popupStyle:de,mouseEnterDelay:E},se),Q)},X=Object(Te.forwardRef)(F),W=Ie.a=X},OZM5:function(it,Ie,l){"use strict";l.d(Ie,"b",function(){return X}),l.d(Ie,"a",function(){return W}),l.d(Ie,"k",function(){return V}),l.d(Ie,"h",function(){return le}),l.d(Ie,"i",function(){return Z}),l.d(Ie,"g",function(){return z}),l.d(Ie,"c",function(){return $}),l.d(Ie,"d",function(){return U}),l.d(Ie,"j",function(){return me}),l.d(Ie,"e",function(){return Ce}),l.d(Ie,"f",function(){return de});var oe=l("KQm4"),Le=l("U8pU"),ge=l("Ff2n"),Te=l("q1tI"),Oe=l.n(Te),Re=l("Kwbf"),ee=l("WaYH"),B=.25,F=2;function X(I,g){var Q=I.slice(),S=Q.indexOf(g);return S>=0&&Q.splice(S,1),Q}function W(I,g){var Q=I.slice();return Q.indexOf(g)===-1&&Q.push(g),Q}function V(I){return I.split("-")}function le(I,g){return"".concat(I,"-").concat(g)}function Z(I){return I&&I.type&&I.type.isTreeNode}function z(I,g){var Q=[I],S=g[I];function A(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(b){var N=b.key,T=b.children;Q.push(N),A(T)})}return A(S.children),Q}function $(I,g){var Q=I.clientY,S=g.selectHandle.getBoundingClientRect(),A=S.top,x=S.bottom,b=S.height,N=Math.max(b*B,F);return Q<=A+N?-1:Q>=x-N?1:0}function U(I,g){if(!I)return;var Q=g.multiple;return Q?I.slice():I.length?[I[0]]:I}var te=function(g){return g};function E(I,g){if(!I)return[];var Q=g||{},S=Q.processProps,A=S===void 0?te:S,x=Array.isArray(I)?I:[I];return x.map(function(b){var N=b.children,T=Object(ge.a)(b,["children"]),y=E(N,g);return Oe.a.createElement(ee.a,Object.assign({},A(T)),y)})}function me(I){if(!I)return null;var g;if(Array.isArray(I))g={checkedKeys:I,halfCheckedKeys:void 0};else if(Object(Le.a)(I)==="object")g={checkedKeys:I.checked||void 0,halfCheckedKeys:I.halfChecked||void 0};else return Object(Re.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function Ce(I,g){var Q=new Set;function S(A){if(Q.has(A))return;var x=g[A];if(!x)return;Q.add(A);var b=x.parent,N=x.node;if(N.disabled)return;b&&S(b.key)}return(I||[]).forEach(function(A){S(A)}),Object(oe.a)(Q)}function de(I){var g={};return Object.keys(I).forEach(function(Q){(Q.startsWith("data-")||Q.startsWith("aria-"))&&(g[Q]=I[Q])}),g}},Ot1p:function(it,Ie,l){"use strict";var oe=l("2qtc"),Le=l("kLXV"),ge=l("rAM+"),Te=l("miYZ"),Oe=l("tsqr"),Re=l("9og8"),ee=l("tJVT"),B=l("jrin"),F=l("WmNS"),X=l.n(F),W=l("q1tI"),V=l.n(W),le=l("VrN/"),Z=l.n(le),z=l("bdgK"),$=l("p77/"),U=l("Bd2K"),te=l("ELLl"),E=l("19Vz"),me=l("lZu9"),Ce=l("+NIl"),de=l("kSUc"),I=l("9Bee"),g=function(ne){var xe=ne.value,qe=xe===void 0?"":xe,ht=ne.className,Fe=ne.showTextOnly,Xe=ne.showLines,Rt=ne.style,Ne=Rt===void 0?{}:Rt,jt=Object(W.useMemo)(function(){return""},[qe]);return V.a.createElement(V.a.Fragment,null,V.a.createElement("div",{dangerouslySetInnerHTML:{__html:jt}}))},Q=l("0Owb"),S=l("dejd"),A=l("C+DQ"),x=l("1vsH"),b=l("m3rI"),N=[{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 T(ne){var xe=ne.onActionCallback,qe=ne.title,ht=ne.icon,Fe=ne.actionName,Xe=ne.className,Rt=Xe===void 0?"":Xe,Ne=ne.children;function jt(){xe(Fe)}return V.a.createElement("a",{title:qe,className:Rt,onClick:jt},V.a.createElement("i",{className:"md-iconfont ".concat(ht)}),Ne)}var y=function(ne){var xe=ne.watch,qe=ne.showNullButton,ht=ne.onActionCallback,Fe=ne.fullScreen,Xe=ne.insertTemp,Rt=ne.hidetoolBar,Ne=ne.uuid,jt=ne.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.D)("_educoder_session"),"&key=").concat(Ne,"&api=").concat(encodeURIComponent(b.a.PROXY_SERVER)));var Ft=[].concat(N,[{title:"".concat(xe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(xe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return V.a.createElement("ul",{className:"markdown-toolbar-container"},!Rt&&Ft.map(function(we,vt){return V.a.createElement("li",{key:vt},we.actionName?V.a.createElement(T,Object(Q.a)({},we,{onActionCallback:ht})):V.a.createElement("span",{className:"v-line"}))}),qe?V.a.createElement("li",null,V.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ht},V.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\u586B\u7A7A\u9879"))):null,Xe&&V.a.createElement("li",null,V.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Xe),onActionCallback:ht},V.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),V.a.createElement("li",{className:"btn-full-screen"},V.a.createElement(T,{icon:"".concat(Fe?"icon-shrink":"icon-enlarge"),title:Fe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ht})))},J=l("M8RZ"),ye=l("+L6B"),q=l("2/Rp"),_e=l("y8nQ"),k=l("Vl3Y"),f=l("5NDa"),R=l("5rEg"),ue={labelCol:{span:4},wrapperCol:{span:20}},se=function(ne){var xe=ne.callback,qe=ne.onCancel;function ht(Fe){xe(Fe)}return V.a.createElement(k.a,Object(Q.a)({},ue,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ht}),V.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},V.a.createElement(R.a,null)),V.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},V.a.createElement(R.a,null)),V.a.createElement("div",{className:"flex-container flex-end"},V.a.createElement(q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),V.a.createElement(q.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},Se=l("7ahc"),fe=l("k1fw"),pe=l("HmJG"),j=l("BjJ7"),M=k.a.useForm,re={width:280,marginRight:10},P={labelCol:{span:5},wrapperCol:{span:19}},_=function(ne){var xe=ne.callback,qe=ne.onCancel,ht=M(),Fe=Object(ee.a)(ht,1),Xe=Fe[0],Rt=Object(W.useRef)();function Ne(we){xe(Object(fe.a)(Object(fe.a)({},we),{},{name:Rt.current}))}function jt(we,vt){Xe.setFieldsValue({src:"/api/attachments/".concat(we.id,"?type=").concat(we.content_type),type:vt.type})}function Ft(we){var vt=we.target.files[0];Rt.current=vt.name,Pe(vt,jt)}return V.a.createElement(k.a,Object(Q.a)({form:Xe},P,{className:"upload-image-panel",onFinish:Ne}),V.a.createElement(k.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},V.a.createElement("div",{className:"flex-container"},V.a.createElement(k.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},V.a.createElement(R.a,{style:re})),V.a.createElement(he,{onFileChange:Ft}))),V.a.createElement(k.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},V.a.createElement(R.a,{style:{width:264}})),V.a.createElement(k.a.Item,{style:{textAlign:"right"}},V.a.createElement(q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),V.a.createElement(q.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))};function he(ne){var xe=ne.onFileChange;return V.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",V.a.createElement("input",{type:"file",onChange:xe}))}function Pe(ne,xe){if(!ne)throw new String("\u6CA1\u6709\u6587\u4EF6");var qe=new FormData;qe.append("editormd-image-file",ne),qe.append("file_param_name","editormd-image-file"),qe.append("byxhr","true");var ht=new window.XMLHttpRequest;ht.withCredentials=!0,ht.addEventListener("load",function(Fe){xe(JSON.parse(Fe.target.responseText),ne)},!1),ht.addEventListener("error",function(Fe){console.error(Fe)},!1),ht.open("POST","".concat(j.a,"/api/attachments.json")),ht.send(qe)}var Je=l("giR+"),Me=l("fyUT"),We=l("7Kak"),Ee=l("9yH6"),De=Ee.a.Group,Ve={margin:"0 8px"},et=function(ne){var xe=ne.callback,qe=ne.onCancel;function ht(Fe){xe(Fe)}return V.a.createElement(k.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ht},V.a.createElement("div",{className:"flex-container"},V.a.createElement("span",{style:Ve},"\u5355\u5143\u683C\u6570\uFF1A"),V.a.createElement("span",{style:Ve},"\u884C\u6570"),V.a.createElement(k.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},V.a.createElement(Me.a,null)),V.a.createElement("span",{style:Ve},"\u5217\u6570"),V.a.createElement(k.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},V.a.createElement(Me.a,null))),V.a.createElement("div",{className:"flex-container",style:{marginTop:12}},V.a.createElement("span",{style:Ve},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),V.a.createElement(k.a.Item,{name:"align"},V.a.createElement(De,null,V.a.createElement(Ee.a,{value:"default"},V.a.createElement("i",{className:"fa fa-align-justify"})),V.a.createElement(Ee.a,{value:"left"},V.a.createElement("i",{className:"fa fa-align-left"})),V.a.createElement(Ee.a,{value:"center"},V.a.createElement("i",{className:"fa fa-align-center"})),V.a.createElement(Ee.a,{value:"right"},V.a.createElement("i",{className:"fa fa-align-right"}))))),V.a.createElement("div",{className:"flex-container flex-end"},V.a.createElement(q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),V.a.createElement(q.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},at=l("ErOA"),Ye=l("7Cbv"),He="link",St="upload-image",ft="code-block",bt="add-table",dt="------------",Dt={default:dt,left:":".concat(dt),center:":".concat(dt,":"),right:"".concat(dt,":")},Ot=l("9VGf"),_t,Ue;function It(){}var kt=0,Be=1e4,Ke="\u2581",K=`
**\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 G(ne){return/^\d+$/.test(ne)?"".concat(ne,"px"):ne}var H=navigator.platform.toUpperCase().indexOf("MAC")>=0,w=H?"Cmd":"Ctrl",O=["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"],L=(_t={},Object(B.a)(_t,w+"-B","bold"),Object(B.a)(_t,w+"-I","italic"),_t),D=(Ue={},Object(B.a)(Ue,He,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(Ue,ft,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(Ue,St,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(Ue,bt,"\u6DFB\u52A0\u8868\u683C"),Ue),ve=Ie.a=function(ne){var xe=ne.defaultValue,qe=xe===void 0?"":xe,ht=ne.onChange,Fe=ne.width,Xe=Fe===void 0?"100%":Fe,Rt=ne.height,Ne=Rt===void 0?400:Rt,jt=ne.miniToolbar,Ft=jt===void 0?!1:jt,we=ne.isFocus,vt=we===void 0?!1:we,lt=ne.watch,Ut=ne.insertTemp,Nt=ne.mode,Ge=Nt===void 0?"markdown":Nt,ut=ne.id,ot=ut===void 0?"markdown-editor-id":ut,ct=ne.showResizeBar,Yt=ct===void 0?!1:ct,Ht=ne.noStorage,an=Ht===void 0?!1:Ht,Qt=ne.showNullButton,xt=Qt===void 0?!1:Qt,nn=ne.hidetoolBar,zt=nn===void 0?!1:nn,on=ne.fullScreen,Gt=on===void 0?!1:on,Dn=ne.onBlur,Nn=ne.onCMBeforeChange,Gn=ne.onFullScreen,je=ne.className,Et=je===void 0?"":je,sn=ne.disablePaste,mn=sn===void 0?!1:sn,Pn=ne.placeholder,jn=Pn===void 0?"":Pn,h=ne.values,o=h===void 0?"":h,r=Object(W.useState)(null),c=Object(ee.a)(r,2),p=c[0],d=c[1],ie=Object(W.useState)(qe),Qe=Object(ee.a)(ie,2),Ct=Qe[0],Mt=Qe[1],tt=Object(W.useState)(lt),Ze=Object(ee.a)(tt,2),ce=Ze[0],nt=Ze[1],Xt=Object(W.useState)(Gt),Lt=Object(ee.a)(Xt,2),wt=Lt[0],Wt=Lt[1],xn=Object(W.useState)(""),hn=Object(ee.a)(xn,2),Tn=hn[0],vn=hn[1],Zn=Object(W.useState)(0),Rn=Object(ee.a)(Zn,2),hi=Rn[0],xi=Rn[1],vi=Object(W.useState)(Ne),Xn=Object(ee.a)(vi,2),Si=Xn[0],pi=Xn[1],Hn=Object(W.useState)(!1),Wi=Object(ee.a)(Hn,2),Sa=Wi[0],Kn=Wi[1],gn=Object(W.useRef)(Object(Ye.a)()),fi=Object(W.useRef)(!1),fn=Object(W.useRef)(),Qn=Object(W.useRef)(),yn=Object(W.useRef)(),Yi=Object(W.useRef)(),An=Object(W.useRef)(),ki=function(){var $t=Object(Re.a)(X.a.mark(function en(){var Jt,ln;return X.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(at.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:gn.current}});case 2:ln=wn.sent,ln!=null&&(Jt=ln.attachments)!==null&&Jt!==void 0&&Jt.length&&(console.log("cm:",p,Qn),ln.attachments.map(function(pn){pn.content_type.indexOf("image")>-1?p.replaceSelection("![,](/api/attachments/".concat(pn.id,"?type=").concat(pn.content_type,")")):pn.content_type.indexOf("video")>-1?p.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):pn.content_type.indexOf("pdf")>-1?p.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(pn.id,"?type=").concat(pn.content_type,'&disposition=inline" target="_blank">').concat(pn.name,"</a>")):p.replaceSelection("[".concat(pn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(pn.id,"?type=").concat(pn.content_type,")"))}));case 4:case"end":return wn.stop()}},en)}));return function(){return $t.apply(this,arguments)}}();Object(W.useEffect)(function(){Mt(o),p==null||p.setValue(o)},[o]),Object(W.useEffect)(function(){Gn==null||Gn(wt)},[wt]),Object(W.useEffect)(function(){if(Qn.current){var $t=Z.a.fromTextArea(Qn.current,{mode:Ge,lineNumbers:!Ft,lineWrapping:!0,value:qe,autoCloseTags:!0,autoCloseBrackets:!0});vt&&$t.focus();function en(Jt,ln){if(mn){ln.preventDefault();return}var bn=ln.clipboardData;if(bn){var wn=bn.types.toString(),pn=bn.items;if(wn==="Files"||bn.types.indexOf("Files")>-1){if(ln.preventDefault(),Ge=="stex")return;try{var ti,gi=pn[1];((ti=pn[0])===null||ti===void 0?void 0:ti.kind)==="file"&&(gi=pn[0]);var cn=gi.getAsFile(),qi=cn.name.split(".").pop();Pe(cn,function(En){if(En.id){var $n,Pi,Hi;(cn==null||(($n=cn.type)===null||$n===void 0)?void 0:$n.indexOf("image"))>-1?$t.replaceSelection("![,](/api/attachments/".concat(En.id,"?type=").concat(En.content_type,")")):(cn==null||((Pi=cn.type)===null||Pi===void 0)?void 0:Pi.indexOf("video"))>-1?$t.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,'"></video>')):(cn==null||((Hi=cn.type)===null||Hi===void 0)?void 0:Hi.indexOf("pdf"))>-1?$t.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(cn.type,'&disposition=inline" target="_blank">').concat(cn.name,"</a>")):O.includes(qi)?$t.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,'?type=office&disposition=inline" target="_blank">').concat(cn.name,"</a>")):$t.replaceSelection("[".concat(cn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}else(En==null?void 0:En.status)===401&&(document.location.href="/user/login")})}catch(En){Oe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return $t.on("paste",en),$t.on("dragleave",function(Jt,ln){yn.current.classList.remove("mouse-hover-md")}),$t.on("dragover",function(Jt,ln){yn.current.classList.add("mouse-hover-md")}),$t.on("drop",function(Jt,ln){yn.current.classList.add("mouse-hover-md");var bn;if(bn=ln.dataTransfer.files,bn.length>0){ln.preventDefault(),ln.stopPropagation();for(var wn=function(gi){var cn=bn[gi],qi=cn.name.split(".").pop();Pe(cn,function(En){if(En.id){var $n,Pi,Hi;(cn==null||(($n=cn.type)===null||$n===void 0)?void 0:$n.indexOf("image"))>-1?$t.replaceSelection("![,](/api/attachments/".concat(En.id,"?type=").concat(En.content_type,")")):(cn==null||((Pi=cn.type)===null||Pi===void 0)?void 0:Pi.indexOf("video"))>-1?$t.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,'"></video>')):(cn==null||((Hi=cn.type)===null||Hi===void 0)?void 0:Hi.indexOf("pdf"))>-1?$t.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(cn.type,'&disposition=inline" target="_blank">').concat(cn.name,"</a>")):O.includes(qi)?$t.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,'?type=office&disposition=inline" target="_blank">').concat(cn.name,"</a>")):$t.replaceSelection("[".concat(cn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}else(En==null?void 0:En.status)===401&&(document.location.href="/user/login")})},pn=0;pn<bn.length;pn++)wn(pn)}}),d($t),function(){$t.off("paste",en)}}},[]);var sa=Object(W.useCallback)(function(){if(yn.current)try{}catch($t){console.log($t,"---- to set md editor body height")}},[Si,yn,wt]);Object(W.useEffect)(function(){function $t(){var Jt=new z.default(function(ln){var bn=Object(ge.a)(ln),wn;try{for(bn.s();!(wn=bn.n()).done;){var pn=wn.value;(pn.target.offsetHeight>0||pn.target.offsetWidth>0)&&(sa(),p.setSize("100%","100%"),p.refresh())}}catch(ti){bn.e(ti)}finally{bn.f()}});return Jt.observe(Qn.current.parentElement),Jt}if(p){var en=$t();return function(){en.unobserve(Qn.current.parentElement)}}},[p,sa]),Object(W.useEffect)(function(){if(p){for(var $t=[],en=function(){var pn=ln[Jt];bn=Object(ee.a)(pn,2);var ti=bn[0],gi=bn[1],cn=Object(B.a)({},ti,function(){da(gi)});$t.push(cn),p.addKeyMap(cn)},Jt=0,ln=Object.entries(L);Jt<ln.length;Jt++){var bn;en()}return fn.current=setInterval(function(){fi.current&&ki()},4e3),function(){clearInterval(fn.current);var wn=Object(ge.a)($t),pn;try{for(wn.s();!(pn=wn.n()).done;){var ti=pn.value;p.removeKeyMap(ti)}}catch(gi){wn.e(gi)}finally{wn.f()}}}},[p]),Object(W.useEffect)(function(){Gt!==wt&&Wt(Gt)},[Gt]),Object(Ot.a)(function(){if(!an&&hi>0){var $t=new Date().getTime(),en=window.sessionStorage.getItem(ot);$t>=hi+Be&&(!en||en!==Ct)&&(window.sessionStorage.setItem(ot,Ct),Kn(!0))}},Be),Object(W.useEffect)(function(){nt(lt)},[p,lt]),Object(W.useEffect)(function(){p&&(vt&&p.focus())},[p,vt]),Object(W.useEffect)(function(){if(ce&&p){var $t=p.getScrollerElement();function en(Jt){var ln=Jt.target;if(An.current){var bn=ln.scrollTop/ln.scrollHeight;An.current.scrollTop=An.current.scrollHeight*bn}}return $t.addEventListener("scroll",en),function(){$t.removeEventListener("scroll",en)}}},[p,ce]),Object(W.useEffect)(function(){if(p&&Nn){function $t(en,Jt){Nn(en,Jt)}return p.on("beforeChange",$t),function(){p.off("beforeChange",$t)}}},[p,Nn]),Object(W.useEffect)(function(){if(p&&Dn){function $t(){Dn(p.getValue())}return p.on("blur",$t),function(){p.off("blur",$t)}}},[p,Dn]),Object(W.useEffect)(function(){if(p){function $t(en){var Jt=en.getValue();Mt(Jt),xi(new Date().getTime()),en.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ht&&ht(Jt)}return p.on("change",$t),function(){p.off("change",$t)}}},[p,ht]),Object(W.useEffect)(function(){p&&(qe==null?(p.setValue(""),Mt("")):qe!==p.getValue()&&(p.setValue(qe),Mt(qe),p.setCursor(p.lineCount(),0)))},[p,qe]);var da=Object(W.useCallback)(function($t){var en=p.getCursor(),Jt=p.getSelection(),ln=Jt.split(`
`);switch($t){case"bold":return p.replaceSelection("**"+Jt+"**"),Jt===""&&p.setCursor(en.line,en.ch+2),p.focus();case"italic":return p.replaceSelection("*"+Jt+"*"),Jt===""&&p.setCursor(en.line,en.ch+1),p.focus();case"code":return p.replaceSelection("`"+Jt+"`"),Jt===""&&p.setCursor(en.line,en.ch+1),p.focus();case"inline-latex":return p.replaceSelection("`$$"+Jt+"$$`"),Jt===""&&p.setCursor(en.line,en.ch+3),p.focus();case"latex":return p.replaceSelection("```latex\n"+Jt+"\n```"),p.setCursor(en.line+1,Jt.length+1),p.focus();case"line-break":return p.replaceSelection(`<br/>
`),p.focus();case"list-ul":return Jt===""?p.replaceSelection("- "+Jt):p.replaceSelection(ln.map(function(bn){return bn===""?"":"- ".concat(bn)}).join(`
`)),p.focus();case"list-ol":return Jt===""?p.replaceSelection("1. "+Jt):p.replaceSelection(ln.map(function(bn,wn){return bn===""?"":"".concat(wn+1,". ").concat(bn)}).join(`
`)),p.focus();case"add-null-ch":return Jt===""&&p.setCursor(en.line,en.ch+1),p.replaceSelection(Ke),p.focus();case"inster-template-1":return Jt===""&&p.setCursor(en.line,en.ch),p.replaceSelection(K),p.focus();case"eraser":return p.setValue(""),p.focus();case"trigger-watch":return nt(!ce),p.focus();case"trigger-full-screen":return Wt(!wt),p.focus();case He:vn(He);return;case ft:vn(ft);return;case St:vn(St);return;case bt:vn(bt);return;default:throw new Error}},[p,ce,wt]),Ji=Object(W.useCallback)(function($t){vn("");switch(Tn){case He:var en=$t.title,Jt=$t.link;return p.replaceSelection("[".concat(en,"](").concat(Jt,")")),p.focus();case ft:var ln=$t.language,bn=$t.content;return p.replaceSelection(["```"+ln,bn,"```"].join(`
`)),p.focus();case St:var wn=$t.src,pn=$t.alt,ti=$t.name;return wn.indexOf("type=image")>-1?p.replaceSelection("![ ".concat(pn||""," ]( ").concat(wn,' "').concat(pn||"",'" )')):wn.indexOf("type=application/pdf")>-1?p.replaceSelection('<a href="'.concat(wn,'&disposition=inline" target="_blank">').concat(ti,"</a>")):p.replaceSelection('<a href="'.concat(wn,'" target="_blank">').concat(ti,"</a>")),p.focus();case bt:for(var gi=$t.row,cn=$t.col,qi=$t.align,En=`
`,$n=0;$n<gi;$n++){for(var Pi=[],Hi=[],ja=0;ja<cn;ja++)$n===1&&Hi.push(Dt[qi]),Pi.push(" ");$n===1&&(En+="| ".concat(Hi.join(" | "),` |
`)),En+="| ".concat(Pi.join(cn===1?"":" | "),` |
`)}return p.replaceSelection(En+`
`),p.focus();default:throw new Error}},[p,Tn]),Na=Object(W.useMemo)(function(){switch(Tn){case He:return V.a.createElement(se,{callback:Ji,onCancel:Ri});case ft:return V.a.createElement(Se.b,{callback:Ji,onCancel:Ri});case St:return V.a.createElement(_,{callback:Ji,onCancel:Ri});case bt:return V.a.createElement(et,{callback:Ji,onCancel:Ri});default:return null}},[Tn]);function Ri(){vn("")}Object(W.useEffect)(function(){if(Yi.current){var $t=Yi.current,en=!1,Jt=0;function ln(pn){en=!0,Jt=pn.pageY}function bn(){en=!1}function wn(pn){if(en){var ti=pn.pageY-Jt;ti<0&&(ti=0),ti>300&&(ti=300);var gi=Ne+ti+"px";pi(gi)}}return $t.addEventListener("mousedown",ln),document.addEventListener("mousemove",wn),document.addEventListener("mouseup",bn),function(){$t.removeEventListener("mousedown",ln),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",bn)}}},[p,Yi]),Object(W.useEffect)(function(){pi(Ne)},[Ne]);var Fn=G(Xe),Oi=G(Si),ha={width:Fn,height:Oi},ka=Object(W.useMemo)(function(){if(hi){var $t=new Date(hi),en=$t.getHours(),Jt=$t.getMinutes(),ln=$t.getSeconds();return en=en<10?"0"+en:en,Jt=Jt<10?"0"+Jt:Jt,ln=ln<10?"0"+ln:ln,"".concat(en,":").concat(Jt,":").concat(ln)}return 0},[hi]);function zi(){window.sessionStorage.removeItem(ot),Kn(!1),xi(0)}function Oo(){Kn(!1),xi(0),p.setValue(window.sessionStorage.getItem(ot))}function oa($t,en){var Jt=p.getValue();Jt=Jt.replace($t,en),Mt(Jt),p==null||p.setValue(Jt)}return V.a.createElement(W.Fragment,null,V.a.createElement("div",{className:"markdown-editor-wrapper",ref:yn},V.a.createElement("div",{className:"markdown-editor-container ".concat(Et," ").concat(ce?"on-preview":""," ").concat(Ft?"mini":""," ").concat(wt?"full-screen":""),style:ha},V.a.createElement(y,{insertTemp:Ut,watch:ce,fullScreen:wt,showNullButton:xt,onActionCallback:da,hidetoolBar:zt,uuid:gn.current,setOpenPhones:function(){fi.current=!0}}),V.a.createElement("div",{className:"markdown-editor-body"},V.a.createElement("div",{className:"codemirror-container"},V.a.createElement("textarea",{ref:Qn,placeholder:jn})),ce?V.a.createElement("div",{ref:An,className:"preview-container"},Ge==="stex"&&V.a.createElement(g,{value:Ct}),Ge!=="stex"&&V.a.createElement(I.a,{edit:!0,value:Ct,replaces:oa})):null))),Yt?V.a.createElement("a",{ref:Yi,className:"editor-resize"}):null,V.a.createElement(J.a,null,D[Tn]?V.a.createElement(Le.a,{centered:!0,title:D[Tn],visible:!0,onCancel:Ri,footer:null},Na):null))}},PGNT:function(it,Ie,l){it.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE:function(it,Ie,l){it.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},QSKd:function(it,Ie,l){it.exports=l.p+"static/wenhao.50b63ac4.svg"},"RZ/O":function(it,Ie,l){it.exports=l.p+"static/bi.9c9b0364.svg"},SJMd:function(it,Ie){/**
* @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 l,oe,Le,ge=!1,Te,Oe;window.PR_SHOULD_USE_CONTINUATION=!0;var Re,ee;(function(){var B=window,F=["break,continue,do,else,for,if,return,while"],X=[F,"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"],W=[X,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],V=[W,"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"],le=[W,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Z=[W,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],z="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",$=[W,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],U="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=[F,"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"],E=[F,"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"],me=[F,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ce=[V,Z,le,$,U,te,E,me],de=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,I="str",g="kwd",Q="com",S="typ",A="lit",x="pun",b="pln",N="tag",T="dec",y="src",J="atn",ye="atv",q="nocode",_e="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Ee){for(var De=0,Ve=!1,et=!1,at=0,Ye=Ee.length;at<Ye;++at){var He=Ee[at];if(He.ignoreCase)et=!0;else if(/[a-z]/i.test(He.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ve=!0,et=!1;break}}var St={b:8,t:9,n:10,v:11,f:12,r:13};function ft(_t){var Ue=_t.charCodeAt(0);if(Ue!==92)return Ue;var It=_t.charAt(1);return Ue=St[It],Ue||("0"<=It&&It<="7"?parseInt(_t.substring(1),8):It==="u"||It==="x"?parseInt(_t.substring(2),16):_t.charCodeAt(1))}function bt(_t){if(_t<32)return(_t<16?"\\x0":"\\x")+_t.toString(16);var Ue=String.fromCharCode(_t);return Ue==="\\"||Ue==="-"||Ue==="]"||Ue==="^"?"\\"+Ue:Ue}function dt(_t){var Ue=_t.substring(1,_t.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")),It=[],kt=Ue[0]==="^",Be=["["];kt&&Be.push("^");for(var Ke=kt?1:0,K=Ue.length;Ke<K;++Ke){var G=Ue[Ke];if(/\\[bdsw]/i.test(G))Be.push(G);else{var H=ft(G),w;Ke+2<K&&Ue[Ke+1]==="-"?(w=ft(Ue[Ke+2]),Ke+=2):w=H,It.push([H,w]),w<65||H>122||(w<65||H>90||It.push([Math.max(65,H)|32,Math.min(w,90)|32]),w<97||H>122||It.push([Math.max(97,H)&~32,Math.min(w,122)&~32]))}}It.sort(function(ve,ne){return ve[0]-ne[0]||ne[1]-ve[1]});for(var O=[],L=[],Ke=0;Ke<It.length;++Ke){var D=It[Ke];D[0]<=L[1]+1?L[1]=Math.max(L[1],D[1]):O.push(L=D)}for(var Ke=0;Ke<O.length;++Ke){var D=O[Ke];Be.push(bt(D[0])),D[1]>D[0]&&(D[1]+1>D[0]&&Be.push("-"),Be.push(bt(D[1])))}return Be.push("]"),Be.join("")}function Dt(_t){for(var Ue=_t.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")),It=Ue.length,kt=[],Be=0,Ke=0;Be<It;++Be){var K=Ue[Be];if(K==="(")++Ke;else if(K.charAt(0)==="\\"){var G=+K.substring(1);G&&(G<=Ke?kt[G]=-1:Ue[Be]=bt(G))}}for(var Be=1;Be<kt.length;++Be)kt[Be]===-1&&(kt[Be]=++De);for(var Be=0,Ke=0;Be<It;++Be){var K=Ue[Be];if(K==="(")++Ke,kt[Ke]||(Ue[Be]="(?:");else if(K.charAt(0)==="\\"){var G=+K.substring(1);G&&G<=Ke&&(Ue[Be]="\\"+kt[G])}}for(var Be=0;Be<It;++Be)Ue[Be]==="^"&&Ue[Be+1]!=="^"&&(Ue[Be]="");if(_t.ignoreCase&&Ve)for(var Be=0;Be<It;++Be){var K=Ue[Be],H=K.charAt(0);K.length>=2&&H==="["?Ue[Be]=dt(K):H!=="\\"&&(Ue[Be]=K.replace(/[a-zA-Z]/g,function(L){var D=L.charCodeAt(0);return"["+String.fromCharCode(D&~32,D|32)+"]"}))}return Ue.join("")}for(var Ot=[],at=0,Ye=Ee.length;at<Ye;++at){var He=Ee[at];if(He.global||He.multiline)throw new Error(""+He);Ot.push("(?:"+Dt(He)+")")}return new RegExp(Ot.join("|"),et?"gi":"g")}function f(Ee,De){var Ve=/(?:^|\s)nocode(?:\s|$)/,et=[],at=0,Ye=[],He=0;function St(ft){var bt=ft.nodeType;if(bt==1){if(Ve.test(ft.className))return;for(var dt=ft.firstChild;dt;dt=dt.nextSibling)St(dt);var Dt=ft.nodeName.toLowerCase();(Dt==="br"||Dt==="li")&&(et[He]=`
`,Ye[He<<1]=at++,Ye[He++<<1|1]=ft)}else if(bt==3||bt==4){var Ot=ft.nodeValue;Ot.length&&(De?Ot=Ot.replace(/\r\n?/g,`
`):Ot=Ot.replace(/[ \t\r\n]+/g," "),et[He]=Ot,Ye[He<<1]=at,at+=Ot.length,Ye[He++<<1|1]=ft)}}return St(Ee),{sourceCode:et.join("").replace(/\n$/,""),spans:Ye}}function R(Ee,De,Ve,et,at){if(!Ve)return;var Ye={sourceNode:Ee,pre:1,langExtension:null,numberLines:null,sourceCode:Ve,spans:null,basePos:De,decorations:null};et(Ye),at.push.apply(at,Ye.decorations)}var ue=/\S/;function se(Ee){for(var De=void 0,Ve=Ee.firstChild;Ve;Ve=Ve.nextSibling){var et=Ve.nodeType;De=et===1?De?Ee:Ve:et===3&&ue.test(Ve.nodeValue)?Ee:De}return De===Ee?void 0:De}function Se(Ee,De){var Ve={},et;(function(){for(var He=Ee.concat(De),St=[],ft={},bt=0,dt=He.length;bt<dt;++bt){var Dt=He[bt],Ot=Dt[3];if(Ot)for(var _t=Ot.length;--_t>=0;)Ve[Ot.charAt(_t)]=Dt;var Ue=Dt[1],It=""+Ue;ft.hasOwnProperty(It)||(St.push(Ue),ft[It]=null)}St.push(/[\0-\uffff]/),et=k(St)})();var at=De.length,Ye=function(He){for(var St=He.sourceCode,ft=He.basePos,bt=He.sourceNode,dt=[ft,b],Dt=0,Ot=St.match(et)||[],_t={},Ue=0,It=Ot.length;Ue<It;++Ue){var kt=Ot[Ue],Be=_t[kt],Ke=void 0,K;if(typeof Be=="string")K=!1;else{var G=Ve[kt.charAt(0)];if(G)Ke=kt.match(G[1]),Be=G[0];else{for(var H=0;H<at;++H)if(G=De[H],Ke=kt.match(G[1]),Ke){Be=G[0];break}Ke||(Be=b)}K=Be.length>=5&&Be.substring(0,5)==="lang-",K&&!(Ke&&typeof Ke[1]=="string")&&(K=!1,Be=y),K||(_t[kt]=Be)}var w=Dt;if(Dt+=kt.length,!K)dt.push(ft+w,Be);else{var O=Ke[1],L=kt.indexOf(O),D=L+O.length;Ke[2]&&(D=kt.length-Ke[2].length,L=D-O.length);var ve=Be.substring(5);R(bt,ft+w,kt.substring(0,L),Ye,dt),R(bt,ft+w+L,O,_(ve,O),dt),R(bt,ft+w+D,kt.substring(D),Ye,dt)}}He.decorations=dt};return Ye}function fe(Ee){var De=[],Ve=[];Ee.tripleQuotedStrings?De.push([I,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ee.multiLineStrings?De.push([I,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([I,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ee.verbatimStrings&&Ve.push([I,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var et=Ee.hashComments;et&&(Ee.cStyleComments?(et>1?De.push([Q,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.push([Q,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ve.push([I,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):De.push([Q,/^#[^\r\n]*/,null,"#"])),Ee.cStyleComments&&(Ve.push([Q,/^\/\/[^\r\n]*/,null]),Ve.push([Q,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var at=Ee.regexLiterals;if(at){var Ye=at>1?"":`
\r`,He=Ye?".":"[\\S\\s]",St="/(?=[^/*"+Ye+"])(?:[^/\\x5B\\x5C"+Ye+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+Ye+"]|\\x5C"+He+")*(?:\\x5D|$))+/";Ve.push(["lang-regex",RegExp("^"+_e+"("+St+")")])}var ft=Ee.types;ft&&Ve.push([S,ft]);var bt=(""+Ee.keywords).replace(/^ | $/g,"");bt.length&&Ve.push([g,new RegExp("^(?:"+bt.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([b,/^\s+/,null,` \r
\xA0`]);var dt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ee.regexLiterals&&(dt+="(?!s*/)"),Ve.push([A,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[b,/^[a-z_$][a-z_$@0-9]*/i,null],[A,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[b,/^\\[\s\S]?/,null],[x,new RegExp(dt),null]),Se(De,Ve)}var pe=fe({keywords:Ce,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function j(Ee,De,Ve){for(var et=/(?:^|\s)nocode(?:\s|$)/,at=/\r\n?|\n/,Ye=Ee.ownerDocument,He=Ye.createElement("li");Ee.firstChild;)He.appendChild(Ee.firstChild);var St=[He];function ft(Ue){var It=Ue.nodeType;if(It==1&&!et.test(Ue.className))if(Ue.nodeName==="br")bt(Ue),Ue.parentNode&&Ue.parentNode.removeChild(Ue);else for(var kt=Ue.firstChild;kt;kt=kt.nextSibling)ft(kt);else if((It==3||It==4)&&Ve){var Be=Ue.nodeValue,Ke=Be.match(at);if(Ke){var K=Be.substring(0,Ke.index);Ue.nodeValue=K;var G=Be.substring(Ke.index+Ke[0].length);if(G){var H=Ue.parentNode;H.insertBefore(Ye.createTextNode(G),Ue.nextSibling)}bt(Ue),K||Ue.parentNode.removeChild(Ue)}}}function bt(Ue){for(;!Ue.nextSibling;)if(Ue=Ue.parentNode,!Ue)return;function It(Ke,K){var G=K?Ke.cloneNode(!1):Ke,H=Ke.parentNode;if(H){var w=It(H,1),O=Ke.nextSibling;w.appendChild(G);for(var L=O;L;L=O)O=L.nextSibling,w.appendChild(L)}return G}for(var kt=It(Ue.nextSibling,0),Be;(Be=kt.parentNode)&&Be.nodeType===1;)kt=Be;St.push(kt)}for(var dt=0;dt<St.length;++dt)ft(St[dt]);De===(De|0)&&St[0].setAttribute("value",De);var Dt=Ye.createElement("ol");Dt.className="linenums";for(var Ot=Math.max(0,De-1|0)||0,dt=0,_t=St.length;dt<_t;++dt)He=St[dt],He.className="L"+(dt+Ot)%10,He.firstChild||He.appendChild(Ye.createTextNode("\xA0")),Dt.appendChild(He);Ee.appendChild(Dt)}function M(Ee){var De=/\bMSIE\s(\d+)/.exec(navigator.userAgent);De=De&&+De[1]<=8;var Ve=/\n/g,et=Ee.sourceCode,at=et.length,Ye=0,He=Ee.spans,St=He.length,ft=0,bt=Ee.decorations,dt=bt.length,Dt=0;bt[dt]=at;var Ot,_t;for(_t=Ot=0;_t<dt;)bt[_t]!==bt[_t+2]?(bt[Ot++]=bt[_t++],bt[Ot++]=bt[_t++]):_t+=2;for(dt=Ot,_t=Ot=0;_t<dt;){for(var Ue=bt[_t],It=bt[_t+1],kt=_t+2;kt+2<=dt&&bt[kt+1]===It;)kt+=2;bt[Ot++]=Ue,bt[Ot++]=It,_t=kt}dt=bt.length=Ot;var Be=Ee.sourceNode,Ke="";Be&&(Ke=Be.style.display,Be.style.display="none");try{for(var K=null;ft<St;){var G=He[ft],H=He[ft+2]||at,w=bt[Dt+2]||at,kt=Math.min(H,w),O=He[ft+1],L;if(O.nodeType!==1&&(L=et.substring(Ye,kt))){De&&(L=L.replace(Ve,"\r")),O.nodeValue=L;var D=O.ownerDocument,ve=D.createElement("span");ve.className=bt[Dt+1];var ne=O.parentNode;ne.replaceChild(ve,O),ve.appendChild(O),Ye<H&&(He[ft+1]=O=D.createTextNode(et.substring(kt,H)),ne.insertBefore(O,ve.nextSibling))}Ye=kt,Ye>=H&&(ft+=2),Ye>=w&&(Dt+=2)}}finally{Be&&(Be.style.display=Ke)}}var re={};function P(Ee,De){for(var Ve=De.length;--Ve>=0;){var et=De[Ve];re.hasOwnProperty(et)?B.console&&console.warn("cannot override language handler %s",et):re[et]=Ee}}function _(Ee,De){return Ee&&re.hasOwnProperty(Ee)||(Ee=/^\s*</.test(De)?"default-markup":"default-code"),re[Ee]}P(pe,["default-code"]),P(Se([],[[b,/^[^<?]+/],[T,/^<!\w[^>]*(?:>|$)/],[Q,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["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"]),P(Se([[b,/^[\s]+/,null,` \r
`],[ye,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[N,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[J,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),P(Se([],[[ye,/^[\s\S]+/]]),["uq.val"]),P(fe({keywords:V,hashComments:!0,cStyleComments:!0,types:de}),["c","cc","cpp","cxx","cyc","m"]),P(fe({keywords:"null,true,false"}),["json"]),P(fe({keywords:Z,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:de}),["cs"]),P(fe({keywords:le,cStyleComments:!0}),["java"]),P(fe({keywords:me,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),P(fe({keywords:te,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),P(fe({keywords:U,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),P(fe({keywords:E,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),P(fe({keywords:$,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),P(fe({keywords:z,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),P(Se([],[[I,/^[\s\S]+/]]),["regex"]);function he(Ee){var De=Ee.langExtension;try{var Ve=f(Ee.sourceNode,Ee.pre),et=Ve.sourceCode;Ee.sourceCode=et,Ee.spans=Ve.spans,Ee.basePos=0,_(De,et)(Ee),M(Ee)}catch(at){B.console&&console.log(at&&at.stack||at)}}function Pe(Ee,De,Ve){var et=Ve||!1,at=De||null,Ye=document.createElement("div");Ye.innerHTML="<pre>"+Ee+"</pre>",Ye=Ye.firstChild,et&&j(Ye,et,!0);var He={langExtension:at,numberLines:et,sourceNode:Ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return he(He),Ye.innerHTML}function Je(Ee,De){var Ve=De||document.body,et=Ve.ownerDocument||document;function at(G){return Ve.getElementsByTagName(G)}for(var Ye=[at("pre"),at("code"),at("xmp")],He=[],St=0;St<Ye.length;++St)for(var ft=0,bt=Ye[St].length;ft<bt;++ft)He.push(Ye[St][ft]);Ye=null;var dt=Date;dt.now||(dt={now:function(){return+new Date}});var Dt=0,Ot=/\blang(?:uage)?-([\w.]+)(?!\S)/,_t=/\bprettyprint\b/,Ue=/\bprettyprinted\b/,It=/pre|xmp/i,kt=/^code$/i,Be=/^(?:pre|code|xmp)$/i,Ke={};function K(){for(var G=B.PR_SHOULD_USE_CONTINUATION?dt.now()+250:Infinity;Dt<He.length&&dt.now()<G;Dt++){for(var H=He[Dt],w=Ke,O=H;O=O.previousSibling;){var L=O.nodeType,D=(L===7||L===8)&&O.nodeValue;if(D?!/^\??prettify\b/.test(D):L!==3||/\S/.test(O.nodeValue))break;if(D){w={},D.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vt,lt,Ut){w[lt]=Ut});break}}var ve=H.className;if((w!==Ke||_t.test(ve))&&!Ue.test(ve)){for(var ne=!1,xe=H.parentNode;xe;xe=xe.parentNode){var qe=xe.tagName;if(Be.test(qe)&&xe.className&&_t.test(xe.className)){ne=!0;break}}if(!ne){H.className+=" prettyprinted";var ht=w.lang;if(!ht){ht=ve.match(Ot);var Fe;!ht&&(Fe=se(H))&&kt.test(Fe.tagName)&&(ht=Fe.className.match(Ot)),ht&&(ht=ht[1])}var Xe;if(It.test(H.tagName))Xe=1;else{var Rt=H.currentStyle,Ne=et.defaultView,jt=Rt?Rt.whiteSpace:Ne&&Ne.getComputedStyle?Ne.getComputedStyle(H,null).getPropertyValue("white-space"):0;Xe=jt&&jt.substring(0,3)==="pre"}var Ft=w.linenums;(Ft=Ft==="true"||+Ft)||(Ft=ve.match(/\blinenums\b(?::(\d+))?/),Ft=Ft?Ft[1]&&Ft[1].length?+Ft[1]:!0:!1),Ft&&j(H,Ft,Xe);var we={langExtension:ht,sourceNode:H,numberLines:Ft,pre:Xe,sourceCode:null,basePos:null,spans:null,decorations:null};he(we)}}}Dt<He.length?B.setTimeout(K,250):typeof Ee=="function"&&Ee()}K()}var Me=B.PR={createSimpleLexer:Se,registerLangHandler:P,sourceDecorator:fe,PR_ATTRIB_NAME:J,PR_ATTRIB_VALUE:ye,PR_COMMENT:Q,PR_DECLARATION:T,PR_KEYWORD:g,PR_LITERAL:A,PR_NOCODE:q,PR_PLAIN:b,PR_PUNCTUATION:x,PR_SOURCE:y,PR_STRING:I,PR_TAG:N,PR_TYPE:S,prettyPrintOne:ge?B.prettyPrintOne=Pe:Re=Pe,prettyPrint:ee=ge?B.prettyPrint=Je:ee=Je},We=B.define;typeof We=="function"&&We.amd&&We("google-code-prettify",[],function(){return Me})})()},"VrN/":function(it,Ie,l){(function(oe,Le){it.exports=Le()})(this,function(){"use strict";var oe=navigator.userAgent,Le=navigator.platform,ge=/gecko\/\d/i.test(oe),Te=/MSIE \d/.test(oe),Oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),Re=/Edge\/(\d+)/.exec(oe),ee=Te||Oe||Re,B=ee&&(Te?document.documentMode||6:+(Re||Oe)[1]),F=!Re&&/WebKit\//.test(oe),X=F&&/Qt\/\d+\.\d+/.test(oe),W=!Re&&/Chrome\//.test(oe),V=/Opera\//.test(oe),le=/Apple Computer/.test(navigator.vendor),Z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),z=/PhantomJS/.test(oe),$=!Re&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),U=/Android/.test(oe),te=$||U||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),E=$||/Mac/.test(Le),me=/\bCrOS\b/.test(oe),Ce=/win/i.test(Le),de=V&&oe.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(V=!1,F=!0);var I=E&&(X||V&&(de==null||de<12.11)),g=ge||ee&&B>=9;function Q(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var i=e.className,n=Q(t).exec(i);if(n){var a=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(a?n[1]+a:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return A(e).appendChild(t)}function b(e,t,i,n){var a=document.createElement(e);if(i&&(a.className=i),n&&(a.style.cssText=n),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)a.appendChild(t[s]);return a}function N(e,t,i,n){var a=b(e,t,i,n);return a.setAttribute("role","presentation"),a}var T;document.createRange?T=function(e,t,i,n){var a=document.createRange();return a.setEnd(n||e,i),a.setStart(e,t),a}:T=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(a){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function y(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 J(){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 ye(e,t){var i=e.className;Q(t).test(i)||(e.className+=(i?" ":"")+t)}function q(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!Q(i[n]).test(t)&&(t+=" "+i[n]);return t}var _e=function(e){e.select()};$?_e=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ee&&(_e=function(e){try{e.select()}catch(t){}});function k(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function f(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function R(e,t,i,n,a){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,u=a||0;;){var m=e.indexOf(" ",s);if(m<0||m>=t)return u+(t-s);u+=m-s,u+=i-u%i,s=m+1}}var ue=function(){this.id=null,this.f=null,this.time=0,this.handler=k(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Se=50,fe={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},j={origin:"*mouse"},M={origin:"+move"};function re(e,t,i){for(var n=0,a=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var u=s-n;if(s==e.length||a+u>=t)return n+Math.min(u,t-a);if(a+=s-n,a+=i-a%i,n=s+1,a>=t)return n}}var P=[""];function _(e){for(;P.length<=e;)P.push(he(P)+" ");return P[e]}function he(e){return e[e.length-1]}function Pe(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Je(e,t,i){for(var n=0,a=i(t);n<e.length&&i(e[n])<=a;)n++;e.splice(n,0,t)}function Me(){}function We(e,t){var i;return Object.create?i=Object.create(e):(Me.prototype=e,i=new Me),t&&f(t,i),i}var Ee=/[\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()||Ee.test(e))}function Ve(e,t){return t?t.source.indexOf("\\w")>-1&&De(e)?!0:t.test(e):De(e)}function et(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var at=/[\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 Ye(e){return e.charCodeAt(0)>=768&&at.test(e)}function He(e,t,i){for(;(i<0?t>0:t<e.length)&&Ye(e.charAt(t));)t+=i;return t}function St(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var a=(t+i)/2,s=n<0?Math.ceil(a):Math.floor(a);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function ft(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var a=!1,s=0;s<e.length;++s){var u=e[s];(u.from<i&&u.to>t||t==i&&u.to==t)&&(n(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr",s),a=!0)}a||n(t,i,"ltr")}var bt=null;function dt(e,t,i){var n;bt=null;for(var a=0;a<e.length;++a){var s=e[a];if(s.from<t&&s.to>t)return a;s.to==t&&(s.from!=s.to&&i=="before"?n=a:bt=a),s.from==t&&(s.from!=s.to&&i!="before"?n=a:bt=a)}return n!=null?n:bt}var Dt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(C){return C<=247?e.charAt(C):1424<=C&&C<=1524?"R":1536<=C&&C<=1785?t.charAt(C-1536):1774<=C&&C<=2220?"r":8192<=C&&C<=8203?"w":C==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,s=/[LRr]/,u=/[Lb1n]/,m=/[1n]/;function v(C,Y,ae){this.level=C,this.from=Y,this.to=ae}return function(C,Y){var ae=Y=="ltr"?"L":"R";if(C.length==0||Y=="ltr"&&!n.test(C))return!1;for(var ke=C.length,be=[],$e=0;$e<ke;++$e)be.push(i(C.charCodeAt($e)));for(var rt=0,gt=ae;rt<ke;++rt){var Tt=be[rt];Tt=="m"?be[rt]=gt:gt=Tt}for(var Bt=0,At=ae;Bt<ke;++Bt){var Kt=be[Bt];Kt=="1"&&At=="r"?be[Bt]="n":s.test(Kt)&&(At=Kt,Kt=="r"&&(be[Bt]="R"))}for(var qt=1,Zt=be[0];qt<ke-1;++qt){var un=be[qt];un=="+"&&Zt=="1"&&be[qt+1]=="1"?be[qt]="1":un==","&&Zt==be[qt+1]&&(Zt=="1"||Zt=="n")&&(be[qt]=Zt),Zt=un}for(var Bn=0;Bn<ke;++Bn){var Ei=be[Bn];if(Ei==",")be[Bn]="N";else if(Ei=="%"){var ei=void 0;for(ei=Bn+1;ei<ke&&be[ei]=="%";++ei);for(var Vi=Bn&&be[Bn-1]=="!"||ei<ke&&be[ei]=="1"?"1":"N",Ii=Bn;Ii<ei;++Ii)be[Ii]=Vi;Bn=ei-1}}for(var ci=0,Bi=ae;ci<ke;++ci){var wi=be[ci];Bi=="L"&&wi=="1"?be[ci]="L":s.test(wi)&&(Bi=wi)}for(var mi=0;mi<ke;++mi)if(a.test(be[mi])){var di=void 0;for(di=mi+1;di<ke&&a.test(be[di]);++di);for(var ri=(mi?be[mi-1]:ae)=="L",Fi=(di<ke?be[di]:ae)=="L",eo=ri==Fi?ri?"L":"R":ae,wa=mi;wa<di;++wa)be[wa]=eo;mi=di-1}for(var Di=[],ra,Ci=0;Ci<ke;)if(u.test(be[Ci])){var Ar=Ci;for(++Ci;Ci<ke&&u.test(be[Ci]);++Ci);Di.push(new v(0,Ar,Ci))}else{var ca=Ci,La=Di.length,Da=Y=="rtl"?1:0;for(++Ci;Ci<ke&&be[Ci]!="L";++Ci);for(var ji=ca;ji<Ci;)if(m.test(be[ji])){ca<ji&&(Di.splice(La,0,new v(1,ca,ji)),La+=Da);var to=ji;for(++ji;ji<Ci&&m.test(be[ji]);++ji);Di.splice(La,0,new v(2,to,ji)),La+=Da,ca=ji}else++ji;ca<Ci&&Di.splice(La,0,new v(1,ca,Ci))}return Y=="ltr"&&(Di[0].level==1&&(ra=C.match(/^\s+/))&&(Di[0].from=ra[0].length,Di.unshift(new v(0,0,ra[0].length))),he(Di).level==1&&(ra=C.match(/\s+$/))&&(he(Di).to-=ra[0].length,Di.push(new v(0,ke-ra[0].length,ke)))),Y=="rtl"?Di.reverse():Di}}();function Ot(e,t){var i=e.order;return i==null&&(i=e.order=Dt(e.text,t)),i}var _t=[],Ue=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||_t).concat(i)}};function It(e,t){return e._handlers&&e._handlers[t]||_t}function kt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,a=n&&n[t];if(a){var s=se(a,i);s>-1&&(n[t]=a.slice(0,s).concat(a.slice(s+1)))}}}function Be(e,t){var i=It(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),a=0;a<i.length;++a)i[a].apply(null,n)}function Ke(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Be(e,i||t.type,e,t),L(t)||t.codemirrorIgnore}function K(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)se(i,t[n])==-1&&i.push(t[n])}function G(e,t){return It(e,t).length>0}function H(e){e.prototype.on=function(t,i){Ue(this,t,i)},e.prototype.off=function(t,i){kt(this,t,i)}}function w(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function O(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function L(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function D(e){w(e),O(e)}function ve(e){return e.target||e.srcElement}function ne(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),E&&e.ctrlKey&&t==1&&(t=3),t}var xe=function(){if(ee&&B<9)return!1;var e=b("div");return"draggable"in e||"dragDrop"in e}(),qe;function ht(e){if(qe==null){var t=b("span","\u200B");x(e,b("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(qe=t.offsetWidth<=1&&t.offsetHeight>2&&!(ee&&B<8))}var i=qe?b("span","\u200B"):b("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Fe;function Xe(e){if(Fe!=null)return Fe;var t=x(e,document.createTextNode("A\u062EA")),i=T(t,0,1).getBoundingClientRect(),n=T(t,1,2).getBoundingClientRect();return A(e),!i||i.left==i.right?!1:Fe=n.right-i.right<3}var Rt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var a=e.indexOf(`
`,t);a==-1&&(a=e.length);var s=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),u=s.indexOf("\r");u!=-1?(i.push(s.slice(0,u)),t+=u+1):(i.push(s),t=a+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Ne=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},jt=function(){var e=b("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ft=null;function we(e){if(Ft!=null)return Ft;var t=x(e,b("span","x")),i=t.getBoundingClientRect(),n=T(t,0,1).getBoundingClientRect();return Ft=Math.abs(i.left-n.left)>1}var vt={},lt={};function Ut(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),vt[e]=t}function Nt(e,t){lt[e]=t}function Ge(e){if(typeof e=="string"&&lt.hasOwnProperty(e))e=lt[e];else if(e&&typeof e.name=="string"&&lt.hasOwnProperty(e.name)){var t=lt[e.name];typeof t=="string"&&(t={name:t}),e=We(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ge("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ge("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ut(e,t){t=Ge(t);var i=vt[t.name];if(!i)return ut(e,"text/plain");var n=i(e,t);if(ot.hasOwnProperty(t.name)){var a=ot[t.name];for(var s in a){if(!a.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=a[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var u in t.modeProps)n[u]=t.modeProps[u];return n}var ot={};function ct(e,t){var i=ot.hasOwnProperty(e)?ot[e]:ot[e]={};f(t,i)}function Yt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var a=t[n];a instanceof Array&&(a=a.concat([])),i[n]=a}return i}function Ht(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function an(e,t,i){return e.startState?e.startState(t,i):!0}var Qt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Qt.prototype.eol=function(){return this.pos>=this.string.length},Qt.prototype.sol=function(){return this.pos==this.lineStart},Qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Qt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qt.prototype.skipToEnd=function(){this.pos=this.string.length},Qt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Qt.prototype.backUp=function(e){this.pos-=e},Qt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Qt.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Qt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(u){return i?u.toLowerCase():u},a=this.string.substr(this.pos,e.length);if(n(a)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function xt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var a=i.children[n],s=a.chunkSize();if(t<s){i=a;break}t-=s}return i.lines[t]}function nn(e,t,i){var n=[],a=t.line;return e.iter(t.line,i.line+1,function(s){var u=s.text;a==i.line&&(u=u.slice(0,i.ch)),a==t.line&&(u=u.slice(t.ch)),n.push(u),++a}),n}function zt(e,t,i){var n=[];return e.iter(t,i,function(a){n.push(a.text)}),n}function on(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Gt(e){if(e.parent==null)return null;for(var t=e.parent,i=se(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var a=0;!(n.children[a]==t);++a)i+=n.children[a].chunkSize();return i+t.first}function Dn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var a=e.children[n],s=a.height;if(t<s){e=a;continue e}t-=s,i+=a.chunkSize()}return i}while(!e.lines);for(var u=0;u<e.lines.length;++u){var m=e.lines[u],v=m.height;if(t<v)break;t-=v}return i+u}function Nn(e,t){return t>=e.first&&t<e.first+e.size}function Gn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function je(e,t,i){if(i===void 0&&(i=null),!(this instanceof je))return new je(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Et(e,t){return e.line-t.line||e.ch-t.ch}function sn(e,t){return e.sticky==t.sticky&&Et(e,t)==0}function mn(e){return je(e.line,e.ch)}function Pn(e,t){return Et(e,t)<0?t:e}function jn(e,t){return Et(e,t)<0?e:t}function h(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 je(e.first,0);var i=e.first+e.size-1;return t.line>i?je(i,xt(e,i).text.length):r(t,xt(e,t.line).text.length)}function r(e,t){var i=e.ch;return i==null||i>t?je(e.line,t):i<0?je(e.line,0):e}function c(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var p=function(e,t){this.state=e,this.lookAhead=t},d=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};d.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},d.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}},d.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},d.fromSaved=function(e,t,i){return t instanceof p?new d(e,Yt(e.mode,t.state),i,t.lookAhead):new d(e,Yt(e.mode,t),i)},d.prototype.save=function(e){var t=e!==!1?Yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function ie(e,t,i,n){var a=[e.state.modeGen],s={};Lt(e,t.text,e.doc.mode,i,function(C,Y){return a.push(C,Y)},s,n);for(var u=i.state,m=function(C){i.baseTokens=a;var Y=e.state.overlays[C],ae=1,ke=0;i.state=!0,Lt(e,t.text,Y.mode,i,function(be,$e){for(var rt=ae;ke<be;){var gt=a[ae];gt>be&&a.splice(ae,1,be,a[ae+1],gt),ae+=2,ke=Math.min(be,gt)}if(!$e)return;if(Y.opaque)a.splice(rt,ae-rt,be,"overlay "+$e),ae=rt+2;else for(;rt<ae;rt+=2){var Tt=a[rt+1];a[rt+1]=(Tt?Tt+" ":"")+"overlay "+$e}},s),i.state=u,i.baseTokens=null,i.baseTokenPos=1},v=0;v<e.state.overlays.length;++v)m(v);return{styles:a,classes:s.bgClass||s.textClass?s:null}}function Qe(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ct(e,Gt(t)),a=t.text.length>e.options.maxHighlightLength&&Yt(e.doc.mode,n.state),s=ie(e,t,n);a&&(n.state=a),t.stateAfter=n.save(!a),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ct(e,t,i){var n=e.doc,a=e.display;if(!n.mode.startState)return new d(n,!0,t);var s=wt(e,t,i),u=s>n.first&&xt(n,s-1).stateAfter,m=u?d.fromSaved(n,u,s):new d(n,an(n.mode),s);return n.iter(s,t,function(v){Mt(e,v.text,m);var C=m.line;v.stateAfter=C==t-1||C%5==0||C>=a.viewFrom&&C<a.viewTo?m.save():null,m.nextLine()}),i&&(n.modeFrontier=m.line),m}function Mt(e,t,i,n){var a=e.doc.mode,s=new Qt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&tt(a,i.state);!s.eol();)Ze(a,s,i.state),s.start=s.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Ht(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Ze(e,t,i,n){for(var a=0;a<10;a++){n&&(n[0]=Ht(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var ce=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function nt(e,t,i,n){var a=e.doc,s=a.mode,u;t=o(a,t);var m=xt(a,t.line),v=Ct(e,t.line,i),C=new Qt(m.text,e.options.tabSize,v),Y;for(n&&(Y=[]);(n||C.pos<t.ch)&&!C.eol();)C.start=C.pos,u=Ze(s,C,v.state),n&&Y.push(new ce(C,u,Yt(a.mode,v.state)));return n?Y:new ce(C,u,v.state)}function Xt(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Lt(e,t,i,n,a,s,u){var m=i.flattenSpans;m==null&&(m=e.options.flattenSpans);var v=0,C=null,Y=new Qt(t,e.options.tabSize,n),ae,ke=e.options.addModeClass&&[null];for(t==""&&Xt(tt(i,n.state),s);!Y.eol();){if(Y.pos>e.options.maxHighlightLength?(m=!1,u&&Mt(e,t,n,Y.pos),Y.pos=t.length,ae=null):ae=Xt(Ze(i,Y,n.state,ke),s),ke){var be=ke[0].name;be&&(ae="m-"+(ae?be+" "+ae:be))}if(!m||C!=ae){for(;v<Y.start;)v=Math.min(Y.start,v+5e3),a(v,C);C=ae}Y.start=Y.pos}for(;v<Y.pos;){var $e=Math.min(Y.pos,v+5e3);a($e,C),v=$e}}function wt(e,t,i){for(var n,a,s=e.doc,u=i?-1:t-(e.doc.mode.innerMode?1e3:100),m=t;m>u;--m){if(m<=s.first)return s.first;var v=xt(s,m-1),C=v.stateAfter;if(C&&(!i||m+(C instanceof p?C.lookAhead:0)<=s.modeFrontier))return m;var Y=R(v.text,null,e.options.tabSize);(a==null||n>Y)&&(a=m-1,n=Y)}return a}function Wt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var a=xt(e,n).stateAfter;if(a&&(!(a instanceof p)||n+a.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var xn=!1,hn=!1;function Tn(){xn=!0}function vn(){hn=!0}function Zn(e,t,i){this.marker=e,this.from=t,this.to=i}function Rn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function hi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function xi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function vi(e,t,i){var n;if(e)for(var a=0;a<e.length;++a){var s=e[a],u=s.marker,m=s.from==null||(u.inclusiveLeft?s.from<=t:s.from<t);if(m||s.from==t&&u.type=="bookmark"&&(!i||!s.marker.insertLeft)){var v=s.to==null||(u.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new Zn(u,s.from,v?null:s.to))}}return n}function Xn(e,t,i){var n;if(e)for(var a=0;a<e.length;++a){var s=e[a],u=s.marker,m=s.to==null||(u.inclusiveRight?s.to>=t:s.to>t);if(m||s.from==t&&u.type=="bookmark"&&(!i||s.marker.insertLeft)){var v=s.from==null||(u.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new Zn(u,v?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Si(e,t){if(t.full)return null;var i=Nn(e,t.from.line)&&xt(e,t.from.line).markedSpans,n=Nn(e,t.to.line)&&xt(e,t.to.line).markedSpans;if(!i&&!n)return null;var a=t.from.ch,s=t.to.ch,u=Et(t.from,t.to)==0,m=vi(i,a,u),v=Xn(n,s,u),C=t.text.length==1,Y=he(t.text).length+(C?a:0);if(m)for(var ae=0;ae<m.length;++ae){var ke=m[ae];if(ke.to==null){var be=Rn(v,ke.marker);be?C&&(ke.to=be.to==null?null:be.to+Y):ke.to=a}}if(v)for(var $e=0;$e<v.length;++$e){var rt=v[$e];if(rt.to!=null&&(rt.to+=Y),rt.from==null){var gt=Rn(m,rt.marker);gt||(rt.from=Y,C&&(m||(m=[])).push(rt))}else rt.from+=Y,C&&(m||(m=[])).push(rt)}m&&(m=pi(m)),v&&v!=m&&(v=pi(v));var Tt=[m];if(!C){var Bt=t.text.length-2,At;if(Bt>0&&m)for(var Kt=0;Kt<m.length;++Kt)m[Kt].to==null&&(At||(At=[])).push(new Zn(m[Kt].marker,null,null));for(var qt=0;qt<Bt;++qt)Tt.push(At);Tt.push(v)}return Tt}function pi(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Hn(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(be){if(be.markedSpans)for(var $e=0;$e<be.markedSpans.length;++$e){var rt=be.markedSpans[$e].marker;rt.readOnly&&(!n||se(n,rt)==-1)&&(n||(n=[])).push(rt)}}),!n)return null;for(var a=[{from:t,to:i}],s=0;s<n.length;++s)for(var u=n[s],m=u.find(0),v=0;v<a.length;++v){var C=a[v];if(Et(C.to,m.from)<0||Et(C.from,m.to)>0)continue;var Y=[v,1],ae=Et(C.from,m.from),ke=Et(C.to,m.to);(ae<0||!u.inclusiveLeft&&!ae)&&Y.push({from:C.from,to:m.from}),(ke>0||!u.inclusiveRight&&!ke)&&Y.push({from:m.to,to:C.to}),a.splice.apply(a,Y),v+=Y.length-3}return a}function Wi(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Sa(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Kn(e){return e.inclusiveLeft?-1:0}function gn(e){return e.inclusiveRight?1:0}function fi(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),a=t.find(),s=Et(n.from,a.from)||Kn(e)-Kn(t);if(s)return-s;var u=Et(n.to,a.to)||gn(e)-gn(t);return u||t.id-e.id}function fn(e,t){var i=hn&&e.markedSpans,n;if(i)for(var a=void 0,s=0;s<i.length;++s)a=i[s],a.marker.collapsed&&(t?a.from:a.to)==null&&(!n||fi(n,a.marker)<0)&&(n=a.marker);return n}function Qn(e){return fn(e,!0)}function yn(e){return fn(e,!1)}function Yi(e,t){var i=hn&&e.markedSpans,n;if(i)for(var a=0;a<i.length;++a){var s=i[a];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||fi(n,s.marker)<0)&&(n=s.marker)}return n}function An(e,t,i,n,a){var s=xt(e,t),u=hn&&s.markedSpans;if(u)for(var m=0;m<u.length;++m){var v=u[m];if(!v.marker.collapsed)continue;var C=v.marker.find(0),Y=Et(C.from,i)||Kn(v.marker)-Kn(a),ae=Et(C.to,n)||gn(v.marker)-gn(a);if(Y>=0&&ae<=0||Y<=0&&ae>=0)continue;if(Y<=0&&(v.marker.inclusiveRight&&a.inclusiveLeft?Et(C.to,i)>=0:Et(C.to,i)>0)||Y>=0&&(v.marker.inclusiveRight&&a.inclusiveLeft?Et(C.from,n)<=0:Et(C.from,n)<0))return!0}}function ki(e){for(var t;t=Qn(e);)e=t.find(-1,!0).line;return e}function sa(e){for(var t;t=yn(e);)e=t.find(1,!0).line;return e}function da(e){for(var t,i;t=yn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ji(e,t){var i=xt(e,t),n=ki(i);return i==n?t:Gt(n)}function Na(e,t){if(t>e.lastLine())return t;var i=xt(e,t),n;if(!Ri(e,i))return t;for(;n=yn(i);)i=n.find(1,!0).line;return Gt(i)+1}function Ri(e,t){var i=hn&&t.markedSpans;if(i)for(var n=void 0,a=0;a<i.length;++a){if(n=i[a],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Fn(e,t,n))return!0}}function Fn(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Fn(e,n.line,Rn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var a=void 0,s=0;s<t.markedSpans.length;++s)if(a=t.markedSpans[s],a.marker.collapsed&&!a.marker.widgetNode&&a.from==i.to&&(a.to==null||a.to!=i.from)&&(a.marker.inclusiveLeft||i.marker.inclusiveRight)&&Fn(e,t,a))return!0}function Oi(e){e=ki(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var a=i.lines[n];if(a==e)break;t+=a.height}for(var s=i.parent;s;i=s,s=i.parent)for(var u=0;u<s.children.length;++u){var m=s.children[u];if(m==i)break;t+=m.height}return t}function ha(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Qn(n);){var a=i.find(0,!0);n=a.from.line,t+=a.from.ch-a.to.ch}for(n=e;i=yn(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function ka(e){var t=e.display,i=e.doc;t.maxLine=xt(i,i.first),t.maxLineLength=ha(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var a=ha(n);a>t.maxLineLength&&(t.maxLineLength=a,t.maxLine=n)})}var zi=function(e,t,i){this.text=e,Sa(this,t),this.height=i?i(this):1};zi.prototype.lineNo=function(){return Gt(this)},H(zi);function Oo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Wi(e),Sa(e,i);var a=n?n(e):1;a!=e.height&&on(e,a)}function oa(e){e.parent=null,Wi(e)}var $t={},en={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?en:$t;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function ln(e,t){var i=N("span",null,null,F?"padding-right: .1px":null),n={pre:N("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var s=a?t.rest[a-1]:t.line,u=void 0;n.pos=0,n.addToken=wn,Xe(e.display.measure)&&(u=Ot(s,e.doc.direction))&&(n.addToken=ti(n.addToken,u)),n.map=[];var m=t!=e.display.externalMeasured&&Gt(s);cn(s,n,Qe(e,s,m)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=q(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=q(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(ht(e.display.measure))),a==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(F){var v=n.content.lastChild;(/\bcm-tab\b/.test(v.className)||v.querySelector&&v.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=q(n.pre.className,n.textClass||"")),n}function bn(e){var t=b("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function wn(e,t,i,n,a,s,u){if(!t)return;var m=e.splitSpaces?pn(t,e.trailingSpace):t,v=e.cm.state.specialChars,C=!1,Y;if(!v.test(t))e.col+=t.length,Y=document.createTextNode(m),e.map.push(e.pos,e.pos+t.length,Y),ee&&B<9&&(C=!0),e.pos+=t.length;else{Y=document.createDocumentFragment();for(var ae=0;;){v.lastIndex=ae;var ke=v.exec(t),be=ke?ke.index-ae:t.length-ae;if(be){var $e=document.createTextNode(m.slice(ae,ae+be));ee&&B<9?Y.appendChild(b("span",[$e])):Y.appendChild($e),e.map.push(e.pos,e.pos+be,$e),e.col+=be,e.pos+=be}if(!ke)break;ae+=be+1;var rt=void 0;if(ke[0]==" "){var gt=e.cm.options.tabSize,Tt=gt-e.col%gt;rt=Y.appendChild(b("span",_(Tt),"cm-tab")),rt.setAttribute("role","presentation"),rt.setAttribute("cm-text"," "),e.col+=Tt}else ke[0]=="\r"||ke[0]==`
`?(rt=Y.appendChild(b("span",ke[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),rt.setAttribute("cm-text",ke[0]),e.col+=1):(rt=e.cm.options.specialCharPlaceholder(ke[0]),rt.setAttribute("cm-text",ke[0]),ee&&B<9?Y.appendChild(b("span",[rt])):Y.appendChild(rt),e.col+=1);e.map.push(e.pos,e.pos+1,rt),e.pos++}}if(e.trailingSpace=m.charCodeAt(t.length-1)==32,i||n||a||C||s||u){var Bt=i||"";n&&(Bt+=n),a&&(Bt+=a);var At=b("span",[Y],Bt,s);if(u)for(var Kt in u)u.hasOwnProperty(Kt)&&Kt!="style"&&Kt!="class"&&At.setAttribute(Kt,u[Kt]);return e.content.appendChild(At)}e.content.appendChild(Y)}function pn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",a=0;a<e.length;a++){var s=e.charAt(a);s==" "&&i&&(a==e.length-1||e.charCodeAt(a+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function ti(e,t){return function(i,n,a,s,u,m,v){a=a?a+" cm-force-border":"cm-force-border";for(var C=i.pos,Y=C+n.length;;){for(var ae=void 0,ke=0;ke<t.length&&!(ae=t[ke],ae.to>C&&ae.from<=C);ke++);if(ae.to>=Y)return e(i,n,a,s,u,m,v);e(i,n.slice(0,ae.to-C),a,s,null,m,v),s=null,n=n.slice(ae.to-C),C=ae.to}}}function gi(e,t,i,n){var a=!n&&i.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!n&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",i.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function cn(e,t,i){var n=e.markedSpans,a=e.text,s=0;if(!n){for(var u=1;u<i.length;u+=2)t.addToken(t,a.slice(s,s=i[u]),Jt(i[u+1],t.cm.options));return}for(var m=a.length,v=0,C=1,Y="",ae,ke,be=0,$e,rt,gt,Tt,Bt;;){if(be==v){$e=rt=gt=ke="",Bt=null,Tt=null,be=Infinity;for(var At=[],Kt=void 0,qt=0;qt<n.length;++qt){var Zt=n[qt],un=Zt.marker;if(un.type=="bookmark"&&Zt.from==v&&un.widgetNode)At.push(un);else if(Zt.from<=v&&(Zt.to==null||Zt.to>v||un.collapsed&&Zt.to==v&&Zt.from==v)){if(Zt.to!=null&&Zt.to!=v&&be>Zt.to&&(be=Zt.to,rt=""),un.className&&($e+=" "+un.className),un.css&&(ke=(ke?ke+";":"")+un.css),un.startStyle&&Zt.from==v&&(gt+=" "+un.startStyle),un.endStyle&&Zt.to==be&&(Kt||(Kt=[])).push(un.endStyle,Zt.to),un.title&&((Bt||(Bt={})).title=un.title),un.attributes)for(var Bn in un.attributes)(Bt||(Bt={}))[Bn]=un.attributes[Bn];un.collapsed&&(!Tt||fi(Tt.marker,un)<0)&&(Tt=Zt)}else Zt.from>v&&be>Zt.from&&(be=Zt.from)}if(Kt)for(var Ei=0;Ei<Kt.length;Ei+=2)Kt[Ei+1]==be&&(rt+=" "+Kt[Ei]);if(!Tt||Tt.from==v)for(var ei=0;ei<At.length;++ei)gi(t,0,At[ei]);if(Tt&&(Tt.from||0)==v){if(gi(t,(Tt.to==null?m+1:Tt.to)-v,Tt.marker,Tt.from==null),Tt.to==null)return;Tt.to==v&&(Tt=!1)}}if(v>=m)break;for(var Vi=Math.min(m,be);;){if(Y){var Ii=v+Y.length;if(!Tt){var ci=Ii>Vi?Y.slice(0,Vi-v):Y;t.addToken(t,ci,ae?ae+$e:$e,gt,v+ci.length==be?rt:"",ke,Bt)}if(Ii>=Vi){Y=Y.slice(Vi-v),v=Vi;break}v=Ii,gt=""}Y=a.slice(s,s=i[C++]),ae=Jt(i[C++],t.cm.options)}}}function qi(e,t,i){this.line=t,this.rest=da(t),this.size=this.rest?Gt(he(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Ri(e,t)}function En(e,t,i){for(var n=[],a,s=t;s<i;s=a){var u=new qi(e.doc,xt(e.doc,s),s);a=s+u.size,n.push(u)}return n}var $n=null;function Pi(e){$n?$n.ops.push(e):e.ownsGroup=$n={ops:[e],delayedCallbacks:[]}}function Hi(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var a=e.ops[n];if(a.cursorActivityHandlers)for(;a.cursorActivityCalled<a.cursorActivityHandlers.length;)a.cursorActivityHandlers[a.cursorActivityCalled++].call(null,a.cm)}}while(i<t.length)}function ja(e,t){var i=e.ownsGroup;if(!i)return;try{Hi(i)}finally{$n=null,t(i)}}var pa=null;function Wn(e,t){var i=It(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),a;$n?a=$n.delayedCallbacks:pa?a=pa:(a=pa=[],setTimeout(no,0));for(var s=function(m){a.push(function(){return i[m].apply(null,n)})},u=0;u<i.length;++u)s(u)}function no(){var e=pa;pa=null;for(var t=0;t<e.length;++t)e[t]()}function Po(e,t,i,n){for(var a=0;a<t.changes.length;a++){var s=t.changes[a];s=="text"?nr(e,t):s=="gutter"?Ra(e,t,i,n):s=="class"?Ua(e,t):s=="widget"&&Lr(e,t,n)}t.changes=null}function fa(e){return e.node==e.text&&(e.node=b("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ee&&B<8&&(e.node.style.zIndex=2)),e.node}function tr(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=fa(t);t.background=n.insertBefore(b("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function io(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):ln(e,t)}function nr(e,t){var i=t.text.className,n=io(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ua(e,t)):i&&(t.text.className=i)}function Ua(e,t){tr(e,t),t.line.wrapClass?fa(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ra(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=fa(t);t.gutterBackground=b("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var u=fa(t),m=t.gutter=b("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(m),u.insertBefore(m,t.text),t.line.gutterClass&&(m.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=m.appendChild(b("div",Gn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var v=0;v<e.display.gutterSpecs.length;++v){var C=e.display.gutterSpecs[v].className,Y=s.hasOwnProperty(C)&&s[C];Y&&m.appendChild(b("div",[Y],"CodeMirror-gutter-elt","left: "+n.gutterLeft[C]+"px; width: "+n.gutterWidth[C]+"px"))}}}function Lr(e,t,i){t.alignable&&(t.alignable=null);for(var n=Q("CodeMirror-linewidget"),a=t.node.firstChild,s=void 0;a;a=s)s=a.nextSibling,n.test(a.className)&&t.node.removeChild(a);Ao(e,t,i)}function To(e,t,i,n){var a=io(e,t);return t.text=t.node=a.pre,a.bgClass&&(t.bgClass=a.bgClass),a.textClass&&(t.textClass=a.textClass),Ua(e,t),Ra(e,t,i,n),Ao(e,t,n),t.node}function Ao(e,t,i){if(Mo(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Mo(e,t.rest[n],t,i,!1)}function Mo(e,t,i,n,a){if(!t.widgets)return;for(var s=fa(i),u=0,m=t.widgets;u<m.length;++u){var v=m[u],C=b("div",[v.node],"CodeMirror-linewidget"+(v.className?" "+v.className:""));v.handleMouseEvents||C.setAttribute("cm-ignore-events","true"),ir(v,C,i,n),e.display.input.setUneditable(C),a&&v.above?s.insertBefore(C,i.gutter||i.text):s.appendChild(C),Wn(v,"redraw")}}function ir(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var a=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(a-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=a+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Oa(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,b("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function ea(e,t){for(var i=ve(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function ma(e){return e.lineSpace.offsetTop}function Ia(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ta(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,b("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Zi(e){return Se-e.display.nativeBarWidth}function la(e){return e.display.scroller.clientWidth-Zi(e)-e.display.barWidth}function ao(e){return e.display.scroller.clientHeight-Zi(e)-e.display.barHeight}function ar(e,t,i){var n=e.options.lineWrapping,a=n&&la(e);if(!t.measure.heights||n&&t.measure.width!=a){var s=t.measure.heights=[];if(n){t.measure.width=a;for(var u=t.text.firstChild.getClientRects(),m=0;m<u.length-1;m++){var v=u[m],C=u[m+1];Math.abs(v.bottom-C.bottom)>2&&s.push((v.bottom+C.top)/2-i.top)}}s.push(i.bottom-i.top)}}function va(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var a=0;a<e.rest.length;a++)if(Gt(e.rest[a])>i)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function Lo(e,t){t=ki(t);var i=Gt(t),n=e.display.externalMeasured=new qi(e.doc,t,i);n.lineN=i;var a=n.built=ln(e,n);return n.text=a.pre,x(e.display.lineMeasure,a.pre),n}function oo(e,t,i,n){return Gi(e,ya(e,t),i,n)}function ga(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Vn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function ya(e,t){var i=Gt(t),n=ga(e,i);n&&!n.text?n=null:n&&n.changes&&(Po(e,n,i,Ai(e)),e.curOp.forceUpdate=!0),n||(n=Lo(e,t));var a=va(n,t,i);return{line:t,view:n,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function Gi(e,t,i,n,a){t.before&&(i=-1);var s=i+(n||""),u;return t.cache.hasOwnProperty(s)?u=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ar(e,t.view,t.rect),t.hasHeights=!0),u=or(e,t,i,n),u.bogus||(t.cache[s]=u)),{left:u.left,right:u.right,top:a?u.rtop:u.top,bottom:a?u.rbottom:u.bottom}}var Do={left:0,right:0,top:0,bottom:0};function No(e,t,i){for(var n,a,s,u,m,v,C=0;C<e.length;C+=3)if(m=e[C],v=e[C+1],t<m?(a=0,s=1,u="left"):t<v?(a=t-m,s=a+1):(C==e.length-3||t==v&&e[C+3]>t)&&(s=v-m,a=s-1,t>=v&&(u="right")),a!=null){if(n=e[C+2],m==v&&i==(n.insertLeft?"left":"right")&&(u=i),i=="left"&&a==0)for(;C&&e[C-2]==e[C-3]&&e[C-1].insertLeft;)n=e[(C-=3)+2],u="left";if(i=="right"&&a==v-m)for(;C<e.length-3&&e[C+3]==e[C+4]&&!e[C+5].insertLeft;)n=e[(C+=3)+2],u="right";break}return{node:n,start:a,end:s,collapse:u,coverStart:m,coverEnd:v}}function ro(e,t){var i=Do;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var a=e.length-1;a>=0&&!((i=e[a]).left!=i.right);a--);return i}function or(e,t,i,n){var a=No(t.map,i,n),s=a.node,u=a.start,m=a.end,v=a.collapse,C;if(s.nodeType==3){for(var Y=0;Y<4;Y++){for(;u&&Ye(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+m<a.coverEnd&&Ye(t.line.text.charAt(a.coverStart+m));)++m;if(ee&&B<9&&u==0&&m==a.coverEnd-a.coverStart?C=s.parentNode.getBoundingClientRect():C=ro(T(s,u,m).getClientRects(),n),C.left||C.right||u==0)break;m=u,u=u-1,v="right"}ee&&B<11&&(C=rr(e.display.measure,C))}else{u>0&&(v=n="right");var ae;e.options.lineWrapping&&(ae=s.getClientRects()).length>1?C=ae[n=="right"?ae.length-1:0]:C=s.getBoundingClientRect()}if(ee&&B<9&&!u&&(!C||!C.left&&!C.right)){var ke=s.parentNode.getClientRects()[0];ke?C={left:ke.left,right:ke.left+ai(e.display),top:ke.top,bottom:ke.bottom}:C=Do}for(var be=C.top-t.rect.top,$e=C.bottom-t.rect.top,rt=(be+$e)/2,gt=t.view.measure.heights,Tt=0;Tt<gt.length-1&&!(rt<gt[Tt]);Tt++);var Bt=Tt?gt[Tt-1]:0,At=gt[Tt],Kt={left:(v=="right"?C.right:C.left)-t.rect.left,right:(v=="left"?C.left:C.right)-t.rect.left,top:Bt,bottom:At};return!C.left&&!C.right&&(Kt.bogus=!0),e.options.singleCursorHeightPerLine||(Kt.rtop=be,Kt.rbottom=$e),Kt}function rr(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!we(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function Ba(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 Fa(e){e.display.externalMeasure=null,A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ba(e.display.view[t])}function pt(e){Fa(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return W&&U?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ze(){return W&&U?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ae(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=Oa(e.widgets[i]));return t}function mt(e,t,i,n,a){if(!a){var s=Ae(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var u=Oi(t);if(n=="local"?u+=ma(e.display):u-=e.display.viewOffset,n=="page"||n=="window"){var m=e.display.lineSpace.getBoundingClientRect();u+=m.top+(n=="window"?0:ze());var v=m.left+(n=="window"?0:st());i.left+=v,i.right+=v}return i.top+=u,i.bottom+=u,i}function yt(e,t,i){if(i=="div")return t;var n=t.left,a=t.top;if(i=="page")n-=st(),a-=ze();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,a+=s.top}var u=e.display.lineSpace.getBoundingClientRect();return{left:n-u.left,top:a-u.top}}function Pt(e,t,i,n,a){return n||(n=xt(e.doc,t.line)),mt(e,n,oo(e,n,t.ch,a),i)}function Vt(e,t,i,n,a,s){n=n||xt(e.doc,t.line),a||(a=ya(e,n));function u($e,rt){var gt=Gi(e,a,$e,rt?"right":"left",s);return rt?gt.left=gt.right:gt.right=gt.left,mt(e,n,gt,i)}var m=Ot(n,e.doc.direction),v=t.ch,C=t.sticky;if(v>=n.text.length?(v=n.text.length,C="before"):v<=0&&(v=0,C="after"),!m)return u(C=="before"?v-1:v,C=="before");function Y($e,rt,gt){var Tt=m[rt],Bt=Tt.level==1;return u(gt?$e-1:$e,Bt!=gt)}var ae=dt(m,v,C),ke=bt,be=Y(v,ae,C=="before");return ke!=null&&(be.other=Y(v,ke,C!="before")),be}function tn(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=ai(e.display)*t.ch);var n=xt(e.doc,t.line),a=Oi(n)+ma(e.display);return{left:i,right:i,top:a,bottom:a+n.height}}function kn(e,t,i,n,a){var s=je(e,t,i);return s.xRel=a,n&&(s.outside=n),s}function Cn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return kn(n.first,0,null,-1,-1);var a=Dn(n,i),s=n.first+n.size-1;if(a>s)return kn(n.first+n.size-1,xt(n,s).text.length,null,1,1);t<0&&(t=0);for(var u=xt(n,a);;){var m=li(e,u,a,t,i),v=Yi(u,m.ch+(m.xRel>0||m.outside>0?1:0));if(!v)return m;var C=v.find(1);if(C.line==a)return C;u=xt(n,a=C.line)}}function Mn(e,t,i,n){n-=Ae(t);var a=t.text.length,s=St(function(u){return Gi(e,i,u-1).bottom<=n},a,0);return a=St(function(u){return Gi(e,i,u).top>n},s,a),{begin:s,end:a}}function Sn(e,t,i,n){i||(i=ya(e,t));var a=mt(e,t,Gi(e,i,n),"line").top;return Mn(e,t,i,a)}function ni(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function li(e,t,i,n,a){a-=Oi(t);var s=ya(e,t),u=Ae(t),m=0,v=t.text.length,C=!0,Y=Ot(t,e.doc.direction);if(Y){var ae=(e.options.lineWrapping?Ti:ii)(e,t,i,s,Y,n,a);C=ae.level!=1,m=C?ae.from:ae.to-1,v=C?ae.to:ae.from-1}var ke=null,be=null,$e=St(function(qt){var Zt=Gi(e,s,qt);return Zt.top+=u,Zt.bottom+=u,ni(Zt,n,a,!1)?(Zt.top<=a&&Zt.left<=n&&(ke=qt,be=Zt),!0):!1},m,v),rt,gt,Tt=!1;if(be){var Bt=n-be.left<be.right-n,At=Bt==C;$e=ke+(At?0:1),gt=At?"after":"before",rt=Bt?be.left:be.right}else{!C&&($e==v||$e==m)&&$e++,gt=$e==0?"after":$e==t.text.length?"before":Gi(e,s,$e-(C?1:0)).bottom+u<=a==C?"after":"before";var Kt=Vt(e,je(i,$e,gt),"line",t,s);rt=Kt.left,Tt=a<Kt.top?-1:a>=Kt.bottom?1:0}return $e=He(t.text,$e,1),kn(i,$e,gt,Tt,n-rt)}function ii(e,t,i,n,a,s,u){var m=St(function(ae){var ke=a[ae],be=ke.level!=1;return ni(Vt(e,je(i,be?ke.to:ke.from,be?"before":"after"),"line",t,n),s,u,!0)},0,a.length-1),v=a[m];if(m>0){var C=v.level!=1,Y=Vt(e,je(i,C?v.from:v.to,C?"after":"before"),"line",t,n);ni(Y,s,u,!0)&&Y.top>u&&(v=a[m-1])}return v}function Ti(e,t,i,n,a,s,u){var m=Mn(e,t,n,u),v=m.begin,C=m.end;/\s/.test(t.text.charAt(C-1))&&C--;for(var Y=null,ae=null,ke=0;ke<a.length;ke++){var be=a[ke];if(be.from>=C||be.to<=v)continue;var $e=be.level!=1,rt=Gi(e,n,$e?Math.min(C,be.to)-1:Math.max(v,be.from)).right,gt=rt<s?s-rt+1e9:rt-s;(!Y||ae>gt)&&(Y=be,ae=gt)}return Y||(Y=a[a.length-1]),Y.from<v&&(Y={from:v,to:Y.to,level:Y.level}),Y.to>C&&(Y={from:Y.from,to:C,level:Y.level}),Y}var In;function qn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(In==null){In=b("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)In.appendChild(document.createTextNode("x")),In.appendChild(b("br"));In.appendChild(document.createTextNode("x"))}x(e.measure,In);var i=In.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),A(e.measure),i||1}function ai(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=b("span","xxxxxxxxxx"),i=b("pre",[t],"CodeMirror-line-like");x(e.measure,i);var n=t.getBoundingClientRect(),a=(n.right-n.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function Ai(e){for(var t=e.display,i={},n={},a=t.gutters.clientLeft,s=t.gutters.firstChild,u=0;s;s=s.nextSibling,++u){var m=e.display.gutterSpecs[u].className;i[m]=s.offsetLeft+s.clientLeft+a,n[m]=s.clientWidth}return{fixedPos:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function dn(e){var t=qn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/ai(e.display)-3);return function(a){if(Ri(e.doc,a))return 0;var s=0;if(a.widgets)for(var u=0;u<a.widgets.length;u++)a.widgets[u].height&&(s+=a.widgets[u].height);return i?s+(Math.ceil(a.text.length/n)||1)*t:s+t}}function zn(e){var t=e.doc,i=dn(e);t.iter(function(n){var a=i(n);a!=n.height&&on(n,a)})}function oi(e,t,i,n){var a=e.display;if(!i&&ve(t).getAttribute("cm-not-content")=="true")return null;var s,u,m=a.lineSpace.getBoundingClientRect();try{s=t.clientX-m.left,u=t.clientY-m.top}catch(ae){return null}var v=Cn(e,s,u),C;if(n&&v.xRel>0&&(C=xt(e.doc,v.line).text).length==v.ch){var Y=R(C,C.length,e.options.tabSize)-C.length;v=je(v.line,Math.max(0,Math.round((s-ta(e.display).left)/ai(e.display))-Y))}return v}function Vn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Un(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var a=e.display;if(n&&i<a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>t)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)hn&&Ji(e.doc,t)<a.viewTo&&_n(e);else if(i<=a.viewFrom)hn&&Na(e.doc,i+n)>a.viewFrom?_n(e):(a.viewFrom+=n,a.viewTo+=n);else if(t<=a.viewFrom&&i>=a.viewTo)_n(e);else if(t<=a.viewFrom){var s=Yn(e,i,i+n,1);s?(a.view=a.view.slice(s.index),a.viewFrom=s.lineN,a.viewTo+=n):_n(e)}else if(i>=a.viewTo){var u=Yn(e,t,t,-1);u?(a.view=a.view.slice(0,u.index),a.viewTo=u.lineN):_n(e)}else{var m=Yn(e,t,t,-1),v=Yn(e,i,i+n,1);m&&v?(a.view=a.view.slice(0,m.index).concat(En(e,m.lineN,v.lineN)).concat(a.view.slice(v.index)),a.viewTo+=n):_n(e)}var C=a.externalMeasured;C&&(i<C.lineN?C.lineN+=n:t<C.lineN+C.size&&(a.externalMeasured=null))}function ui(e,t,i){e.curOp.viewChanged=!0;var n=e.display,a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Vn(e,t)];if(s.node==null)return;var u=s.changes||(s.changes=[]);se(u,i)==-1&&u.push(i)}function _n(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Yn(e,t,i,n){var a=Vn(e,t),s,u=e.display.view;if(!hn||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var m=e.display.viewFrom,v=0;v<a;v++)m+=u[v].size;if(m!=t){if(n>0){if(a==u.length-1)return null;s=m+u[a].size-t,a++}else s=m-t;t+=s,i+=s}for(;Ji(e.doc,i)!=i;){if(a==(n<0?0:u.length-1))return null;i+=n*u[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:i}}function yi(e,t,i){var n=e.display,a=n.view;a.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=En(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=En(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Vn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(En(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Vn(e,i)))),n.viewTo=i}function Qi(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var a=t[n];!a.hidden&&(!a.node||a.changes)&&++i}return i}function Mi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function na(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},a=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),u=0;u<i.sel.ranges.length;u++){if(!t&&u==i.sel.primIndex)continue;var m=i.sel.ranges[u];if(m.from().line>=e.display.viewTo||m.to().line<e.display.viewFrom)continue;var v=m.empty();(v||e.options.showCursorWhenSelecting)&&jo(e,m.head,a),v||Xs(e,m,s)}return n}function jo(e,t,i){var n=Vt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=i.appendChild(b("div","\xA0","CodeMirror-cursor"));if(a.style.left=n.left+"px",a.style.top=n.top+"px",a.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(b("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Wa(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,a=e.doc,s=document.createDocumentFragment(),u=ta(e.display),m=u.left,v=Math.max(n.sizerWidth,la(e)-n.sizer.offsetLeft)-u.right,C=a.direction=="ltr";function Y(At,Kt,qt,Zt){Kt<0&&(Kt=0),Kt=Math.round(Kt),Zt=Math.round(Zt),s.appendChild(b("div",null,"CodeMirror-selected","position: absolute; left: "+At+`px;
top: `+Kt+"px; width: "+(qt==null?v-At:qt)+`px;
height: `+(Zt-Kt)+"px"))}function ae(At,Kt,qt){var Zt=xt(a,At),un=Zt.text.length,Bn,Ei;function ei(ci,Bi){return Pt(e,je(At,ci),"div",Zt,Bi)}function Vi(ci,Bi,wi){var mi=Sn(e,Zt,null,ci),di=Bi=="ltr"==(wi=="after")?"left":"right",ri=wi=="after"?mi.begin:mi.end-(/\s/.test(Zt.text.charAt(mi.end-1))?2:1);return ei(ri,di)[di]}var Ii=Ot(Zt,a.direction);return ft(Ii,Kt||0,qt==null?un:qt,function(ci,Bi,wi,mi){var di=wi=="ltr",ri=ei(ci,di?"left":"right"),Fi=ei(Bi-1,di?"right":"left"),eo=Kt==null&&ci==0,wa=qt==null&&Bi==un,Di=mi==0,ra=!Ii||mi==Ii.length-1;if(Fi.top-ri.top<=3){var Ci=(C?eo:wa)&&Di,Ar=(C?wa:eo)&&ra,ca=Ci?m:(di?ri:Fi).left,La=Ar?v:(di?Fi:ri).right;Y(ca,ri.top,La-ca,ri.bottom)}else{var Da,ji,to,Mr;di?(Da=C&&eo&&Di?m:ri.left,ji=C?v:Vi(ci,wi,"before"),to=C?m:Vi(Bi,wi,"after"),Mr=C&&wa&&ra?v:Fi.right):(Da=C?Vi(ci,wi,"before"):m,ji=!C&&eo&&Di?v:ri.right,to=!C&&wa&&ra?m:Fi.left,Mr=C?Vi(Bi,wi,"after"):v),Y(Da,ri.top,ji-Da,ri.bottom),ri.bottom<Fi.top&&Y(m,ri.bottom,null,Fi.top),Y(to,Fi.top,Mr-to,Fi.bottom)}(!Bn||Wa(ri,Bn)<0)&&(Bn=ri),Wa(Fi,Bn)<0&&(Bn=Fi),(!Ei||Wa(ri,Ei)<0)&&(Ei=ri),Wa(Fi,Ei)<0&&(Ei=Fi)}),{start:Bn,end:Ei}}var ke=t.from(),be=t.to();if(ke.line==be.line)ae(ke.line,ke.ch,be.ch);else{var $e=xt(a,ke.line),rt=xt(a,be.line),gt=ki($e)==ki(rt),Tt=ae(ke.line,ke.ch,gt?$e.text.length+1:null).end,Bt=ae(be.line,gt?0:null,be.ch).start;gt&&(Tt.top<Bt.top-2?(Y(Tt.right,Tt.top,null,Tt.bottom),Y(m,Bt.top,Bt.left,Bt.bottom)):Y(Tt.right,Tt.top,Bt.left-Tt.right,Tt.bottom)),Tt.bottom<Bt.top&&Y(m,Tt.bottom,null,Bt.top)}i.appendChild(s)}function sr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||za(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Dr(e){e.state.focused||(e.display.input.focus(),lr(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,za(e))},100)}function lr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Be(e,"focus",e,t),e.state.focused=!0,ye(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),F&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),sr(e)}function za(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Uo(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var a=t.view[n],s=e.options.lineWrapping,u=void 0,m=0;if(a.hidden)continue;if(ee&&B<8){var v=a.node.offsetTop+a.node.offsetHeight;u=v-i,i=v}else{var C=a.node.getBoundingClientRect();u=C.bottom-C.top,!s&&a.text.firstChild&&(m=a.text.firstChild.getBoundingClientRect().right-C.left-1)}var Y=a.line.height-u;if((Y>.005||Y<-.005)&&(on(a.line,u),jr(a.line),a.rest))for(var ae=0;ae<a.rest.length;ae++)jr(a.rest[ae]);if(m>e.display.sizerWidth){var ke=Math.ceil(m/ai(e.display));ke>e.display.maxLineLength&&(e.display.maxLineLength=ke,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}function jr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Io(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-ma(e));var a=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Dn(t,n),u=Dn(t,a);if(i&&i.ensure){var m=i.ensure.from.line,v=i.ensure.to.line;m<s?(s=m,u=Dn(t,Oi(xt(t,m))+e.wrapper.clientHeight)):Math.min(v,t.lastLine())>=u&&(s=Dn(t,Oi(xt(t,v))-e.wrapper.clientHeight),u=v)}return{from:s,to:Math.max(u,s+1)}}function $s(e,t){if(Ke(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),a=null;if(t.top+n.top<0?a=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!z){var s=b("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-ma(e.display))+`px;
height: `+(t.bottom-t.top+Zi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(a),e.display.lineSpace.removeChild(s)}}function Ys(e,t,i,n){n==null&&(n=0);var a;!e.options.lineWrapping&&t==i&&(t=t.ch?je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?je(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var u=!1,m=Vt(e,t),v=!i||i==t?m:Vt(e,i);a={left:Math.min(m.left,v.left),top:Math.min(m.top,v.top)-n,right:Math.max(m.left,v.left),bottom:Math.max(m.bottom,v.bottom)+n};var C=ur(e,a),Y=e.doc.scrollTop,ae=e.doc.scrollLeft;if(C.scrollTop!=null&&(lo(e,C.scrollTop),Math.abs(e.doc.scrollTop-Y)>1&&(u=!0)),C.scrollLeft!=null&&(Pa(e,C.scrollLeft),Math.abs(e.doc.scrollLeft-ae)>1&&(u=!0)),!u)break}return a}function Js(e,t){var i=ur(e,t);i.scrollTop!=null&&lo(e,i.scrollTop),i.scrollLeft!=null&&Pa(e,i.scrollLeft)}function ur(e,t){var i=e.display,n=qn(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=ao(e),u={};t.bottom-t.top>s&&(t.bottom=t.top+s);var m=e.doc.height+Ia(i),v=t.top<n,C=t.bottom>m-n;if(t.top<a)u.scrollTop=v?0:t.top;else if(t.bottom>a+s){var Y=Math.min(t.top,(C?m:t.bottom)-s);Y!=a&&(u.scrollTop=Y)}var ae=e.options.fixedGutter?0:i.gutters.offsetWidth,ke=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ae,be=la(e)-i.gutters.offsetWidth,$e=t.right-t.left>be;return $e&&(t.right=t.left+be),t.left<10?u.scrollLeft=0:t.left<ke?u.scrollLeft=Math.max(0,t.left+ae-($e?0:10)):t.right>be+ke-3&&(u.scrollLeft=t.right+($e?0:10)-be),u}function cr(e,t){if(t==null)return;Bo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ha(e){Bo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function so(e,t,i){(t!=null||i!=null)&&Bo(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Bo(e),e.curOp.scrollToPos=t}function Bo(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=tn(e,t.from),n=tn(e,t.to);Ur(e,i,n,t.margin)}}function Ur(e,t,i,n){var a=ur(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});so(e,a.scrollLeft,a.scrollTop)}function lo(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ge||hr(e,{top:t}),Ir(e,t,!0),ge&&hr(e),ho(e,100)}function Ir(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Pa(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function uo(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ia(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Zi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Ta=function(e,t,i){this.cm=i;var n=this.vert=b("div",[b("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=b("div",[b("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=a.tabIndex=-1,e(n),e(a),Ue(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ue(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ee&&B<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ta.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var a=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Ta.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ta.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ta.prototype.zeroWidthHack=function(){var e=E&&!Z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ue,this.disableVert=new ue},Ta.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var a=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Ta.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var co=function(){};co.prototype.update=function(){return{bottom:0,right:0}},co.prototype.setScrollLeft=function(){},co.prototype.setScrollTop=function(){},co.prototype.clear=function(){};function Ka(e,t){t||(t=uo(e));var i=e.display.barWidth,n=e.display.barHeight;Br(e,t);for(var a=0;a<4&&i!=e.display.barWidth||n!=e.display.barHeight;a++)i!=e.display.barWidth&&e.options.lineWrapping&&Uo(e),Br(e,uo(e)),i=e.display.barWidth,n=e.display.barHeight}function Br(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Fr={native:Ta,null:co};function Wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fr[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,i){i=="horizontal"?Pa(e,t):lo(e,t)},e),e.display.scrollbars.addClass&&ye(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Aa(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},Pi(e.curOp)}function Ma(e){var t=e.curOp;t&&ja(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var a=0;a<t.length;a++)nl(t[a]);for(var s=0;s<t.length;s++)il(t[s]);for(var u=0;u<t.length;u++)al(t[u])}function el(e){var t=e.cm,i=t.display;rl(t),e.updateMaxLine&&ka(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Fo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&dr(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Uo(t),e.barMeasure=uo(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oo(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Zi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-la(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pa(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==J();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ka(t,e.barMeasure),e.updatedDisplay&&fr(t,e.barMeasure),e.selectionChanged&&sr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Dr(e.cm)}function al(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&zr(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ir(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Pa(t,e.scrollLeft,!0,!0),e.scrollToPos){var a=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,a)}var s=e.maybeHiddenMarkers,u=e.maybeUnhiddenMarkers;if(s)for(var m=0;m<s.length;++m)s[m].lines.length||Be(s[m],"hide");if(u)for(var v=0;v<u.length;++v)u[v].lines.length&&Be(u[v],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ki(e,t){if(e.curOp)return t();Aa(e);try{return t()}finally{Ma(e)}}function bi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Aa(e);try{return t.apply(e,arguments)}finally{Ma(e)}}}function Ni(e){return function(){if(this.curOp)return e.apply(this,arguments);Aa(this);try{return e.apply(this,arguments)}finally{Ma(this)}}}function _i(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Aa(t);try{return e.apply(this,arguments)}finally{Ma(t)}}}function ho(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,k(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Ct(e,t.highlightFrontier),a=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var u=s.styles,m=s.text.length>e.options.maxHighlightLength?Yt(t.mode,n.state):null,v=ie(e,s,n,!0);m&&(n.state=m),s.styles=v.styles;var C=s.styleClasses,Y=v.classes;Y?s.styleClasses=Y:C&&(s.styleClasses=null);for(var ae=!u||u.length!=s.styles.length||C!=Y&&(!C||!Y||C.bgClass!=Y.bgClass||C.textClass!=Y.textClass),ke=0;!ae&&ke<u.length;++ke)ae=u[ke]!=s.styles[ke];ae&&a.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&Mt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return ho(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),a.length&&Ki(e,function(){for(var s=0;s<a.length;s++)ui(e,a[s],"text")})}var Fo=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Io(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=la(e),this.force=i,this.dims=Ai(e),this.events=[]};Fo.prototype.signal=function(e,t){G(e,t)&&this.events.push(arguments)},Fo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Be.apply(null,this.events[e])};function rl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Zi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Zi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=J();if(!t||!y(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&y(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==J())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function dr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return _n(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Qi(e)==0)return!1;Kr(e)&&(_n(e),t.dims=Ai(e));var a=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),u=Math.min(a,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>u&&i.viewTo-u<20&&(u=Math.min(a,i.viewTo)),hn&&(s=Ji(e.doc,s),u=Na(e.doc,u));var m=s!=i.viewFrom||u!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;yi(e,s,u),i.viewOffset=Oi(xt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var v=Qi(e);if(!m&&v==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var C=sl(e);return v>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),v>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(C),A(i.cursorDiv),A(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,m&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ho(e,400)),i.updateLineNumbers=null,!0}function zr(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==la(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Ia(e.display)-ao(e),i.top)}),t.visible=Io(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Io(e.display,e.doc,i));if(!dr(e,t))break;Uo(e);var a=uo(e);Mi(e),Ka(e,a),fr(e,a),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 hr(e,t){var i=new Fo(e,t);if(dr(e,i)){Uo(e),zr(e,i);var n=uo(e);Mi(e),Ka(e,n),fr(e,n),i.finish()}}function ul(e,t,i){var n=e.display,a=e.options.lineNumbers,s=n.lineDiv,u=s.firstChild;function m($e){var rt=$e.nextSibling;return F&&E&&e.display.currentWheelTarget==$e?$e.style.display="none":$e.parentNode.removeChild($e),rt}for(var v=n.view,C=n.viewFrom,Y=0;Y<v.length;Y++){var ae=v[Y];if(!ae.hidden)if(!ae.node||ae.node.parentNode!=s){var ke=To(e,ae,C,i);s.insertBefore(ke,u)}else{for(;u!=ae.node;)u=m(u);var be=a&&t!=null&&t<=C&&ae.lineNumber;ae.changes&&(se(ae.changes,"gutter")>-1&&(be=!1),Po(e,ae,C,i)),be&&(A(ae.lineNumber),ae.lineNumber.appendChild(document.createTextNode(Gn(e.options,C)))),u=ae.node.nextSibling}C+=ae.size}for(;u;)u=m(u)}function pr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function fr(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+Zi(e)+"px"}function Hr(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=rn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,s=n+"px",u=0;u<i.length;u++)if(!i[u].hidden){e.options.fixedGutter&&(i[u].gutter&&(i[u].gutter.style.left=s),i[u].gutterBackground&&(i[u].gutterBackground.style.left=s));var m=i[u].alignable;if(m)for(var v=0;v<m.length;v++)m[v].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+a+"px")}function Kr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Gn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var a=n.measure.appendChild(b("div",[b("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=a.firstChild.offsetWidth,u=a.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-u)+1,n.lineNumWidth=n.lineNumInnerWidth+u,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",pr(e.display),!0}return!1}function mr(e,t){for(var i=[],n=!1,a=0;a<e.length;a++){var s=e[a],u=null;if(typeof s!="string"&&(u=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:u})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Vr(e){var t=e.gutters,i=e.gutterSpecs;A(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var a=i[n],s=a.className,u=a.style,m=t.appendChild(b("div",null,"CodeMirror-gutter "+s));u&&(m.style.cssText=u),s=="CodeMirror-linenumbers"&&(e.lineGutter=m,m.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",pr(e)}function po(e){Vr(e.display),Un(e),Hr(e)}function cl(e,t,i,n){var a=this;this.input=i,a.scrollbarFiller=b("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=b("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=N("div",null,"CodeMirror-code"),a.selectionDiv=b("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=b("div",null,"CodeMirror-cursors"),a.measure=b("div",null,"CodeMirror-measure"),a.lineMeasure=b("div",null,"CodeMirror-measure"),a.lineSpace=N("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var s=N("div",[a.lineSpace],"CodeMirror-lines");a.mover=b("div",[s],null,"position: relative"),a.sizer=b("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=b("div",null,null,"position: absolute; height: "+Se+"px; width: 1px;"),a.gutters=b("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=b("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=b("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),ee&&B<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!F&&!(ge&&te)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=mr(n.gutters,n.lineNumbers),Vr(a),i.init(a)}var Wo=0,Xi=null;ee?Xi=-.53:ge?Xi=15:W?Xi=-.7:le&&(Xi=-1/3);function Gr(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Gr(e);return t.x*=Xi,t.y*=Xi,t}function Xr(e,t){var i=Gr(t),n=i.x,a=i.y,s=e.display,u=s.scroller,m=u.scrollWidth>u.clientWidth,v=u.scrollHeight>u.clientHeight;if(!(n&&m||a&&v))return;if(a&&E&&F){e:for(var C=t.target,Y=s.view;C!=u;C=C.parentNode)for(var ae=0;ae<Y.length;ae++)if(Y[ae].node==C){e.display.currentWheelTarget=C;break e}}if(n&&!ge&&!V&&Xi!=null){a&&v&&lo(e,Math.max(0,u.scrollTop+a*Xi)),Pa(e,Math.max(0,u.scrollLeft+n*Xi)),(!a||a&&v)&&w(t),s.wheelStartX=null;return}if(a&&Xi!=null){var ke=a*Xi,be=e.doc.scrollTop,$e=be+s.wrapper.clientHeight;ke<0?be=Math.max(0,be+ke-50):$e=Math.min(e.doc.height,$e+ke+50),hr(e,{top:be,bottom:$e})}Wo<20&&(s.wheelStartX==null?(s.wheelStartX=u.scrollLeft,s.wheelStartY=u.scrollTop,s.wheelDX=n,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX==null)return;var rt=u.scrollLeft-s.wheelStartX,gt=u.scrollTop-s.wheelStartY,Tt=gt&&s.wheelDY&&gt/s.wheelDY||rt&&s.wheelDX&&rt/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Tt)return;Xi=(Xi*Wo+Tt)/(Wo+1),++Wo},200)):(s.wheelDX+=n,s.wheelDY+=a))}var $i=function(e,t){this.ranges=e,this.primIndex=t};$i.prototype.primary=function(){return this.ranges[this.primIndex]},$i.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!sn(i.anchor,n.anchor)||!sn(i.head,n.head))return!1}return!0},$i.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new On(mn(this.ranges[t].anchor),mn(this.ranges[t].head));return new $i(e,this.primIndex)},$i.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},$i.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Et(t,n.from())>=0&&Et(e,n.to())<=0)return i}return-1};var On=function(e,t){this.anchor=e,this.head=t};On.prototype.from=function(){return jn(this.anchor,this.head)},On.prototype.to=function(){return Pn(this.anchor,this.head)},On.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ia(e,t,i){var n=e&&e.options.selectionsMayTouch,a=t[i];t.sort(function(ke,be){return Et(ke.from(),be.from())}),i=se(t,a);for(var s=1;s<t.length;s++){var u=t[s],m=t[s-1],v=Et(m.to(),u.from());if(n&&!u.empty()?v>0:v>=0){var C=jn(m.from(),u.from()),Y=Pn(m.to(),u.to()),ae=m.empty()?u.from()==u.head:m.from()==m.head;s<=i&&--i,t.splice(--s,2,new On(ae?Y:C,ae?C:Y))}}return new $i(t,i)}function ba(e,t){return new $i([new On(e,t||e)],0)}function _a(e){return e.text?je(e.from.line+e.text.length-1,he(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function $r(e,t){if(Et(e,t.from)<0)return e;if(Et(e,t.to)<=0)return _a(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=_a(t).ch-t.to.ch),je(i,n)}function vr(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var a=e.sel.ranges[n];i.push(new On($r(a.anchor,t),$r(a.head,t)))}return ia(e.cm,i,e.sel.primIndex)}function Yr(e,t,i){return e.line==t.line?je(i.line,e.ch-t.ch+i.ch):je(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],a=je(e.first,0),s=a,u=0;u<t.length;u++){var m=t[u],v=Yr(m.from,a,s),C=Yr(_a(m),a,s);if(a=m.to,s=C,i=="around"){var Y=e.sel.ranges[u],ae=Et(Y.head,Y.anchor)<0;n[u]=new On(ae?C:v,ae?v:C)}else n[u]=new On(v,v)}return new $i(n,e.sel.primIndex)}function gr(e){e.doc.mode=ut(e.options,e.doc.modeOption),fo(e)}function fo(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,ho(e,100),e.state.modeGen++,e.curOp&&Un(e)}function Jr(e,t){return t.from.ch==0&&t.to.ch==0&&he(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function yr(e,t,i,n){function a(Bt){return i?i[Bt]:null}function s(Bt,At,Kt){Oo(Bt,At,Kt,n),Wn(Bt,"change",Bt,t)}function u(Bt,At){for(var Kt=[],qt=Bt;qt<At;++qt)Kt.push(new zi(C[qt],a(qt),n));return Kt}var m=t.from,v=t.to,C=t.text,Y=xt(e,m.line),ae=xt(e,v.line),ke=he(C),be=a(C.length-1),$e=v.line-m.line;if(t.full)e.insert(0,u(0,C.length)),e.remove(C.length,e.size-C.length);else if(Jr(e,t)){var rt=u(0,C.length-1);s(ae,ae.text,be),$e&&e.remove(m.line,$e),rt.length&&e.insert(m.line,rt)}else if(Y==ae)if(C.length==1)s(Y,Y.text.slice(0,m.ch)+ke+Y.text.slice(v.ch),be);else{var gt=u(1,C.length-1);gt.push(new zi(ke+Y.text.slice(v.ch),be,n)),s(Y,Y.text.slice(0,m.ch)+C[0],a(0)),e.insert(m.line+1,gt)}else if(C.length==1)s(Y,Y.text.slice(0,m.ch)+C[0]+ae.text.slice(v.ch),a(0)),e.remove(m.line+1,$e);else{s(Y,Y.text.slice(0,m.ch)+C[0],a(0)),s(ae,ke+ae.text.slice(v.ch),be);var Tt=u(1,C.length-1);$e>1&&e.remove(m.line+1,$e-1),e.insert(m.line+1,Tt)}Wn(e,"change",e,t)}function Ea(e,t,i){function n(a,s,u){if(a.linked)for(var m=0;m<a.linked.length;++m){var v=a.linked[m];if(v.doc==s)continue;var C=u&&v.sharedHist;if(i&&!C)continue;t(v.doc,C),n(v.doc,a,C)}}n(e,null,!0)}function Zr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,zn(e),gr(e),Qr(e),e.options.lineWrapping||ka(e),e.options.mode=t.modeOption,Un(e)}function Qr(e){(e.doc.direction=="rtl"?ye:S)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Ki(e,function(){Qr(e),Un(e)})}function zo(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 br(e,t){var i={from:mn(t.from),to:_a(t),text:nn(e,t.from,t.to)};return ts(e,i,t.from.line,t.to.line+1),Ea(e,function(n){return ts(n,i,t.from.line,t.to.line+1)},!0),i}function qr(e){for(;e.length;){var t=he(e);if(t.ranges)e.pop();else break}}function fl(e,t){if(t)return qr(e.done),he(e.done);if(e.done.length&&!he(e.done).ranges)return he(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),he(e.done)}function es(e,t,i,n){var a=e.history;a.undone.length=0;var s=+new Date,u,m;if((a.lastOp==n||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(u=fl(a,a.lastOp==n)))m=he(u.changes),Et(t.from,t.to)==0&&Et(t.from,m.to)==0?m.to=_a(t):u.changes.push(br(e,t));else{var v=he(a.done);for((!v||!v.ranges)&&Ho(e.sel,a.done),u={changes:[br(e,t)],generation:a.generation},a.done.push(u);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(i),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=s,a.lastOp=a.lastSelOp=n,a.lastOrigin=a.lastSelOrigin=t.origin,m||Be(e,"historyAdded")}function ml(e,t,i,n){var a=t.charAt(0);return a=="*"||a=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,i,n){var a=e.history,s=n&&n.origin;i==a.lastSelOp||s&&a.lastSelOrigin==s&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==s||ml(e,s,he(a.done),t))?a.done[a.done.length-1]=t:Ho(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=i,n&&n.clearRedo!==!1&&qr(a.undone)}function Ho(e,t){var i=he(t);i&&i.ranges&&i.equals(e)||t.push(e)}function ts(e,t,i,n){var a=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(u){u.markedSpans&&((a||(a=t["spans_"+e.id]={}))[s]=u.markedSpans),++s})}function gl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],a=0;a<t.text.length;++a)n.push(gl(i[a]));return n}function ns(e,t){var i=yl(e,t),n=Si(e,t);if(!i)return n;if(!n)return i;for(var a=0;a<i.length;++a){var s=i[a],u=n[a];if(s&&u){e:for(var m=0;m<u.length;++m){for(var v=u[m],C=0;C<s.length;++C)if(s[C].marker==v.marker)continue e;s.push(v)}}else u&&(i[a]=u)}return i}function Va(e,t,i){for(var n=[],a=0;a<e.length;++a){var s=e[a];if(s.ranges){n.push(i?$i.prototype.deepCopy.call(s):s);continue}var u=s.changes,m=[];n.push({changes:m});for(var v=0;v<u.length;++v){var C=u[v],Y=void 0;if(m.push({from:C.from,to:C.to,text:C.text}),t)for(var ae in C)(Y=ae.match(/^spans_(\d+)$/))&&(se(t,Number(Y[1]))>-1&&(he(m)[ae]=C[ae],delete C[ae]))}}return n}function _r(e,t,i,n){if(n){var a=e.anchor;if(i){var s=Et(t,a)<0;s!=Et(i,a)<0?(a=t,t=i):s!=Et(t,i)<0&&(t=i)}return new On(a,t)}else return new On(i||t,t)}function Ko(e,t,i,n,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),Li(e,new $i([_r(e.sel.primary(),t,i,a)],0),n)}function is(e,t,i){for(var n=[],a=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=_r(e.sel.ranges[s],t[s],null,a);var u=ia(e.cm,n,e.sel.primIndex);Li(e,u,i)}function Er(e,t,i,n){var a=e.sel.ranges.slice(0);a[t]=i,Li(e,ia(e.cm,a,e.sel.primIndex),n)}function as(e,t,i,n){Li(e,ba(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(a){this.ranges=[];for(var s=0;s<a.length;s++)this.ranges[s]=new On(o(e,a[s].anchor),o(e,a[s].head))},origin:i&&i.origin};return Be(e,"beforeSelectionChange",e,n),e.cm&&Be(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ia(e.cm,n.ranges,n.ranges.length-1):t}function os(e,t,i){var n=e.history.done,a=he(n);a&&a.ranges?(n[n.length-1]=t,Vo(e,t,i)):Li(e,t,i)}function Li(e,t,i){Vo(e,t,i),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Vo(e,t,i){(G(e,"beforeSelectionChange")||e.cm&&G(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Et(t.primary().head,e.sel.primary().head)<0?-1:1);rs(e,ls(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Ha(e.cm)}function rs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,K(e.cm)),Wn(e,"cursorActivity",e)}function ss(e){rs(e,ls(e,e.sel,null,!1))}function ls(e,t,i,n){for(var a,s=0;s<t.ranges.length;s++){var u=t.ranges[s],m=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],v=Go(e,u.anchor,m&&m.anchor,i,n),C=Go(e,u.head,m&&m.head,i,n);(a||v!=u.anchor||C!=u.head)&&(a||(a=t.ranges.slice(0,s)),a[s]=new On(v,C))}return a?ia(e.cm,a,t.primIndex):t}function Ga(e,t,i,n,a){var s=xt(e,t.line);if(s.markedSpans)for(var u=0;u<s.markedSpans.length;++u){var m=s.markedSpans[u],v=m.marker,C="selectLeft"in v?!v.selectLeft:v.inclusiveLeft,Y="selectRight"in v?!v.selectRight:v.inclusiveRight;if((m.from==null||(C?m.from<=t.ch:m.from<t.ch))&&(m.to==null||(Y?m.to>=t.ch:m.to>t.ch))){if(a&&(Be(v,"beforeCursorEnter"),v.explicitlyCleared))if(s.markedSpans){--u;continue}else break;if(!v.atomic)continue;if(i){var ae=v.find(n<0?1:-1),ke=void 0;if((n<0?Y:C)&&(ae=us(e,ae,-n,ae&&ae.line==t.line?s:null)),ae&&ae.line==t.line&&(ke=Et(ae,i))&&(n<0?ke<0:ke>0))return Ga(e,ae,t,n,a)}var be=v.find(n<0?-1:1);return(n<0?C:Y)&&(be=us(e,be,n,be.line==t.line?s:null)),be?Ga(e,be,t,n,a):null}}return t}function Go(e,t,i,n,a){var s=n||1,u=Ga(e,t,i,s,a)||!a&&Ga(e,t,i,s,!0)||Ga(e,t,i,-s,a)||!a&&Ga(e,t,i,-s,!0);return u||(e.cantEdit=!0,je(e.first,0))}function us(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,je(t.line-1)):null:i>0&&t.ch==(n||xt(e,t.line)).text.length?t.line<e.first+e.size-1?je(t.line+1,0):null:new je(t.line,t.ch+i)}function cs(e){e.setSelection(je(e.firstLine(),0),je(e.lastLine()),pe)}function ds(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(a,s,u,m){a&&(n.from=o(e,a)),s&&(n.to=o(e,s)),u&&(n.text=u),m!==void 0&&(n.origin=m)}),Be(e,"beforeChange",e,n),e.cm&&Be(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Xa(e,t,i){if(e.cm){if(!e.cm.curOp)return bi(e.cm,Xa)(e,t,i);if(e.cm.state.suppressEdits)return}if((G(e,"beforeChange")||e.cm&&G(e.cm,"beforeChange"))&&(t=ds(e,t,!0),!t))return;var n=xn&&!i&&Hn(e,t.from,t.to);if(n)for(var a=n.length-1;a>=0;--a)hs(e,{from:n[a].from,to:n[a].to,text:a?[""]:t.text,origin:t.origin});else hs(e,t)}function hs(e,t){if(t.text.length==1&&t.text[0]==""&&Et(t.from,t.to)==0)return;var i=vr(e,t);es(e,t,i,e.cm?e.cm.curOp.id:NaN),mo(e,t,i,Si(e,t));var n=[];Ea(e,function(a,s){!s&&se(n,a.history)==-1&&(vs(a.history,t),n.push(a.history)),mo(a,t,null,Si(a,t))})}function Xo(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var a=e.history,s,u=e.sel,m=t=="undo"?a.done:a.undone,v=t=="undo"?a.undone:a.done,C=0;C<m.length&&!(s=m[C],i?s.ranges&&!s.equals(e.sel):!s.ranges);C++);if(C==m.length)return;for(a.lastOrigin=a.lastSelOrigin=null;;)if(s=m.pop(),s.ranges){if(Ho(s,v),i&&!s.equals(e.sel)){Li(e,s,{clearRedo:!1});return}u=s}else if(n){m.push(s);return}else break;var Y=[];Ho(u,v),v.push({changes:Y,generation:a.generation}),a.generation=s.generation||++a.maxGeneration;for(var ae=G(e,"beforeChange")||e.cm&&G(e.cm,"beforeChange"),ke=function(rt){var gt=s.changes[rt];if(gt.origin=t,ae&&!ds(e,gt,!1))return m.length=0,{};Y.push(br(e,gt));var Tt=rt?vr(e,gt):he(m);mo(e,gt,Tt,ns(e,gt)),!rt&&e.cm&&e.cm.scrollIntoView({from:gt.from,to:_a(gt)});var Bt=[];Ea(e,function(At,Kt){!Kt&&se(Bt,At.history)==-1&&(vs(At.history,gt),Bt.push(At.history)),mo(At,gt,null,ns(At,gt))})},be=s.changes.length-1;be>=0;--be){var $e=ke(be);if($e)return $e.v}}function ps(e,t){if(t==0)return;if(e.first+=t,e.sel=new $i(Pe(e.sel.ranges,function(a){return new On(je(a.anchor.line+t,a.anchor.ch),je(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm){Un(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)ui(e.cm,n,"gutter")}}function mo(e,t,i,n){if(e.cm&&!e.cm.curOp)return bi(e.cm,mo)(e,t,i,n);if(t.to.line<e.first){ps(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 a=t.text.length-1-(e.first-t.from.line);ps(e,a),t={from:je(e.first,0),to:je(t.to.line+a,t.to.ch),text:[he(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:je(s,xt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nn(e,t.from,t.to),i||(i=vr(e,t)),e.cm?_l(e.cm,t,n):yr(e,t,n),Vo(e,i,pe),e.cantEdit&&Go(e,je(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,a=e.display,s=t.from,u=t.to,m=!1,v=s.line;e.options.lineWrapping||(v=Gt(ki(xt(n,s.line))),n.iter(v,u.line+1,function(be){if(be==a.maxLine)return m=!0,!0})),n.sel.contains(t.from,t.to)>-1&&K(e),yr(n,t,i,dn(e)),e.options.lineWrapping||(n.iter(v,s.line+t.text.length,function(be){var $e=ha(be);$e>a.maxLineLength&&(a.maxLine=be,a.maxLineLength=$e,a.maxLineChanged=!0,m=!1)}),m&&(e.curOp.updateMaxLine=!0)),Wt(n,s.line),ho(e,400);var C=t.text.length-(u.line-s.line)-1;t.full?Un(e):s.line==u.line&&t.text.length==1&&!Jr(e.doc,t)?ui(e,s.line,"text"):Un(e,s.line,u.line+1,C);var Y=G(e,"changes"),ae=G(e,"change");if(ae||Y){var ke={from:s,to:u,text:t.text,removed:t.removed,origin:t.origin};ae&&Wn(e,"change",e,ke),Y&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ke)}e.display.selForContextMenu=null}function $a(e,t,i,n,a){var s;n||(n=i),Et(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),Xa(e,{from:i,to:n,text:t,origin:a})}function fs(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ms(e,t,i,n){for(var a=0;a<e.length;++a){var s=e[a],u=!0;if(s.ranges){s.copied||(s=e[a]=s.deepCopy(),s.copied=!0);for(var m=0;m<s.ranges.length;m++)fs(s.ranges[m].anchor,t,i,n),fs(s.ranges[m].head,t,i,n);continue}for(var v=0;v<s.changes.length;++v){var C=s.changes[v];if(i<C.from.line)C.from=je(C.from.line+n,C.from.ch),C.to=je(C.to.line+n,C.to.ch);else if(t<=C.to.line){u=!1;break}}u||(e.splice(0,a+1),a=0)}}function vs(e,t){var i=t.from.line,n=t.to.line,a=t.text.length-(n-i)-1;ms(e.done,i,n,a),ms(e.undone,i,n,a)}function vo(e,t,i,n){var a=t,s=t;return typeof t=="number"?s=xt(e,h(e,t)):a=Gt(t),a==null?null:(n(s,a)&&e.cm&&ui(e.cm,a,i),s)}function go(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}go.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var a=this.lines[i];this.height-=a.height,oa(a),Wn(a,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function yo(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var a=e[n];t+=a.chunkSize(),i+=a.height,a.parent=this}this.size=t,this.height=i,this.parent=null}yo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],a=n.chunkSize();if(e<a){var s=Math.min(t,a-e),u=n.height;if(n.removeInner(e,s),this.height-=u-n.height,a==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof go))){var m=[];this.collapse(m),this.children=[new go(m)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var a=this.children[n],s=a.chunkSize();if(e<=s){if(a.insertInner(e,t,i),a.lines&&a.lines.length>50){for(var u=a.lines.length%25+25,m=u;m<a.lines.length;){var v=new go(a.lines.slice(m,m+=25));a.height-=v.height,this.children.splice(++n,0,v),v.parent=this}a.lines=a.lines.slice(0,u),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new yo(t);if(e.parent){e.size-=i.size,e.height-=i.height;var a=se(e.parent.children,e);e.parent.children.splice(a+1,0,i)}else{var n=new yo(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var a=this.children[n],s=a.chunkSize();if(e<s){var u=Math.min(t,s-e);if(a.iterN(e,u,i))return!0;if((t-=u)==0)break;e=0}else e-=s}}};var bo=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};bo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Gt(i);if(n==null||!t)return;for(var a=0;a<t.length;++a)t[a]==this&&t.splice(a--,1);t.length||(i.widgets=null);var s=Oa(this);on(i,Math.max(0,i.height-s)),e&&(Ki(e,function(){gs(e,i,-s),ui(e,n,"widget")}),Wn(e,"lineWidgetCleared",e,this,n))},bo.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var a=Oa(this)-t;if(!a)return;Ri(this.doc,n)||on(n,n.height+a),i&&Ki(i,function(){i.curOp.forceUpdate=!0,gs(i,n,a),Wn(i,"lineWidgetChanged",i,e,Gt(n))})},H(bo);function gs(e,t,i){Oi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&cr(e,i)}function El(e,t,i,n){var a=new bo(e,i,n),s=e.cm;return s&&a.noHScroll&&(s.display.alignWidgets=!0),vo(e,t,"widget",function(u){var m=u.widgets||(u.widgets=[]);if(a.insertAt==null?m.push(a):m.splice(Math.min(m.length-1,Math.max(0,a.insertAt)),0,a),a.line=u,s&&!Ri(e,u)){var v=Oi(u)<e.scrollTop;on(u,u.height+Oa(a)),v&&cr(s,a.height),s.curOp.forceUpdate=!0}return!0}),s&&Wn(s,"lineWidgetAdded",s,a,typeof t=="number"?t:Gt(t)),a}var ys=0,Ca=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ys};Ca.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Aa(e),G(this,"clear")){var i=this.find();i&&Wn(this,"clear",i.from,i.to)}for(var n=null,a=null,s=0;s<this.lines.length;++s){var u=this.lines[s],m=Rn(u.markedSpans,this);e&&!this.collapsed?ui(e,Gt(u),"text"):e&&(m.to!=null&&(a=Gt(u)),m.from!=null&&(n=Gt(u))),u.markedSpans=hi(u.markedSpans,m),m.from==null&&this.collapsed&&!Ri(this.doc,u)&&e&&on(u,qn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var v=0;v<this.lines.length;++v){var C=ki(this.lines[v]),Y=ha(C);Y>e.display.maxLineLength&&(e.display.maxLine=C,e.display.maxLineLength=Y,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Un(e,n,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ss(e.doc)),e&&Wn(e,"markerCleared",e,this,n,a),t&&Ma(e),this.parent&&this.parent.clear()},Ca.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,a=0;a<this.lines.length;++a){var s=this.lines[a],u=Rn(s.markedSpans,this);if(u.from!=null&&(i=je(t?s:Gt(s),u.from),e==-1))return i;if(u.to!=null&&(n=je(t?s:Gt(s),u.to),e==1))return n}return i&&{from:i,to:n}},Ca.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Ki(n,function(){var a=t.line,s=Gt(t.line),u=ga(n,s);if(u&&(Ba(u),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ri(i.doc,a)&&i.height!=null){var m=i.height;i.height=null;var v=Oa(i)-m;v&&on(a,a.height+v)}Wn(n,"markerChanged",n,e)})},Ca.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ca.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},H(Ca);function Ya(e,t,i,n,a){if(n&&n.shared)return Cl(e,t,i,n,a);if(e.cm&&!e.cm.curOp)return bi(e.cm,Ya)(e,t,i,n,a);var s=new Ca(e,a),u=Et(t,i);if(n&&f(n,s,!1),u>0||u==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=N("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(An(e,t.line,t,i,s)||t.line!=i.line&&An(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");vn()}s.addToHistory&&es(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var m=t.line,v=e.cm,C;if(e.iter(m,i.line+1,function(ae){v&&s.collapsed&&!v.options.lineWrapping&&ki(ae)==v.display.maxLine&&(C=!0),s.collapsed&&m!=t.line&&on(ae,0),xi(ae,new Zn(s,m==t.line?t.ch:null,m==i.line?i.ch:null)),++m}),s.collapsed&&e.iter(t.line,i.line+1,function(ae){Ri(e,ae)&&on(ae,0)}),s.clearOnEnter&&Ue(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Tn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++ys,s.atomic=!0),v){if(C&&(v.curOp.updateMaxLine=!0),s.collapsed)Un(v,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var Y=t.line;Y<=i.line;Y++)ui(v,Y,"text");s.atomic&&ss(v.doc),Wn(v,"markerAdded",v,s)}return s}var _o=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};_o.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wn(this,"clear")},_o.prototype.find=function(e,t){return this.primary.find(e,t)},H(_o);function Cl(e,t,i,n,a){n=f(n),n.shared=!1;var s=[Ya(e,t,i,n,a)],u=s[0],m=n.widgetNode;return Ea(e,function(v){m&&(n.widgetNode=m.cloneNode(!0)),s.push(Ya(v,o(v,t),o(v,i),n,a));for(var C=0;C<v.linked.length;++C)if(v.linked[C].isParent)return;u=he(s)}),new _o(s,u)}function bs(e){return e.findMarks(je(e.first,0),e.clipPos(je(e.lastLine())),function(t){return t.parent})}function xl(e,t){for(var i=0;i<t.length;i++){var n=t[i],a=n.find(),s=e.clipPos(a.from),u=e.clipPos(a.to);if(Et(s,u)){var m=Ya(e,s,u,n.primary,n.primary.type);n.markers.push(m),m.parent=n}}}function wl(e){for(var t=function(n){var a=e[n],s=[a.primary.doc];Ea(a.primary.doc,function(v){return s.push(v)});for(var u=0;u<a.markers.length;u++){var m=a.markers[u];se(s,m.doc)==-1&&(m.parent=null,a.markers.splice(u--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Ui=function(e,t,i,n,a){if(!(this instanceof Ui))return new Ui(e,t,i,n,a);i==null&&(i=0),yo.call(this,[new go([new zi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=je(i,0);this.sel=ba(s),this.history=new zo(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=a=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),yr(this,{from:s,to:s,text:e}),Li(this,ba(s),pe)};Ui.prototype=We(yo.prototype,{constructor:Ui,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=zt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:_i(function(e){var t=je(this.first,0),i=this.first+this.size-1;Xa(this,{from:t,to:je(i,xt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&so(this.cm,0,0),Li(this,ba(t),pe)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,$a(this,e,t,i,n)},getRange:function(e,t,i){var n=nn(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Nn(this,e))return xt(this,e)},getLineNumber:function(e){return Gt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=xt(this,e)),ki(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_i(function(e,t,i){as(this,o(this,typeof e=="number"?je(e,t||0):e),null,i)}),setSelection:_i(function(e,t,i){as(this,o(this,e),o(this,t||e),i)}),extendSelection:_i(function(e,t,i){Ko(this,o(this,e),t&&o(this,t),i)}),extendSelections:_i(function(e,t){is(this,c(this,e),t)}),extendSelectionsBy:_i(function(e,t){var i=Pe(this.sel.ranges,e);is(this,c(this,i),t)}),setSelections:_i(function(e,t,i){if(!e.length)return;for(var n=[],a=0;a<e.length;a++)n[a]=new On(o(this,e[a].anchor),o(this,e[a].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Li(this,ia(this.cm,n,t),i)}),addSelection:_i(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new On(o(this,e),o(this,t||e))),Li(this,ia(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var a=nn(this,t[n].from(),t[n].to());i=i?i.concat(a):a}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var a=nn(this,i[n].from(),i[n].to());e!==!1&&(a=a.join(e||this.lineSeparator())),t[n]=a}return t},replaceSelection:function(e,t,i){for(var n=[],a=0;a<this.sel.ranges.length;a++)n[a]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:_i(function(e,t,i){for(var n=[],a=this.sel,s=0;s<a.ranges.length;s++){var u=a.ranges[s];n[s]={from:u.from(),to:u.to(),text:this.splitLines(e[s]),origin:i}}for(var m=t&&t!="end"&&hl(this,n,t),v=n.length-1;v>=0;v--)Xa(this,n[v]);m?os(this,m):this.cm&&Ha(this.cm)}),undo:_i(function(){Xo(this,"undo")}),redo:_i(function(){Xo(this,"redo")}),undoSelection:_i(function(){Xo(this,"undo",!0)}),redoSelection:_i(function(){Xo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var a=0;a<e.undone.length;a++)e.undone[a].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new zo(this.history.maxGeneration),Ea(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:Va(this.history.done),undone:Va(this.history.undone)}},setHistory:function(e){var t=this.history=new zo(this.history.maxGeneration);t.done=Va(e.done.slice(0),null,!0),t.undone=Va(e.undone.slice(0),null,!0)},setGutterMarker:_i(function(e,t,i){return vo(this,e,"gutter",function(n){var a=n.gutterMarkers||(n.gutterMarkers={});return a[t]=i,!i&&et(a)&&(n.gutterMarkers=null),!0})}),clearGutter:_i(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&vo(t,i,"gutter",function(){return i.gutterMarkers[e]=null,et(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Nn(this,e))return null;if(t=e,e=xt(this,e),!e)return null}else if(t=Gt(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:_i(function(e,t,i){return vo(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[a])n[a]=i;else{if(Q(i).test(n[a]))return!1;n[a]+=" "+i}return!0})}),removeLineClass:_i(function(e,t,i){return vo(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[a];if(s)if(i==null)n[a]=null;else{var u=s.match(Q(i));if(!u)return!1;var m=u.index+u[0].length;n[a]=s.slice(0,u.index)+(!u.index||m==s.length?"":" ")+s.slice(m)||null}else return!1;return!0})}),addLineWidget:_i(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ya(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),Ya(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=xt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var a=i[n];(a.from==null||a.from<=e.ch)&&(a.to==null||a.to>=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],a=e.line;return this.iter(e.line,t.line+1,function(s){var u=s.markedSpans;if(u)for(var m=0;m<u.length;m++){var v=u[m];!(v.to!=null&&a==e.line&&e.ch>=v.to||v.from==null&&a!=e.line||v.from!=null&&a==t.line&&v.from>=t.ch)&&(!i||i(v.marker))&&n.push(v.marker.parent||v.marker)}++a}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(a){var s=a.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,je(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Ui(zt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Ui(zt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],xl(n,bs(this)),n},unlinkDoc:function(e){if(e instanceof Jn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(bs(this));break}if(e.history==this.history){var n=[e.id];Ea(e,function(a){return n.push(a.id)},!0),e.history=new zo(null),e.history.done=Va(this.history.done,n),e.history.undone=Va(this.history.undone,n)}},iterLinkedDocs:function(e){Ea(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Rt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:_i(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&pl(this.cm)})}),Ui.prototype.eachLine=Ui.prototype.iter;var _s=0;function kl(e){var t=this;if(Es(t),Ke(t,e)||ea(t.display,e))return;w(e),ee&&(_s=+new Date);var i=oi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var a=n.length,s=Array(a),u=0,m=function(){++u==a&&bi(t,function(){i=o(t.doc,i);var be={from:i,to:i,text:t.doc.splitLines(s.filter(function($e){return $e!=null}).join(t.doc.lineSeparator())),origin:"paste"};Xa(t.doc,be),os(t.doc,ba(o(t.doc,i),o(t.doc,_a(be))))})()},v=function(be,$e){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,be.type)==-1){m();return}var rt=new FileReader;rt.onerror=function(){return m()},rt.onload=function(){var gt=rt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(gt)){m();return}s[$e]=gt,m()},rt.readAsText(be)},C=0;C<n.length;C++)v(n[C],C);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Y=e.dataTransfer.getData("Text");if(Y){var ae;if(t.state.draggingText&&!t.state.draggingText.copy&&(ae=t.listSelections()),Vo(t.doc,ba(i,i)),ae)for(var ke=0;ke<ae.length;++ke)$a(t.doc,"",ae[ke].anchor,ae[ke].head,"drag");t.replaceSelection(Y,"around","paste"),t.display.input.focus()}}catch(be){}}}function Rl(e,t){if(ee&&(!e.state.draggingText||+new Date-_s<100)){D(t);return}if(Ke(e,t)||ea(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!le){var i=b("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",V&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),V&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=oi(e,t);if(!i)return;var n=document.createDocumentFragment();jo(e,i,n),e.display.dragCursor||(e.display.dragCursor=b("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,n)}function Es(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Cs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var a=t[n].CodeMirror;a&&i.push(a)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var xs=!1;function Pl(){if(xs)return;Tl(),xs=!0}function Tl(){var e;Ue(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Cs(Al)},100))}),Ue(window,"blur",function(){return Cs(za)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xa={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"},Eo=0;Eo<10;Eo++)xa[Eo+48]=xa[Eo+96]=String(Eo);for(var $o=65;$o<=90;$o++)xa[$o]=String.fromCharCode($o);for(var Co=1;Co<=12;Co++)xa[Co+111]=xa[Co+63235]="F"+Co;var ua={};ua.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"},ua.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"},ua.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"},ua.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"]},ua.default=E?ua.macDefault:ua.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,a,s,u=0;u<t.length-1;u++){var m=t[u];if(/^(cmd|meta|m)$/i.test(m))s=!0;else if(/^a(lt)?$/i.test(m))i=!0;else if(/^(c|ctrl|control)$/i.test(m))n=!0;else if(/^s(hift)?$/i.test(m))a=!0;else throw new Error("Unrecognized modifier name: "+m)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),a&&(e="Shift-"+e),e}function Ll(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var a=Pe(i.split(" "),Ml),s=0;s<a.length;s++){var u=void 0,m=void 0;s==a.length-1?(m=a.join(" "),u=n):(m=a.slice(0,s+1).join(" "),u="...");var v=t[m];if(!v)t[m]=u;else if(v!=u)throw new Error("Inconsistent bindings for "+m)}delete e[i]}for(var C in t)e[C]=t[C];return e}function Ja(e,t,i,n){t=Yo(t);var a=t.call?t.call(e,n):t[e];if(a===!1)return"nothing";if(a==="...")return"multi";if(a!=null&&i(a))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ja(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var u=Ja(e,t.fallthrough[s],i,n);if(u)return u}}}function ws(e){var t=typeof e=="string"?e:xa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ss(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(I?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(I?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ks(e,t){if(V&&e.keyCode==34&&e.char)return!1;var i=xa[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Ss(i,e,t))}function Yo(e){return typeof e=="string"?ua[e]:e}function Za(e,t){for(var i=e.doc.sel.ranges,n=[],a=0;a<i.length;a++){for(var s=t(i[a]);n.length&&Et(s.from,he(n).to)<=0;){var u=n.pop();if(Et(u.from,s.from)<0){s.from=u.from;break}}n.push(s)}Ki(e,function(){for(var m=n.length-1;m>=0;m--)$a(e.doc,"",n[m].from,n[m].to,"+delete");Ha(e)})}function Cr(e,t,i){var n=He(e.text,t+i,i);return n<0||n>e.text.length?null:n}function xr(e,t,i){var n=Cr(e,t.ch,i);return n==null?null:new je(t.line,n,i<0?"after":"before")}function wr(e,t,i,n,a){if(e){t.doc.direction=="rtl"&&(a=-a);var s=Ot(i,t.doc.direction);if(s){var u=a<0?he(s):s[0],m=a<0==(u.level==1),v=m?"after":"before",C;if(u.level>0||t.doc.direction=="rtl"){var Y=ya(t,i);C=a<0?i.text.length-1:0;var ae=Gi(t,Y,C).top;C=St(function(ke){return Gi(t,Y,ke).top==ae},a<0==(u.level==1)?u.from:u.to-1,C),v=="before"&&(C=Cr(i,C,1))}else C=a<0?u.to:u.from;return new je(n,C,v)}}return new je(n,a<0?i.text.length:0,a<0?"before":"after")}function Dl(e,t,i,n){var a=Ot(t,e.doc.direction);if(!a)return xr(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=dt(a,i.ch,i.sticky),u=a[s];if(e.doc.direction=="ltr"&&u.level%2==0&&(n>0?u.to>i.ch:u.from<i.ch))return xr(t,i,n);var m=function(Tt,Bt){return Cr(t,Tt instanceof je?Tt.ch:Tt,Bt)},v,C=function(Tt){return e.options.lineWrapping?(v=v||ya(e,t),Sn(e,t,v,Tt)):{begin:0,end:t.text.length}},Y=C(i.sticky=="before"?m(i,-1):i.ch);if(e.doc.direction=="rtl"||u.level==1){var ae=u.level==1==n<0,ke=m(i,ae?1:-1);if(ke!=null&&(ae?ke<=u.to&&ke<=Y.end:ke>=u.from&&ke>=Y.begin)){var be=ae?"before":"after";return new je(i.line,ke,be)}}var $e=function(Tt,Bt,At){for(var Kt=function(Bn,Ei){return Ei?new je(i.line,m(Bn,1),"before"):new je(i.line,Bn,"after")};Tt>=0&&Tt<a.length;Tt+=Bt){var qt=a[Tt],Zt=Bt>0==(qt.level!=1),un=Zt?At.begin:m(At.end,-1);if(qt.from<=un&&un<qt.to)return Kt(un,Zt);if(un=Zt?qt.from:m(qt.to,-1),At.begin<=un&&un<At.end)return Kt(un,Zt)}},rt=$e(s+n,n,Y);if(rt)return rt;var gt=n>0?Y.end:m(Y.begin,-1);return gt!=null&&!(n>0&&gt==t.text.length)&&(rt=$e(n>0?0:a.length-1,n,C(gt)),rt)?rt:null}var xo={selectAll:cs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return Za(e,function(t){if(t.empty()){var i=xt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:je(t.head.line+1,0)}:{from:t.head,to:je(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Za(e,function(t){return{from:je(t.from().line,0),to:o(e.doc,je(t.to().line+1,0))}})},delLineLeft:function(e){return Za(e,function(t){return{from:je(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Za(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Za(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Rs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Os(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},M)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},M)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Os(e,t.head):n},M)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,a=0;a<i.length;a++){var s=i[a].from(),u=R(e.getLine(s.line),s.ch,n);t.push(_(n-u%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ki(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var a=t[n].head,s=xt(e.doc,a.line).text;if(s){if(a.ch==s.length&&(a=new je(a.line,a.ch-1)),a.ch>0)a=new je(a.line,a.ch+1),e.replaceRange(s.charAt(a.ch-1)+s.charAt(a.ch-2),je(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var u=xt(e.doc,a.line-1).text;u&&(a=new je(a.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+u.charAt(u.length-1),je(a.line-1,u.length-1),a,"+transpose"))}}i.push(new On(a,a))}e.setSelections(i)})},newlineAndIndent:function(e){return Ki(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Ha(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Rs(e,t){var i=xt(e.doc,t),n=ki(i);return n!=i&&(t=Gt(n)),wr(!0,e,n,t,1)}function Nl(e,t){var i=xt(e.doc,t),n=sa(i);return n!=i&&(t=Gt(n)),wr(!0,e,i,t,-1)}function Os(e,t){var i=Rs(e,t.line),n=xt(e.doc,i.line),a=Ot(n,e.doc.direction);if(!a||a[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),u=t.line==i.line&&t.ch<=s&&t.ch;return je(i.line,u?0:s,i.sticky)}return i}function Jo(e,t,i){if(typeof t=="string"&&(t=xo[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),a=t(e)!=fe}finally{e.display.shift=n,e.state.suppressEdits=!1}return a}function jl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var a=Ja(t,e.state.keyMaps[n],i,e);if(a)return a}return e.options.extraKeys&&Ja(t,e.options.extraKeys,i,e)||Ja(t,e.options.keyMap,i,e)}var Ul=new ue;function wo(e,t,i,n){var a=e.state.keySeq;if(a){if(ws(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==a&&(e.state.keySeq=null,e.display.input.reset())}),Ps(e,a+" "+t,i,n))return!0}return Ps(e,t,i,n)}function Ps(e,t,i,n){var a=jl(e,t,n);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&Wn(e,"keyHandled",e,t,i),(a=="handled"||a=="multi")&&(w(i),sr(e)),!!a}function Ts(e,t){var i=ks(t,!0);return i?t.shiftKey&&!e.state.keySeq?wo(e,"Shift-"+i,t,function(n){return Jo(e,n,!0)})||wo(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Jo(e,n)}):wo(e,i,t,function(n){return Jo(e,n)}):!1}function Il(e,t,i){return wo(e,"'"+i+"'",t,function(n){return Jo(e,n,!0)})}var Sr=null;function As(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=J(),Ke(t,e))return;ee&&B<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Ts(t,e);V&&(Sr=n?i:null,!n&&i==88&&!jt&&(E?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ge&&!E&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;ye(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(S(t,"CodeMirror-crosshair"),kt(document,"keyup",i),kt(document,"mouseover",i))}Ue(document,"keyup",i),Ue(document,"mouseover",i)}function Ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,e)}function Ls(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ea(t.display,e)||Ke(t,e)||e.ctrlKey&&!e.altKey||E&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(V&&i==Sr){Sr=null,w(e);return}if(V&&(!e.which||e.which<10)&&Ts(t,e))return;var a=String.fromCharCode(n==null?i:n);if(a=="\b")return;if(Il(t,e,a))return;t.display.input.onKeyPress(e)}var Fl=400,kr=function(e,t,i){this.time=e,this.pos=t,this.button=i};kr.prototype.compare=function(e,t,i){return this.time+Fl>e&&Et(t,this.pos)==0&&i==this.button};var So,ko;function Wl(e,t){var i=+new Date;return ko&&ko.compare(i,e,t)?(So=ko=null,"triple"):So&&So.compare(i,e,t)?(ko=new kr(i,e,t),So=null,"double"):(So=new kr(i,e,t),ko=null,"single")}function Ds(e){var t=this,i=t.display;if(Ke(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,ea(i,e)){F||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Rr(t,e))return;var n=oi(t,e),a=ne(e),s=n?Wl(n,a):"single";if(window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,a,n,s,e))return;a==1?n?Kl(t,n,s,e):ve(e)==i.scroller&&w(e):a==2?(n&&Ko(t.doc,n),setTimeout(function(){return i.input.focus()},20)):a==3&&(g?t.display.input.onContextMenu(e):Nr(t))}function zl(e,t,i,n,a){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,wo(e,Ss(s,a),a,function(u){if(typeof u=="string"&&(u=xo[u]),!u)return!1;var m=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),m=u(e,i)!=fe}finally{e.state.suppressEdits=!1}return m})}function Hl(e,t,i){var n=e.getOption("configureMouse"),a=n?n(e,t,i):{};if(a.unit==null){var s=me?i.shiftKey&&i.metaKey:i.altKey;a.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||i.shiftKey),a.addNew==null&&(a.addNew=E?i.metaKey:i.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(E?i.altKey:i.ctrlKey)),a}function Kl(e,t,i,n){ee?setTimeout(k(Dr,e),0):e.curOp.focus=J();var a=Hl(e,i,n),s=e.doc.sel,u;e.options.dragDrop&&xe&&!e.isReadOnly()&&i=="single"&&(u=s.contains(t))>-1&&(Et((u=s.ranges[u]).from(),t)<0||t.xRel>0)&&(Et(u.to(),t)>0||t.xRel<0)?Vl(e,n,t,a):Gl(e,n,t,a)}function Vl(e,t,i,n){var a=e.display,s=!1,u=bi(e,function(C){F&&(a.scroller.draggable=!1),e.state.draggingText=!1,kt(a.wrapper.ownerDocument,"mouseup",u),kt(a.wrapper.ownerDocument,"mousemove",m),kt(a.scroller,"dragstart",v),kt(a.scroller,"drop",u),s||(w(C),n.addNew||Ko(e.doc,i,null,null,n.extend),F&&!le||ee&&B==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),m=function(C){s=s||Math.abs(t.clientX-C.clientX)+Math.abs(t.clientY-C.clientY)>=10},v=function(){return s=!0};F&&(a.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),Ue(a.wrapper.ownerDocument,"mouseup",u),Ue(a.wrapper.ownerDocument,"mousemove",m),Ue(a.scroller,"dragstart",v),Ue(a.scroller,"drop",u),Nr(e),setTimeout(function(){return a.input.focus()},20)}function Ns(e,t,i){if(i=="char")return new On(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new On(je(t.line,0),o(e.doc,je(t.line+1,0)));var n=i(e,t);return new On(n.from,n.to)}function Gl(e,t,i,n){var a=e.display,s=e.doc;w(t);var u,m,v=s.sel,C=v.ranges;if(n.addNew&&!n.extend?(m=s.sel.contains(i),m>-1?u=C[m]:u=new On(i,i)):(u=s.sel.primary(),m=s.sel.primIndex),n.unit=="rectangle")n.addNew||(u=new On(i,i)),i=oi(e,t,!0,!0),m=-1;else{var Y=Ns(e,i,n.unit);n.extend?u=_r(u,Y.anchor,Y.head,n.extend):u=Y}n.addNew?m==-1?(m=C.length,Li(s,ia(e,C.concat([u]),m),{scroll:!1,origin:"*mouse"})):C.length>1&&C[m].empty()&&n.unit=="char"&&!n.extend?(Li(s,ia(e,C.slice(0,m).concat(C.slice(m+1)),0),{scroll:!1,origin:"*mouse"}),v=s.sel):Er(s,m,u,j):(m=0,Li(s,new $i([u],0),j),v=s.sel);var ae=i;function ke(At){if(Et(ae,At)==0)return;if(ae=At,n.unit=="rectangle"){for(var Kt=[],qt=e.options.tabSize,Zt=R(xt(s,i.line).text,i.ch,qt),un=R(xt(s,At.line).text,At.ch,qt),Bn=Math.min(Zt,un),Ei=Math.max(Zt,un),ei=Math.min(i.line,At.line),Vi=Math.min(e.lastLine(),Math.max(i.line,At.line));ei<=Vi;ei++){var Ii=xt(s,ei).text,ci=re(Ii,Bn,qt);Bn==Ei?Kt.push(new On(je(ei,ci),je(ei,ci))):Ii.length>ci&&Kt.push(new On(je(ei,ci),je(ei,re(Ii,Ei,qt))))}Kt.length||Kt.push(new On(i,i)),Li(s,ia(e,v.ranges.slice(0,m).concat(Kt),m),{origin:"*mouse",scroll:!1}),e.scrollIntoView(At)}else{var Bi=u,wi=Ns(e,At,n.unit),mi=Bi.anchor,di;Et(wi.anchor,mi)>0?(di=wi.head,mi=jn(Bi.from(),wi.anchor)):(di=wi.anchor,mi=Pn(Bi.to(),wi.head));var ri=v.ranges.slice(0);ri[m]=Xl(e,new On(o(s,mi),di)),Li(s,ia(e,ri,m),j)}}var be=a.wrapper.getBoundingClientRect(),$e=0;function rt(At){var Kt=++$e,qt=oi(e,At,!0,n.unit=="rectangle");if(!qt)return;if(Et(qt,ae)!=0){e.curOp.focus=J(),ke(qt);var Zt=Io(a,s);(qt.line>=Zt.to||qt.line<Zt.from)&&setTimeout(bi(e,function(){$e==Kt&&rt(At)}),150)}else{var un=At.clientY<be.top?-20:At.clientY>be.bottom?20:0;un&&setTimeout(bi(e,function(){if($e!=Kt)return;a.scroller.scrollTop+=un,rt(At)}),50)}}function gt(At){e.state.selectingText=!1,$e=Infinity,At&&(w(At),a.input.focus()),kt(a.wrapper.ownerDocument,"mousemove",Tt),kt(a.wrapper.ownerDocument,"mouseup",Bt),s.history.lastSelOrigin=null}var Tt=bi(e,function(At){At.buttons===0||!ne(At)?gt(At):rt(At)}),Bt=bi(e,gt);e.state.selectingText=Bt,Ue(a.wrapper.ownerDocument,"mousemove",Tt),Ue(a.wrapper.ownerDocument,"mouseup",Bt)}function Xl(e,t){var i=t.anchor,n=t.head,a=xt(e.doc,i.line);if(Et(i,n)==0&&i.sticky==n.sticky)return t;var s=Ot(a);if(!s)return t;var u=dt(s,i.ch,i.sticky),m=s[u];if(m.from!=i.ch&&m.to!=i.ch)return t;var v=u+(m.from==i.ch==(m.level!=1)?0:1);if(v==0||v==s.length)return t;var C;if(n.line!=i.line)C=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Y=dt(s,n.ch,n.sticky),ae=Y-u||(n.ch-i.ch)*(m.level==1?-1:1);Y==v-1||Y==v?C=ae<0:C=ae>0}var ke=s[v+(C?-1:0)],be=C==(ke.level==1),$e=be?ke.from:ke.to,rt=be?"after":"before";return i.ch==$e&&i.sticky==rt?t:new On(new je(i.line,$e,rt),n)}function js(e,t,i,n){var a,s;if(t.touches)a=t.touches[0].clientX,s=t.touches[0].clientY;else try{a=t.clientX,s=t.clientY}catch(ke){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&w(t);var u=e.display,m=u.lineDiv.getBoundingClientRect();if(s>m.bottom||!G(e,i))return L(t);s-=m.top-u.viewOffset;for(var v=0;v<e.display.gutterSpecs.length;++v){var C=u.gutters.childNodes[v];if(C&&C.getBoundingClientRect().right>=a){var Y=Dn(e.doc,s),ae=e.display.gutterSpecs[v];return Be(e,i,e,Y,ae.className,t),L(t)}}}function Rr(e,t){return js(e,t,"gutterClick",!0)}function Us(e,t){if(ea(e.display,t)||$l(e,t))return;if(Ke(e,t,"contextmenu"))return;g||e.display.input.onContextMenu(t)}function $l(e,t){return G(e,"gutterContextMenu")?js(e,t,"gutterContextMenu",!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pt(e)}var Qa={toString:function(){return"CodeMirror.Init"}},Bs={},Zo={};function Yl(e){var t=e.optionHandlers;function i(n,a,s,u){e.defaults[n]=a,s&&(t[n]=u?function(m,v,C){C!=Qa&&s(m,v,C)}:s)}e.defineOption=i,e.Init=Qa,i("value","",function(n,a){return n.setValue(a)},!0),i("mode",null,function(n,a){n.doc.modeOption=a,gr(n)},!0),i("indentUnit",2,gr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){fo(n),pt(n),Un(n)},!0),i("lineSeparator",null,function(n,a){if(n.doc.lineSep=a,!a)return;var s=[],u=n.doc.first;n.doc.iter(function(v){for(var C=0;;){var Y=v.text.indexOf(a,C);if(Y==-1)break;C=Y+a.length,s.push(je(u,Y))}u++});for(var m=s.length-1;m>=0;m--)$a(n.doc,a,s[m],je(s[m].line,s[m].ch+a.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,a,s){n.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),s!=Qa&&n.refresh()}),i("specialCharPlaceholder",bn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",te?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,a){return n.getInputField().spellcheck=a},!0),i("autocorrect",!1,function(n,a){return n.getInputField().autocorrect=a},!0),i("autocapitalize",!1,function(n,a){return n.getInputField().autocapitalize=a},!0),i("rtlMoveVisually",!Ce),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Is(n),po(n)},!0),i("keyMap","default",function(n,a,s){var u=Yo(a),m=s!=Qa&&Yo(s);m&&m.detach&&m.detach(n,u),u.attach&&u.attach(n,m||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,a){n.display.gutterSpecs=mr(a,n.options.lineNumbers),po(n)},!0),i("fixedGutter",!0,function(n,a){n.display.gutters.style.left=a?rn(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Ka(n)},!0),i("scrollbarStyle","native",function(n){Wr(n),Ka(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,a){n.display.gutterSpecs=mr(n.options.gutters,a),po(n)},!0),i("firstLineNumber",1,po,!0),i("lineNumberFormatter",function(n){return n},po,!0),i("showCursorWhenSelecting",!1,Mi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,a){a=="nocursor"&&(za(n),n.display.input.blur()),n.display.input.readOnlyChanged(a)}),i("screenReaderLabel",null,function(n,a){a=a===""?null:a,n.display.input.screenReaderLabelChanged(a)}),i("disableInput",!1,function(n,a){a||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Mi,!0),i("singleCursorHeightPerLine",!0,Mi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,fo,!0),i("addModeClass",!1,fo,!0),i("pollInterval",100),i("undoDepth",200,function(n,a){return n.doc.history.undoDepth=a}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,fo,!0),i("moveInputWithCursor",!0,function(n,a){a||n.display.input.resetPosition()}),i("tabindex",null,function(n,a){return n.display.input.getField().tabIndex=a||""}),i("autofocus",null),i("direction","ltr",function(n,a){return n.doc.setDirection(a)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=Qa;if(!t!=!n){var a=e.display.dragFunctions,s=t?Ue:kt;s(e.display.scroller,"dragstart",a.start),s(e.display.scroller,"dragenter",a.enter),s(e.display.scroller,"dragover",a.over),s(e.display.scroller,"dragleave",a.leave),s(e.display.scroller,"drop",a.drop)}}function Zl(e){e.options.lineWrapping?(ye(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),ka(e)),zn(e),Un(e),pt(e),setTimeout(function(){return Ka(e)},100)}function Jn(e,t){var i=this;if(!(this instanceof Jn))return new Jn(e,t);this.options=t=t?f(t):{},f(Bs,t,!1);var n=t.value;typeof n=="string"?n=new Ui(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var a=new Jn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,a,t);s.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(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 ue,keySeq:null,specialChars:null},t.autofocus&&!te&&s.input.focus(),ee&&B<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Pl(),Aa(this),this.curOp.forceUpdate=!0,Zr(this,n),t.autofocus&&!te||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&lr(i)},20):za(this);for(var u in Zo)Zo.hasOwnProperty(u)&&Zo[u](this,t[u],Qa);Kr(this),t.finishInit&&t.finishInit(this);for(var m=0;m<Or.length;++m)Or[m](this);Ma(this),F&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Jn.defaults=Bs,Jn.optionHandlers=Zo;function Ql(e){var t=e.display;Ue(t.scroller,"mousedown",bi(e,Ds)),ee&&B<11?Ue(t.scroller,"dblclick",bi(e,function(v){if(Ke(e,v))return;var C=oi(e,v);if(!C||Rr(e,v)||ea(e.display,v))return;w(v);var Y=e.findWordAt(C);Ko(e.doc,Y.anchor,Y.head)})):Ue(t.scroller,"dblclick",function(v){return Ke(e,v)||w(v)}),Ue(t.scroller,"contextmenu",function(v){return Us(e,v)}),Ue(t.input.getField(),"contextmenu",function(v){t.scroller.contains(v.target)||Us(e,v)});var i,n={end:0};function a(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(v){if(v.touches.length!=1)return!1;var C=v.touches[0];return C.radiusX<=1&&C.radiusY<=1}function u(v,C){if(C.left==null)return!0;var Y=C.left-v.left,ae=C.top-v.top;return Y*Y+ae*ae>20*20}Ue(t.scroller,"touchstart",function(v){if(!Ke(e,v)&&!s(v)&&!Rr(e,v)){t.input.ensurePolled(),clearTimeout(i);var C=+new Date;t.activeTouch={start:C,moved:!1,prev:C-n.end<=300?n:null},v.touches.length==1&&(t.activeTouch.left=v.touches[0].pageX,t.activeTouch.top=v.touches[0].pageY)}}),Ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ue(t.scroller,"touchend",function(v){var C=t.activeTouch;if(C&&!ea(t,v)&&C.left!=null&&!C.moved&&new Date-C.start<300){var Y=e.coordsChar(t.activeTouch,"page"),ae;!C.prev||u(C,C.prev)?ae=new On(Y,Y):!C.prev.prev||u(C,C.prev.prev)?ae=e.findWordAt(Y):ae=new On(je(Y.line,0),o(e.doc,je(Y.line+1,0))),e.setSelection(ae.anchor,ae.head),e.focus(),w(v)}a()}),Ue(t.scroller,"touchcancel",a),Ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(lo(e,t.scroller.scrollTop),Pa(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Ue(t.scroller,"mousewheel",function(v){return Xr(e,v)}),Ue(t.scroller,"DOMMouseScroll",function(v){return Xr(e,v)}),Ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){Ke(e,v)||D(v)},over:function(v){Ke(e,v)||(Ol(e,v),D(v))},start:function(v){return Rl(e,v)},drop:bi(e,kl),leave:function(v){Ke(e,v)||Es(e)}};var m=t.input.getField();Ue(m,"keyup",function(v){return Ms.call(e,v)}),Ue(m,"keydown",bi(e,As)),Ue(m,"keypress",bi(e,Ls)),Ue(m,"focus",function(v){return lr(e,v)}),Ue(m,"blur",function(v){return za(e,v)})}var Or=[];Jn.defineInitHook=function(e){return Or.push(e)};function Ro(e,t,i,n){var a=e.doc,s;i==null&&(i="add"),i=="smart"&&(a.mode.indent?s=Ct(e,t).state:i="prev");var u=e.options.tabSize,m=xt(a,t),v=R(m.text,null,u);m.stateAfter&&(m.stateAfter=null);var C=m.text.match(/^\s*/)[0],Y;if(!n&&!/\S/.test(m.text))Y=0,i="not";else if(i=="smart"&&(Y=a.mode.indent(s,m.text.slice(C.length),m.text),Y==fe||Y>150)){if(!n)return;i="prev"}i=="prev"?t>a.first?Y=R(xt(a,t-1).text,null,u):Y=0:i=="add"?Y=v+e.options.indentUnit:i=="subtract"?Y=v-e.options.indentUnit:typeof i=="number"&&(Y=v+i),Y=Math.max(0,Y);var ae="",ke=0;if(e.options.indentWithTabs)for(var be=Math.floor(Y/u);be;--be)ke+=u,ae+=" ";if(ke<Y&&(ae+=_(Y-ke)),ae!=C)return $a(a,ae,je(t,0),je(t,C.length),"+input"),m.stateAfter=null,!0;for(var $e=0;$e<a.sel.ranges.length;$e++){var rt=a.sel.ranges[$e];if(rt.head.line==t&&rt.head.ch<C.length){var gt=je(t,C.length);Er(a,$e,new On(gt,gt));break}}}var aa=null;function Qo(e){aa=e}function Pr(e,t,i,n,a){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var u=+new Date-200,m=a=="paste"||e.state.pasteIncoming>u,v=Rt(t),C=null;if(m&&n.ranges.length>1)if(aa&&aa.text.join(`
`)==t){if(n.ranges.length%aa.text.length==0){C=[];for(var Y=0;Y<aa.text.length;Y++)C.push(s.splitLines(aa.text[Y]))}}else v.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(C=Pe(v,function(Tt){return[Tt]}));for(var ae=e.curOp.updateInput,ke=n.ranges.length-1;ke>=0;ke--){var be=n.ranges[ke],$e=be.from(),rt=be.to();be.empty()&&(i&&i>0?$e=je($e.line,$e.ch-i):e.state.overwrite&&!m?rt=je(rt.line,Math.min(xt(s,rt.line).text.length,rt.ch+he(v).length)):m&&aa&&aa.lineWise&&aa.text.join(`
`)==v.join(`
`)&&($e=rt=je($e.line,0)));var gt={from:$e,to:rt,text:C?C[ke%C.length]:v,origin:a||(m?"paste":e.state.cutIncoming>u?"cut":"+input")};Xa(e.doc,gt),Wn(e,"inputRead",e,gt)}t&&!m&&Ws(e,t),Ha(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ae),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Fs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ki(t,function(){return Pr(t,i,0,null,"paste")}),!0}function Ws(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var a=i.ranges[n];if(a.head.ch>100||n&&i.ranges[n-1].head.line==a.head.line)continue;var s=e.getModeAt(a.head),u=!1;if(s.electricChars){for(var m=0;m<s.electricChars.length;m++)if(t.indexOf(s.electricChars.charAt(m))>-1){u=Ro(e,a.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(xt(e.doc,a.head.line).text.slice(0,a.head.ch))&&(u=Ro(e,a.head.line,"smart")));u&&Wn(e,"electricInput",e,a.head.line)}}function zs(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var a=e.doc.sel.ranges[n].head.line,s={anchor:je(a,0),head:je(a+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Hs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ks(){var e=b("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=b("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return F?e.style.width="1000px":e.setAttribute("wrap","off"),$&&(e.style.border="1px solid black"),Hs(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,a){var s=this.options,u=s[n];if(s[n]==a&&n!="mode")return;s[n]=a,t.hasOwnProperty(n)&&bi(this,t[n])(this,a,u),Be(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,a){this.state.keyMaps[a?"push":"unshift"](Yo(n))},removeKeyMap:function(n){for(var a=this.state.keyMaps,s=0;s<a.length;++s)if(a[s]==n||a[s].name==n)return a.splice(s,1),!0},addOverlay:Ni(function(n,a){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");Je(this.state.overlays,{mode:s,modeSpec:n,opaque:a&&a.opaque,priority:a&&a.priority||0},function(u){return u.priority}),this.state.modeGen++,Un(this)}),removeOverlay:Ni(function(n){for(var a=this.state.overlays,s=0;s<a.length;++s){var u=a[s].modeSpec;if(u==n||typeof n=="string"&&u.name==n){a.splice(s,1),this.state.modeGen++,Un(this);return}}}),indentLine:Ni(function(n,a,s){typeof a!="string"&&typeof a!="number"&&(a==null?a=this.options.smartIndent?"smart":"prev":a=a?"add":"subtract"),Nn(this.doc,n)&&Ro(this,n,a,s)}),indentSelection:Ni(function(n){for(var a=this.doc.sel.ranges,s=-1,u=0;u<a.length;u++){var m=a[u];if(m.empty())m.head.line>s&&(Ro(this,m.head.line,n,!0),s=m.head.line,u==this.doc.sel.primIndex&&Ha(this));else{var v=m.from(),C=m.to(),Y=Math.max(s,v.line);s=Math.min(this.lastLine(),C.line-(C.ch?0:1))+1;for(var ae=Y;ae<s;++ae)Ro(this,ae,n);var ke=this.doc.sel.ranges;v.ch==0&&a.length==ke.length&&ke[u].from().ch>0&&Er(this.doc,u,new On(v,ke[u].to()),pe)}}}),getTokenAt:function(n,a){return nt(this,n,a)},getLineTokens:function(n,a){return nt(this,je(n),a,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var a=Qe(this,xt(this.doc,n.line)),s=0,u=(a.length-1)/2,m=n.ch,v;if(m==0)v=a[2];else for(;;){var C=s+u>>1;if((C?a[C*2-1]:0)>=m)u=C;else if(a[C*2+1]<m)s=C+1;else{v=a[C*2+2];break}}var Y=v?v.indexOf("overlay "):-1;return Y<0?v:Y==0?null:v.slice(0,Y-1)},getModeAt:function(n){var a=this.doc.mode;return a.innerMode?e.innerMode(a,this.getTokenAt(n).state).mode:a},getHelper:function(n,a){return this.getHelpers(n,a)[0]},getHelpers:function(n,a){var s=[];if(!i.hasOwnProperty(a))return s;var u=i[a],m=this.getModeAt(n);if(typeof m[a]=="string")u[m[a]]&&s.push(u[m[a]]);else if(m[a])for(var v=0;v<m[a].length;v++){var C=u[m[a][v]];C&&s.push(C)}else m.helperType&&u[m.helperType]?s.push(u[m.helperType]):u[m.name]&&s.push(u[m.name]);for(var Y=0;Y<u._global.length;Y++){var ae=u._global[Y];ae.pred(m,this)&&se(s,ae.val)==-1&&s.push(ae.val)}return s},getStateAfter:function(n,a){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),Ct(this,n+1,a).state},cursorCoords:function(n,a){var s,u=this.doc.sel.primary();return n==null?s=u.head:typeof n=="object"?s=o(this.doc,n):s=n?u.from():u.to(),Vt(this,s,a||"page")},charCoords:function(n,a){return Pt(this,o(this.doc,n),a||"page")},coordsChar:function(n,a){return n=yt(this,n,a||"page"),Cn(this,n.left,n.top)},lineAtHeight:function(n,a){return n=yt(this,{top:n,left:0},a||"page").top,Dn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,a,s){var u=!1,m;if(typeof n=="number"){var v=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>v&&(n=v,u=!0),m=xt(this.doc,n)}else m=n;return mt(this,m,{top:0,left:0},a||"page",s||u).top+(u?this.doc.height-Oi(m):0)},defaultTextHeight:function(){return qn(this.display)},defaultCharWidth:function(){return ai(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,a,s,u,m){var v=this.display;n=Vt(this,o(this.doc,n));var C=n.bottom,Y=n.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),v.sizer.appendChild(a),u=="over")C=n.top;else if(u=="above"||u=="near"){var ae=Math.max(v.wrapper.clientHeight,this.doc.height),ke=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(u=="above"||n.bottom+a.offsetHeight>ae)&&n.top>a.offsetHeight?C=n.top-a.offsetHeight:n.bottom+a.offsetHeight<=ae&&(C=n.bottom),Y+a.offsetWidth>ke&&(Y=ke-a.offsetWidth)}a.style.top=C+"px",a.style.left=a.style.right="",m=="right"?(Y=v.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(m=="left"?Y=0:m=="middle"&&(Y=(v.sizer.clientWidth-a.offsetWidth)/2),a.style.left=Y+"px"),s&&Js(this,{left:Y,top:C,right:Y+a.offsetWidth,bottom:C+a.offsetHeight})},triggerOnKeyDown:Ni(As),triggerOnKeyPress:Ni(Ls),triggerOnKeyUp:Ms,triggerOnMouseDown:Ni(Ds),execCommand:function(n){if(xo.hasOwnProperty(n))return xo[n].call(null,this)},triggerElectric:Ni(function(n){Ws(this,n)}),findPosH:function(n,a,s,u){var m=1;a<0&&(m=-1,a=-a);for(var v=o(this.doc,n),C=0;C<a&&!(v=Tr(this.doc,v,m,s,u),v.hitSide);++C);return v},moveH:Ni(function(n,a){var s=this;this.extendSelectionsBy(function(u){return s.display.shift||s.doc.extend||u.empty()?Tr(s.doc,u.head,n,a,s.options.rtlMoveVisually):n<0?u.from():u.to()},M)}),deleteH:Ni(function(n,a){var s=this.doc.sel,u=this.doc;s.somethingSelected()?u.replaceSelection("",null,"+delete"):Za(this,function(m){var v=Tr(u,m.head,n,a,!1);return n<0?{from:v,to:m.head}:{from:m.head,to:v}})}),findPosV:function(n,a,s,u){var m=1,v=u;a<0&&(m=-1,a=-a);for(var C=o(this.doc,n),Y=0;Y<a;++Y){var ae=Vt(this,C,"div");if(v==null?v=ae.left:ae.left=v,C=Vs(this,ae,m,s),C.hitSide)break}return C},moveV:Ni(function(n,a){var s=this,u=this.doc,m=[],v=!this.display.shift&&!u.extend&&u.sel.somethingSelected();if(u.extendSelectionsBy(function(Y){if(v)return n<0?Y.from():Y.to();var ae=Vt(s,Y.head,"div");Y.goalColumn!=null&&(ae.left=Y.goalColumn),m.push(ae.left);var ke=Vs(s,ae,n,a);return a=="page"&&Y==u.sel.primary()&&cr(s,Pt(s,ke,"div").top-ae.top),ke},M),m.length)for(var C=0;C<u.sel.ranges.length;C++)u.sel.ranges[C].goalColumn=m[C]}),findWordAt:function(n){var a=this.doc,s=xt(a,n.line).text,u=n.ch,m=n.ch;if(s){var v=this.getHelper(n,"wordChars");(n.sticky=="before"||m==s.length)&&u?--u:++m;for(var C=s.charAt(u),Y=Ve(C,v)?function(ae){return Ve(ae,v)}:/\s/.test(C)?function(ae){return/\s/.test(ae)}:function(ae){return!/\s/.test(ae)&&!Ve(ae)};u>0&&Y(s.charAt(u-1));)--u;for(;m<s.length&&Y(s.charAt(m));)++m}return new On(je(n.line,u),je(n.line,m))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?ye(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),Be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==J()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ni(function(n,a){so(this,n,a)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Zi(this)-this.display.barHeight,width:n.scrollWidth-Zi(this)-this.display.barWidth,clientHeight:ao(this),clientWidth:la(this)}},scrollIntoView:Ni(function(n,a){n==null?(n={from:this.doc.sel.primary().head,to:null},a==null&&(a=this.options.cursorScrollMargin)):typeof n=="number"?n={from:je(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=a||0,n.from.line!=null?Zs(this,n):Ur(this,n.from,n.to,n.margin)}),setSize:Ni(function(n,a){var s=this,u=function(v){return typeof v=="number"||/^\d+$/.test(String(v))?v+"px":v};n!=null&&(this.display.wrapper.style.width=u(n)),a!=null&&(this.display.wrapper.style.height=u(a)),this.options.lineWrapping&&Fa(this);var m=this.display.viewFrom;this.doc.iter(m,this.display.viewTo,function(v){if(v.widgets){for(var C=0;C<v.widgets.length;C++)if(v.widgets[C].noHScroll){ui(s,m,"widget");break}}++m}),this.curOp.forceUpdate=!0,Be(this,"refresh",this)}),operation:function(n){return Ki(this,n)},startOperation:function(){return Aa(this)},endOperation:function(){return Ma(this)},refresh:Ni(function(){var n=this.display.cachedTextHeight;Un(this),this.curOp.forceUpdate=!0,pt(this),so(this,this.doc.scrollLeft,this.doc.scrollTop),pr(this.display),(n==null||Math.abs(n-qn(this.display))>.5||this.options.lineWrapping)&&zn(this),Be(this,"refresh",this)}),swapDoc:Ni(function(n){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Zr(this,n),pt(this),this.display.input.reset(),so(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Wn(this,"swapDoc",this,a),a}),phrase:function(n){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,n)?a[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},H(e),e.registerHelper=function(n,a,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][a]=s},e.registerGlobalHelper=function(n,a,s,u){e.registerHelper(n,a,u),i[n]._global.push({pred:s,val:u})}}function Tr(e,t,i,n,a){var s=t,u=i,m=xt(e,t.line),v=a&&e.direction=="rtl"?-i:i;function C(){var Bt=t.line+v;return Bt<e.first||Bt>=e.first+e.size?!1:(t=new je(Bt,t.ch,t.sticky),m=xt(e,Bt))}function Y(Bt){var At;if(n=="codepoint"){var Kt=m.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Kt)?At=null:At=new je(t.line,Math.max(0,Math.min(m.text.length,t.ch+i*(Kt>=55296&&Kt<56320?2:1))),-i)}else a?At=Dl(e.cm,m,t,i):At=xr(m,t,i);if(At==null)if(!Bt&&C())t=wr(a,e.cm,m,t.line,v);else return!1;else t=At;return!0}if(n=="char"||n=="codepoint")Y();else if(n=="column")Y(!0);else if(n=="word"||n=="group")for(var ae=null,ke=n=="group",be=e.cm&&e.cm.getHelper(t,"wordChars"),$e=!0;!(i<0&&!Y(!$e));$e=!1){var rt=m.text.charAt(t.ch)||`
`,gt=Ve(rt,be)?"w":ke&&rt==`
`?"n":!ke||/\s/.test(rt)?null:"p";if(ke&&!$e&&!gt&&(gt="s"),ae&&ae!=gt){i<0&&(i=1,Y(),t.sticky="after");break}if(gt&&(ae=gt),i>0&&!Y(!$e))break}var Tt=Go(e,t,s,u,!0);return sn(s,Tt)&&(Tt.hitSide=!0),Tt}function Vs(e,t,i,n){var a=e.doc,s=t.left,u;if(n=="page"){var m=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),v=Math.max(m-.5*qn(e.display),3);u=(i>0?t.bottom:t.top)+i*v}else n=="line"&&(u=i>0?t.bottom+3:t.top-3);for(var C;!(C=Cn(e,s,u),!C.outside);){if(i<0?u<=0:u>=a.height){C.hitSide=!0;break}u+=i*5}return C}var Ln=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ln.prototype.init=function(e){var t=this,i=this,n=i.cm,a=i.div=e.lineDiv;Hs(a,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(m){for(var v=m.target;v;v=v.parentNode){if(v==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}Ue(a,"paste",function(m){if(!s(m)||Ke(n,m)||Fs(m,n))return;B<=11&&setTimeout(bi(n,function(){return t.updateFromDOM()}),20)}),Ue(a,"compositionstart",function(m){t.composing={data:m.data,done:!1}}),Ue(a,"compositionupdate",function(m){t.composing||(t.composing={data:m.data,done:!1})}),Ue(a,"compositionend",function(m){t.composing&&(m.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ue(a,"touchstart",function(){return i.forceCompositionEnd()}),Ue(a,"input",function(){t.composing||t.readFromDOMSoon()});function u(m){if(!s(m)||Ke(n,m))return;if(n.somethingSelected())Qo({lineWise:!1,text:n.getSelections()}),m.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var v=zs(n);Qo({lineWise:!0,text:v.text}),m.type=="cut"&&n.operation(function(){n.setSelections(v.ranges,0,pe),n.replaceSelection("",null,"cut")})}else return;if(m.clipboardData){m.clipboardData.clearData();var C=aa.text.join(`
`);if(m.clipboardData.setData("Text",C),m.clipboardData.getData("Text")==C){m.preventDefault();return}}var Y=Ks(),ae=Y.firstChild;n.display.lineSpace.insertBefore(Y,n.display.lineSpace.firstChild),ae.value=aa.text.join(`
`);var ke=document.activeElement;_e(ae),setTimeout(function(){n.display.lineSpace.removeChild(Y),ke.focus(),ke==a&&i.showPrimarySelection()},50)}Ue(a,"copy",u),Ue(a,"cut",u)},Ln.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ln.prototype.prepareSelection=function(){var e=na(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ln.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ln.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ln.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),a=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var s=qo(t,e.anchorNode,e.anchorOffset),u=qo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&u&&!u.bad&&Et(jn(s,u),n)==0&&Et(Pn(s,u),a)==0)return;var m=t.display.view,v=n.line>=t.display.viewFrom&&Gs(t,n)||{node:m[0].measure.map[2],offset:0},C=a.line<t.display.viewTo&&Gs(t,a);if(!C){var Y=m[m.length-1].measure,ae=Y.maps?Y.maps[Y.maps.length-1]:Y.map;C={node:ae[ae.length-1],offset:ae[ae.length-2]-ae[ae.length-3]}}if(!v||!C){e.removeAllRanges();return}var ke=e.rangeCount&&e.getRangeAt(0),be;try{be=T(v.node,v.offset,C.offset,C.node)}catch($e){}be&&(!ge&&t.state.focused?(e.collapse(v.node,v.offset),be.collapsed||(e.removeAllRanges(),e.addRange(be))):(e.removeAllRanges(),e.addRange(be)),ke&&e.anchorNode==null?e.addRange(ke):ge&&this.startGracePeriod()),this.rememberSelection()},Ln.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ln.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},Ln.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ln.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},Ln.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ln.prototype.blur=function(){this.div.blur()},Ln.prototype.getField=function(){return this.div},Ln.prototype.supportsTouch=function(){return!0},Ln.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ki(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Ln.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ln.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(U&&W&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=qo(t,e.anchorNode,e.anchorOffset),n=qo(t,e.focusNode,e.focusOffset);i&&n&&Ki(t,function(){Li(t.doc,ba(i,n),pe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Ln.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),a=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=je(n.line-1,xt(e.doc,n.line-1).length)),a.ch==xt(e.doc,a.line).text.length&&a.line<e.lastLine()&&(a=je(a.line+1,0)),n.line<t.viewFrom||a.line>t.viewTo-1)return!1;var s,u,m;n.line==t.viewFrom||(s=Vn(e,n.line))==0?(u=Gt(t.view[0].line),m=t.view[0].node):(u=Gt(t.view[s].line),m=t.view[s-1].node.nextSibling);var v=Vn(e,a.line),C,Y;if(v==t.view.length-1?(C=t.viewTo-1,Y=t.lineDiv.lastChild):(C=Gt(t.view[v+1].line)-1,Y=t.view[v+1].node.previousSibling),!m)return!1;for(var ae=e.doc.splitLines(tu(e,m,Y,u,C)),ke=nn(e.doc,je(u,0),je(C,xt(e.doc,C).text.length));ae.length>1&&ke.length>1;)if(he(ae)==he(ke))ae.pop(),ke.pop(),C--;else if(ae[0]==ke[0])ae.shift(),ke.shift(),u++;else break;for(var be=0,$e=0,rt=ae[0],gt=ke[0],Tt=Math.min(rt.length,gt.length);be<Tt&&rt.charCodeAt(be)==gt.charCodeAt(be);)++be;for(var Bt=he(ae),At=he(ke),Kt=Math.min(Bt.length-(ae.length==1?be:0),At.length-(ke.length==1?be:0));$e<Kt&&Bt.charCodeAt(Bt.length-$e-1)==At.charCodeAt(At.length-$e-1);)++$e;if(ae.length==1&&ke.length==1&&u==n.line)for(;be&&be>n.ch&&Bt.charCodeAt(Bt.length-$e-1)==At.charCodeAt(At.length-$e-1);)be--,$e++;ae[ae.length-1]=Bt.slice(0,Bt.length-$e).replace(/^\u200b+/,""),ae[0]=ae[0].slice(be).replace(/\u200b+$/,"");var qt=je(u,be),Zt=je(C,ke.length?he(ke).length-$e:0);if(ae.length>1||ae[0]||Et(qt,Zt))return $a(e.doc,ae,qt,Zt,"+input"),!0},Ln.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ln.prototype.reset=function(){this.forceCompositionEnd()},Ln.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ln.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Ln.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ki(this.cm,function(){return Un(e.cm)})},Ln.prototype.setUneditable=function(e){e.contentEditable="false"},Ln.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bi(this.cm,Pr)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ln.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ln.prototype.onContextMenu=function(){},Ln.prototype.resetPosition=function(){},Ln.prototype.needsContentAttribute=!0;function Gs(e,t){var i=ga(e,t.line);if(!i||i.hidden)return null;var n=xt(e.doc,t.line),a=va(i,n,t.line),s=Ot(n,e.doc.direction),u="left";if(s){var m=dt(s,t.ch);u=m%2?"right":"left"}var v=No(a.map,t.ch,u);return v.offset=v.collapse=="right"?v.end:v.start,v}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function qa(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,a){var s="",u=!1,m=e.doc.lineSeparator(),v=!1;function C(be){return function($e){return $e.id==be}}function Y(){u&&(s+=m,v&&(s+=m),u=v=!1)}function ae(be){be&&(Y(),s+=be)}function ke(be){if(be.nodeType==1){var $e=be.getAttribute("cm-text");if($e){ae($e);return}var rt=be.getAttribute("cm-marker"),gt;if(rt){var Tt=e.findMarks(je(n,0),je(a+1,0),C(+rt));Tt.length&&(gt=Tt[0].find(0))&&ae(nn(e.doc,gt.from,gt.to).join(m));return}if(be.getAttribute("contenteditable")=="false")return;var Bt=/^(pre|div|p|li|table|br)$/i.test(be.nodeName);if(!/^br$/i.test(be.nodeName)&&be.textContent.length==0)return;Bt&&Y();for(var At=0;At<be.childNodes.length;At++)ke(be.childNodes[At]);/^(pre|p)$/i.test(be.nodeName)&&(v=!0),Bt&&(u=!0)}else be.nodeType==3&&ae(be.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ke(t),t==i);)t=t.nextSibling,v=!1;return s}function qo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return qa(e.clipPos(je(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var a=0;a<e.display.view.length;a++){var s=e.display.view[a];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,a=!1;if(!t||!y(n,t))return qa(je(Gt(e.line),0),!0);if(t==n&&(a=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?he(e.rest):e.line;return qa(je(Gt(s),s.text.length),a)}var u=t.nodeType==3?t:null,m=t;for(!u&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(u=t.firstChild,i&&(i=u.nodeValue.length));m.parentNode!=n;)m=m.parentNode;var v=e.measure,C=v.maps;function Y(gt,Tt,Bt){for(var At=-1;At<(C?C.length:0);At++)for(var Kt=At<0?v.map:C[At],qt=0;qt<Kt.length;qt+=3){var Zt=Kt[qt+2];if(Zt==gt||Zt==Tt){var un=Gt(At<0?e.line:e.rest[At]),Bn=Kt[qt]+Bt;return(Bt<0||Zt!=gt)&&(Bn=Kt[qt+(Bt?1:0)]),je(un,Bn)}}}var ae=Y(u,m,i);if(ae)return qa(ae,a);for(var ke=m.nextSibling,be=u?u.nodeValue.length-i:0;ke;ke=ke.nextSibling){if(ae=Y(ke,ke.firstChild,0),ae)return qa(je(ae.line,ae.ch-be),a);be+=ke.textContent.length}for(var $e=m.previousSibling,rt=i;$e;$e=$e.previousSibling){if(ae=Y($e,$e.firstChild,-1),ae)return qa(je(ae.line,ae.ch+rt),a);rt+=$e.textContent.length}}var si=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ue,this.hasSelection=!1,this.composing=null};si.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var a=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),$&&(a.style.width="0px"),Ue(a,"input",function(){ee&&B>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ue(a,"paste",function(u){if(Ke(n,u)||Fs(u,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(u){if(Ke(n,u))return;if(n.somethingSelected())Qo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var m=zs(n);Qo({lineWise:!0,text:m.text}),u.type=="cut"?n.setSelections(m.ranges,null,pe):(i.prevInput="",a.value=m.text.join(`
`),_e(a))}else return;u.type=="cut"&&(n.state.cutIncoming=+new Date)}Ue(a,"cut",s),Ue(a,"copy",s),Ue(e.scroller,"paste",function(u){if(ea(e,u)||Ke(n,u))return;if(!a.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var m=new Event("paste");m.clipboardData=u.clipboardData,a.dispatchEvent(m)}),Ue(e.lineSpace,"selectstart",function(u){ea(e,u)||w(u)}),Ue(a,"compositionstart",function(){var u=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:u,range:n.markText(u,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ue(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},si.prototype.createField=function(e){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},si.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},si.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=na(e);if(e.options.moveInputWithCursor){var a=Vt(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+u.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+u.left-s.left))}return n},si.prototype.showSelection=function(e){var t=this.cm,i=t.display;x(i.cursorDiv,e.cursors),x(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},si.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&_e(this.textarea),ee&&B>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",ee&&B>=9&&(this.hasSelection=null))},si.prototype.getField=function(){return this.textarea},si.prototype.supportsTouch=function(){return!1},si.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!te||J()!=this.textarea))try{this.textarea.focus()}catch(e){}},si.prototype.blur=function(){this.textarea.blur()},si.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},si.prototype.receivedFocus=function(){this.slowPoll()},si.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()})},si.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},si.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ne(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=i.value;if(a==n&&!t.somethingSelected())return!1;if(ee&&B>=9&&this.hasSelection===a||E&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=a.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var u=0,m=Math.min(n.length,a.length);u<m&&n.charCodeAt(u)==a.charCodeAt(u);)++u;return Ki(t,function(){Pr(t,a.slice(u),n.length-u,null,e.composing?"*compose":null),a.length>1e3||a.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},si.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},si.prototype.onKeyPress=function(){ee&&B>=9&&(this.hasSelection=null),this.fastPoll()},si.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=oi(i,e),u=n.scroller.scrollTop;if(!s||V)return;var m=i.options.resetSelectionOnContextMenu;m&&i.doc.sel.contains(s)==-1&&bi(i,Li)(i.doc,ba(s),pe);var v=a.style.cssText,C=t.wrapper.style.cssText,Y=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Y.top-5)+"px; left: "+(e.clientX-Y.left-5)+`px;
z-index: 1000; background: `+(ee?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ae;F&&(ae=window.scrollY),n.input.focus(),F&&window.scrollTo(null,ae),n.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=be,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ke(){if(a.selectionStart!=null){var rt=i.somethingSelected(),gt="\u200B"+(rt?a.value:"");a.value="\u21DA",a.value=gt,t.prevInput=rt?"":"\u200B",a.selectionStart=1,a.selectionEnd=gt.length,n.selForContextMenu=i.doc.sel}}function be(){if(t.contextMenuPending!=be)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=C,a.style.cssText=v,ee&&B<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),a.selectionStart!=null){(!ee||ee&&B<9)&&ke();var rt=0,gt=function(){n.selForContextMenu==i.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="\u200B"?bi(i,cs)(i):rt++<10?n.detectingSelectAll=setTimeout(gt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(gt,200)}}if(ee&&B>=9&&ke(),g){D(e);var $e=function(){kt(window,"mouseup",$e),setTimeout(be,20)};Ue(window,"mouseup",$e)}else setTimeout(be,50)},si.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},si.prototype.setUneditable=function(){},si.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?f(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=J();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=m.getValue()}var a;if(e.form&&(Ue(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;a=s.submit;try{var u=s.submit=function(){n(),s.submit=a,s.submit(),s.submit=u}}catch(v){}}t.finishInit=function(v){v.save=n,v.getTextArea=function(){return e},v.toTextArea=function(){v.toTextArea=isNaN,n(),e.parentNode.removeChild(v.getWrapperElement()),e.style.display="",e.form&&(kt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var m=Jn(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return m}function au(e){e.off=kt,e.on=Ue,e.wheelEventPixels=dl,e.Doc=Ui,e.splitLines=Rt,e.countColumn=R,e.findColumn=re,e.isWordChar=De,e.Pass=fe,e.signal=Be,e.Line=zi,e.changeEnd=_a,e.scrollbarModel=Fr,e.Pos=je,e.cmpPos=Et,e.modes=vt,e.mimeModes=lt,e.resolveMode=Ge,e.getMode=ut,e.modeExtensions=ot,e.extendMode=ct,e.copyState=Yt,e.startState=an,e.innerMode=Ht,e.commands=xo,e.keyMap=ua,e.keyName=ks,e.isModifierKey=ws,e.lookupKey=Ja,e.normalizeKeyMap=Ll,e.StringStream=Qt,e.SharedTextMarker=_o,e.TextMarker=Ca,e.LineWidget=bo,e.e_preventDefault=w,e.e_stopPropagation=O,e.e_stop=D,e.addClass=ye,e.contains=y,e.rmClass=S,e.keyNames=xa}Yl(Jn),ql(Jn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var er in Ui.prototype)Ui.prototype.hasOwnProperty(er)&&se(ou,er)<0&&(Jn.prototype[er]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ui.prototype[er]));return H(Ui),Jn.inputStyles={textarea:si,contenteditable:Ln},Jn.defineMode=function(e){!Jn.defaults.mode&&e!="null"&&(Jn.defaults.mode=e),Ut.apply(this,arguments)},Jn.defineMIME=Nt,Jn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Jn.defineMIME("text/plain","null"),Jn.defineExtension=function(e,t){Jn.prototype[e]=t},Jn.defineDocExtension=function(e,t){Ui.prototype[e]=t},Jn.fromTextArea=iu,au(Jn),Jn.version="5.58.2",Jn})},WaYH:function(it,Ie,l){"use strict";var oe=l("rePB"),Le=l("Ff2n"),ge=l("VTBJ"),Te=l("1OyB"),Oe=l("vuIU"),Re=l("JX7q"),ee=l("Ji7U"),B=l("LK+K"),F=l("q1tI"),X=l("TSYQ"),W=l.n(X),V=l("sboe"),le=l("OZM5"),Z=function(g){var Q=g.prefixCls,S=g.level,A=g.isStart,x=g.isEnd;if(!S)return null;for(var b="".concat(Q,"-indent-unit"),N=[],T=0;T<S;T+=1){var y;N.push(F.createElement("span",{key:T,className:W()(b,(y={},Object(oe.a)(y,"".concat(b,"-start"),A[T+1]),Object(oe.a)(y,"".concat(b,"-end"),x[T+1]),Object(oe.a)(y,"".concat(b,"-end-first-level"),!T&&x[0]),y))}))}return F.createElement("span",{"aria-hidden":"true",className:"".concat(Q,"-indent")},N)},z=Z,$=l("815F"),U="open",te="close",E="---",me=function(I){Object(ee.a)(Q,I);var g=Object(B.a)(Q);function Q(){var S;return Object(Te.a)(this,Q),S=g.apply(this,arguments),S.state={dragNodeHighlight:!1},S.onSelectorClick=function(A){var x=S.props.context.onNodeClick;x(A,Object($.b)(S.props)),S.isSelectable()?S.onSelect(A):S.onCheck(A)},S.onSelectorDoubleClick=function(A){var x=S.props.context.onNodeDoubleClick;x(A,Object($.b)(S.props))},S.onSelect=function(A){if(S.isDisabled())return;var x=S.props.context.onNodeSelect;A.preventDefault(),x(A,Object($.b)(S.props))},S.onCheck=function(A){if(S.isDisabled())return;var x=S.props,b=x.disableCheckbox,N=x.checked,T=S.props.context.onNodeCheck;if(!S.isCheckable()||b)return;A.preventDefault();var y=!N;T(A,Object($.b)(S.props),y)},S.onMouseEnter=function(A){var x=S.props.context.onNodeMouseEnter;x(A,Object($.b)(S.props))},S.onMouseLeave=function(A){var x=S.props.context.onNodeMouseLeave;x(A,Object($.b)(S.props))},S.onContextMenu=function(A){var x=S.props.context.onNodeContextMenu;x(A,Object($.b)(S.props))},S.onDragStart=function(A){var x=S.props.context.onNodeDragStart;A.stopPropagation(),S.setState({dragNodeHighlight:!0}),x(A,Object(Re.a)(S));try{A.dataTransfer.setData("text/plain","")}catch(b){}},S.onDragEnter=function(A){var x=S.props.context.onNodeDragEnter;A.preventDefault(),A.stopPropagation(),x(A,Object(Re.a)(S))},S.onDragOver=function(A){var x=S.props.context.onNodeDragOver;A.preventDefault(),A.stopPropagation(),x(A,Object(Re.a)(S))},S.onDragLeave=function(A){var x=S.props.context.onNodeDragLeave;A.stopPropagation(),x(A,Object(Re.a)(S))},S.onDragEnd=function(A){var x=S.props.context.onNodeDragEnd;A.stopPropagation(),S.setState({dragNodeHighlight:!1}),x(A,Object(Re.a)(S))},S.onDrop=function(A){var x=S.props.context.onNodeDrop;A.preventDefault(),A.stopPropagation(),S.setState({dragNodeHighlight:!1}),x(A,Object(Re.a)(S))},S.onExpand=function(A){var x=S.props.context.onNodeExpand;x(A,Object($.b)(S.props))},S.setSelectHandle=function(A){S.selectHandle=A},S.getNodeState=function(){var A=S.props.expanded;return S.isLeaf()?null:A?U:te},S.hasChildren=function(){var A=S.props.eventKey,x=S.props.context.keyEntities,b=x[A]||{},N=b.children;return!!(N||[]).length},S.isLeaf=function(){var A=S.props,x=A.isLeaf,b=A.loaded,N=S.props.context.loadData,T=S.hasChildren();return x===!1?!1:x||!N&&!T||N&&b&&!T},S.isDisabled=function(){var A=S.props.disabled,x=S.props.context.disabled;return!!(x||A)},S.isCheckable=function(){var A=S.props.checkable,x=S.props.context.checkable;return!x||A===!1?!1:x},S.syncLoadData=function(A){var x=A.expanded,b=A.loading,N=A.loaded,T=S.props.context,y=T.loadData,J=T.onNodeLoad;if(b)return;y&&x&&!S.isLeaf()&&(!S.hasChildren()&&!N&&J(Object($.b)(S.props)))},S.renderSwitcher=function(){var A=S.props,x=A.expanded,b=A.switcherIcon,N=S.props.context,T=N.prefixCls,y=N.switcherIcon,J=b||y;if(S.isLeaf())return F.createElement("span",{className:W()("".concat(T,"-switcher"),"".concat(T,"-switcher-noop"))},typeof J=="function"?J(Object(ge.a)(Object(ge.a)({},S.props),{},{isLeaf:!0})):J);var ye=W()("".concat(T,"-switcher"),"".concat(T,"-switcher_").concat(x?U:te));return F.createElement("span",{onClick:S.onExpand,className:ye},typeof J=="function"?J(Object(ge.a)(Object(ge.a)({},S.props),{},{isLeaf:!1})):J)},S.renderCheckbox=function(){var A=S.props,x=A.checked,b=A.halfChecked,N=A.disableCheckbox,T=S.props.context.prefixCls,y=S.isDisabled(),J=S.isCheckable();if(!J)return null;var ye=typeof J!="boolean"?J:null;return F.createElement("span",{className:W()("".concat(T,"-checkbox"),x&&"".concat(T,"-checkbox-checked"),!x&&b&&"".concat(T,"-checkbox-indeterminate"),(y||N)&&"".concat(T,"-checkbox-disabled")),onClick:S.onCheck},ye)},S.renderIcon=function(){var A=S.props.loading,x=S.props.context.prefixCls;return F.createElement("span",{className:W()("".concat(x,"-iconEle"),"".concat(x,"-icon__").concat(S.getNodeState()||"docu"),A&&"".concat(x,"-icon_loading"))})},S.renderSelector=function(){var A=S.state.dragNodeHighlight,x=S.props,b=x.title,N=x.selected,T=x.icon,y=x.loading,J=x.data,ye=S.props.context,q=ye.prefixCls,_e=ye.showIcon,k=ye.icon,f=ye.draggable,R=ye.loadData,ue=ye.titleRender,se=S.isDisabled(),Se="".concat(q,"-node-content-wrapper"),fe;if(_e){var pe=T||k;fe=pe?F.createElement("span",{className:W()("".concat(q,"-iconEle"),"".concat(q,"-icon__customize"))},typeof pe=="function"?pe(S.props):pe):S.renderIcon()}else R&&y&&(fe=S.renderIcon());var j;typeof b=="function"?j=b(J):ue?j=ue(J):j=b;var M=F.createElement("span",{className:"".concat(q,"-title")},j);return F.createElement("span",{ref:S.setSelectHandle,title:typeof b=="string"?b:"",className:W()("".concat(Se),"".concat(Se,"-").concat(S.getNodeState()||"normal"),!se&&(N||A)&&"".concat(q,"-node-selected"),!se&&f&&"draggable"),draggable:!se&&f||void 0,"aria-grabbed":!se&&f||void 0,onMouseEnter:S.onMouseEnter,onMouseLeave:S.onMouseLeave,onContextMenu:S.onContextMenu,onClick:S.onSelectorClick,onDoubleClick:S.onSelectorDoubleClick,onDragStart:f?S.onDragStart:void 0},fe,M)},S}return Object(Oe.a)(Q,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var A=this.props.selectable,x=this.props.context.selectable;return typeof A=="boolean"?A:x}},{key:"render",value:function(){var A,x=this.props,b=x.eventKey,N=x.className,T=x.style,y=x.dragOver,J=x.dragOverGapTop,ye=x.dragOverGapBottom,q=x.isLeaf,_e=x.isStart,k=x.isEnd,f=x.expanded,R=x.selected,ue=x.checked,se=x.halfChecked,Se=x.loading,fe=x.domRef,pe=x.active,j=x.onMouseMove,M=Object(Le.a)(x,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),re=this.props.context,P=re.prefixCls,_=re.filterTreeNode,he=re.draggable,Pe=re.keyEntities,Je=this.isDisabled(),Me=Object(le.f)(M),We=Pe[b]||{},Ee=We.level,De=k[k.length-1];return F.createElement("div",Object.assign({ref:fe,className:W()(N,"".concat(P,"-treenode"),(A={},Object(oe.a)(A,"".concat(P,"-treenode-disabled"),Je),Object(oe.a)(A,"".concat(P,"-treenode-switcher-").concat(f?"open":"close"),!q),Object(oe.a)(A,"".concat(P,"-treenode-checkbox-checked"),ue),Object(oe.a)(A,"".concat(P,"-treenode-checkbox-indeterminate"),se),Object(oe.a)(A,"".concat(P,"-treenode-selected"),R),Object(oe.a)(A,"".concat(P,"-treenode-loading"),Se),Object(oe.a)(A,"".concat(P,"-treenode-active"),pe),Object(oe.a)(A,"".concat(P,"-treenode-leaf-last"),De),Object(oe.a)(A,"drag-over",!Je&&y),Object(oe.a)(A,"drag-over-gap-top",!Je&&J),Object(oe.a)(A,"drag-over-gap-bottom",!Je&&ye),Object(oe.a)(A,"filter-node",_&&_(Object($.b)(this.props))),A)),style:T,onDragEnter:he?this.onDragEnter:void 0,onDragOver:he?this.onDragOver:void 0,onDragLeave:he?this.onDragLeave:void 0,onDrop:he?this.onDrop:void 0,onDragEnd:he?this.onDragEnd:void 0,onMouseMove:j},Me),F.createElement(z,{prefixCls:P,level:Ee,isStart:_e,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),Q}(F.Component),Ce=function(g){return F.createElement(V.a.Consumer,null,function(Q){return F.createElement(me,Object.assign({},g,{context:Q}))})};Ce.displayName="TreeNode",Ce.defaultProps={title:E},Ce.isTreeNode=1;var de=Ie.a=Ce},WdTA:function(it,Ie,l){it.exports=l.p+"static/studnetqun.598eeb43.png"},Y1PL:function(it,Ie,l){"use strict";l.r(Ie),l.d(Ie,"ResizableTextArea",function(){return se});var oe=l("wx14"),Le=l("1OyB"),ge=l("vuIU"),Te=l("Ji7U"),Oe=l("LK+K"),Re=l("q1tI"),ee=l("VTBJ"),B=l("rePB"),F=l("Zm9Q"),X=l("Kwbf"),W=l("c+Xe"),V=l("m+aA"),le=l("bdgK"),Z=new Map;function z(pe){pe.forEach(function(j){var M,re=j.target;(M=Z.get(re))===null||M===void 0||M.forEach(function(P){return P(re)})})}var $=new le.default(z),U=null,te=null;function E(pe,j){Z.has(pe)||(Z.set(pe,new Set),$.observe(pe)),Z.get(pe).add(j)}function me(pe,j){Z.has(pe)&&(Z.get(pe).delete(j),Z.get(pe).size||($.unobserve(pe),Z.delete(pe)))}var Ce=function(pe){Object(Te.a)(M,pe);var j=Object(Oe.a)(M);function M(){return Object(Le.a)(this,M),j.apply(this,arguments)}return Object(ge.a)(M,[{key:"render",value:function(){return this.props.children}}]),M}(Re.Component),de=Re.createContext(null);function I(pe){var j=pe.children,M=pe.onBatchResize,re=Re.useRef(0),P=Re.useRef([]),_=Re.useContext(de),he=Re.useCallback(function(Pe,Je,Me){re.current+=1;var We=re.current;P.current.push({size:Pe,element:Je,data:Me}),Promise.resolve().then(function(){We===re.current&&(M==null||M(P.current),P.current=[])}),_==null||_(Pe,Je,Me)},[M,_]);return Re.createElement(de.Provider,{value:he},j)}function g(pe){var j=pe.children,M=pe.disabled,re=Re.useRef(null),P=Re.useRef(null),_=Re.useContext(de),he=Re.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Pe=Re.isValidElement(j)&&Object(W.c)(j),Je=Pe?j.ref:null,Me=Re.useMemo(function(){return Object(W.a)(Je,re)},[Je,re]),We=Re.useRef(pe);We.current=pe;var Ee=Re.useCallback(function(De){var Ve=We.current,et=Ve.onResize,at=Ve.data,Ye=De.getBoundingClientRect(),He=Ye.width,St=Ye.height,ft=De.offsetWidth,bt=De.offsetHeight,dt=Math.floor(He),Dt=Math.floor(St);if(he.current.width!==dt||he.current.height!==Dt||he.current.offsetWidth!==ft||he.current.offsetHeight!==bt){var Ot={width:dt,height:Dt,offsetWidth:ft,offsetHeight:bt};he.current=Ot;var _t=ft===Math.round(He)?He:ft,Ue=bt===Math.round(St)?St:bt,It=Object(ee.a)(Object(ee.a)({},Ot),{},{offsetWidth:_t,offsetHeight:Ue});_==null||_(It,De,at),et&&Promise.resolve().then(function(){et(It,De)})}},[]);return Re.useEffect(function(){var De=Object(V.a)(re.current)||Object(V.a)(P.current);return De&&!M&&E(De,Ee),function(){return me(De,Ee)}},[re.current,M]),Re.createElement(Ce,{ref:P},Pe?Re.cloneElement(j,{ref:Me}):j)}var Q="rc-observer-key";function S(pe){var j=pe.children,M=Object(F.a)(j);return M.map(function(re,P){var _=(re==null?void 0:re.key)||"".concat(Q,"-").concat(P);return Re.createElement(g,Object(oe.a)({},pe,{key:_}),re)})}S.Collection=I;var A=S,x=l("bT9E"),b=l("TSYQ"),N=l.n(b),T=`
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
`,y=["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"],J={},ye;function q(pe){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(j&&J[M])return J[M];var re=window.getComputedStyle(pe),P=re.getPropertyValue("box-sizing")||re.getPropertyValue("-moz-box-sizing")||re.getPropertyValue("-webkit-box-sizing"),_=parseFloat(re.getPropertyValue("padding-bottom"))+parseFloat(re.getPropertyValue("padding-top")),he=parseFloat(re.getPropertyValue("border-bottom-width"))+parseFloat(re.getPropertyValue("border-top-width")),Pe=y.map(function(Me){return"".concat(Me,":").concat(re.getPropertyValue(Me))}).join(";"),Je={sizingStyle:Pe,paddingSize:_,borderSize:he,boxSizing:P};return j&&M&&(J[M]=Je),Je}function _e(pe){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ye||(ye=document.createElement("textarea"),ye.setAttribute("tab-index","-1"),ye.setAttribute("aria-hidden","true"),document.body.appendChild(ye)),pe.getAttribute("wrap")?ye.setAttribute("wrap",pe.getAttribute("wrap")):ye.removeAttribute("wrap");var P=q(pe,j),_=P.paddingSize,he=P.borderSize,Pe=P.boxSizing,Je=P.sizingStyle;ye.setAttribute("style","".concat(Je,";").concat(T)),ye.value=pe.value||pe.placeholder||"";var Me=Number.MIN_SAFE_INTEGER,We=Number.MAX_SAFE_INTEGER,Ee=ye.scrollHeight,De;if(Pe==="border-box"?Ee+=he:Pe==="content-box"&&(Ee-=_),M!==null||re!==null){ye.value=" ";var Ve=ye.scrollHeight-_;M!==null&&(Me=Ve*M,Pe==="border-box"&&(Me=Me+_+he),Ee=Math.max(Me,Ee)),re!==null&&(We=Ve*re,Pe==="border-box"&&(We=We+_+he),De=Ee>We?"":"hidden",Ee=Math.min(We,Ee))}return{height:Ee,minHeight:Me,maxHeight:We,overflowY:De,resize:"none"}}var k=l("Gytx"),f=l.n(k),R;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(R||(R={}));var ue=function(pe){Object(Te.a)(M,pe);var j=Object(Oe.a)(M);function M(re){var P;return Object(Le.a)(this,M),P=j.call(this,re),P.nextFrameActionId=void 0,P.resizeFrameId=void 0,P.textArea=void 0,P.saveTextArea=function(_){P.textArea=_},P.handleResize=function(_){var he=P.state.resizeStatus,Pe=P.props,Je=Pe.autoSize,Me=Pe.onResize;if(he!==R.NONE)return;typeof Me=="function"&&Me(_),Je&&P.resizeOnNextFrame()},P.resizeOnNextFrame=function(){cancelAnimationFrame(P.nextFrameActionId),P.nextFrameActionId=requestAnimationFrame(P.resizeTextarea)},P.resizeTextarea=function(){var _=P.props.autoSize;if(!_||!P.textArea)return;var he=_.minRows,Pe=_.maxRows,Je=_e(P.textArea,!1,he,Pe);P.setState({textareaStyles:Je,resizeStatus:R.RESIZING},function(){cancelAnimationFrame(P.resizeFrameId),P.resizeFrameId=requestAnimationFrame(function(){P.setState({resizeStatus:R.RESIZED},function(){P.resizeFrameId=requestAnimationFrame(function(){P.setState({resizeStatus:R.NONE}),P.fixFirefoxAutoScroll()})})})})},P.renderTextArea=function(){var _=P.props,he=_.prefixCls,Pe=he===void 0?"rc-textarea":he,Je=_.autoSize,Me=_.onResize,We=_.className,Ee=_.disabled,De=P.state,Ve=De.textareaStyles,et=De.resizeStatus,at=Object(x.a)(P.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ye=N()(Pe,We,Object(B.a)({},"".concat(Pe,"-disabled"),Ee));"value"in at&&(at.value=at.value||"");var He=Object(ee.a)(Object(ee.a)(Object(ee.a)({},P.props.style),Ve),et===R.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return Re.createElement(A,{onResize:P.handleResize,disabled:!(Je||Me)},Re.createElement("textarea",Object(oe.a)({},at,{className:Ye,style:He,ref:P.saveTextArea})))},P.state={textareaStyles:{},resizeStatus:R.NONE},P}return Object(ge.a)(M,[{key:"componentDidUpdate",value:function(P){(P.value!==this.props.value||!f()(P.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 P=this.textArea.selectionStart,_=this.textArea.selectionEnd;this.textArea.setSelectionRange(P,_)}}catch(he){}}},{key:"render",value:function(){return this.renderTextArea()}}]),M}(Re.Component),se=ue,Se=function(pe){Object(Te.a)(M,pe);var j=Object(Oe.a)(M);function M(re){var P;Object(Le.a)(this,M),P=j.call(this,re),P.resizableTextArea=void 0,P.focus=function(){P.resizableTextArea.textArea.focus()},P.saveTextArea=function(he){P.resizableTextArea=he},P.handleChange=function(he){var Pe=P.props.onChange;P.setValue(he.target.value,function(){P.resizableTextArea.resizeTextarea()}),Pe&&Pe(he)},P.handleKeyDown=function(he){var Pe=P.props,Je=Pe.onPressEnter,Me=Pe.onKeyDown;he.keyCode===13&&Je&&Je(he),Me&&Me(he)};var _=typeof re.value=="undefined"||re.value===null?re.defaultValue:re.value;return P.state={value:_},P}return Object(ge.a)(M,[{key:"setValue",value:function(P,_){"value"in this.props||this.setState({value:P},_)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return Re.createElement(se,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(P){return"value"in P?{value:P.value}:null}}]),M}(Re.Component),fe=Ie.default=Se},YBdh:function(it,Ie,l){it.exports=l.p+"static/xiren.a6554bc1.svg"},ZW9T:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return Ce});var oe=l("k1fw"),Le=l("miYZ"),ge=l("tsqr"),Te=l("rAM+"),Oe=l("tJVT"),Re=l("PpiC"),ee=l("q1tI"),B=l.n(ee),F=l("bdgK");function X(de,I,g,Q,S){var A=I.getWordUntilPosition(g),x={startLineNumber:g.lineNumber,endLineNumber:g.lineNumber,startColumn:A.startColumn,endColumn:A.endColumn},b=Q.map(function(N){return{label:N,kind:de.languages.CompletionItemKind.Keyword,insertText:N,insertTextRules:de.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:x}});return S.map(function(N){b.push(Object(oe.a)(Object(oe.a)({},N),{},{range:x}))}),b}var W=function(de){var I={label:"ifelse",kind:de.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:de.languages.CompletionItemInsertTextRule.InsertAsSnippet},g=["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"];de.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(x,b){var N=X(de,x,b,g,[I]);return{suggestions:N}}});var Q=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];de.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(x,b){var N=[{label:"print",kind:de.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:de.languages.CompletionItemInsertTextRule.InsertAsSnippet}],T=X(de,x,b,Q,N);return{suggestions:T}}});var S=["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"];de.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(x,b){var N=[I,{label:"main",kind:de.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:de.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:de.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:de.languages.CompletionItemInsertTextRule.InsertAsSnippet}],T=X(de,x,b,S,N);return{suggestions:T}}})},V="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",le=l("LvDl");function Z(de){return/^\d+$/.test(de)?"".concat(de,"px"):de}function z(){}var $=!1,U={"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 de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],I=de;if(Array.isArray(de)){for(var g=0;g<de.length;g++){var Q=U[de[g]];if(Q)return Q}return I[0]}return U[I]||I}var E=null,me=Ie.b=function(de){var I=de.width,g=I===void 0?"100%":I,Q=de.height,S=Q===void 0?"100%":Q,A=de.value,x=de.language,b=x===void 0?"javascript":x,N=de.style,T=N===void 0?{}:N,y=de.options,J=y===void 0?{}:y,ye=de.overrideServices,q=ye===void 0?{}:ye,_e=de.theme,k=_e===void 0?"vs-dark":_e,f=de.onEditBlur,R=de.onSave,ue=de.autoHeight,se=ue===void 0?!1:ue,Se=de.forbidCopy,fe=Se===void 0?!1:Se,pe=de.onChange,j=pe===void 0?z:pe,M=de.editorDidMount,re=M===void 0?z:M,P=de.onFocus,_=P===void 0?z:P,he=de.filename,Pe=he===void 0?"educoder.txt":he,Je=Object(Re.a)(de,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Me=Object(ee.useRef)(),We=Object(ee.useRef)({}),Ee=Object(ee.useRef)(),De=Object(ee.useRef)(!1),Ve=Object(ee.useRef)(),et=Object(ee.useState)(!1),at=Object(Oe.a)(et,2),Ye=at[0],He=at[1];function St(){var L;return Me.current&&(L=new F.default(function(D){var ve=Object(Te.a)(D),ne;try{for(ve.s();!(ne=ve.n()).done;){var xe=ne.value;(xe.target.offsetHeight>0||xe.target.offsetWidth>0)&&We.current.instance.layout()}}catch(qe){ve.e(qe)}finally{ve.f()}}),L.observe(Me.current)),L}function ft(){ge.b.warn(decodeURIComponent(V))}var bt=function(){var D=We.current.instance;if(A!=null&&D&&Ye){var ve=D.getModel();ve&&A!==ve.getValue()&&($=!0,ve.setValue(A),D.layout(),$=!1)}};Object(ee.useEffect)(function(){Ee.current&&clearTimeout(Ee.current),Ee.current=setTimeout(function(){bt()},500)},[A,Ye,We.current]);function dt(){var L=We.current.instance;if(L){var D=L.getSelection(),ve=We.current.pastePos||{},ne=new E.Range(ve.startLineNumber||D.endLineNumber,ve.startColumn||D.endColumn,ve.endLineNumber||D.endLineNumber,ve.endColumn||D.endColumn);setTimeout(function(){L.executeEdits("",[{range:ne,text:""}])},300)}}function Dt(L){(window.navigator.platform.match("Mac")?L.metaKey:L.ctrlKey)&&L.keyCode==83&&(L.preventDefault(),R())}var Ot=function(){if(se&&We.current.instance){var D=We.current.instance.getContentHeight();w(D<S?S:D)}else w(S)};function _t(L){var D=document.createEvent("MouseEvents");D.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),L.dispatchEvent(D)}function Ue(L,D){var ve=window.URL||window.webkitURL||window,ne=new Blob([D]),xe=document.createElementNS("http://www.w3.org/1999/xhtml","a");xe.href=ve.createObjectURL(ne),xe.download=L,_t(xe)}Object(ee.useEffect)(function(){Ot()},[Ot]),Object(ee.useEffect)(function(){Me.current&&!Ye&&l.e(27).then(l.t.bind(null,"M/lh",7)).then(function(L){try{E=L,We.current.instance=E.editor.create(Me.current,{value:A,language:te(b),theme:k,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},q);var D=We.current.instance;if(re(D,E),setTimeout(function(){Ot(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ue(Pe||"educoder.txt",D.getValue())}})},500),We.current.subscription=D.onDidChangeModelContent(function(ne){De.current?clearTimeout(Ve.current):(Ot(),j(D.getValue(),ne)),Ve.current=setTimeout(function(){De.current=!1},500)}),window.Monaco||W(E),fe&&(D.addCommand(E.KeyMod.CtrlCmd|E.KeyMod.Shift|E.KeyCode.KEY_V,function(){return ft(),null}),D.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KEY_C,function(){return ft(),null})),window.Monaco=E,f&&D.onDidBlurEditorWidget(function(){f(D.getValue())}),_&&D.onDidFocusEditorText(function(){_(D.getValue())}),fe){D.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KEY_V,function(){return ft(),null}),D.onDidPaste(function(ne){We.current.pastePos=ne});try{window.addEventListener("paste",dt)}catch(ne){}}var ve=St();return He(!0),function(){var ne=We.current.instance;ne.dispose();var xe=ne.getModel();xe&&xe.dispose(),We.current.subscription&&We.current.subscription.dispose(),fe&&window.removeEventListener("paste",dt),ve.unobserve(Me.current)}}catch(ne){}})},[]),Object(ee.useEffect)(function(){var L=We.current.instance;if(L&&Ye)return document.addEventListener("keydown",Dt,!1),function(){document.removeEventListener("keydown",Dt)}},[R,Ye]),Object(ee.useEffect)(function(){var L=We.current.instance;if(L&&Ye){var D=te(b);E.editor.setModelLanguage(L.getModel(),D),console.log("language:",b,L.getModel(),D)}},[b,Ye]),Object(ee.useEffect)(function(){var L=We.current.instance;L&&Ye&&E.editor.setTheme(k)},[k,Ye]),Object(ee.useEffect)(function(){var L=We.current.instance;L&&Ye&&(L.updateOptions(Object(oe.a)({},J)),setTimeout(function(){L.getModel().updateOptions(Object(oe.a)({},J))},200))},[JSON.stringify(J),Ye]),Object(ee.useEffect)(function(){var L=We.current.instance;L&&Ye&&L.layout()},[g,S,Ye]);var It=Object(ee.useState)(Z(g)),kt=Object(Oe.a)(It,2),Be=kt[0],Ke=kt[1],K=Object(ee.useState)(Z(S)),G=Object(Oe.a)(K,2),H=G[0],w=G[1],O=Object(oe.a)(Object(oe.a)({},T),{},{width:Be,height:H});return B.a.createElement("div",{className:"my-monaco-editor",ref:Me,style:O})};function Ce(de){var I=de.width,g=I===void 0?"100%":I,Q=de.height,S=Q===void 0?"100%":Q,A=de.original,x=de.modified,b=de.language,N=de.options,T=N===void 0?{}:N,y=Object(ee.useRef)(),J=Object(ee.useState)(null),ye=Object(Oe.a)(J,2),q=ye[0],_e=ye[1];function k(se){var Se;return y.current&&(Se=new F.default(function(fe){var pe=Object(Te.a)(fe),j;try{for(pe.s();!(j=pe.n()).done;){var M=j.value;(M.target.offsetHeight>0||M.target.offsetWidth>0)&&se.layout()}}catch(re){pe.e(re)}finally{pe.f()}}),Se.observe(y.current)),Se}Object(ee.useEffect)(function(){y.current&&l.e(27).then(l.t.bind(null,"M/lh",7)).then(function(se){E=se;var Se=E.editor.createDiffEditor(y.current,Object(oe.a)(Object(oe.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},T),{},{wordWrap:!0}));_e(Se);var fe=k(Se);return function(){Se.dispose();var pe=Se.getModel();pe&&pe.dispose(),fe.unobserve(y.current)}})},[]),Object(ee.useEffect)(function(){q&&q.setModel({original:E.editor.createModel(A,b),modified:E.editor.createModel(x,b)})},[A,x,b,q]);var f=Z(g),R=Z(S),ue={width:f,height:R};return B.a.createElement("div",{className:"my-diff-editor",ref:y,style:ue})}},ZpRC:function(it,Ie,l){"use strict";function oe(W){return typeof W=="object"&&W!=null&&W.nodeType===1}function Le(W,V){return(!V||W!=="hidden")&&W!=="visible"&&W!=="clip"}function ge(W,V){if(W.clientHeight<W.scrollHeight||W.clientWidth<W.scrollWidth){var le=getComputedStyle(W,null);return Le(le.overflowY,V)||Le(le.overflowX,V)||function(Z){var z=function($){if(!$.ownerDocument||!$.ownerDocument.defaultView)return null;try{return $.ownerDocument.defaultView.frameElement}catch(U){return null}}(Z);return!!z&&(z.clientHeight<Z.scrollHeight||z.clientWidth<Z.scrollWidth)}(W)}return!1}function Te(W,V,le,Z,z,$,U,te){return $<W&&U>V||$>W&&U<V?0:$<=W&&te<=le||U>=V&&te>=le?$-W-Z:U>V&&te<le||$<W&&te>le?U-V+z:0}var Oe=function(W,V){var le=window,Z=V.scrollMode,z=V.block,$=V.inline,U=V.boundary,te=V.skipOverflowHiddenElements,E=typeof U=="function"?U:function(Ve){return Ve!==U};if(!oe(W))throw new TypeError("Invalid target");for(var me=document.scrollingElement||document.documentElement,Ce=[],de=W;oe(de)&&E(de);){if((de=de.parentElement)===me){Ce.push(de);break}de!=null&&de===document.body&&ge(de)&&!ge(document.documentElement)||de!=null&&ge(de,te)&&Ce.push(de)}for(var I=le.visualViewport?le.visualViewport.width:innerWidth,g=le.visualViewport?le.visualViewport.height:innerHeight,Q=window.scrollX||pageXOffset,S=window.scrollY||pageYOffset,A=W.getBoundingClientRect(),x=A.height,b=A.width,N=A.top,T=A.right,y=A.bottom,J=A.left,ye=z==="start"||z==="nearest"?N:z==="end"?y:N+x/2,q=$==="center"?J+b/2:$==="end"?T:J,_e=[],k=0;k<Ce.length;k++){var f=Ce[k],R=f.getBoundingClientRect(),ue=R.height,se=R.width,Se=R.top,fe=R.right,pe=R.bottom,j=R.left;if(Z==="if-needed"&&N>=0&&J>=0&&y<=g&&T<=I&&N>=Se&&y<=pe&&J>=j&&T<=fe)return _e;var M=getComputedStyle(f),re=parseInt(M.borderLeftWidth,10),P=parseInt(M.borderTopWidth,10),_=parseInt(M.borderRightWidth,10),he=parseInt(M.borderBottomWidth,10),Pe=0,Je=0,Me="offsetWidth"in f?f.offsetWidth-f.clientWidth-re-_:0,We="offsetHeight"in f?f.offsetHeight-f.clientHeight-P-he:0;if(me===f)Pe=z==="start"?ye:z==="end"?ye-g:z==="nearest"?Te(S,S+g,g,P,he,S+ye,S+ye+x,x):ye-g/2,Je=$==="start"?q:$==="center"?q-I/2:$==="end"?q-I:Te(Q,Q+I,I,re,_,Q+q,Q+q+b,b),Pe=Math.max(0,Pe+S),Je=Math.max(0,Je+Q);else{Pe=z==="start"?ye-Se-P:z==="end"?ye-pe+he+We:z==="nearest"?Te(Se,pe,ue,P,he+We,ye,ye+x,x):ye-(Se+ue/2)+We/2,Je=$==="start"?q-j-re:$==="center"?q-(j+se/2)+Me/2:$==="end"?q-fe+_+Me:Te(j,fe,se,re,_+Me,q,q+b,b);var Ee=f.scrollLeft,De=f.scrollTop;ye+=De-(Pe=Math.max(0,Math.min(De+Pe,f.scrollHeight-ue+We))),q+=Ee-(Je=Math.max(0,Math.min(Ee+Je,f.scrollWidth-se+Me)))}_e.push({el:f,top:Pe,left:Je})}return _e};function Re(W){return W===Object(W)&&Object.keys(W).length!==0}function ee(W,V){V===void 0&&(V="auto");var le="scrollBehavior"in document.body.style;W.forEach(function(Z){var z=Z.el,$=Z.top,U=Z.left;z.scroll&&le?z.scroll({top:$,left:U,behavior:V}):(z.scrollTop=$,z.scrollLeft=U)})}function B(W){return W===!1?{block:"end",inline:"nearest"}:Re(W)?W:{block:"start",inline:"nearest"}}function F(W,V){var le=!W.ownerDocument.documentElement.contains(W);if(Re(V)&&typeof V.behavior=="function")return V.behavior(le?[]:Oe(W,V));if(le)return;var Z=B(V);return ee(Oe(W,Z),Z.behavior)}var X=Ie.a=F},bT9E:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return Le});var oe=l("VTBJ");function Le(ge,Te){var Oe=Object(oe.a)({},ge);return Array.isArray(Te)&&Te.forEach(function(Re){delete Oe[Re]}),Oe}},c5Ni:function(it,Ie,l){},dejd:function(it,Ie,l){},dmUQ:function(it,Ie,l){"use strict";var oe=l("Ff2n"),Le=l("rePB"),ge=l("1OyB"),Te=l("vuIU"),Oe=l("Ji7U"),Re=l("md7G"),ee=l("foSv"),B=l("q1tI"),F=l.n(B),X=l("TSYQ"),W=l.n(X),V=l("4IlW");function le(x,b){var N=Object.keys(x);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(x);b&&(T=T.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),N.push.apply(N,T)}return N}function Z(x){for(var b=1;b<arguments.length;b++){var N=arguments[b]!=null?arguments[b]:{};b%2?le(Object(N),!0).forEach(function(T){Object(Le.a)(x,T,N[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(N)):le(Object(N)).forEach(function(T){Object.defineProperty(x,T,Object.getOwnPropertyDescriptor(N,T))})}return x}function z(x){var b=$();return function(){var T=Object(ee.a)(x),y;if(b){var J=Object(ee.a)(this).constructor;y=Reflect.construct(T,arguments,J)}else y=T.apply(this,arguments);return Object(Re.a)(this,y)}}function $(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(x){return!1}}function U(){}function te(x){x.preventDefault()}var E=function(b){return b.replace(/[^\w.-]+/g,"")},me=200,Ce=600,de=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,I=function(b){return b!=null},g=function(b,N){return N===b||typeof N=="number"&&typeof b=="number"&&isNaN(N)&&isNaN(b)},Q=function(x){Object(Oe.a)(N,x);var b=z(N);function N(T){var y;Object(ge.a)(this,N),y=b.call(this,T),y.onKeyDown=function(q){var _e=y.props,k=_e.onKeyDown,f=_e.onPressEnter;if(q.keyCode===V.a.UP){var R=y.getRatio(q);y.up(q,R,null),y.stop()}else if(q.keyCode===V.a.DOWN){var ue=y.getRatio(q);y.down(q,ue,null),y.stop()}else q.keyCode===V.a.ENTER&&f&&f(q);if(y.recordCursorPosition(),y.lastKeyCode=q.keyCode,k){for(var se=arguments.length,Se=new Array(se>1?se-1:0),fe=1;fe<se;fe++)Se[fe-1]=arguments[fe];k.apply(void 0,[q].concat(Se))}},y.onKeyUp=function(q){var _e=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),_e){for(var k=arguments.length,f=new Array(k>1?k-1:0),R=1;R<k;R++)f[R-1]=arguments[R];_e.apply(void 0,[q].concat(f))}},y.onChange=function(q){var _e=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(q)),y.setState({inputValue:y.rawInput}),_e(y.toNumber(y.rawInput))},y.onMouseUp=function(){var q=y.props.onMouseUp;y.recordCursorPosition(),q&&q.apply(void 0,arguments)},y.onFocus=function(){var q;y.setState({focused:!0}),(q=y.props).onFocus.apply(q,arguments)},y.onBlur=function(){var q=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var _e=y.getCurrentValidValue(y.state.inputValue),k=y.setValue(_e,U);if(q){var f=y.input.value,R=y.getInputDisplayValue({focus:!1,value:k});y.input.value=R&&Number(R),q.apply(void 0,arguments),y.input.value=f}},y.getRatio=function(q){var _e=1;return q.metaKey||q.ctrlKey?_e=.1:q.shiftKey&&(_e=10),_e},y.getFullNum=function(q){return isNaN(q)?q:/e/i.test(String(q))?Number(q).toFixed(18).replace(/\.?0+$/,""):q},y.getPrecision=function(q){if(I(y.props.precision))return y.props.precision;var _e=String(q);if(_e.indexOf("e-")>=0)return parseInt(_e.slice(_e.indexOf("e-")+2),10);var k=0;return _e.indexOf(".")>=0&&(k=_e.length-_e.indexOf(".")-1),k},y.getInputDisplayValue=function(q){var _e=q||y.state,k=_e.focused,f=_e.inputValue,R=_e.value,ue;k?ue=f:ue=y.toPrecisionAsStep(R),ue==null&&(ue="");var se=y.formatWrapper(ue);return I(y.props.decimalSeparator)&&(se=se.toString().replace(".",y.props.decimalSeparator)),se},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(q){}},y.restoreByAfter=function(q){if(q===void 0)return!1;var _e=y.input.value,k=_e.lastIndexOf(q);if(k===-1)return!1;var f=y.cursorBefore.length;return y.lastKeyCode===V.a.DELETE&&y.cursorBefore.charAt(f-1)===q[0]?(y.fixCaret(f,f),!0):k+q.length===_e.length?(y.fixCaret(k,k),!0):!1},y.partRestoreByAfter=function(q){return q===void 0?!1:Array.prototype.some.call(q,function(_e,k){var f=q.substring(k);return y.restoreByAfter(f)})},y.isNotCompleteNumber=function(q){return isNaN(q)||q===""||q===null||q&&q.toString().indexOf(".")===q.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(q,_e,k){y.pressingUpOrDown=!0,y.step("down",q,_e,k)},y.up=function(q,_e,k){y.pressingUpOrDown=!0,y.step("up",q,_e,k)},y.saveInput=function(q){y.input=q};var J=T.value;J===void 0&&(J=T.defaultValue),y.state={focused:T.autoFocus};var ye=y.getValidValue(y.toNumber(J));return y.state=Z(Z({},y.state),{},{inputValue:y.toPrecisionAsStep(ye),value:ye}),y}return Object(Te.a)(N,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var J=this.props,ye=J.value,q=J.onChange,_e=J.max,k=J.min,f=this.state.focused;if(y){if(!g(y.value,ye)||!g(y.max,_e)||!g(y.min,k)){var R=f?ye:this.getValidValue(ye),ue;this.pressingUpOrDown?ue=R:this.inputting?ue=this.rawInput:ue=this.toPrecisionAsStep(R),this.setState({value:R,inputValue:ue})}var se="value"in this.props?ye:this.state.value;"max"in this.props&&y.max!==_e&&typeof se=="number"&&se>_e&&q&&q(_e),"min"in this.props&&y.min!==k&&typeof se=="number"&&se<k&&q&&q(k)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===V.a.BACKSPACE?Se=this.cursorStart-1:this.lastKeyCode===V.a.DELETE&&(Se=this.cursorStart):Se=this.input.value.length,this.fixCaret(Se,Se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case V.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case V.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(fe){}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(y){var J=y;return J===""?J="":this.isNotCompleteNumber(parseFloat(J))?J=this.state.value:J=this.getValidValue(J),this.toNumber(J)}},{key:"getValueFromEvent",value:function(y){var J=y.target.value.trim().replace(/。/g,".");return I(this.props.decimalSeparator)&&(J=J.replace(this.props.decimalSeparator,".")),J}},{key:"getValidValue",value:function(y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,q=parseFloat(y);return isNaN(q)?y:(q<J&&(q=J),q>ye&&(q=ye),q)}},{key:"setValue",value:function(y,J){var ye=this.props.precision,q=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),_e=this.state.value,k=_e===void 0?null:_e,f=this.state.inputValue,R=f===void 0?null:f,ue=typeof q=="number"?q.toFixed(ye):"".concat(q),se=q!==k||ue!=="".concat(R);return"value"in this.props?(R=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:R},J)):this.setState({value:q,inputValue:this.toPrecisionAsStep(y)},J),se&&this.props.onChange(q),q}},{key:"getMaxPrecision",value:function(y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ye=this.props,q=ye.precision,_e=ye.step;if(I(q))return q;var k=this.getPrecision(J),f=this.getPrecision(_e),R=this.getPrecision(y);return y?Math.max(R,k+f):k+f}},{key:"getPrecisionFactor",value:function(y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ye=this.getMaxPrecision(y,J);return Math.pow(10,ye)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var J=Math.abs(this.getMaxPrecision(y));return isNaN(J)?y.toString():Number(y).toFixed(J)}},{key:"toNumber",value:function(y){var J=this.props.precision,ye=this.state.focused,q=y&&y.length>16&&ye;return this.isNotCompleteNumber(y)||q?y:I(J)?Math.round(y*Math.pow(10,J))/Math.pow(10,J):Number(y)}},{key:"upStep",value:function(y,J){var ye=this.props.step,q=this.getPrecisionFactor(y,J),_e=Math.abs(this.getMaxPrecision(y,J)),k=((q*y+q*ye*J)/q).toFixed(_e);return this.toNumber(k)}},{key:"downStep",value:function(y,J){var ye=this.props.step,q=this.getPrecisionFactor(y,J),_e=Math.abs(this.getMaxPrecision(y,J)),k=((q*y-q*ye*J)/q).toFixed(_e);return this.toNumber(k)}},{key:"step",value:function(y,J){var ye=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_e=arguments.length>3?arguments[3]:void 0;this.stop(),J&&(J.persist(),J.preventDefault());var k=this.props;if(k.disabled)return;var f=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(f))return;var R=this["".concat(y,"Step")](f,q),ue=R>k.max||R<k.min;if(R>k.max?R=k.max:R<k.min&&(R=k.min),this.setValue(R,null),this.setState({focused:!0},function(){ye.pressingUpOrDown=!1}),ue)return;this.autoStepTimer=setTimeout(function(){ye[y](J,q,!0)},_e?me:Ce)}},{key:"fixCaret",value:function(y,J){if(y===void 0||J===void 0||!this.input||!this.input.value)return;try{var ye=this.input.selectionStart,q=this.input.selectionEnd;(y!==ye||J!==q)&&this.input.setSelectionRange(y,J)}catch(_e){}}},{key:"render",value:function(){var y,J=this.props,ye=J.prefixCls,q=J.disabled,_e=J.readOnly,k=J.useTouch,f=J.autoComplete,R=J.upHandler,ue=J.downHandler,se=J.className,Se=J.max,fe=J.min,pe=J.style,j=J.title,M=J.onMouseEnter,re=J.onMouseLeave,P=J.onMouseOver,_=J.onMouseOut,he=J.required,Pe=J.onClick,Je=J.tabIndex,Me=J.type,We=J.placeholder,Ee=J.id,De=J.inputMode,Ve=J.pattern,et=J.step,at=J.maxLength,Ye=J.autoFocus,He=J.name,St=J.onPaste,ft=J.onInput,bt=Object(oe.a)(J,["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"]),dt=this.state,Dt=dt.value,Ot=dt.focused,_t=W()(ye,(y={},Object(Le.a)(y,se,!!se),Object(Le.a)(y,"".concat(ye,"-disabled"),q),Object(Le.a)(y,"".concat(ye,"-focused"),Ot),y)),Ue={};Object.keys(bt).forEach(function(D){(D.substr(0,5)==="data-"||D.substr(0,5)==="aria-"||D==="role")&&(Ue[D]=bt[D])});var It=!_e&&!q,kt=this.getInputDisplayValue(null),Be=(Dt||Dt===0)&&(isNaN(Dt)||Number(Dt)>=Se),Ke=(Dt||Dt===0)&&(isNaN(Dt)||Number(Dt)<=fe),K=Be||q||_e,G=Ke||q||_e,H=W()("".concat(ye,"-handler"),"".concat(ye,"-handler-up"),Object(Le.a)({},"".concat(ye,"-handler-up-disabled"),K)),w=W()("".concat(ye,"-handler"),"".concat(ye,"-handler-down"),Object(Le.a)({},"".concat(ye,"-handler-down-disabled"),G)),O=k?{onTouchStart:K?U:this.up,onTouchEnd:this.stop}:{onMouseDown:K?U:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},L=k?{onTouchStart:G?U:this.down,onTouchEnd:this.stop}:{onMouseDown:G?U:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return F.a.createElement("div",{className:_t,style:pe,title:j,onMouseEnter:M,onMouseLeave:re,onMouseOver:P,onMouseOut:_,onFocus:function(){return null},onBlur:function(){return null}},F.a.createElement("div",{className:"".concat(ye,"-handler-wrap")},F.a.createElement("span",Object.assign({unselectable:"on"},O,{role:"button","aria-label":"Increase Value","aria-disabled":K,className:H}),R||F.a.createElement("span",{unselectable:"on",className:"".concat(ye,"-handler-up-inner"),onClick:te})),F.a.createElement("span",Object.assign({unselectable:"on"},L,{role:"button","aria-label":"Decrease Value","aria-disabled":G,className:w}),ue||F.a.createElement("span",{unselectable:"on",className:"".concat(ye,"-handler-down-inner"),onClick:te}))),F.a.createElement("div",{className:"".concat(ye,"-input-wrap")},F.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":fe,"aria-valuemax":Se,"aria-valuenow":Dt,required:he,type:Me,placeholder:We,onPaste:St,onClick:Pe,onMouseUp:this.onMouseUp,className:"".concat(ye,"-input"),tabIndex:Je,autoComplete:f,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:It?this.onKeyDown:U,onKeyUp:It?this.onKeyUp:U,autoFocus:Ye,maxLength:at,readOnly:_e,disabled:q,max:Se,min:fe,step:et,name:He,title:j,id:Ee,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(kt),pattern:Ve,inputMode:De,onInput:ft},Ue))))}}]),N}(F.a.Component);Q.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:de,min:-de,step:1,style:{},onChange:U,onKeyDown:U,onPressEnter:U,onFocus:U,onBlur:U,parser:E,required:!1,autoComplete:"off"};var S=Q,A=Ie.a=S},"e+RI":function(it,Ie,l){it.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":function(it,Ie,l){"use strict";var oe=l("giR+"),Le=l("fyUT"),ge=l("tJVT"),Te=l("PpiC"),Oe=l("OaEy"),Re=l("2fM7"),ee=l("q1tI"),B=l.n(ee),F=l("2sxD"),X=l.n(F),W=l("51dB"),V=l.n(W),le=l("5MlY"),Z=l.n(le),z=l("lnNo"),$=l.n(z),U=l("YBdh"),te=l.n(U),E=l("LvDl"),me=l.n(E),Ce=l("TSYQ"),de=l.n(Ce),I=Re.a.Option,g=function(x){var b=parseInt(x);return Object(E.isNaN)(b)?0:b},Q=function(x){var b,N,T=x.index,y=x.value,J=y===void 0?[]:y,ye=x.onChange,q=x.type,_e=x.disabled,k=_e===void 0?!1:_e,f=x.expansion,R=f===void 0?!0:f,ue=Object(Te.a)(x,["index","value","onChange","type","disabled","expansion"]),se=Object(ee.useState)(!0),Se=Object(ge.a)(se,2),fe=Se[0],pe=Se[1],j=function(re,P){var _=Object(E.cloneDeep)(J);_.difficulties[P].num=re,ye(_)};return B.a.createElement("div",{className:X.a.ListGroup,style:{borderWidth:T?1:0}},B.a.createElement("div",{className:X.a.a},T+1),B.a.createElement("div",{"data-type":"width",className:X.a.b},J==null?void 0:J.name),B.a.createElement("div",{className:X.a.c},J==null||((b=J.difficulties)===null||b===void 0)?void 0:b.map(function(M,re){return B.a.createElement("div",{key:re,style:{display:fe?"flex":re?"none":"flex"},className:X.a.c1},B.a.createElement("span",{style:{color:"#777777",marginRight:5}},"\u96BE\u5EA6"),M.difficulty===1&&B.a.createElement("span",{className:X.a.radio},"\u7B80\u5355"),M.difficulty===2&&B.a.createElement("span",{className:X.a.radio},"\u9002\u4E2D"),M.difficulty===3&&B.a.createElement("span",{className:X.a.radio},"\u56F0\u96BE"),B.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"\u62BD\u9898\u6570\u91CF"),T===0&&re===0?B.a.createElement("div",{id:"".concat(q,"_sum")},B.a.createElement(Le.a,{disabled:k,parser:g,onChange:function(_){return j(_,re)},min:0,max:M==null?void 0:M.count,value:(M==null?void 0:M.num)||0,style:{width:66}}),B.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6570\u91CF")):B.a.createElement(Le.a,{disabled:k,parser:g,onChange:function(_){return j(_,re)},min:0,max:M==null?void 0:M.count,value:(M==null?void 0:M.num)||0,style:{width:66}}),B.a.createElement("span",{style:{marginLeft:5}},"/",M==null?void 0:M.count))})),B.a.createElement("div",{style:{display:(J==null||((N=J.difficulties)===null||N===void 0)?void 0:N.length)===1||!R?"none":"block"},onClick:function(){return pe(!fe)},className:X.a.d},fe?"\u6536\u8D77":"\u5C55\u5F00",B.a.createElement("img",{style:{marginTop:-2,transform:fe?"rotate(0deg)":"rotate(180deg)"},src:$.a,className:"ml5"})))},S=function(x){var b,N,T=x.value,y=T===void 0?[]:T,J=x.onChange,ye=x.listClassName,q=x.disabled,_e=q===void 0?!1:q,k=x.expansion,f=k===void 0?!0:k,R=Object(Te.a)(x,["value","onChange","listClassName","disabled","expansion"]),ue=Object(ee.useState)(!0),se=Object(ge.a)(ue,2),Se=se[0],fe=se[1],pe=function(_){var he,Pe=_.score||0,Je=[];_==null||((he=_.item_banks)===null||he===void 0)||he.forEach(function(We){var Ee;We==null||((Ee=We.tag_disciplines)===null||Ee===void 0)||Ee.forEach(function(De){var Ve;De==null||((Ve=De.difficulties)===null||Ve===void 0)||Ve.forEach(function(et){et.num&&Je.push(et.num)})})});var Me=Je.reduce(function(We,Ee){return We+Ee},0);return Me*Pe},j=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"PROGRAM",name:"\u7A0B\u5E8F\u8BBE\u8BA1\u9898"},{type:"PROGRAM_CORRECTION",name:"\u7A0B\u5E8F\u6539\u9519\u9898"},{type:"PROGRAM_COMPLETION",name:"\u7A0B\u5E8F\u586B\u7A7A\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],M=function(_,he,Pe){var Je=Object(E.cloneDeep)(y);Je.item_banks[he].tag_disciplines[Pe]=_;var Me=pe(Je);Je.scoreTotal=Me,console.log(Je,"newValue"),J(Je)},re=function(_){var he=Object(E.cloneDeep)(y);he.score=_;var Pe=pe(he);he.scoreTotal=Pe,J(he)};return B.a.createElement("div",{className:de()(X.a.list,ye)},B.a.createElement("div",{className:X.a.head},B.a.createElement("div",{className:X.a.name},B.a.createElement("b",null),B.a.createElement("span",null,(b=j.find(function(P){return P.type===(y==null?void 0:y.item_type)}))===null||b===void 0?void 0:b.name)),B.a.createElement("div",{className:X.a.right},f&&B.a.createElement("div",{onClick:function(){return fe(!Se)},className:"current c-light-primary mb10"},Se?"\u6536\u8D77":"\u5C55\u5F00",B.a.createElement("img",{style:{marginTop:-2,transform:Se?"rotate(0deg)":"rotate(180deg)"},src:$.a,className:"ml5"})),B.a.createElement("div",null,B.a.createElement("img",{src:V.a}),B.a.createElement("span",{className:"ml10 mr20"},"\u603B\u5206",y.scoreTotal,"\u5206"),B.a.createElement("img",{className:"mr10",src:Z.a}),B.a.createElement("span",null,(y==null?void 0:y.item_type)==="COMBINATION"?"\u6BCF\u5C0F\u9898":"\u6BCF\u9898"),B.a.createElement("div",{id:"".concat(y==null?void 0:y.item_type,"_score")},B.a.createElement(Le.a,{disabled:_e,parser:g,min:0,onChange:re,value:y.score,style:{margin:"0 5px"}}),B.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6BCF\u9898\u5206\u6570")),B.a.createElement("span",null,"\u5206")))),B.a.createElement("div",{className:X.a.body,style:{display:Se?"block":"none"}},y==null||((N=y.item_banks)===null||N===void 0)?void 0:N.map(function(P,_){var he;return B.a.createElement(B.a.Fragment,{key:_},B.a.createElement("div",{className:X.a.top},B.a.createElement("img",{src:te.a}),B.a.createElement("span",null,"\u65B9\u5411/\u8BFE\u7A0B"),B.a.createElement("b",null),B.a.createElement("aside",null,P==null?void 0:P.disciplines,"/",P==null?void 0:P.sub_discipline)),B.a.createElement("div",{className:X.a.bottom},B.a.createElement("div",{className:X.a.l},"\u77E5\u8BC6\u70B9"),B.a.createElement("div",{className:X.a.r},P==null||((he=P.tag_disciplines)===null||he===void 0)?void 0:he.map(function(Pe,Je){return B.a.createElement(Q,{expansion:f,disabled:_e,type:y==null?void 0:y.item_type,key:"".concat(_,"-").concat(Je),value:Pe,index:Je,onChange:function(We){return M(We,_,Je)}})}))))})))};Ie.a=S},exQ7:function(it,Ie,l){it.exports=l.p+"static/te.6f9c0684.svg"},fAei:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return me.a});var oe=l("rePB"),Le=l("VTBJ"),ge=l("KQm4"),Te=l("1OyB"),Oe=l("vuIU"),Re=l("Ji7U"),ee=l("LK+K"),B=l("q1tI"),F=l("4IlW"),X=l("Kwbf"),W=l("TSYQ"),V=l.n(W),le=l("sboe"),Z=l("OZM5"),z=l("815F"),$=l("ODXe"),U=l("Ff2n"),te=l("+nKL"),E=l("8XRh"),me=l("WaYH"),Ce=function(fe,pe){var j=fe.className,M=fe.style,re=fe.motion,P=fe.motionNodes,_=fe.motionType,he=fe.onMotionStart,Pe=fe.onMotionEnd,Je=fe.active,Me=fe.treeNodeRequiredProps,We=Object(U.a)(fe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Ee=B.useState(!0),De=Object($.a)(Ee,2),Ve=De[0],et=De[1],at=B.useContext(le.a),Ye=at.prefixCls,He=B.useRef(!1),St=function(){He.current||Pe(),He.current=!0};return Object(B.useEffect)(function(){P&&_==="hide"&&Ve&&et(!1)},[P]),Object(B.useEffect)(function(){return P&&he(),function(){P&&St()}},[]),P?B.createElement(E.default,Object.assign({ref:pe,visible:Ve},re,{motionAppear:_==="show",onAppearEnd:St,onLeaveEnd:St}),function(ft,bt){var dt=ft.className,Dt=ft.style;return B.createElement("div",{ref:bt,className:V()("".concat(Ye,"-treenode-motion"),dt),style:Dt},P.map(function(Ot){var _t=Ot.data,Ue=_t.key,It=Object(U.a)(_t,["key"]),kt=Ot.isStart,Be=Ot.isEnd;delete It.children;var Ke=Object(z.f)(Ue,Me);return B.createElement(me.a,Object.assign({},It,Ke,{active:Je,data:Ot.data,key:Ue,isStart:kt,isEnd:Be}))}))}):B.createElement(me.a,Object.assign({domRef:pe,className:j,style:M},We,{active:Je}))};Ce.displayName="MotionTreeNode";var de=B.forwardRef(Ce),I=de;function g(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],pe=Se.length,j=fe.length;if(Math.abs(pe-j)!==1)return{add:!1,key:null};function M(re,P){var _=new Map;re.forEach(function(Pe){_.set(Pe,!0)});var he=P.filter(function(Pe){return!_.has(Pe)});return he.length===1?he[0]:null}return pe<j?{add:!0,key:M(Se,fe)}:{add:!1,key:M(fe,Se)}}function Q(Se,fe,pe){var j=Se.findIndex(function(_){var he=_.data;return he.key===pe}),M=Se[j+1],re=fe.findIndex(function(_){var he=_.data;return he.key===pe});if(M){var P=fe.findIndex(function(_){var he=_.data;return he.key===M.data.key});return fe.slice(re+1,P)}return fe.slice(re+1)}var S={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},A=function(){},x="RC_TREE_MOTION_".concat(Math.random()),b={key:x},N={key:x,level:0,index:0,pos:"0",node:b},T={parent:null,children:[],pos:N.pos,data:b,isStart:[],isEnd:[]};function y(Se,fe,pe,j){return fe===!1||!pe?Se:Se.slice(0,Math.ceil(pe/j)+1)}function J(Se){var fe=Se.data.key,pe=Se.pos;return Object(z.e)(fe,pe)}function ye(Se){for(var fe=String(Se.data.key),pe=Se;pe.parent;)pe=pe.parent,fe="".concat(pe.data.key," > ").concat(fe);return fe}var q=function(fe,pe){var j=fe.prefixCls,M=fe.data,re=fe.selectable,P=fe.checkable,_=fe.expandedKeys,he=fe.selectedKeys,Pe=fe.checkedKeys,Je=fe.loadedKeys,Me=fe.loadingKeys,We=fe.halfCheckedKeys,Ee=fe.keyEntities,De=fe.disabled,Ve=fe.dragging,et=fe.dragOverNodeKey,at=fe.dropPosition,Ye=fe.motion,He=fe.height,St=fe.itemHeight,ft=fe.virtual,bt=fe.focusable,dt=fe.activeItem,Dt=fe.focused,Ot=fe.tabIndex,_t=fe.onKeyDown,Ue=fe.onFocus,It=fe.onBlur,kt=fe.onActiveChange,Be=fe.onListChangeStart,Ke=fe.onListChangeEnd,K=Object(U.a)(fe,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),G=B.useRef(null);B.useImperativeHandle(pe,function(){return{scrollTo:function(ct){G.current.scrollTo(ct)}}});var H=B.useState(_),w=Object($.a)(H,2),O=w[0],L=w[1],D=B.useState(M),ve=Object($.a)(D,2),ne=ve[0],xe=ve[1],qe=B.useState(M),ht=Object($.a)(qe,2),Fe=ht[0],Xe=ht[1],Rt=B.useState([]),Ne=Object($.a)(Rt,2),jt=Ne[0],Ft=Ne[1],we=B.useState(null),vt=Object($.a)(we,2),lt=vt[0],Ut=vt[1];function Nt(){xe(M),Xe(M),Ft([]),Ut(null),Ke()}B.useEffect(function(){L(_);var ot=g(O,_);if(ot.key!==null)if(ot.add){var ct=ne.findIndex(function(nn){var zt=nn.data.key;return zt===ot.key}),Yt=y(Q(ne,M,ot.key),ft,He,St),Ht=ne.slice();Ht.splice(ct+1,0,T),Xe(Ht),Ft(Yt),Ut("show")}else{var an=M.findIndex(function(nn){var zt=nn.data.key;return zt===ot.key}),Qt=y(Q(M,ne,ot.key),ft,He,St),xt=M.slice();xt.splice(an+1,0,T),Xe(xt),Ft(Qt),Ut("hide")}else ne!==M&&(xe(M),Xe(M))},[_,M]),B.useEffect(function(){Ve||Nt()},[Ve]);var Ge=Ye?Fe:M,ut={expandedKeys:_,selectedKeys:he,loadedKeys:Je,loadingKeys:Me,checkedKeys:Pe,halfCheckedKeys:We,dragOverNodeKey:et,dropPosition:at,keyEntities:Ee};return B.createElement(B.Fragment,null,Dt&&dt&&B.createElement("span",{style:S,"aria-live":"assertive"},ye(dt)),B.createElement("div",{role:"tree"},B.createElement("input",{style:S,disabled:bt===!1||De,tabIndex:bt!==!1?Ot:null,onKeyDown:_t,onFocus:Ue,onBlur:It,value:"",onChange:A})),B.createElement(te.a,Object.assign({},K,{data:Ge,itemKey:J,height:He,fullHeight:!1,virtual:ft,itemHeight:St,prefixCls:"".concat(j,"-list"),ref:G}),function(ot){var ct=ot.pos,Yt=ot.data,Ht=Yt.key,an=Object(U.a)(Yt,["key"]),Qt=ot.isStart,xt=ot.isEnd,nn=Object(z.e)(Ht,ct);delete an.children;var zt=Object(z.f)(nn,ut);return B.createElement(I,Object.assign({},an,zt,{active:dt&&Ht===dt.data.key,pos:ct,data:ot.data,isStart:Qt,isEnd:xt,motion:Ye,motionNodes:Ht===x?jt:null,motionType:lt,onMotionStart:Be,onMotionEnd:Nt,treeNodeRequiredProps:ut,onMouseMove:function(){kt(null)}}))}))},_e=B.forwardRef(q);_e.displayName="NodeList";var k=_e,f=l("NvD2"),R=function(Se){Object(Re.a)(pe,Se);var fe=Object(ee.a)(pe);function pe(){var j;return Object(Te.a)(this,pe),j=fe.apply(this,arguments),j.destroyed=!1,j.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},j.listRef=B.createRef(),j.onNodeDragStart=function(M,re){var P=j.state,_=P.expandedKeys,he=P.keyEntities,Pe=j.props.onDragStart,Je=re.props.eventKey;j.dragNode=re;var Me=Object(Z.b)(_,Je);j.setState({dragging:!0,dragNodesKeys:Object(Z.g)(Je,he)}),j.setExpandedKeys(Me),Pe&&Pe({event:M,node:Object(z.b)(re.props)})},j.onNodeDragEnter=function(M,re){var P=j.state,_=P.expandedKeys,he=P.keyEntities,Pe=P.dragNodesKeys,Je=j.props.onDragEnter,Me=re.props,We=Me.pos,Ee=Me.eventKey;if(!j.dragNode||Pe.indexOf(Ee)!==-1)return;var De=Object(Z.c)(M,re);if(j.dragNode.props.eventKey===Ee&&De===0){j.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){j.setState({dragOverNodeKey:Ee,dropPosition:De}),j.delayedDragEnterLogic||(j.delayedDragEnterLogic={}),Object.keys(j.delayedDragEnterLogic).forEach(function(Ve){clearTimeout(j.delayedDragEnterLogic[Ve])}),j.delayedDragEnterLogic[We]=window.setTimeout(function(){if(!j.state.dragging)return;var Ve=Object(ge.a)(_),et=he[Ee];et&&(et.children||[]).length&&(Ve=Object(Z.a)(_,Ee)),"expandedKeys"in j.props||j.setExpandedKeys(Ve),Je&&Je({event:M,node:Object(z.b)(re.props),expandedKeys:Ve})},400)},0)},j.onNodeDragOver=function(M,re){var P=j.state.dragNodesKeys,_=j.props.onDragOver,he=re.props.eventKey;if(P.indexOf(he)!==-1)return;if(j.dragNode&&he===j.state.dragOverNodeKey){var Pe=Object(Z.c)(M,re);if(Pe===j.state.dropPosition)return;j.setState({dropPosition:Pe})}_&&_({event:M,node:Object(z.b)(re.props)})},j.onNodeDragLeave=function(M,re){var P=j.props.onDragLeave;j.setState({dragOverNodeKey:""}),P&&P({event:M,node:Object(z.b)(re.props)})},j.onNodeDragEnd=function(M,re){var P=j.props.onDragEnd;j.setState({dragOverNodeKey:""}),j.cleanDragState(),P&&P({event:M,node:Object(z.b)(re.props)}),j.dragNode=null},j.onNodeDrop=function(M,re){var P=j.state,_=P.dragNodesKeys,he=_===void 0?[]:_,Pe=P.dropPosition,Je=j.props.onDrop,Me=re.props,We=Me.eventKey,Ee=Me.pos;if(j.setState({dragOverNodeKey:""}),j.cleanDragState(),he.indexOf(We)!==-1){Object(X.a)(!1,"Can not drop to dragNode(include it's children node)");return}var De=Object(Z.k)(Ee),Ve={event:M,node:Object(z.b)(re.props),dragNode:j.dragNode?Object(z.b)(j.dragNode.props):null,dragNodesKeys:he.slice(),dropPosition:Pe+Number(De[De.length-1]),dropToGap:!1};Pe!==0&&(Ve.dropToGap=!0),Je&&Je(Ve),j.dragNode=null},j.cleanDragState=function(){var M=j.state.dragging;M&&j.setState({dragging:!1})},j.onNodeClick=function(M,re){var P=j.props.onClick;P&&P(M,re)},j.onNodeDoubleClick=function(M,re){var P=j.props.onDoubleClick;P&&P(M,re)},j.onNodeSelect=function(M,re){var P=j.state.selectedKeys,_=j.state.keyEntities,he=j.props,Pe=he.onSelect,Je=he.multiple,Me=re.selected,We=re.key,Ee=!Me;Ee?Je?P=Object(Z.a)(P,We):P=[We]:P=Object(Z.b)(P,We);var De=P.map(function(Ve){var et=_[Ve];return et?et.node:null}).filter(function(Ve){return Ve});j.setUncontrolledState({selectedKeys:P}),Pe&&Pe(P,{event:"select",selected:Ee,node:re,selectedNodes:De,nativeEvent:M.nativeEvent})},j.onNodeCheck=function(M,re,P){var _=j.state,he=_.keyEntities,Pe=_.checkedKeys,Je=_.halfCheckedKeys,Me=j.props,We=Me.checkStrictly,Ee=Me.onCheck,De=re.key,Ve,et={event:"check",node:re,checked:P,nativeEvent:M.nativeEvent};if(We){var at=P?Object(Z.a)(Pe,De):Object(Z.b)(Pe,De),Ye=Object(Z.b)(Je,De);Ve={checked:at,halfChecked:Ye},et.checkedNodes=at.map(function(Dt){return he[Dt]}).filter(function(Dt){return Dt}).map(function(Dt){return Dt.node}),j.setUncontrolledState({checkedKeys:at})}else{var He=Object(f.a)([].concat(Object(ge.a)(Pe),[De]),!0,he),St=He.checkedKeys,ft=He.halfCheckedKeys;if(!P){var bt=new Set(St);bt.delete(De);var dt=Object(f.a)(Array.from(bt),{checked:!1,halfCheckedKeys:ft},he);St=dt.checkedKeys,ft=dt.halfCheckedKeys}Ve=St,et.checkedNodes=[],et.checkedNodesPositions=[],et.halfCheckedKeys=ft,St.forEach(function(Dt){var Ot=he[Dt];if(!Ot)return;var _t=Ot.node,Ue=Ot.pos;et.checkedNodes.push(_t),et.checkedNodesPositions.push({node:_t,pos:Ue})}),j.setUncontrolledState({checkedKeys:St},!1,{halfCheckedKeys:ft})}Ee&&Ee(Ve,et)},j.onNodeLoad=function(M){return new Promise(function(re){j.setState(function(P){var _=P.loadedKeys,he=_===void 0?[]:_,Pe=P.loadingKeys,Je=Pe===void 0?[]:Pe,Me=j.props,We=Me.loadData,Ee=Me.onLoad,De=M.key;if(!We||he.indexOf(De)!==-1||Je.indexOf(De)!==-1)return{};var Ve=We(M);return Ve.then(function(){var et=j.state,at=et.loadedKeys,Ye=et.loadingKeys,He=Object(Z.a)(at,De),St=Object(Z.b)(Ye,De);Ee&&Ee(He,{event:"load",node:M}),j.setUncontrolledState({loadedKeys:He}),j.setState({loadingKeys:St}),re()}),{loadingKeys:Object(Z.a)(Je,De)}})})},j.onNodeMouseEnter=function(M,re){var P=j.props.onMouseEnter;P&&P({event:M,node:re})},j.onNodeMouseLeave=function(M,re){var P=j.props.onMouseLeave;P&&P({event:M,node:re})},j.onNodeContextMenu=function(M,re){var P=j.props.onRightClick;P&&(M.preventDefault(),P({event:M,node:re}))},j.onFocus=function(){var M=j.props.onFocus;j.setState({focused:!0}),M&&M.apply(void 0,arguments)},j.onBlur=function(){var M=j.props.onBlur;j.setState({focused:!1}),j.onActiveChange(null),M&&M.apply(void 0,arguments)},j.getTreeNodeRequiredProps=function(){var M=j.state,re=M.expandedKeys,P=M.selectedKeys,_=M.loadedKeys,he=M.loadingKeys,Pe=M.checkedKeys,Je=M.halfCheckedKeys,Me=M.dragOverNodeKey,We=M.dropPosition,Ee=M.keyEntities;return{expandedKeys:re||[],selectedKeys:P||[],loadedKeys:_||[],loadingKeys:he||[],checkedKeys:Pe||[],halfCheckedKeys:Je||[],dragOverNodeKey:Me,dropPosition:We,keyEntities:Ee}},j.setExpandedKeys=function(M){var re=j.state.treeData,P=Object(z.d)(re,M);j.setUncontrolledState({expandedKeys:M,flattenNodes:P},!0)},j.onNodeExpand=function(M,re){var P=j.state.expandedKeys,_=j.state.listChanging,he=j.props,Pe=he.onExpand,Je=he.loadData,Me=re.key,We=re.expanded;if(_)return;var Ee=P.indexOf(Me),De=!We;if(Object(X.a)(We&&Ee!==-1||!We&&Ee===-1,"Expand state not sync with index check"),De?P=Object(Z.a)(P,Me):P=Object(Z.b)(P,Me),j.setExpandedKeys(P),Pe&&Pe(P,{node:re,expanded:De,nativeEvent:M.nativeEvent}),De&&Je){var Ve=j.onNodeLoad(re);Ve&&Ve.then(function(){var et=Object(z.d)(j.state.treeData,P);j.setUncontrolledState({flattenNodes:et})})}},j.onListChangeStart=function(){j.setUncontrolledState({listChanging:!0})},j.onListChangeEnd=function(){setTimeout(function(){j.setUncontrolledState({listChanging:!1})})},j.onActiveChange=function(M){var re=j.state.activeKey,P=j.props.onActiveChange;if(re===M)return;j.setState({activeKey:M}),M!==null&&j.scrollTo({key:M}),P&&P(M)},j.getActiveItem=function(){var M=j.state,re=M.activeKey,P=M.flattenNodes;return re===null?null:P.find(function(_){var he=_.data.key;return he===re})||null},j.offsetActiveKey=function(M){var re=j.state,P=re.flattenNodes,_=re.activeKey,he=P.findIndex(function(Me){var We=Me.data.key;return We===_});he===-1&&M<0&&(he=P.length),he=(he+M+P.length)%P.length;var Pe=P[he];if(Pe){var Je=Pe.data.key;j.onActiveChange(Je)}else j.onActiveChange(null)},j.onKeyDown=function(M){var re=j.state,P=re.activeKey,_=re.expandedKeys,he=re.checkedKeys,Pe=j.props,Je=Pe.onKeyDown,Me=Pe.checkable,We=Pe.selectable;switch(M.which){case F.a.UP:{j.offsetActiveKey(-1),M.preventDefault();break}case F.a.DOWN:{j.offsetActiveKey(1),M.preventDefault();break}}var Ee=j.getActiveItem();if(Ee&&Ee.data){var De=j.getTreeNodeRequiredProps(),Ve=Ee.data.isLeaf===!1||!!(Ee.data.children||[]).length,et=Object(z.b)(Object(Le.a)(Object(Le.a)({},Object(z.f)(P,De)),{},{data:Ee.data,active:!0}));switch(M.which){case F.a.LEFT:{Ve&&_.includes(P)?j.onNodeExpand({},et):Ee.parent&&j.onActiveChange(Ee.parent.data.key),M.preventDefault();break}case F.a.RIGHT:{Ve&&!_.includes(P)?j.onNodeExpand({},et):Ee.children&&Ee.children.length&&j.onActiveChange(Ee.children[0].data.key),M.preventDefault();break}case F.a.ENTER:case F.a.SPACE:{Me&&!et.disabled&&et.checkable!==!1&&!et.disableCheckbox?j.onNodeCheck({},et,!he.includes(P)):!Me&&We&&!et.disabled&&et.selectable!==!1&&j.onNodeSelect({},et);break}}}Je&&Je(M)},j.setUncontrolledState=function(M){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(j.destroyed)return;var _=!1,he=!0,Pe={};Object.keys(M).forEach(function(Je){if(Je in j.props){he=!1;return}_=!0,Pe[Je]=M[Je]}),_&&(!re||he)&&j.setState(Object(Le.a)(Object(Le.a)({},Pe),P))},j.scrollTo=function(M){j.listRef.current.scrollTo(M)},j}return Object(Oe.a)(pe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var M,re=this.state,P=re.focused,_=re.flattenNodes,he=re.keyEntities,Pe=re.dragging,Je=re.activeKey,Me=this.props,We=Me.prefixCls,Ee=Me.className,De=Me.style,Ve=Me.showLine,et=Me.focusable,at=Me.tabIndex,Ye=at===void 0?0:at,He=Me.selectable,St=Me.showIcon,ft=Me.icon,bt=Me.switcherIcon,dt=Me.draggable,Dt=Me.checkable,Ot=Me.checkStrictly,_t=Me.disabled,Ue=Me.motion,It=Me.loadData,kt=Me.filterTreeNode,Be=Me.height,Ke=Me.itemHeight,K=Me.virtual,G=Me.titleRender,H=Me.onContextMenu,w=Object(Z.f)(this.props);return B.createElement(le.a.Provider,{value:{prefixCls:We,selectable:He,showIcon:St,icon:ft,switcherIcon:bt,draggable:dt,checkable:Dt,checkStrictly:Ot,disabled:_t,keyEntities:he,loadData:It,filterTreeNode:kt,titleRender:G,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},B.createElement("div",{className:V()(We,Ee,(M={},Object(oe.a)(M,"".concat(We,"-show-line"),Ve),Object(oe.a)(M,"".concat(We,"-focused"),P),Object(oe.a)(M,"".concat(We,"-active-focused"),Je!==null),M))},B.createElement(k,Object.assign({ref:this.listRef,prefixCls:We,style:De,data:_,disabled:_t,selectable:He,checkable:!!Dt,motion:Ue,dragging:Pe,height:Be,itemHeight:Ke,virtual:K,focusable:et,focused:P,tabIndex:Ye,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:H},this.getTreeNodeRequiredProps(),w))))}}],[{key:"getDerivedStateFromProps",value:function(M,re){var P=re.prevProps,_={prevProps:M};function he(ft){return!P&&ft in M||P&&P[ft]!==M[ft]}var Pe;if(he("treeData")?Pe=M.treeData:he("children")&&(Object(X.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Pe=Object(z.c)(M.children)),Pe){_.treeData=Pe;var Je=Object(z.a)(Pe);_.keyEntities=Object(Le.a)(Object(oe.a)({},x,N),Je.keyEntities)}var Me=_.keyEntities||re.keyEntities;if(he("expandedKeys")||P&&he("autoExpandParent"))_.expandedKeys=M.autoExpandParent||!P&&M.defaultExpandParent?Object(Z.e)(M.expandedKeys,Me):M.expandedKeys;else if(!P&&M.defaultExpandAll){var We=Object(Le.a)({},Me);delete We[x],_.expandedKeys=Object.keys(We).map(function(ft){return We[ft].key})}else!P&&M.defaultExpandedKeys&&(_.expandedKeys=M.autoExpandParent||M.defaultExpandParent?Object(Z.e)(M.defaultExpandedKeys,Me):M.defaultExpandedKeys);if(_.expandedKeys||delete _.expandedKeys,Pe||_.expandedKeys){var Ee=Object(z.d)(Pe||re.treeData,_.expandedKeys||re.expandedKeys);_.flattenNodes=Ee}if(M.selectable&&(he("selectedKeys")?_.selectedKeys=Object(Z.d)(M.selectedKeys,M):!P&&M.defaultSelectedKeys&&(_.selectedKeys=Object(Z.d)(M.defaultSelectedKeys,M))),M.checkable){var De;if(he("checkedKeys")?De=Object(Z.j)(M.checkedKeys)||{}:!P&&M.defaultCheckedKeys?De=Object(Z.j)(M.defaultCheckedKeys)||{}:Pe&&(De=Object(Z.j)(M.checkedKeys)||{checkedKeys:re.checkedKeys,halfCheckedKeys:re.halfCheckedKeys}),De){var Ve=De,et=Ve.checkedKeys,at=et===void 0?[]:et,Ye=Ve.halfCheckedKeys,He=Ye===void 0?[]:Ye;if(!M.checkStrictly){var St=Object(f.a)(at,!0,Me);at=St.checkedKeys,He=St.halfCheckedKeys}_.checkedKeys=at,_.halfCheckedKeys=He}}return he("loadedKeys")&&(_.loadedKeys=M.loadedKeys),_}}]),pe}(B.Component);R.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},R.TreeNode=me.a;var ue=R,se=Ie.b=ue},fcSX:function(it,Ie,l){"use strict";var oe=l("Ff2n"),Le=l("1OyB"),ge=l("vuIU"),Te=l("Ji7U"),Oe=l("md7G"),Re=l("foSv"),ee=l("1W/9"),B=l("q1tI"),F=l("rePB"),X=l("JX7q"),W=l("TSYQ"),V=l.n(W),le=l("qx4F"),Z=l("4IlW");function z(q){return Array.isArray(q)?q:[q]}var $={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},U=Object.keys($).filter(function(q){if(typeof document=="undefined")return!1;var _e=document.getElementsByTagName("html")[0];return q in(_e?_e.style:{})})[0],te=$[U];function E(q,_e,k,f){q.addEventListener?q.addEventListener(_e,k,f):q.attachEvent&&q.attachEvent("on".concat(_e),k)}function me(q,_e,k,f){q.removeEventListener?q.removeEventListener(_e,k,f):q.attachEvent&&q.detachEvent("on".concat(_e),k)}function Ce(q,_e){var k=typeof q=="function"?q(_e):q;return Array.isArray(k)?k.length===2?k:[k[0],k[1]]:[k]}var de=function(_e){return!isNaN(parseFloat(_e))&&isFinite(_e)},I=!(typeof window!="undefined"&&window.document&&window.document.createElement),g=function q(_e,k,f,R){if(!k||k===document||k instanceof Document)return!1;if(k===_e.parentNode)return!0;var ue=Math.max(Math.abs(f),Math.abs(R))===Math.abs(R),se=Math.max(Math.abs(f),Math.abs(R))===Math.abs(f),Se=k.scrollHeight-k.clientHeight,fe=k.scrollWidth-k.clientWidth,pe=document.defaultView.getComputedStyle(k),j=pe.overflowY==="auto"||pe.overflowY==="scroll",M=pe.overflowX==="auto"||pe.overflowX==="scroll",re=Se&&j,P=fe&&M;return ue&&(!re||re&&(k.scrollTop>=Se&&R<0||k.scrollTop<=0&&R>0))||se&&(!P||P&&(k.scrollLeft>=fe&&f<0||k.scrollLeft<=0&&f>0))?q(_e,k.parentNode,f,R):!1};function Q(q){var _e=S();return function(){var f=Object(Re.a)(q),R;if(_e){var ue=Object(Re.a)(this).constructor;R=Reflect.construct(f,arguments,ue)}else R=f.apply(this,arguments);return Object(Oe.a)(this,R)}}function S(){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(q){return!1}}var A={},x=function(q){Object(Te.a)(k,q);var _e=Q(k);function k(f){var R;return Object(Le.a)(this,k),R=_e.call(this,f),R.domFocus=function(){R.dom&&R.dom.focus()},R.removeStartHandler=function(ue){if(ue.touches.length>1)return;R.startPos={x:ue.touches[0].clientX,y:ue.touches[0].clientY}},R.removeMoveHandler=function(ue){if(ue.changedTouches.length>1)return;var se=ue.currentTarget,Se=ue.changedTouches[0].clientX-R.startPos.x,fe=ue.changedTouches[0].clientY-R.startPos.y;(se===R.maskDom||se===R.handlerDom||se===R.contentDom&&g(se,ue.target,Se,fe))&&ue.cancelable&&ue.preventDefault()},R.transitionEnd=function(ue){var se=ue.target;me(se,te,R.transitionEnd),se.style.transition=""},R.onKeyDown=function(ue){if(ue.keyCode===Z.a.ESC){var se=R.props.onClose;ue.stopPropagation(),se&&se(ue)}},R.onWrapperTransitionEnd=function(ue){var se=R.props,Se=se.open,fe=se.afterVisibleChange;ue.target===R.contentWrapper&&ue.propertyName.match(/transform$/)&&(R.dom.style.transition="",!Se&&R.getCurrentDrawerSome()&&(document.body.style.overflowX="",R.maskDom&&(R.maskDom.style.left="",R.maskDom.style.width="")),fe&&fe(!!Se))},R.openLevelTransition=function(){var ue=R.props,se=ue.open,Se=ue.width,fe=ue.height,pe=R.getHorizontalBoolAndPlacementName(),j=pe.isHorizontal,M=pe.placementName,re=R.contentDom?R.contentDom.getBoundingClientRect()[j?"width":"height"]:0,P=(j?Se:fe)||re;R.setLevelAndScrolling(se,M,P)},R.setLevelTransform=function(ue,se,Se,fe){var pe=R.props,j=pe.placement,M=pe.levelMove,re=pe.duration,P=pe.ease,_=pe.showMask;R.levelDom.forEach(function(he){he.style.transition="transform ".concat(re," ").concat(P),E(he,te,R.transitionEnd);var Pe=ue?Se:0;if(M){var Je=Ce(M,{target:he,open:ue});Pe=ue?Je[0]:Je[1]||0}var Me=typeof Pe=="number"?"".concat(Pe,"px"):Pe,We=j==="left"||j==="top"?Me:"-".concat(Me);We=_&&j==="right"&&fe?"calc(".concat(We," + ").concat(fe,"px)"):We,he.style.transform=Pe?"".concat(se,"(").concat(We,")"):""})},R.setLevelAndScrolling=function(ue,se,Se){var fe=R.props.onChange;if(!I){var pe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(le.a)(!0):0;R.setLevelTransform(ue,se,Se,pe),R.toggleScrollingToDrawerAndBody(pe)}fe&&fe(ue)},R.toggleScrollingToDrawerAndBody=function(ue){var se=R.props,Se=se.getOpenCount,fe=se.getContainer,pe=se.showMask,j=se.open,M=fe&&fe(),re=Se&&Se();if(M&&M.parentNode===document.body&&pe){var P=["touchstart"],_=[document.body,R.maskDom,R.handlerDom,R.contentDom];j&&document.body.style.overflow!=="hidden"?(ue&&R.addScrollingEffect(ue),re===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",_.forEach(function(he,Pe){if(!he)return;E(he,P[Pe]||"touchmove",Pe?R.removeMoveHandler:R.removeStartHandler,R.passive)})):R.getCurrentDrawerSome()&&(re||(document.body.style.overflow=""),document.body.style.touchAction="",ue&&R.remScrollingEffect(ue),_.forEach(function(he,Pe){if(!he)return;me(he,P[Pe]||"touchmove",Pe?R.removeMoveHandler:R.removeStartHandler,R.passive)}))}},R.addScrollingEffect=function(ue){var se=R.props,Se=se.placement,fe=se.duration,pe=se.ease,j=se.getOpenCount,M=se.switchScrollingEffect,re=j&&j();re===1&&M();var P="width ".concat(fe," ").concat(pe),_="transform ".concat(fe," ").concat(pe);R.dom.style.transition="none";switch(Se){case"right":R.dom.style.transform="translateX(-".concat(ue,"px)");break;case"top":case"bottom":R.dom.style.width="calc(100% - ".concat(ue,"px)"),R.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(R.timeout),R.timeout=setTimeout(function(){R.dom&&(R.dom.style.transition="".concat(_,",").concat(P),R.dom.style.width="",R.dom.style.transform="")})},R.remScrollingEffect=function(ue){var se=R.props,Se=se.placement,fe=se.duration,pe=se.ease,j=se.getOpenCount,M=se.switchScrollingEffect,re=j&&j();re||M(!0),U&&(document.body.style.overflowX="hidden"),R.dom.style.transition="none";var P,_="width ".concat(fe," ").concat(pe),he="transform ".concat(fe," ").concat(pe);switch(Se){case"left":{R.dom.style.width="100%",_="width 0s ".concat(pe," ").concat(fe);break}case"right":{R.dom.style.transform="translateX(".concat(ue,"px)"),R.dom.style.width="100%",_="width 0s ".concat(pe," ").concat(fe),R.maskDom&&(R.maskDom.style.left="-".concat(ue,"px"),R.maskDom.style.width="calc(100% + ".concat(ue,"px)"));break}case"top":case"bottom":{R.dom.style.width="calc(100% + ".concat(ue,"px)"),R.dom.style.height="100%",R.dom.style.transform="translateZ(0)",P="height 0s ".concat(pe," ").concat(fe);break}default:break}clearTimeout(R.timeout),R.timeout=setTimeout(function(){R.dom&&(R.dom.style.transition="".concat(he,",").concat(P?"".concat(P,","):"").concat(_),R.dom.style.transform="",R.dom.style.width="",R.dom.style.height="")})},R.getCurrentDrawerSome=function(){return!Object.keys(A).some(function(ue){return A[ue]})},R.getLevelDom=function(ue){var se=ue.level,Se=ue.getContainer;if(I)return;var fe=Se&&Se(),pe=fe?fe.parentNode:null;if(R.levelDom=[],se==="all"){var j=pe?Array.prototype.slice.call(pe.children):[];j.forEach(function(M){M.nodeName!=="SCRIPT"&&M.nodeName!=="STYLE"&&M.nodeName!=="LINK"&&M!==fe&&R.levelDom.push(M)})}else se&&z(se).forEach(function(M){document.querySelectorAll(M).forEach(function(re){R.levelDom.push(re)})})},R.getHorizontalBoolAndPlacementName=function(){var ue=R.props.placement,se=ue==="left"||ue==="right",Se="translate".concat(se?"X":"Y");return{isHorizontal:se,placementName:Se}},R.state={_self:Object(X.a)(R)},R}return Object(ge.a)(k,[{key:"componentDidMount",value:function(){var R=this;if(!I){var ue=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ue=!0,null}}))}catch(j){}this.passive=ue?{passive:!1}:!1}var se=this.props,Se=se.open,fe=se.getContainer,pe=fe&&fe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),Se&&(pe&&pe.parentNode===document.body&&(A[this.drawerId]=Se),this.openLevelTransition(),this.forceUpdate(function(){R.domFocus()}))}},{key:"componentDidUpdate",value:function(R){var ue=this.props,se=ue.open,Se=ue.getContainer,fe=Se&&Se();se!==R.open&&(se&&this.domFocus(),fe&&fe.parentNode===document.body&&(A[this.drawerId]=!!se),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var R=this.props,ue=R.getOpenCount,se=R.open,Se=R.switchScrollingEffect,fe=typeof ue=="function"&&ue();delete A[this.drawerId],se&&(this.setLevelTransform(!1),document.body.style.touchAction=""),fe||(document.body.style.overflow="",Se(!0))}},{key:"render",value:function(){var R,ue=this,se=this.props,Se=se.className,fe=se.children,pe=se.style,j=se.width,M=se.height,re=se.defaultOpen,P=se.open,_=se.prefixCls,he=se.placement,Pe=se.level,Je=se.levelMove,Me=se.ease,We=se.duration,Ee=se.getContainer,De=se.handler,Ve=se.onChange,et=se.afterVisibleChange,at=se.showMask,Ye=se.maskClosable,He=se.maskStyle,St=se.onClose,ft=se.onHandleClick,bt=se.keyboard,dt=se.getOpenCount,Dt=se.switchScrollingEffect,Ot=Object(oe.a)(se,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),_t=this.dom?P:!1,Ue=V()(_,(R={},Object(F.a)(R,"".concat(_,"-").concat(he),!0),Object(F.a)(R,"".concat(_,"-open"),_t),Object(F.a)(R,Se||"",!!Se),Object(F.a)(R,"no-mask",!at),R)),It=this.getHorizontalBoolAndPlacementName(),kt=It.placementName,Be=he==="left"||he==="top"?"-100%":"100%",Ke=_t?"":"".concat(kt,"(").concat(Be,")"),K=De&&B.cloneElement(De,{onClick:function(H){De.props.onClick&&De.props.onClick(),ft&&ft(H)},ref:function(H){ue.handlerDom=H}});return B.createElement("div",Object.assign({},Ot,{tabIndex:-1,className:Ue,style:pe,ref:function(H){ue.dom=H},onKeyDown:_t&&bt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),at&&B.createElement("div",{className:"".concat(_,"-mask"),onClick:Ye?St:void 0,style:He,ref:function(H){ue.maskDom=H}}),B.createElement("div",{className:"".concat(_,"-content-wrapper"),style:{transform:Ke,msTransform:Ke,width:de(j)?"".concat(j,"px"):j,height:de(M)?"".concat(M,"px"):M},ref:function(H){ue.contentWrapper=H}},B.createElement("div",{className:"".concat(_,"-content"),ref:function(H){ue.contentDom=H},onTouchStart:_t&&at?this.removeStartHandler:void 0,onTouchMove:_t&&at?this.removeMoveHandler:void 0},fe),K))}}],[{key:"getDerivedStateFromProps",value:function(R,ue){var se=ue.prevProps,Se=ue._self,fe={prevProps:R};if(se!==void 0){var pe=R.placement,j=R.level;pe!==se.placement&&(Se.contentDom=null),j!==se.level&&Se.getLevelDom(R)}return fe}}]),k}(B.Component);x.defaultProps={switchScrollingEffect:function(){}};var b=x;function N(q){var _e=T();return function(){var f=Object(Re.a)(q),R;if(_e){var ue=Object(Re.a)(this).constructor;R=Reflect.construct(f,arguments,ue)}else R=f.apply(this,arguments);return Object(Oe.a)(this,R)}}function T(){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(q){return!1}}var y=function(q){Object(Te.a)(k,q);var _e=N(k);function k(f){var R;Object(Le.a)(this,k),R=_e.call(this,f),R.onHandleClick=function(se){var Se=R.props,fe=Se.onHandleClick,pe=Se.open;if(fe&&fe(se),typeof pe=="undefined"){var j=R.state.open;R.setState({open:!j})}},R.onClose=function(se){var Se=R.props,fe=Se.onClose,pe=Se.open;fe&&fe(se),typeof pe=="undefined"&&R.setState({open:!1})};var ue=typeof f.open!="undefined"?f.open:!!f.defaultOpen;return R.state={open:ue},"onMaskClick"in f&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),R}return Object(ge.a)(k,[{key:"render",value:function(){var R=this,ue=this.props,se=ue.defaultOpen,Se=ue.getContainer,fe=ue.wrapperClassName,pe=ue.forceRender,j=ue.handler,M=Object(oe.a)(ue,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),re=this.state.open;if(!Se)return B.createElement("div",{className:fe,ref:function(he){R.dom=he}},B.createElement(b,Object.assign({},M,{open:re,handler:j,getContainer:function(){return R.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var P=!!j||pe;return B.createElement(ee.a,{visible:re,forceRender:P,getContainer:Se,wrapperClassName:fe},function(_){var he=_.visible,Pe=_.afterClose,Je=Object(oe.a)(_,["visible","afterClose"]);return B.createElement(b,Object.assign({},M,Je,{open:he!==void 0?he:re,afterVisibleChange:Pe!==void 0?Pe:M.afterVisibleChange,handler:j,onClose:R.onClose,onHandleClick:R.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(R,ue){var se=ue.prevProps,Se={prevProps:R};return typeof se!="undefined"&&R.open!==se.open&&(Se.open=R.open),Se}}]),k}(B.Component);y.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:B.createElement("div",{className:"drawer-handle"},B.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var J=y,ye=Ie.a=J},k4n4:function(it,Ie,l){"use strict";var oe=l("tJVT"),Le=l("q1tI"),ge=l.n(Le),Te=l("e+RI"),Oe=l.n(Te),Re=l("FTkQ"),ee=l.n(Re),B=l("E/GV"),F=l.n(B),X=function(V){var le=V.type,Z=le===void 0?1:le,z=V.value,$=z===void 0?[]:z,U=V.onChange,te=V.disabled,E=te===void 0?!1:te,me=V.icon,Ce=Object(Le.useState)(),de=Object(oe.a)(Ce,2),I=de[0],g=de[1],Q=function(A){U(A)};return Z===1?ge.a.createElement("div",null,$==null?void 0:$.map(function(S,A){return ge.a.createElement("div",{key:A,className:E?"".concat(Oe.a.btn," ").concat(Oe.a.btnDisabled):Oe.a.btn},ge.a.createElement("span",{className:Oe.a.s1},S.name),ge.a.createElement("img",{src:ee.a,className:Oe.a.s2,onClick:function(){return Q(S.id)}}))})):ge.a.createElement("div",null,$==null?void 0:$.map(function(S,A){return ge.a.createElement("div",{key:A,className:Oe.a.btn2},ge.a.createElement("span",{className:Oe.a.s1},ge.a.createElement("img",{src:me||F.a}),S.name),ge.a.createElement("img",{src:ee.a,className:Oe.a.s2,onClick:function(){return Q(S.id)}}))}))};Ie.a=X},kSUc:function(it,Ie,l){},kqOp:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return X});var oe=l("0Owb"),Le=l("fWQN"),ge=l("mtLc"),Te=l("yKVA"),Oe=l("879j"),Re=l("q1tI"),ee=l.n(Re),B=l("Ot1p"),F="\u2581",X=function(W){Object(Te.a)(le,W);var V=Object(Oe.a)(le);function le(){var Z;Object(Le.a)(this,le);for(var z=arguments.length,$=new Array(z),U=0;U<z;U++)$[U]=arguments[U];return Z=V.call.apply(V,[this].concat($)),Z.getChCountBeforeCursor=function(te,E){for(var me=E.line,Ce=0,de=0;de<me;de++)Ce+=te.getLine(de).split(F).length-1;var I=te.getLine(me).substring(0,E.ch);return Ce+=I.split(F).length-1,Ce},Z.onCMBeforeChange=function(te,E){var me=te.getRange(E.from,E.to),Ce=0;if(E.text.forEach(function(Q){Ce+=Q.split(F).length-1}),me&&me.indexOf(F)!=-1){var de=me.split(F).length-1,I=Z.getChCountBeforeCursor(te,E.from);console.log("\u5220\u9664".concat(de,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(I,"\u4E2A\uFF0C\u65B0\u589E").concat(Ce,"\u4E2A")),Z.props.deleteEmptyDisabled?E.cancel():Z.props.onPlaceholderChange&&Z.props.onPlaceholderChange(I,de,Ce)}else if(Ce){var g=Z.getChCountBeforeCursor(te,E.from);console.log("\u65B0\u589E".concat(Ce,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(g,"\u4E2A")),Z.props.onPlaceholderChange&&Z.props.onPlaceholderChange(g,0,Ce)}},Z}return Object(ge.a)(le,[{key:"render",value:function(){return ee.a.createElement(B.a,Object(oe.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),le}(Re.Component)},lZu9:function(it,Ie,l){(function(oe){oe(l("VrN/"),l("1eCo"),l("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function(Le,ge){var Te=oe.getMode(Le,"text/html"),Oe=Te.name=="null";function Re(k){if(oe.findModeByName){var f=oe.findModeByName(k);f&&(k=f.mime||f.mimes[0])}var R=oe.getMode(Le,k);return R.name=="null"?null:R}ge.highlightFormatting===void 0&&(ge.highlightFormatting=!1),ge.maxBlockquoteDepth===void 0&&(ge.maxBlockquoteDepth=0),ge.taskLists===void 0&&(ge.taskLists=!1),ge.strikethrough===void 0&&(ge.strikethrough=!1),ge.emoji===void 0&&(ge.emoji=!1),ge.fencedCodeBlockHighlighting===void 0&&(ge.fencedCodeBlockHighlighting=!0),ge.fencedCodeBlockDefaultMode===void 0&&(ge.fencedCodeBlockDefaultMode="text/plain"),ge.xml===void 0&&(ge.xml=!0),ge.tokenTypeOverrides===void 0&&(ge.tokenTypeOverrides={});var ee={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 B in ee)ee.hasOwnProperty(B)&&ge.tokenTypeOverrides[B]&&(ee[B]=ge.tokenTypeOverrides[B]);var F=/^([*\-_])(?:\s*\1){2,}\s*$/,X=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,W=/^\[(x| )\](?=\s)/i,V=ge.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,le=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Z=/^[^#!\[\]*_\\<>` "'(~:]+/,z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,$=/^\s*\[[^\]]+?\]:.*$/,U=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 E(k,f,R){return f.f=f.inline=R,R(k,f)}function me(k,f,R){return f.f=f.block=R,R(k,f)}function Ce(k){return!k||!/\S/.test(k.string)}function de(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==g){var f=Oe;if(!f){var R=oe.innerMode(Te,k.htmlState);f=R.mode.name=="xml"&&R.state.tagStart===null&&!R.state.context&&R.state.tokenize.isInText}f&&(k.f=x,k.block=I,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function I(k,f){var R=k.column()===f.indentation,ue=Ce(f.prevLine.stream),se=f.indentedCode,Se=f.prevLine.hr,fe=f.list!==!1,pe=(f.listStack[f.listStack.length-1]||0)+3;f.indentedCode=!1;var j=f.indentation;if(f.indentationDiff===null&&(f.indentationDiff=f.indentation,fe)){for(f.list=null;j<f.listStack[f.listStack.length-1];)f.listStack.pop(),f.listStack.length?f.indentation=f.listStack[f.listStack.length-1]:f.list=!1;f.list!==!1&&(f.indentationDiff=j-f.listStack[f.listStack.length-1])}var M=!ue&&!Se&&!f.prevLine.header&&(!fe||!se)&&!f.prevLine.fencedCodeEnd,re=(f.list===!1||Se||ue)&&f.indentation<=pe&&k.match(F),P=null;if(f.indentationDiff>=4&&(se||f.prevLine.fencedCodeEnd||f.prevLine.header||ue))return k.skipToEnd(),f.indentedCode=!0,ee.code;if(k.eatSpace())return null;if(R&&f.indentation<=pe&&(P=k.match(V))&&P[1].length<=6)return f.quote=0,f.header=P[1].length,f.thisLine.header=!0,ge.highlightFormatting&&(f.formatting="header"),f.f=f.inline,S(f);if(f.indentation<=pe&&k.eat(">"))return f.quote=R?1:f.quote+1,ge.highlightFormatting&&(f.formatting="quote"),k.eatSpace(),S(f);if(!re&&!f.setext&&R&&f.indentation<=pe&&(P=k.match(X))){var _=P[1]?"ol":"ul";return f.indentation=j+k.current().length,f.list=!0,f.quote=0,f.listStack.push(f.indentation),f.em=!1,f.strong=!1,f.code=!1,f.strikethrough=!1,ge.taskLists&&k.match(W,!1)&&(f.taskList=!0),f.f=f.inline,ge.highlightFormatting&&(f.formatting=["list","list-"+_]),S(f)}else{if(R&&f.indentation<=pe&&(P=k.match(z,!0)))return f.quote=0,f.fencedEndRE=new RegExp(P[1]+"+ *$"),f.localMode=ge.fencedCodeBlockHighlighting&&Re(P[2]||ge.fencedCodeBlockDefaultMode),f.localMode&&(f.localState=oe.startState(f.localMode)),f.f=f.block=Q,ge.highlightFormatting&&(f.formatting="code-block"),f.code=-1,S(f);if(f.setext||(!M||!fe)&&!f.quote&&f.list===!1&&!f.code&&!re&&!$.test(k.string)&&(P=k.lookAhead(1))&&(P=P.match(le)))return f.setext?(f.header=f.setext,f.setext=0,k.skipToEnd(),ge.highlightFormatting&&(f.formatting="header")):(f.header=P[0].charAt(0)=="="?1:2,f.setext=f.header),f.thisLine.header=!0,f.f=f.inline,S(f);if(re)return k.skipToEnd(),f.hr=!0,f.thisLine.hr=!0,ee.hr;if(k.peek()==="[")return E(k,f,J)}return E(k,f,f.inline)}function g(k,f){var R=Te.token(k,f.htmlState);if(!Oe){var ue=oe.innerMode(Te,f.htmlState);(ue.mode.name=="xml"&&ue.state.tagStart===null&&!ue.state.context&&ue.state.tokenize.isInText||f.md_inside&&k.current().indexOf(">")>-1)&&(f.f=x,f.block=I,f.htmlState=null)}return R}function Q(k,f){var R=f.listStack[f.listStack.length-1]||0,ue=f.indentation<R,se=R+3;if(f.fencedEndRE&&f.indentation<=se&&(ue||k.match(f.fencedEndRE))){ge.highlightFormatting&&(f.formatting="code-block");var Se;return ue||(Se=S(f)),f.localMode=f.localState=null,f.block=I,f.f=x,f.fencedEndRE=null,f.code=0,f.thisLine.fencedCodeEnd=!0,ue?me(k,f,f.block):Se}else return f.localMode?f.localMode.token(k,f.localState):(k.skipToEnd(),ee.code)}function S(k){var f=[];if(k.formatting){f.push(ee.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var R=0;R<k.formatting.length;R++)f.push(ee.formatting+"-"+k.formatting[R]),k.formatting[R]==="header"&&f.push(ee.formatting+"-"+k.formatting[R]+"-"+k.header),k.formatting[R]==="quote"&&(!ge.maxBlockquoteDepth||ge.maxBlockquoteDepth>=k.quote?f.push(ee.formatting+"-"+k.formatting[R]+"-"+k.quote):f.push("error"))}if(k.taskOpen)return f.push("meta"),f.length?f.join(" "):null;if(k.taskClosed)return f.push("property"),f.length?f.join(" "):null;if(k.linkHref?f.push(ee.linkHref,"url"):(k.strong&&f.push(ee.strong),k.em&&f.push(ee.em),k.strikethrough&&f.push(ee.strikethrough),k.emoji&&f.push(ee.emoji),k.linkText&&f.push(ee.linkText),k.code&&f.push(ee.code),k.image&&f.push(ee.image),k.imageAltText&&f.push(ee.imageAltText,"link"),k.imageMarker&&f.push(ee.imageMarker)),k.header&&f.push(ee.header,ee.header+"-"+k.header),k.quote&&(f.push(ee.quote),!ge.maxBlockquoteDepth||ge.maxBlockquoteDepth>=k.quote?f.push(ee.quote+"-"+k.quote):f.push(ee.quote+"-"+ge.maxBlockquoteDepth)),k.list!==!1){var ue=(k.listStack.length-1)%3;ue?ue===1?f.push(ee.list2):f.push(ee.list3):f.push(ee.list1)}return k.trailingSpaceNewLine?f.push("trailing-space-new-line"):k.trailingSpace&&f.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),f.length?f.join(" "):null}function A(k,f){return k.match(Z,!0)?S(f):void 0}function x(k,f){var R=f.text(k,f);if(typeof R!="undefined")return R;if(f.list)return f.list=null,S(f);if(f.taskList){var ue=k.match(W,!0)[1]===" ";return ue?f.taskOpen=!0:f.taskClosed=!0,ge.highlightFormatting&&(f.formatting="task"),f.taskList=!1,S(f)}if(f.taskOpen=!1,f.taskClosed=!1,f.header&&k.match(/^#+$/,!0))return ge.highlightFormatting&&(f.formatting="header"),S(f);var se=k.next();if(f.linkTitle){f.linkTitle=!1;var Se=se;se==="("&&(Se=")"),Se=(Se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var fe="^\\s*(?:[^"+Se+"\\\\]+|\\\\\\\\|\\\\.)"+Se;if(k.match(new RegExp(fe),!0))return ee.linkHref}if(se==="`"){var pe=f.formatting;ge.highlightFormatting&&(f.formatting="code"),k.eatWhile("`");var j=k.current().length;if(f.code==0&&(!f.quote||j==1))return f.code=j,S(f);if(j==f.code){var M=S(f);return f.code=0,M}else return f.formatting=pe,S(f)}else if(f.code)return S(f);if(se==="\\"&&(k.next(),ge.highlightFormatting)){var re=S(f),P=ee.formatting+"-escape";return re?re+" "+P:P}if(se==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return f.imageMarker=!0,f.image=!0,ge.highlightFormatting&&(f.formatting="image"),S(f);if(se==="["&&f.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return f.imageMarker=!1,f.imageAltText=!0,ge.highlightFormatting&&(f.formatting="image"),S(f);if(se==="]"&&f.imageAltText){ge.highlightFormatting&&(f.formatting="image");var re=S(f);return f.imageAltText=!1,f.image=!1,f.inline=f.f=N,re}if(se==="["&&!f.image)return f.linkText&&k.match(/^.*?\]/)||(f.linkText=!0,ge.highlightFormatting&&(f.formatting="link")),S(f);if(se==="]"&&f.linkText){ge.highlightFormatting&&(f.formatting="link");var re=S(f);return f.linkText=!1,f.inline=f.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?N:x,re}if(se==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){f.f=f.inline=b,ge.highlightFormatting&&(f.formatting="link");var re=S(f);return re?re+=" ":re="",re+ee.linkInline}if(se==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){f.f=f.inline=b,ge.highlightFormatting&&(f.formatting="link");var re=S(f);return re?re+=" ":re="",re+ee.linkEmail}if(ge.xml&&se==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=k.string.indexOf(">",k.pos);if(_!=-1){var he=k.string.substring(k.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(he)&&(f.md_inside=!0)}return k.backUp(1),f.htmlState=oe.startState(Te),me(k,f,g)}if(ge.xml&&se==="<"&&k.match(/^\/\w*?>/))return f.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var Pe=1,Je=k.pos==1?" ":k.string.charAt(k.pos-2);Pe<3&&k.eat(se);)Pe++;var Me=k.peek()||" ",We=!/\s/.test(Me)&&(!U.test(Me)||/\s/.test(Je)||U.test(Je)),Ee=!/\s/.test(Je)&&(!U.test(Je)||/\s/.test(Me)||U.test(Me)),De=null,Ve=null;if(Pe%2&&(!f.em&&We&&(se==="*"||!Ee||U.test(Je))?De=!0:f.em==se&&Ee&&(se==="*"||!We||U.test(Me))&&(De=!1)),Pe>1&&(!f.strong&&We&&(se==="*"||!Ee||U.test(Je))?Ve=!0:f.strong==se&&Ee&&(se==="*"||!We||U.test(Me))&&(Ve=!1)),Ve!=null||De!=null){ge.highlightFormatting&&(f.formatting=De==null?"strong":Ve==null?"em":"strong em"),De===!0&&(f.em=se),Ve===!0&&(f.strong=se);var M=S(f);return De===!1&&(f.em=!1),Ve===!1&&(f.strong=!1),M}}else if(se===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return S(f);k.backUp(1)}if(ge.strikethrough){if(se==="~"&&k.eatWhile(se)){if(f.strikethrough){ge.highlightFormatting&&(f.formatting="strikethrough");var M=S(f);return f.strikethrough=!1,M}else if(k.match(/^[^\s]/,!1))return f.strikethrough=!0,ge.highlightFormatting&&(f.formatting="strikethrough"),S(f)}else if(se===" "&&k.match(/^~~/,!0)){if(k.peek()===" ")return S(f);k.backUp(2)}}if(ge.emoji&&se===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){f.emoji=!0,ge.highlightFormatting&&(f.formatting="emoji");var et=S(f);return f.emoji=!1,et}return se===" "&&(k.match(/^ +$/,!1)?f.trailingSpace++:f.trailingSpace&&(f.trailingSpaceNewLine=!0)),S(f)}function b(k,f){var R=k.next();if(R===">"){f.f=f.inline=x,ge.highlightFormatting&&(f.formatting="link");var ue=S(f);return ue?ue+=" ":ue="",ue+ee.linkInline}return k.match(/^[^>]+/,!0),ee.linkInline}function N(k,f){if(k.eatSpace())return null;var R=k.next();return R==="("||R==="["?(f.f=f.inline=y(R==="("?")":"]"),ge.highlightFormatting&&(f.formatting="link-string"),f.linkHref=!0,S(f)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(k){return function(f,R){var ue=f.next();if(ue===k){R.f=R.inline=x,ge.highlightFormatting&&(R.formatting="link-string");var se=S(R);return R.linkHref=!1,se}return f.match(T[k]),R.linkHref=!0,S(R)}}function J(k,f){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(f.f=ye,k.next(),ge.highlightFormatting&&(f.formatting="link"),f.linkText=!0,S(f)):E(k,f,x)}function ye(k,f){if(k.match(/^\]:/,!0)){f.f=f.inline=q,ge.highlightFormatting&&(f.formatting="link");var R=S(f);return f.linkText=!1,R}return k.match(/^([^\]\\]|\\.)+/,!0),ee.linkText}function q(k,f){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?f.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),f.f=f.inline=x,ee.linkHref+" url")}var _e={startState:function(){return{f:I,prevLine:{stream:null},thisLine:{stream:null},block:I,htmlState:null,indentation:0,inline:x,text:A,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(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&oe.copyState(Te,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?oe.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,f){if(f.formatting=!1,k!=f.thisLine.stream){if(f.header=0,f.hr=!1,k.match(/^\s*$/,!0))return de(f),null;if(f.prevLine=f.thisLine,f.thisLine={stream:k},f.taskList=!1,f.trailingSpace=0,f.trailingSpaceNewLine=!1,!f.localState&&(f.f=f.block,f.f!=g)){var R=k.match(/^\s*/,!0)[0].replace(/\t/g,te).length;if(f.indentation=R,f.indentationDiff=null,R>0)return null}}return f.f(k,f)},innerMode:function(k){return k.block==g?{state:k.htmlState,mode:Te}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:_e}},indent:function(k,f,R){return k.block==g&&Te.indent?Te.indent(k.htmlState,f,R):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,f,R):oe.Pass},blankLine:de,getType:S,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return _e},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},lnNo:function(it,Ie,l){it.exports=l.p+"static/up.69f3b3fd.svg"},m3fD:function(it,Ie,l){it.exports={flex_box_center:"flex_box_center___1w3aZ",flex_space_between:"flex_space_between___26eB1",flex_box_vertical_center:"flex_box_vertical_center___LffUi",flex_box_center_end:"flex_box_center_end___2AiD3",flex_box_column:"flex_box_column___hZDm1",wrap:"wrap___3Du1e",btns:"btns___35pkF",crumbs:"crumbs___3CPsi",oneWrap:"oneWrap___3F99r",title:"title___2n1na",formWrap:"formWrap___3CHwR",rb:"rb___19sZ1"}},mOS8:function(it,Ie,l){it.exports=l.p+"static/403Qrcode.6c17b6f4.png"},nwOs:function(it,Ie,l){"use strict";var oe=l("bbsP"),Le=l("/wGt"),ge=l("DjyN"),Te=l("NUBc"),Oe=l("T2oS"),Re=l("W9HT"),ee=l("/zsF"),B=l("PArb"),F=l("5Dmo"),X=l("3S7+"),W=l("sRBo"),V=l("kaz8"),le=l("14J3"),Z=l("BMrR"),z=l("jCWc"),$=l("kPKH"),U=l("miYZ"),te=l("tsqr"),E=l("oBTY"),me=l("+L6B"),Ce=l("2/Rp"),de=l("9og8"),I=l("y8nQ"),g=l("Vl3Y"),Q=l("k1fw"),S=l("tJVT"),A=l("5NDa"),x=l("5rEg"),b=l("WmNS"),N=l.n(b),T=l("q1tI"),y=l.n(T),J=l("BdwD"),ye=l("Ty5D"),q=l("55Ip"),_e=l("9kvl"),k=l("phTj"),f=l.n(k),R=l("NLgs"),ue=l("1vsH"),se=l("xKgJ"),Se=x.a.Search,fe=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],pe=function(M){var re,P,_=M.classroomList,he=M.loading,Pe=M.dispatch,Je=M.shixunsList,Me=M.configPaper,We=M.setshiXunIds,Ee=M.shiXunIds,De=M.getList,Ve=M.source,et=M.group_ids,at=M.tag_discipline_ids,Ye=M.teach_group_ids,He=M.isPreview,St=M.setisPreview,ft=Object(T.useState)(Object(Q.a)({},Object(ye.i)())),bt=Object(S.a)(ft,2),dt=bt[0],Dt=bt[1],Ot=Object(ye.h)(),_t=_.actionTabs,Ue=g.a.useForm(),It=Object(S.a)(Ue,1),kt=It[0],Be=_.shixunLists,Ke=_.shixunAiRecommendLists,K=Object(T.useState)([]),G=Object(S.a)(K,2),H=G[0],w=G[1],O=Object(T.useState)({}),L=Object(S.a)(O,2),D=L[0],ve=L[1],ne=Object(T.useState)(!1),xe=Object(S.a)(ne,2),qe=xe[0],ht=xe[1],Fe=[{name:"\u6700\u65B0",id:"created_at"},{name:"\u6700\u70ED",id:"myshixuns_count"}].filter(function(we){return!!we}),Xe=Object(T.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"myshixuns_count",no_jupyter:1}),Rt=Object(S.a)(Xe,2),Ne=Rt[0],jt=Rt[1];Object(T.useEffect)(function(){Ft()},[dt.coursesId,Ne]),Object(T.useEffect)(function(){_.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&w([]),Pe({type:"shixunsList/getMenus",payload:{}})},[_.actionTabs.key]),Object(T.useEffect)(function(){(Be!=null&&Be.shixun_list||Ke!=null&&Ke.shixun_list)&&ve(Ne.sort==="recommend"?Ke:Be)},[Be,Ke]);var Ft=function(){var we=Object(de.a)(N.a.mark(function vt(){var lt,Ut;return N.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:if(ht(!0),lt=Object(Q.a)({},Ne),Ne.sort==="recommend"&&(lt.sort="myshixuns_count"),!(Ne.sort==="recommend")){Ge.next=8;break}return Ge.next=6,Pe({type:"classroomList/getShixunAiRecommendLists",payload:Object(Q.a)(Object(Q.a)({},lt),{},{course_id:dt.coursesId})});case 6:Ge.next=11;break;case 8:return Ut=Object(Q.a)({},lt),Ge.next=11,Pe({type:"classroomList/getShixunLists",payload:Ut});case 11:ht(!1);case 12:case"end":return Ge.stop()}},vt)}));return function(){return we.apply(this,arguments)}}();return _.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u8BFE\u7A0B"?void 0:(_.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?document.body.setAttribute("data-custom","height"):document.body.removeAttribute("data-custom"),y.a.createElement(Le.a,{placement:"bottom",height:"100%",closable:!0,style:{zIndex:9999},visible:_.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:f.a.drawer,onClose:function(){Pe({type:"classroomList/setActionTabs",payload:{key:""}})},footer:y.a.createElement("div",{className:"tc",style:{height:"64px",display:"flex",alignItems:"center",justifyContent:"center"}},y.a.createElement(Ce.a,{size:"large",onClick:function(){St(!1),Ne.type="all",jt(Ne),Pe({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8,width:"120px",height:"40px",fontSize:"16px",borderRadius:"4px"}},"\u53D6\u6D88"),y.a.createElement(Ce.a,{style:{width:"120px",height:"40px",fontSize:"16px",borderRadius:"4px"},size:"large",onClick:Object(de.a)(N.a.mark(function we(){var vt,lt;return N.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:if(Ne.type="all",jt(Ne),St(!1),!Me){Nt.next=8;break}vt={source:Ve,group_ids:et,tag_discipline_ids:at,teach_group_ids:Ye,shixun_ids:Ee},De(vt),Nt.next=12;break;case 8:return Nt.next=10,Pe({type:"classroomList/createShixunHomework",payload:Object(Q.a)({shixun_ids:Object(E.a)(H),category_id:dt.categoryId},dt)});case 10:lt=Nt.sent,lt.status||(Object(ue.Y)(["\u6559\u5B66\u8BFE\u5802","\u8BFE\u7A0B\u5B9E\u9A8C","\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"]),te.b.success("\u64CD\u4F5C\u6210\u529F"),Pe({type:"classroomList/setActionTabs",payload:{}}),Object(se.d)()?Pe({type:"classroomList/getClassroomTeacherShixunsList",payload:Object(Q.a)(Object(Q.a)({},_.actionTabs.params),{},{type:4})}):Pe({type:"classroomList/getClassroomShixunsList",payload:Object(Q.a)({},_.actionTabs.params)}),Pe({type:"classroomList/getClassroomLeftMenus",payload:{id:dt.coursesId}}),localStorage.getItem("Noviceguide")==="0"||Pe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:12,text:y.a.createElement("div",null,"\u63A5\u4E0B\u6765\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u4E2A\u201C\u8BFE\u7A0B\u5B9E\u9A8C\u201D~\u70B9\u51FB\u201C\u9009\u7528\u5B9E\u8DF5\u9879\u76EE\u201D\uFF0C\u9009\u62E9\u4E00\u4E2A\u4F5C\u4E1A\uFF0C\u7136\u540E\u70B9\u51FB\u201C\u7ACB\u5373\u53D1\u5E03\u201D\u5C31\u7ED9\u5B9E\u8DF5\u8BFE\u5802\u6DFB\u52A0\u4E86\u4E00\u4E2A\u8BFE\u7A0B\u5B9E\u9A8C\u3002")}}));case 12:case"end":return Nt.stop()}},we)})),type:"primary"},"\u786E\u5B9A"))},y.a.createElement("section",{className:"tc"},y.a.createElement(Se,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",className:f.a.search,onSearch:function(vt){Ne.keyword=vt,jt(Object(Q.a)({},Ne))}})),y.a.createElement("section",{className:"edu-container"},y.a.createElement(Re.a,{spinning:qe},y.a.createElement("aside",null,fe.map(function(we,vt){var lt;return vt!==0?null:y.a.createElement("ul",{className:f.a.menu,key:vt},y.a.createElement("li",null,we.name),we==null||((lt=we.children)===null||lt===void 0)?void 0:lt.map(function(Ut,Nt){return y.a.createElement("li",{className:Ne[we.id]==Ut.id?f.a.actived:"",onClick:function(){Ne[we.id]=Ut.id,jt(Object(Q.a)({},Ne))}},y.a.createElement("strong",null,Ut.name))}))}),y.a.createElement("ul",{className:f.a.menu},y.a.createElement("li",null,"\u65B9\u5411"),y.a.createElement("li",{className:Ne!=null&&Ne.discipline_id?"":f.a.actived,onClick:function(){delete Ne.tag_level,delete Ne.sub_discipline_id,delete Ne.discipline_id,jt(Object(Q.a)({},Ne))}},y.a.createElement("strong",null,"\u5168\u90E8")),Je.menus&&Je.menus.map(function(we,vt){return y.a.createElement("li",{key:vt,className:(Ne==null?void 0:Ne.discipline_id)==we.id?f.a.actived:""},y.a.createElement("strong",{onClick:function(){Ne.tag_level=1,Ne.discipline_id=we.id,delete Ne.sub_discipline_id,jt(Object(Q.a)({},Ne))}},we.name),y.a.createElement("div",null,we.sub_repertoires.map(function(lt,Ut){return y.a.createElement("div",{key:Ut,className:"mt5"},y.a.createElement("div",{className:(Ne==null?void 0:Ne.sub_discipline_id)==lt.id&&Ne.tag_level===2?"".concat(f.a.actived2," ").concat(f.a.subTag):f.a.subTag,onClick:function(){Ne.tag_level=2,Ne.discipline_id=we.id,Ne.sub_discipline_id=lt.id,jt(Object(Q.a)({},Ne))}},lt.name),y.a.createElement("ul",{className:"mt5"},lt.tags&&lt.tags.map(function(Nt,Ge){return y.a.createElement("li",{key:Ge,className:Ne.sub_discipline_id==Nt.id&&Ne.tag_level===3?f.a.actived2:"",onClick:function(){Ne.tag_level=3,Ne.discipline_id=we.id,Ne.sub_discipline_id=Nt.id,jt(Object(Q.a)({},Ne))}},Nt.name)})))})))})),fe.map(function(we,vt){var lt;return vt!==1?null:y.a.createElement("ul",{className:f.a.menu,key:vt},y.a.createElement("li",null,we.name),we==null||((lt=we.children)===null||lt===void 0)?void 0:lt.map(function(Ut,Nt){return y.a.createElement("li",{className:Ne[we.id]==Ut.id?f.a.actived:"",onClick:function(){Ne[we.id]=Ut.id,jt(Object(Q.a)({},Ne))}},y.a.createElement("strong",null,Ut.name))}))}),y.a.createElement(Z.a,{align:"middle"},y.a.createElement($.a,{flex:"1",className:f.a.filter},Fe.map(function(we,vt){return y.a.createElement(Ce.a,{key:vt,className:"mr20",type:Ne.sort===we.id?"primary":"default",onClick:function(){Ne.sort=we.id,jt(Object(Q.a)({},Ne))}},we.name)})),y.a.createElement($.a,{className:"c-grey-999"},y.a.createElement("div",{className:f.a.menuCourse},y.a.createElement("ul",null,y.a.createElement("li",null,"\u5DF2\u9009",y.a.createElement("span",{className:"c-blue"},H.length),"\u4E2A\u5B9E\u8BAD"),y.a.createElement("li",null,"\u5171",y.a.createElement("span",{className:"c-blue"},D.shixuns_count),"\u4E2A\u8BFE\u7A0B"),y.a.createElement("li",{className:"current",onClick:function(){Ne.order=Ne.order==="asc"?"desc":"asc",jt(Object(Q.a)({},Ne))}},"\u5B66\u4E60\u4EBA\u6570",y.a.createElement("p",{className:"edu-sorter current ".concat(Ne.order)},y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}),y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"}))))))),(D==null||((re=D.shixun_list)===null||re===void 0)?void 0:re.length)===0&&y.a.createElement(J.a,null),D==null||((P=D.shixun_list)===null||P===void 0)?void 0:P.map(function(we,vt){var lt,Ut,Nt;return y.a.createElement("div",{className:f.a.listItem,key:vt,style:{cursor:"auto"}},y.a.createElement(V.a,{checked:H.includes(we.id)||Array.isArray(Ee)?Ee.includes(we.id):"",value:we.id,style:{marginTop:"3px"},disabled:we==null?void 0:we.need_authorize,onChange:function(ut){We&&We(Array.from(new Set([].concat(Object(E.a)(Ee),[ut.target.value]))));var ot=H.indexOf(we.id);H.indexOf(we.id)>-1?(w(H.filter(function(ct){return ct!==we.id})),We(Ee.filter(function(ct){return ct!==we.id}))):(w(H.concat(we.id)),We(Ee.concat(we.id)))}}),y.a.createElement("div",{className:f.a.info},y.a.createElement("div",{className:f.a.title},y.a.createElement("div",{className:f.a.titleLeft},y.a.createElement(q.a,{to:"/shixuns/".concat(we.identifier,"/challenges"),target:"_blank"},y.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:we.title}})),(we==null?void 0:we.need_authorize)&&y.a.createElement("span",{onClick:function(){Object(R.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(se.w)()&&(we==null?void 0:we.mark_status)===1&&y.a.createElement(X.a,{zIndex:1e4,title:we==null?void 0:we.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(se.w)()&&(we==null?void 0:we.mark_status)===2&&y.a.createElement(X.a,{zIndex:1e4,title:we==null?void 0:we.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(se.w)()&&(we==null?void 0:we.mark_status)===3&&y.a.createElement(X.a,{zIndex:1e4,title:we==null?void 0:we.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")),y.a.createElement(Ce.a,{ghost:!0,href:"/shixuns/".concat(we.identifier,"/challenges"),type:"primary",target:"_blank",style:{borderRadius:"50px"}},"\u4F53\u9A8C\u5B9E\u8BAD"))),y.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},y.a.createElement("span",{className:f.a.description,dangerouslySetInnerHTML:{__html:we.description}})),y.a.createElement("div",{className:" mt15"},we.challenge_names.map(function(Ge,ut){return y.a.createElement("span",{key:ut,className:"mr30"},"\u7B2C",ut+1,"\u5173 ",Ge," ")})),y.a.createElement(B.a,{dashed:!0}),y.a.createElement("div",{className:"c-light-black mt20"},we!=null&&(lt=we.content)!==null&&lt!==void 0&&lt.author_name?y.a.createElement("span",{dangerouslySetInnerHTML:{__html:we==null||((Ut=we.content)===null||Ut===void 0||((Nt=Ut.author_name)===null||Nt===void 0))?void 0:Nt[0]}}):y.a.createElement("span",null,we.author_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),we.author_school_name&&y.a.createElement(y.a.Fragment,null,y.a.createElement("span",null,we.author_school_name),y.a.createElement("span",{className:"ml15 mr15"},"|")),y.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",we.level),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),y.a.createElement("span",null,we.study_count))))})))),y.a.createElement("div",{className:"tc mt20"},y.a.createElement(Te.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showSizeChanger:!1,current:Ne.page||1,showQuickJumper:!0,total:D==null?void 0:D.shixuns_count,onChange:function(vt){Ne.page=vt,jt(Object(Q.a)({},Ne))}}))))};Ie.a=Object(_e.a)(function(j){var M=j.classroomList,re=j.shixunsList,P=j.loading;return{classroomList:M,shixunsList:re,loading:P.effects}})(pe)},osHv:function(it,Ie,l){(function(oe){oe(l("VrN/"))})(function(oe){"use strict";var Le=oe.Pos;function ge(U,te){return U.line-te.line||U.ch-te.ch}var Te="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",Oe=Te+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Re=new RegExp("<(/?)(["+Te+"]["+Oe+"]*)","g");function ee(U,te,E,me){this.line=te,this.ch=E,this.cm=U,this.text=U.getLine(te),this.min=me?Math.max(me.from,U.firstLine()):U.firstLine(),this.max=me?Math.min(me.to-1,U.lastLine()):U.lastLine()}function B(U,te){var E=U.cm.getTokenTypeAt(Le(U.line,te));return E&&/\btag\b/.test(E)}function F(U){return U.line>=U.max?void 0:(U.ch=0,U.text=U.cm.getLine(++U.line),!0)}function X(U){return U.line<=U.min?void 0:(U.text=U.cm.getLine(--U.line),U.ch=U.text.length,!0)}function W(U){for(;;){var te=U.text.indexOf(">",U.ch);if(te==-1){if(F(U))continue;return}if(!B(U,te+1)){U.ch=te+1;continue}var E=U.text.lastIndexOf("/",te),me=E>-1&&!/\S/.test(U.text.slice(E+1,te));return U.ch=te+1,me?"selfClose":"regular"}}function V(U){for(;;){var te=U.ch?U.text.lastIndexOf("<",U.ch-1):-1;if(te==-1){if(X(U))continue;return}if(!B(U,te+1)){U.ch=te;continue}Re.lastIndex=te,U.ch=te;var E=Re.exec(U.text);if(E&&E.index==te)return E}}function le(U){for(;;){Re.lastIndex=U.ch;var te=Re.exec(U.text);if(!te){if(F(U))continue;return}if(!B(U,te.index+1)){U.ch=te.index+1;continue}return U.ch=te.index+te[0].length,te}}function Z(U){for(;;){var te=U.ch?U.text.lastIndexOf(">",U.ch-1):-1;if(te==-1){if(X(U))continue;return}if(!B(U,te+1)){U.ch=te;continue}var E=U.text.lastIndexOf("/",te),me=E>-1&&!/\S/.test(U.text.slice(E+1,te));return U.ch=te+1,me?"selfClose":"regular"}}function z(U,te){for(var E=[];;){var me=le(U),Ce,de=U.line,I=U.ch-(me?me[0].length:0);if(!me||!(Ce=W(U)))return;if(Ce=="selfClose")continue;if(me[1]){for(var g=E.length-1;g>=0;--g)if(E[g]==me[2]){E.length=g;break}if(g<0&&(!te||te==me[2]))return{tag:me[2],from:Le(de,I),to:Le(U.line,U.ch)}}else E.push(me[2])}}function $(U,te){for(var E=[];;){var me=Z(U);if(!me)return;if(me=="selfClose"){V(U);continue}var Ce=U.line,de=U.ch,I=V(U);if(!I)return;if(I[1])E.push(I[2]);else{for(var g=E.length-1;g>=0;--g)if(E[g]==I[2]){E.length=g;break}if(g<0&&(!te||te==I[2]))return{tag:I[2],from:Le(U.line,U.ch),to:Le(Ce,de)}}}}oe.registerHelper("fold","xml",function(U,te){for(var E=new ee(U,te.line,0);;){var me=le(E);if(!me||E.line!=te.line)return;var Ce=W(E);if(!Ce)return;if(!me[1]&&Ce!="selfClose"){var de=Le(E.line,E.ch),I=z(E,me[2]);return I&&ge(I.from,de)>0?{from:de,to:I.from}:null}}}),oe.findMatchingTag=function(U,te,E){var me=new ee(U,te.line,te.ch,E);if(me.text.indexOf(">")==-1&&me.text.indexOf("<")==-1)return;var Ce=W(me),de=Ce&&Le(me.line,me.ch),I=Ce&&V(me);if(!Ce||!I||ge(me,te)>0)return;var g={from:Le(me.line,me.ch),to:de,tag:I[2]};return Ce=="selfClose"?{open:g,close:null,at:"open"}:I[1]?{open:$(me,I[2]),close:g,at:"close"}:(me=new ee(U,de.line,de.ch,E),{open:g,close:z(me,I[2]),at:"open"})},oe.findEnclosingTag=function(U,te,E,me){for(var Ce=new ee(U,te.line,te.ch,E);;){var de=$(Ce,me);if(!de)break;var I=new ee(U,te.line,te.ch,E),g=z(I,de.tag);if(g)return{open:de,close:g}}},oe.scanForClosingTag=function(U,te,E,me){var Ce=new ee(U,te.line,te.ch,me?{from:0,to:me}:null);return z(Ce,E)}})},p5ED:function(it,Ie,l){"use strict";var oe=l("+L6B"),Le=l("2/Rp"),ge=l("5Dmo"),Te=l("3S7+"),Oe=l("k1fw"),Re=l("9og8"),ee=l("tJVT"),B=l("WmNS"),F=l.n(B),X=l("q1tI"),W=l.n(X),V=l("vHTk"),le=l.n(V),Z=l("yEEn"),z=l("ZW9T"),$=l("1vsH"),U=l("V0Rq"),te=l("m3rI"),E=function(Ce){var de=Ce.name,I=Ce.data,g=Ce.theme,Q=Ce.type,S=Ce.filename,A=Ce.monacoEditor,x=Ce.className,b=Ce.style,N=Ce.close,T=Ce.onClose,y=Ce.hasMask,J=Ce.otherData,ye=J===void 0?{}:J,q=Object(X.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_e=Object(ee.a)(q,2),k=_e[0],f=_e[1],R=Object(X.useState)(""),ue=Object(ee.a)(R,2),se=ue[0],Se=ue[1],fe=Object(X.useState)(),pe=Object(ee.a)(fe,2),j=pe[0],M=pe[1],re=window.ENV==="build"?"/react/build/office.html":"/office.html",P,_=1024*1024,he=10*_,Pe=Object(X.useRef)();Q==="office"&&(P=Object($.P)(I).filesize,P>he&&(Q="other")),S&&(A.filename=S),Object(X.useEffect)(function(){var Ee,De,Ve=(Ee=document.cookie)===null||Ee===void 0||((De=Ee.replace(/\s/g,""))===null||De===void 0)?void 0:De.split(";");Ve==null||Ve.map(function(et){var at=et.split("=");at[0]==="_educoder_session"&&Se(at[1])})},[]),Object(X.useEffect)(function(){Q==="office"&&Je()},[Q]);var Je=function(){var Ee=Object(Re.a)(F.a.mark(function De(){var Ve,et,at;return F.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return console.log("data:",I),Ve=I,I.startsWith("http")||(Ve=location.origin+Ve),et=new URL(Ve).pathname.split("/").pop(),He.next=6,Object(U.U)({attachment_id:et});case 6:at=He.sent,M(at);case 8:case"end":return He.stop()}},De)}));return function(){return Ee.apply(this,arguments)}}(),Me=function(){if(I.startsWith("http")||I.startsWith("blob:")){We();return}Object($.x)(S||"educoder",I,S)},We=function(){Object($.v)(S||"educoder",decodeURIComponent(I))};return W.a.createElement("div",{style:Object(Oe.a)({},b||{}),className:"".concat(y&&le.a.bgBlack," ").concat(Q?le.a.wrp:"hide")},N&&W.a.createElement("div",{className:le.a.close,ref:Pe},W.a.createElement(Te.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Pe.current}},W.a.createElement("span",{onClick:We},W.a.createElement("i",{className:"icon-quxiaozhiding"}))),W.a.createElement(Te.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Pe.current}},W.a.createElement("span",{className:"",onClick:function(){T(),M(null)}},W.a.createElement("i",{className:"icon-guanbi1"})))),W.a.createElement("div",{className:"".concat(le.a[x]," ").concat(x," ").concat(le.a.monaco," ").concat(Q==="txt"?"show":"hide")},Q==="txt"&&W.a.createElement(z.b,A)),Q==="audio"&&W.a.createElement("audio",{src:"".concat((I==null?void 0:I.indexOf("http://"))>-1||(I==null?void 0:I.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(I),autoPlay:!0}),Q==="video"&&W.a.createElement(W.a.Fragment,null,(I==null?void 0:I.indexOf("/api"))>-1?W.a.createElement("video",{controls:!0,src:"".concat(I),autoPlay:!0}):W.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(I),autoPlay:!0})),Q==="office"&&j&&W.a.createElement("iframe",{src:"".concat(re,"?key=").concat(j.key,"&url=").concat(te.a.API_SERVER+j.url,"&callbackUrl=").concat(te.a.API_SERVER+j.callbackUrl,"&fileType=").concat(j.fileType,"&title=").concat(j.title,"&model=view")}),(Q==="xlsx"||Q==="doc"||Q==="pptx"||Q==="docx")&&W.a.createElement("iframe",{src:"".concat(re,"?key=").concat(ye.key,"&url=").concat(te.a.API_SERVER+ye.url,"&callbackUrl=").concat(te.a.API_SERVER+ye.callbackUrl,"&fileType=").concat(ye.fileType,"&title=").concat(ye.title,"&model=").concat(ye.model)}),Q==="html"&&W.a.createElement("iframe",{src:I+"&disposition=inline"}),Q==="pdf"&&W.a.createElement("embed",{className:le.a.embed,src:I,type:"application/pdf"}),Q==="image"&&W.a.createElement("img",{src:"".concat((I==null?void 0:I.indexOf("http://"))>-1||(I==null?void 0:I.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(I)}),Q==="other"&&W.a.createElement("div",null,W.a.createElement(Le.a,{type:"primary",size:"large",onClick:Me},W.a.createElement(Z.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),Q==="download"&&W.a.createElement(Le.a,{type:"primary",size:"large",onClick:Me},W.a.createElement(Z.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Ie.a=E},"p77/":function(it,Ie,l){},phTj:function(it,Ie,l){it.exports={flex_box_center:"flex_box_center___KJvh4",flex_space_between:"flex_space_between___1UOzJ",flex_box_vertical_center:"flex_box_vertical_center___2wd96",flex_box_center_end:"flex_box_center_end____hvMu",flex_box_column:"flex_box_column___3N4t0",wrp:"wrp___1KTZo",drawer:"drawer___BzmQG",menu:"menu___3Vg6-",actived:"actived___3L8Av",actived2:"actived2___3acSY",subTag:"subTag___2eJ3A",listItem:"listItem___AJkGb",listItem2:"listItem2___3qd_z",info:"info___2C0fa",title:"title___3u1-5",titleLeft:"titleLeft___Ge33n",titleRight:"titleRight___3rWHm",search:"search___20Y-8",filter:"filter___3mcQo",description:"description___2YpqZ",menuCourse:"menuCourse___ffwA6"}},"rAM+":function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return Le});var oe=l("Qw5x");function Le(ge,Te){var Oe;if(typeof Symbol=="undefined"||ge[Symbol.iterator]==null){if(Array.isArray(ge)||(Oe=Object(oe.a)(ge))||Te&&ge&&typeof ge.length=="number"){Oe&&(ge=Oe);var Re=0,ee=function(){};return{s:ee,n:function(){return Re>=ge.length?{done:!0}:{done:!1,value:ge[Re++]}},e:function(V){throw V},f:ee}}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 B=!0,F=!1,X;return{s:function(){Oe=ge[Symbol.iterator]()},n:function(){var V=Oe.next();return B=V.done,V},e:function(V){F=!0,X=V},f:function(){try{!B&&Oe.return!=null&&Oe.return()}finally{if(F)throw X}}}}},rUJ1:function(it,Ie){const l=/[&<>"']/,oe=/[&<>"']/g,Le=/[<>"']|&(?!#?\w+;)/,ge=/[<>"']|&(?!#?\w+;)/g,Te={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=Q=>Te[Q];function Re(Q,S){if(S){if(l.test(Q))return Q.replace(oe,Oe)}else if(Le.test(Q))return Q.replace(ge,Oe);return Q}const ee=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(Q){return Q.replace(ee,(S,A)=>(A=A.toLowerCase(),A==="colon"?":":A.charAt(0)==="#"?A.charAt(1)==="x"?String.fromCharCode(parseInt(A.substring(2),16)):String.fromCharCode(+A.substring(1)):""))}const F=/(^|[^\[])\^/g;function X(Q,S){Q=Q.source||Q,S=S||"";const A={replace:(x,b)=>(b=b.source||b,b=b.replace(F,"$1"),Q=Q.replace(x,b),A),getRegex:()=>new RegExp(Q,S)};return A}const W=/[^\w:]/g,V=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function le(Q,S,A){if(Q){let x;try{x=decodeURIComponent(B(A)).replace(W,"").toLowerCase()}catch(b){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}S&&!V.test(A)&&(A=te(S,A));try{A=encodeURI(A).replace(/%25/g,"%")}catch(x){return null}return A}const Z={},z=/^[^:]+:\/*[^/]*$/,$=/^([^:]+:)[\s\S]*$/,U=/^([^:]+:\/*[^/]*)[\s\S]*$/;function te(Q,S){Z[" "+Q]||(z.test(Q)?Z[" "+Q]=Q+"/":Z[" "+Q]=de(Q,"/",!0)),Q=Z[" "+Q];const A=Q.indexOf(":")===-1;return S.substring(0,2)==="//"?A?S:Q.replace($,"$1")+S:S.charAt(0)==="/"?A?S:Q.replace(U,"$1")+S:Q+S}const E={exec:function(){}};function me(Q){let S=1,A,x;for(;S<arguments.length;S++){A=arguments[S];for(x in A)Object.prototype.hasOwnProperty.call(A,x)&&(Q[x]=A[x])}return Q}function Ce(Q,S){const A=Q.replace(/\|/g,(N,T,y)=>{let J=!1,ye=T;for(;--ye>=0&&y[ye]==="\\";)J=!J;return J?"|":" |"}),x=A.split(/ \|/);let b=0;if(x.length>S)x.splice(S);else for(;x.length<S;)x.push("");for(;b<x.length;b++)x[b]=x[b].trim().replace(/\\\|/g,"|");return x}function de(Q,S,A){const x=Q.length;if(x===0)return"";let b=0;for(;b<x;){const N=Q.charAt(x-b-1);if(N===S&&!A)b++;else if(N!==S&&A)b++;else break}return Q.substr(0,x-b)}function I(Q,S){if(Q.indexOf(S[1])===-1)return-1;const A=Q.length;let x=0,b=0;for(;b<A;b++)if(Q[b]==="\\")b++;else if(Q[b]===S[0])x++;else if(Q[b]===S[1]&&(x--,x<0))return b;return-1}function g(Q){Q&&Q.sanitize&&!Q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}it.exports={escape:Re,unescape:B,edit:X,cleanUrl:le,resolveUrl:te,noopTest:E,merge:me,splitCells:Ce,rtrim:de,findClosingBracket:I,checkSanitizeDeprecation:g}},sbIO:function(it,Ie,l){"use strict";var oe=l("DjyN"),Le=l("NUBc"),ge=l("5Dmo"),Te=l("3S7+"),Oe=l("/zsF"),Re=l("PArb"),ee=l("Q9mQ"),B=l("diRs"),F=l("+L6B"),X=l("2/Rp"),W=l("5NDa"),V=l("5rEg"),le=l("miYZ"),Z=l("tsqr"),z=l("9og8"),$=l("giR+"),U=l("fyUT"),te=l("2qtc"),E=l("kLXV"),me=l("tJVT"),Ce=l("WmNS"),de=l.n(Ce),I=l("q1tI"),g=l.n(I),Q=l("PsQE"),S=l.n(Q),A=l("0eGx"),x=l.n(A),b=l("9Bee"),N=l("Ty5D"),T=l("9kvl"),y=l("ErOA"),J=l("+yhJ"),ye=l.n(J),q=l("RZ/O"),_e=l.n(q),k=l("LvDl"),f=l("6K3P"),R=l.n(f),ue=l("sRBo"),se=l("kaz8"),Se=l("oBTY"),fe=l("PpiC"),pe=l("Ot1p"),j=l("kqOp"),M=l("7qnI"),re=l("1vsH"),P=l("PGNT"),_=l.n(P),he=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Pe=function(K,G){var H=K.globalSetting,w=K.loading,O=K.dispatch,L=K.isEdit,D=K.editData,ve=Object(fe.a)(K,["globalSetting","loading","dispatch","isEdit","editData"]),ne=Object(I.useState)(""),xe=Object(me.a)(ne,2),qe=xe[0],ht=xe[1],Fe=Object(I.useState)(""),Xe=Object(me.a)(Fe,2),Rt=Xe[0],Ne=Xe[1],jt=Object(I.useState)([]),Ft=Object(me.a)(jt,2),we=Ft[0],vt=Ft[1],lt=Object(I.useState)(""),Ut=Object(me.a)(lt,2),Nt=Ut[0],Ge=Ut[1],ut=Object(I.useState)(),ot=Object(me.a)(ut,2),ct=ot[0],Yt=ot[1],Ht=Object(I.useState)(!1),an=Object(me.a)(Ht,2),Qt=an[0],xt=an[1];Object(I.useEffect)(function(){if(!D||!L)return;ht(D==null?void 0:D.name),Ne(D==null?void 0:D.analysis),Yt(D==null?void 0:D.is_ordered),xt(!0)},[D]),Object(I.useEffect)(function(){if(!Qt)return;var je=D==null?void 0:D.standard_answer.map(function(Et){return Et.answer_text});vt(je),xt(!1)},[Qt]),Object(I.useImperativeHandle)(G,function(){return{onSave:nn,Clear:zt}});var nn=function(){var Et=[],sn=!1;return qe?(we.forEach(function(mn,Pn){Et.push({position:Pn+1,answer_text:[]}),mn.forEach(function(jn,h){Et[Pn].answer_text.push(jn),(!jn||!Object(re.Z)(jn,1e4))&&(Ge("".concat(Pn,"-").concat(h)),Z.b.info(jn?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),sn=!0)})}),sn?!1:(Et==null?void 0:Et.length)>20?(Z.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:qe,analysis:Rt,standard_answers:Et,is_ordered:ct}):(Z.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},zt=function(){ht(""),Ne(""),vt([]),Yt(!1)},on=function(Et,sn,mn){var Pn=we.slice();if(sn&&Pn.splice(Et,sn),mn)for(var jn=0;jn<mn;jn++)Pn.splice(Et+jn,0,[""]);vt(Pn)},Gt=function(Et,sn,mn){Ge("");var Pn=we.slice();Pn[Et][sn]=mn,vt(Pn)},Dn=function(Et){var sn=we.slice();sn[Et]=[].concat(Object(Se.a)(sn[Et]),[""]),vt(sn)},Nn=function(Et,sn){var mn=we.slice();if(!mn[Et][sn]){mn[Et]=mn[Et].filter(function(Pn,jn){return jn!==sn}),vt(mn);return}E.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:_.a.modal,onOk:function(){mn[Et]=mn[Et].filter(function(jn,h){return h!==sn}),vt(mn)}})},Gn=function(Et){E.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:_.a.modal,onOk:function(){var mn=we.slice();mn=we.filter(function(Pn,jn){return Et!==jn}),vt(mn)}})};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement("div",null,g.a.createElement(j.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:qe,onChange:function(Et){return ht(Et)},showNullButton:!0,onPlaceholderChange:on})),g.a.createElement("div",{className:"mt20"},we.map(function(je,Et){return g.a.createElement(M.a,{key:Et,answers:je,index:Et,flex:1,is_md:!0,activeOptionErrorIndex:Nt,onAnswerChange:Gt,addChildAnswer:Dn,deleteChildAnswer:Nn,deleteChildAnswermain:Gn})})),g.a.createElement("div",{className:"mt20"},we.length>1&&g.a.createElement("span",null,g.a.createElement(se.a,{checked:ct,onChange:function(Et){return Yt(Et.target.checked)},className:"".concat(_.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),g.a.createElement("span",{className:"".concat(_.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Rt,onChange:function(Et){return Ne(Et)}}))},Je=Object(T.a)(function(Ke){var K=Ke.loading,G=Ke.globalSetting;return{globalSetting:G,loading:K.effects}},null,null,{forwardRef:!0})(Object(I.forwardRef)(Pe)),Me=l("7Kak"),We=l("9yH6"),Ee=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],De=function(K,G){var H=K.globalSetting,w=K.loading,O=K.editData,L=K.dispatch,D=K.onRef,ve=D===void 0?function(){}:D,ne=K.isEdit,xe=Object(fe.a)(K,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),qe=Object(I.useState)(),ht=Object(me.a)(qe,2),Fe=ht[0],Xe=ht[1],Rt=Object(I.useState)(""),Ne=Object(me.a)(Rt,2),jt=Ne[0],Ft=Ne[1],we=Object(I.useState)(""),vt=Object(me.a)(we,2),lt=vt[0],Ut=vt[1];Object(I.useEffect)(function(){if(!O||!ne)return;Ft(O==null?void 0:O.name),Ut(O==null?void 0:O.analysis);var ut=O==null?void 0:O.choices.find(function(ot){return ot.is_answer});Xe(ut.choice_text==="\u6B63\u786E"?"0":"1")},[O]),Object(I.useImperativeHandle)(G,function(){return{onSave:Nt,Clear:Ge}});var Nt=function(){if(!jt)return Z.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!Fe)return Z.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var ot=[{choice_text:"\u6B63\u786E",is_answer:Fe==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Fe==="1"?1:0}];return{name:jt,choices:ot,analysis:lt}},Ge=function(){Ft(""),Ut(""),Xe("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:jt,onChange:function(ot){return Ft(ot)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),g.a.createElement(We.a.Group,{buttonStyle:"solid",value:Fe,onChange:function(ot){return Xe(ot.target.value)}},g.a.createElement(We.a.Button,{value:"0",className:"".concat(_.a.radio," mr40")},"\u6B63\u786E"),g.a.createElement(We.a.Button,{value:"1",className:_.a.radio},"\u9519\u8BEF")),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:lt,onChange:function(ot){return Ut(ot)}}))},Ve=Object(T.a)(function(Ke){var K=Ke.loading,G=Ke.globalSetting;return{globalSetting:G,loading:K.effects}},null,null,{forwardRef:!0})(Object(I.forwardRef)(De)),et=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],at=function(K,G){var H=K.editData,w=K.globalSetting,O=K.loading,L=K.dispatch,D=K.onRef,ve=D===void 0?function(){}:D,ne=K.isEdit,xe=Object(fe.a)(K,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),qe=Object(I.useState)([]),ht=Object(me.a)(qe,2),Fe=ht[0],Xe=ht[1],Rt=Object(I.useState)(),Ne=Object(me.a)(Rt,2),jt=Ne[0],Ft=Ne[1],we=Object(I.useState)([]),vt=Object(me.a)(we,2),lt=vt[0],Ut=vt[1],Nt=Object(I.useState)(""),Ge=Object(me.a)(Nt,2),ut=Ge[0],ot=Ge[1],ct=Object(I.useState)(""),Yt=Object(me.a)(ct,2),Ht=Yt[0],an=Yt[1];Object(I.useEffect)(function(){Xe(["","","",""])},[]),Object(I.useEffect)(function(){if(!H||!ne)return;ot(H==null?void 0:H.name),an(H==null?void 0:H.analysis),Xe(H==null?void 0:H.choices.map(function(zt){return zt.choice_text}));var nn=[];H==null||H.choices.map(function(zt,on){zt.is_answer&&nn.push(on)}),Ut(nn)},[H]),Object(I.useImperativeHandle)(G,function(){return{onSave:Qt,Clear:xt}});var Qt=function(){if(!ut)return Z.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var zt=Fe.findIndex(function(Gt){return!Gt});if(zt>-1)return Z.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(et[zt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!lt.length)return Z.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(lt.length<2)return Z.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var on=Fe.map(function(Gt,Dn){return{choice_text:Gt,is_answer:lt.includes(Dn)?1:0}});return{name:ut,choices:on,analysis:Ht}},xt=function(){Xe(["","","",""]),ot(""),an(""),Ut("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ut,onChange:function(zt){return ot(zt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Fe.map(function(nn,zt){return g.a.createElement("div",{className:_.a.choiceWrap,key:zt},g.a.createElement(Te.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(_.a.answer," ").concat(lt.includes(zt)?_.a.activeAnswer:""),onClick:function(){lt.includes(zt)?Ut(lt.filter(function(Gt){return Gt!==zt})):Ut([].concat(Object(Se.a)(lt),[zt]))}},et[zt])),g.a.createElement("div",{className:_.a.editorWrap},jt===zt?g.a.createElement(pe.a,{id:"single-question-option-".concat(zt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:nn,onChange:function(Gt){Fe[zt]=Gt,Xe(Fe)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return Ft(zt)}},g.a.createElement(b.a,{value:nn}))),zt>1&&g.a.createElement(Te.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(_.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){Xe(Fe.filter(function(Gt,Dn){return Dn!==zt})),lt.includes(zt)?Ut(lt.filter(function(Gt){return Gt!==zt})):Ut([].concat(Object(Se.a)(lt),[zt]))}})),zt<7&&zt===Fe.length-1&&g.a.createElement(Te.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(_.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Xe([].concat(Object(Se.a)(Fe),[""]))}})))}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ht,onChange:function(zt){return an(zt)}}))},Ye=Object(T.a)(function(Ke){var K=Ke.loading,G=Ke.globalSetting;return{globalSetting:G,loading:K.effects}},null,null,{forwardRef:!0})(Object(I.forwardRef)(at)),He=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],St=function(K,G){var H=K.editData,w=K.globalSetting,O=K.loading,L=K.dispatch,D=K.onRef,ve=D===void 0?function(){}:D,ne=K.isEdit,xe=Object(fe.a)(K,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),qe=Object(I.useState)([]),ht=Object(me.a)(qe,2),Fe=ht[0],Xe=ht[1],Rt=Object(I.useState)(),Ne=Object(me.a)(Rt,2),jt=Ne[0],Ft=Ne[1],we=Object(I.useState)(),vt=Object(me.a)(we,2),lt=vt[0],Ut=vt[1],Nt=Object(I.useState)(""),Ge=Object(me.a)(Nt,2),ut=Ge[0],ot=Ge[1],ct=Object(I.useState)(""),Yt=Object(me.a)(ct,2),Ht=Yt[0],an=Yt[1];Object(I.useEffect)(function(){Xe(["","","",""])},[]),Object(I.useEffect)(function(){if(!H||!ne)return;ot(H==null?void 0:H.name),an(H==null?void 0:H.analysis),Xe(H==null?void 0:H.choices.map(function(nn){return nn.choice_text})),Ut(H==null?void 0:H.choices.findIndex(function(nn){return nn.is_answer}))},[H]),Object(I.useImperativeHandle)(G,function(){return{onSave:Qt,Clear:xt}});var Qt=function(){if(!ut)return Z.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var zt=Fe.findIndex(function(Gt){return!Gt});if(zt>-1)return Z.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(He[zt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",lt),!(typeof lt=="number"))return Z.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var on=Fe.map(function(Gt,Dn){return{choice_text:Gt,is_answer:lt===Dn?1:0}});return{name:ut,choices:on,analysis:Ht}},xt=function(){Xe(["","","",""]),ot(""),an(""),Ut("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ut,onChange:function(zt){return ot(zt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Fe.map(function(nn,zt){return g.a.createElement("div",{className:_.a.choiceWrap,key:zt},g.a.createElement(Te.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(_.a.answer," ").concat(lt===zt?_.a.activeAnswer:""),onClick:function(){return Ut(zt)}},He[zt])),g.a.createElement("div",{className:_.a.editorWrap},jt===zt?g.a.createElement(pe.a,{id:"single-question-option-".concat(zt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:nn,onChange:function(Gt){Fe[zt]=Gt,Xe(Fe)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return Ft(zt)}},g.a.createElement(b.a,{value:nn}))),zt>1&&g.a.createElement(Te.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(_.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){Xe(Fe.filter(function(Gt,Dn){return Dn!==zt})),zt===lt&&Ut(null)}})),zt<7&&zt===Fe.length-1&&g.a.createElement(Te.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(_.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Xe([].concat(Object(Se.a)(Fe),[""]))}})))}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ht,onChange:function(zt){return an(zt)}}))},ft=Object(T.a)(function(Ke){var K=Ke.loading,G=Ke.globalSetting;return{globalSetting:G,loading:K.effects}},null,null,{forwardRef:!0})(Object(I.forwardRef)(St)),bt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],dt=function(K,G){var H=K.editData,w=K.globalSetting,O=K.loading,L=K.dispatch,D=K.onRef,ve=D===void 0?function(){}:D,ne=K.isEdit,xe=Object(fe.a)(K,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),qe=Object(I.useState)(""),ht=Object(me.a)(qe,2),Fe=ht[0],Xe=ht[1],Rt=Object(I.useState)(""),Ne=Object(me.a)(Rt,2),jt=Ne[0],Ft=Ne[1],we=Object(I.useState)(""),vt=Object(me.a)(we,2),lt=vt[0],Ut=vt[1];Object(I.useEffect)(function(){var ut;if(!H||!ne)return;Xe(H==null?void 0:H.name),Ft(H==null?void 0:H.analysis),Ut(H==null||((ut=H.answer_texts)===null||ut===void 0)?void 0:ut[0])},[H]),Object(I.useImperativeHandle)(G,function(){return{onSave:Nt,Clear:Ge}});var Nt=function(){return Fe?lt?{name:Fe,answer_texts:[lt],analysis:jt}:(Z.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(Z.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Ge=function(){Xe(""),Ft(""),Ut("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fe,onChange:function(ot){return Xe(ot)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),g.a.createElement(pe.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:lt,onChange:function(ot){return Ut(ot)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:jt,onChange:function(ot){return Ft(ot)}}))},Dt=Object(T.a)(function(Ke){var K=Ke.loading,G=Ke.globalSetting;return{globalSetting:G,loading:K.effects}},null,null,{forwardRef:!0})(Object(I.forwardRef)(dt)),Ot=l("k1fw"),_t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ue=function(K,G){var H=K.globalSetting,w=K.loading,O=K.dispatch,L=K.editData,D=K.onRef,ve=D===void 0?function(){}:D,ne=K.isEdit,xe=Object(fe.a)(K,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),qe=Object(I.useState)(""),ht=Object(me.a)(qe,2),Fe=ht[0],Xe=ht[1],Rt=Object(I.useState)([]),Ne=Object(me.a)(Rt,2),jt=Ne[0],Ft=Ne[1];console.log(jt),Object(I.useEffect)(function(){var Nt;if(!L||!ne)return;Xe(L==null?void 0:L.name);var Ge=L==null||((Nt=L.sub_item_banks)===null||Nt===void 0)?void 0:Nt.map(function(ut){var ot,ct,Yt;return Object(Ot.a)(Object(Ot.a)({},ut),{},{id:ut.id,open:!1,qusList:ut==null||((ot=ut.choices)===null||ot===void 0)?void 0:ot.map(function(Ht){return Ht.choice_text}),activeQusEditor:null,qusAnswer:(ct=[ut==null||((Yt=ut.choices)===null||Yt===void 0)?void 0:Yt.findIndex(function(Ht){return Ht.is_answer})])===null||ct===void 0?void 0:ct.filter(function(Ht){return Ht!==-1})})});Ft(Ge)},[L]),Object(I.useImperativeHandle)(G,function(){return{onSave:we,Clear:vt}});var we=function(){if(!Fe)return Z.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(jt.length===0)return Z.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var Ge=0;Ge<jt.length;Ge++){var ut,ot=jt[Ge];if(!(ot!=null&&ot.name))return Z.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Ge+1,"\u5C0F\u9898\u9898\u5E72")),!1;var ct=ot==null||((ut=ot.qusList)===null||ut===void 0)?void 0:ut.findIndex(function(Ht){return!Ht});if(ct>-1)return Z.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Ge+1,"\u5C0F\u9898").concat(_t[ct],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(ot!=null&&ot.qusAnswer.length))return Z.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Ge+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Yt=jt.map(function(Ht){return{id:Ht.id>1?Ht.id:null,name:Ht.name,item_type:Ht.item_type,analysis:Ht.analysis,choices:Ht.qusList.map(function(an,Qt){return{choice_text:an,is_answer:Ht.qusAnswer[0]===Qt?1:0}})}});return{name:Fe,sub_item_banks:Yt}},vt=function(){Xe(""),Ft([])},lt=function(){var Ge={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Ft(jt.concat(Ge))},Ut=function(Ge,ut,ot){var ct=Object(k.cloneDeep)(jt);if(Ge==="open"&&(ct[ut].open=!ct[ut].open),Ge==="delete"&&ct.splice(ut,1),Ge==="value"&&(ct[ut].name=ot),Ge==="answer"&&(ct[ut].qusAnswer=[ot]),Ge==="edit"&&(ct[ut].activeQusEditor=ot),Ge==="details"&&(ct[ut].qusList[ct[ut].activeQusEditor]=ot),Ge==="addQus"&&(ct[ut].qusList=ct[ut].qusList.concat("")),Ge==="deleteQus"){var Yt;ct[ut].qusList=ct[ut].qusList.filter(function(Ht,an){return an!==ot}),ct[ut].qusAnswer=(Yt=ct[ut].qusAnswer)===null||Yt===void 0?void 0:Yt.filter(function(Ht){return Ht!==ot})}Ge==="analysis"&&(ct[ut].analysis=ot),Ft(ct)};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(pe.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fe,onChange:function(Ge){return Xe(Ge)}}),jt==null?void 0:jt.map(function(Nt,Ge){var ut;return g.a.createElement("div",{className:_.a.fold,key:Nt.id},g.a.createElement("div",{onClick:function(){return Ut("open",Ge)},className:_.a.head},g.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Nt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),g.a.createElement("span",null,"\u7B2C",Ge+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),g.a.createElement("b",{style:{visibility:"hidden"},onClick:function(ct){ct.stopPropagation(),Ut("delete",Ge)},className:"iconfont icon-shanchu8"})),g.a.createElement("div",{className:"mb10",style:{display:Nt.open?"block":"none"}},g.a.createElement(pe.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Nt==null?void 0:Nt.name,onChange:function(ct){return Ut("value",Ge,ct)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Nt==null||((ut=Nt.qusList)===null||ut===void 0)?void 0:ut.map(function(ot,ct){var Yt,Ht;return g.a.createElement("div",{className:_.a.choiceWrap,key:ct},g.a.createElement(Te.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(_.a.answer," ").concat(Nt!=null&&(Yt=Nt.qusAnswer)!==null&&Yt!==void 0&&Yt.includes(ct)?_.a.activeAnswer:""),onClick:function(){return Ut("answer",Ge,ct)}},_t[ct])),g.a.createElement("div",{className:_.a.editorWrap},(Nt==null?void 0:Nt.activeQusEditor)===ct?g.a.createElement(pe.a,{id:"single-question-option-".concat(ct),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ot,onChange:function(Qt){return Ut("details",Ge,Qt)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return Ut("edit",Ge,ct)}},g.a.createElement(b.a,{value:ot}))),ct>1&&g.a.createElement(Te.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(_.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Ut("deleteQus",Ge,ct)}})),ct<7&&ct===(Nt==null||((Ht=Nt.qusList)===null||Ht===void 0)?void 0:Ht.length)-1&&g.a.createElement(Te.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(_.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Ut("addQus",Ge)}})))}),g.a.createElement("p",{className:"mb10 mt10"},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Nt.analysis,onChange:function(ct){return Ut("analysis",Ge,ct)}})))}))},It=Object(T.a)(function(Ke){var K=Ke.loading,G=Ke.globalSetting;return{globalSetting:G,loading:K.effects}},null,null,{forwardRef:!0})(Object(I.forwardRef)(Ue)),kt=function(K){var G,H,w,O,L,D,ve,ne,xe=K.data,qe=K.submit,ht=K.goBack,Fe=K.loading,Xe=K.onTypeScore,Rt=K.editPreview,Ne=Rt===void 0?!1:Rt,jt=K.onSkipExamination,Ft=K.selectValue,we=K.onExchange,vt=Object(I.useRef)(),lt=Object(I.useRef)(Object(k.debounce)(function(){return on()},100,{leading:!0,trailing:!0})),Ut=Object(I.useState)(null),Nt=Object(me.a)(Ut,2),Ge=Nt[0],ut=Nt[1],ot=Object(I.useState)(!1),ct=Object(me.a)(ot,2),Yt=ct[0],Ht=ct[1],an=Object(N.i)();Object(I.useEffect)(function(){return window.addEventListener("scroll",lt==null?void 0:lt.current),function(){window.removeEventListener("scroll",lt==null?void 0:lt.current)}},[]),Object(I.useEffect)(function(){Ht(!0)},[]),Object(I.useEffect)(function(){var Ze,ce,nt,Xt,Lt=(Ze=document.getElementById("examName"))===null||Ze===void 0||((ce=Ze.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||ce===void 0||((nt=ce[0])===null||nt===void 0||((Xt=nt.childNodes)===null||Xt===void 0)))?void 0:Xt[2];Lt&&(Lt.nodeValue="\u4EFD")},[xe]),console.log(xe,"--------data");var Qt=function(ce){var nt=parseInt(ce);return isNaN(nt)?"":nt};function xt(){var Ze=0,ce=0,nt=0;return document.body&&(ce=document.body.scrollTop),document.documentElement&&(nt=document.documentElement.scrollTop),Ze=ce-nt>0?ce:nt,Ze}function nn(){var Ze=0,ce=0,nt=0;return document.body&&(ce=document.body.scrollHeight),document.documentElement&&(nt=document.documentElement.scrollHeight),Ze=ce-nt>0?ce:nt,Ze}function zt(){var Ze=0;return document.compatMode=="CSS1Compat"?Ze=document.documentElement.clientHeight:Ze=document.body.clientHeight,Ze}var on=function(){var ce=document.getElementById("preview_btns"),nt=document.getElementById("preview_btns_else");xt()+zt()>=nn()-68?(ce.style.visibility="hidden",nt.style.visibility="visible"):(ce.style.visibility="visible",nt.style.visibility="hidden")},Gt=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],Dn=function(ce){var nt,Xt=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("aside",{className:S.a.single},ce==null||((nt=ce.choices)===null||nt===void 0)?void 0:nt.map(function(Lt,wt){return Lt.is_answer&&Xt.push(mn[wt]),g.a.createElement("ul",{key:wt},g.a.createElement("li",null,mn[wt],"\u3001"),g.a.createElement("li",null,g.a.createElement(b.a,{value:Lt.choice_text})))})),g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Xt.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Gt[ce.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},Nn=function(ce){var nt,Xt=ce==null||((nt=ce.standard_answer)===null||nt===void 0)?void 0:nt.map(function(Lt){var wt;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Lt.position,"\uFF09\uFF1A").concat(Lt==null||((wt=Lt.answer_text)===null||wt===void 0)?void 0:wt.join("\u3001"))});return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Xt),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},Gn=function(ce){var nt;return g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ce==null||((nt=ce.answer_texts)===null||nt===void 0)?void 0:nt[0]),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name)))},je=function(ce){var nt;return g.a.createElement("div",{className:S.a.analysis},g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u9884\u671F\u8F93\u51FA:"),g.a.createElement(b.a,{value:ce==null||((nt=ce.program_attr)===null||nt===void 0)?void 0:nt.description})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name)))},Et=function(ce,nt){var Xt;return g.a.createElement("div",null,ce==null||((Xt=ce.sub_item_banks)===null||Xt===void 0)?void 0:Xt.map(function(Lt,wt){var Wt,xn=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},nt+1+"."+(wt+1),"\uFF08\u5355\u9009\u9898\uFF09",Lt.name),g.a.createElement("aside",{className:S.a.single},Lt==null||((Wt=Lt.choices)===null||Wt===void 0)?void 0:Wt.map(function(hn,Tn){return hn.is_answer&&xn.push(mn[Tn]),g.a.createElement("ul",{key:Tn},g.a.createElement("li",null,mn[Tn],"\u3001"),g.a.createElement("li",null,g.a.createElement(b.a,{value:hn.choice_text})))})),g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",xn.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Gt[Lt.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:Lt.analysis?Lt.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))}))},sn=function(ce,nt){return g.a.createElement("div",null,g.a.createElement("div",{style:{background:"#fafafa",padding:"26px 32px",marginTop:"8px",fontSize:"14px"}},ce==null?void 0:ce.description,g.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"12px"}},g.a.createElement("div",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat((ce==null?void 0:ce.discipline_name)||"\u6682\u65E0","/").concat((ce==null?void 0:ce.sub_discipline_name)||"\u6682\u65E0")),g.a.createElement("div",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},mn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Pn=function(ce){console.log("---",ce);var nt=[];ce.questions.map(function(Lt){return Lt==null?void 0:Lt.sub_item_banks.map(function(wt){nt.push(wt)})});var Xt=0;ce.type==="COMBINATION"?Xt=ce.questions_score/nt.length:Xt=ce.questions_score/ce.questions_count,E.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:g.a.createElement("div",{className:S.a.modalColumn},g.a.createElement("div",{className:S.a.modalRow,style:{justifyContent:"flex-start"}},g.a.createElement("sup",{className:S.a.sup},"*"),g.a.createElement("span",null,ce==null?void 0:ce.name,(ce==null?void 0:ce.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),g.a.createElement(U.a,{min:1,parser:Qt,defaultValue:Xt,onChange:function(wt){Xt=wt}}),g.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Lt=Object(z.a)(de.a.mark(function Wt(){var xn,hn;return de.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(Xt){vn.next=3;break}return Z.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),vn.abrupt("return",Promise.reject());case 3:ce.type==="COMBINATION"?(xn={type:ce==null?void 0:ce.type,score:Xt,scoreTotal:Xt*(nt==null?void 0:nt.length)},Xe(xn)):(hn={type:ce==null?void 0:ce.type,score:Xt,scoreTotal:Xt*ce.questions_count},Xe(hn));case 4:case"end":return vn.stop()}},Wt)}));function wt(){return Lt.apply(this,arguments)}return wt}()})},jn=function(){var ce="";E.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:g.a.createElement("div",{className:S.a.modalColumn},g.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},g.a.createElement("img",{style:{marginRight:5},src:R.a}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),g.a.createElement("div",{className:S.a.modalRow,style:{marginTop:20}},g.a.createElement("sup",{className:S.a.sup},"*"),g.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),g.a.createElement(V.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:ce,onChange:function(Xt){ce=Xt.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var nt=Object(z.a)(de.a.mark(function Lt(){var wt,Wt,xn,hn,Tn;return de.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:if(ce){Zn.next=3;break}return Z.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Zn.abrupt("return",Promise.reject());case 3:return Wt=[],xn=[],hn=[],xe==null||((wt=xe.questionList)===null||wt===void 0)||wt.forEach(function(Rn){var hi;(hi=Rn.questions)===null||hi===void 0||hi.forEach(function(xi){Wt.push(xi.id),xn.push(Rn.questions_score/Rn.questions_count),Rn.type==="COMBINATION"&&hn.push({id:xi.id,sub_item_bank_ids:xi.sub_item_banks.map(function(vi){return vi.id})})})}),console.log("-----",hn),Tn={item_bank_ids:Wt,item_bank_scores:xn,name:ce,combination_item_banks:hn},Zn.next=11,qe(Tn);case 11:case"end":return Zn.stop()}},Lt)}));function Xt(){return nt.apply(this,arguments)}return Xt}()})},h=function(ce,nt,Xt,Lt){var wt,Wt=(wt=Lt.questions)===null||wt===void 0?void 0:wt.map(function(hn){return hn.id}),xn=E.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var hn=Object(z.a)(de.a.mark(function vn(){return de.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return xn.update({cancelButtonProps:{disabled:!0}}),Rn.next=3,we({single_question_id:ce,seleted_item_bank_ids:Wt},{type:nt,index:Xt});case 3:xn.update({cancelButtonProps:{disabled:!1}}),Z.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return Rn.stop()}},vn)}));function Tn(){return hn.apply(this,arguments)}return Tn}()})},o=function(ce){var nt,Xt=(nt=ce.questions)===null||nt===void 0?void 0:nt.map(function(Wt){return Wt.id}),Lt=ce.name,wt=E.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(Lt,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Wt=Object(z.a)(de.a.mark(function hn(){return de.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return wt.update({cancelButtonProps:{disabled:!0}}),vn.next=3,we({seleted_item_bank_ids:Xt},{type:ce.type});case 3:wt.update({cancelButtonProps:{disabled:!1}}),Z.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(Lt,"\u8BD5\u9898"));case 5:case"end":return vn.stop()}},hn)}));function xn(){return Wt.apply(this,arguments)}return xn}()})},r=function(){var ce=E.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var nt=Object(z.a)(de.a.mark(function Lt(){return de.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return ce.update({cancelButtonProps:{disabled:!0}}),Wt.next=3,we();case 3:ce.update({cancelButtonProps:{disabled:!1}}),Z.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Wt.stop()}},Lt)}));function Xt(){return nt.apply(this,arguments)}return Xt}()})},c=function(ce){console.log(ce,"key"),jt(ce-1)},p=function(){return g.a.createElement(g.a.Fragment,null,g.a.createElement(B.a,{color:"#55575D",overlayClassName:S.a.popover,visible:Yt,getPopupContainer:function(nt){return nt==null?void 0:nt.parentNode},content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},g.a.createElement(X.a,{onMouseEnter:function(){return Ht(!0)},onMouseLeave:function(){return Ht(!1)},onClick:function(){jn()}},"\u4FDD\u5B58")),g.a.createElement(X.a,{onClick:function(){document.body.scrollIntoView(),ht()}},"\u8FD4\u56DE"),g.a.createElement(X.a,{loading:Fe,onClick:function(){return qe()},type:"primary"},"\u63D0\u4EA4"))},d=function(){var ce;return g.a.createElement(g.a.Fragment,null,g.a.createElement(X.a,{onClick:ht},"\u8FD4\u56DE"),Ft>0&&g.a.createElement(X.a,{onClick:function(){return c(Ft)},type:"primary"},"\u4E0A\u4E00\u4EFD"),Ft<(xe==null||((ce=xe.exam)===null||ce===void 0)?void 0:ce.total_num)-1&&g.a.createElement(X.a,{onClick:function(){return c(Ft+2)}},"\u4E0B\u4E00\u4EFD"))},ie=function(ce,nt){if(console.log(ce,222),nt==="SINGLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(ft,{ref:vt,editData:ce,isEdit:!0}),g.a.createElement(Re.a,null));if(nt==="MULTIPLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ye,{ref:vt,editData:ce,isEdit:!0}),g.a.createElement(Re.a,null));if(nt==="JUDGMENT")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ve,{ref:vt,editData:ce,isEdit:!0}),g.a.createElement(Re.a,null));if(nt==="COMPLETION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Je,{ref:vt,editData:ce,isEdit:!0}),g.a.createElement(Re.a,null));if(nt==="SUBJECTIVE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Dt,{ref:vt,editData:ce,isEdit:!0}),g.a.createElement(Re.a,null));if(nt==="COMBINATION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(It,{ref:vt,editData:ce,isEdit:!0}),g.a.createElement(Re.a,null));if(["PROGRAM","PROGRAM_CORRECTION","PROGRAM_COMPLETION"].includes(nt)){var Xt;T.d.push("/problems/".concat(ce==null||((Xt=ce.program_attr)===null||Xt===void 0)?void 0:Xt.identifier,"/edit?type=exercises&express_id=").concat(an.categoryId,"&question_id=").concat(ce==null?void 0:ce.id,"&score=").concat(ce==null?void 0:ce.score,"&callback_url=").concat(location.pathname,"&select=").concat(Ft,"&exercise=true"))}},Qe=function(){var Ze=Object(z.a)(de.a.mark(function ce(nt,Xt){var Lt,wt,Wt,xn,hn,Tn,vn,Zn,Rn,hi;return de.a.wrap(function(vi){for(;;)switch(vi.prev=vi.next){case 0:return vi.next=2,(Lt=vt.current)===null||Lt===void 0?void 0:Lt.onSave();case 2:if(wt=vi.sent,wt){vi.next=5;break}return vi.abrupt("return");case 5:return Wt={question_score:Xt.score,analysis:wt.analysis},console.log(wt,"editorData"),(nt==="SINGLE"||nt==="MULTIPLE"||nt==="JUDGMENT")&&(hn=[],Tn=[],Wt.question_type=nt==="JUDGMENT"?2:1,Wt.question_title=wt==null?void 0:wt.name,wt==null||((xn=wt.choices)===null||xn===void 0)||xn.forEach(function(Xn,Si){hn.push(Xn.choice_text),Xn!=null&&Xn.is_answer&&Tn.push(Si+1)}),Wt.question_choices=hn,Wt.standard_answers=Tn),nt==="COMPLETION"&&(Wt.is_ordered=wt.is_ordered,Wt.question_title=wt==null?void 0:wt.name,Wt.question_type=3,Zn=[],wt==null||((vn=wt.standard_answers)===null||vn===void 0)||vn.forEach(function(Xn,Si){Zn.push({choice_id:Xn.position,answer_text:Xn.answer_text})}),Wt.standard_answers=Zn),nt==="SUBJECTIVE"&&(Wt.question_title=wt==null?void 0:wt.name,Wt.question_type=3,Wt.standard_answers=wt==null?void 0:wt.answer_texts),nt==="COMBINATION"&&(Wt.question_title=wt==null?void 0:wt.name,Wt.question_type=7,Wt.sub_questions=wt==null||((Rn=wt.sub_item_banks)===null||Rn===void 0)?void 0:Rn.map(function(Xn,Si){return{id:Xn.id,question_title:Xn.name,question_type:1,question_choices:Xn.choices.map(function(pi){return pi.choice_text}),standard_answers:[Xn.choices.findIndex(function(pi){return pi.is_answer})+1],analysis:Xn.analysis}}),delete Wt.analysis),vi.next=13,Object(y.a)("/api/exercise_questions/".concat(Xt.id,".json"),{method:"put",body:Wt});case 13:hi=vi.sent,(hi==null?void 0:hi.status)===0&&(Z.b.success("\u7F16\u8F91\u6210\u529F"),c(Ft+1)),ut(null);case 16:case"end":return vi.stop()}},ce)}));return function(nt,Xt){return Ze.apply(this,arguments)}}(),Ct=function(){for(var ce=[],nt=0;nt<(xe==null||((Xt=xe.exam)===null||Xt===void 0)?void 0:Xt.total_num);nt++){var Xt;ce.push({})}return ce},Mt=xe==null||((G=xe.questionList)===null||G===void 0)?void 0:G.reduce(function(Ze,ce){return Ze+Number(ce.questions_score)},0),tt=Ne&&(xe==null||((H=xe.exam)===null||H===void 0)?void 0:H.exercise_status)!==1;return g.a.createElement("section",{className:S.a.wrap},g.a.createElement("div",{id:"id_left_preview",className:S.a.left,onMouseEnter:function(ce){var nt=document.getElementById("id_left_preview");nt.style.overflowY="auto"},onMouseLeave:function(ce){var nt=document.getElementById("id_left_preview");nt.style.overflowY="hidden"}},g.a.createElement("div",{className:S.a.title},g.a.createElement("div",null,g.a.createElement("b",null),g.a.createElement("span",null,"\u7B54\u9898\u5361"))),g.a.createElement("div",{className:S.a.total},g.a.createElement("div",null,g.a.createElement("img",{src:ye.a}),g.a.createElement("span",null,"\u9898\u6570(\u9053)"),g.a.createElement("aside",null,xe==null?void 0:xe.all_questions_count)),g.a.createElement("div",{className:"mr30 ml30"},g.a.createElement("img",{src:_e.a}),g.a.createElement("span",null,"\u603B\u5206(\u5206)"),g.a.createElement("aside",null,Mt)),g.a.createElement("div",null,g.a.createElement("img",{src:x.a}),g.a.createElement("span",null,"\u65F6\u957F(\u5206)"),g.a.createElement("aside",null,xe==null||((w=xe.exam)===null||w===void 0)?void 0:w.time))),xe==null||((O=xe.questionList)===null||O===void 0)?void 0:O.map(function(Ze,ce){var nt;return g.a.createElement("div",{className:S.a.list,key:ce},g.a.createElement("div",{className:S.a.name},g.a.createElement("b",null),g.a.createElement("span",null,Ze.name)),g.a.createElement("aside",null,g.a.createElement("div",null,"\u5171",g.a.createElement("span",{className:S.a.b},Ze.questions_count),"\u9898 ",g.a.createElement("span",{className:S.a.l},"|"),"\u5171",g.a.createElement("span",{className:S.a.r},Number(Ze.questions_score)),"\u5206"),g.a.createElement("div",{className:S.a.answerSheet},Ze==null||((nt=Ze.questions)===null||nt===void 0)?void 0:nt.map(function(Xt,Lt){return g.a.createElement("div",{onClick:function(){var Wt="Anchor_".concat(Xt.id),xn=document.getElementById(Wt);xn&&setTimeout(function(){return xn.scrollIntoView({block:"center",behavior:"smooth"})})},key:Xt.id,className:S.a.tag},Lt+1)}))))})),g.a.createElement("div",{className:S.a.right},g.a.createElement("div",{className:S.a.examName,id:"examName"},g.a.createElement("div",{className:S.a.name},g.a.createElement(Te.a,{title:xe==null||((L=xe.exam)===null||L===void 0)?void 0:L.name,getPopupContainer:function(ce){return ce.parentNode}},g.a.createElement("span",{className:S.a.t},xe==null||((D=xe.exam)===null||D===void 0)?void 0:D.name))),Ne?g.a.createElement(Le.a,{showTotal:function(ce){return g.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",g.a.createElement("span",{className:"c-light-primary"},ce),"\u4EFD\u8BD5\u5377")},total:xe==null||((ve=xe.exam)===null||ve===void 0)?void 0:ve.total_num,pageSize:1,current:Ft+1,showSizeChanger:!1,onChange:c,showQuickJumper:!0,hideOnSinglePage:!1}):g.a.createElement(X.a,{onClick:r,type:"primary"},"\u968F\u673A\u66F4\u6362")),g.a.createElement("div",{className:S.a.topWarp},xe==null||((ne=xe.questionList)===null||ne===void 0)?void 0:ne.map(function(Ze,ce){var nt,Xt;return g.a.createElement(g.a.Fragment,{key:ce},g.a.createElement("div",{className:S.a.head,style:ce===0?{border:0,marginTop:-16}:{}},g.a.createElement("div",{className:S.a.name},g.a.createElement("b",null),g.a.createElement("span",null,Ze.name)),g.a.createElement("div",{className:S.a.so},"\u5171",g.a.createElement("span",{className:S.a.b},Ze.questions_count," "),"\u9898 ",Ze.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(Ze==null||((nt=Ze.questions)===null||nt===void 0)?void 0:nt.map(function(Lt){var wt;return Lt==null||((wt=Lt.sub_item_banks)===null||wt===void 0)?void 0:wt.length}).reduce(function(Lt,wt){return Lt+wt}),"\u5C0F\u9898\uFF09"),g.a.createElement("span",{className:S.a.l},"|"),"\u5171",g.a.createElement("span",{className:S.a.r},Number(Ze.questions_score)),"\u5206"),!Ne&&g.a.createElement("div",{className:S.a.btn},g.a.createElement(X.a,{onClick:function(){return o(Ze)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),Ze==null||((Xt=Ze.questions)===null||Xt===void 0)?void 0:Xt.map(function(Lt,wt){return Ge===Lt.id?g.a.createElement("div",{id:"Anchor_".concat(Lt.id),className:S.a.content,style:{padding:0,marginTop:10},key:Lt.id},g.a.createElement("div",{style:{float:"right",marginTop:-6}},g.a.createElement(X.a,{onClick:function(){return ut(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),g.a.createElement(X.a,{onClick:function(){return Qe(Ze==null?void 0:Ze.type,Lt)},type:"primary"},"\u4FDD\u5B58")),ie(Lt,Ze.type)):g.a.createElement("div",{id:"Anchor_".concat(Lt.id),className:S.a.content,key:Lt.id},g.a.createElement("div",{className:S.a.titleWrap},g.a.createElement(b.a,{style:{paddingRight:10},className:S.a.titleHtml,value:wt+1+"\u3001"+"".concat((Lt==null?void 0:Lt.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+Lt.name}),Ne&&Ze.type!=="PRACTICAL"&&g.a.createElement(X.a,{disabled:tt,onClick:function(){if(Ge){Z.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}ut(Lt.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),g.a.createElement(X.a,{disabled:tt,onClick:function(){return h(Lt.id,Ze.type,wt,Ze)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Ze.type==="SINGLE"||Ze.type==="JUDGMENT"||Ze.type==="MULTIPLE")&&Dn(Lt),Ze.type==="COMPLETION"&&Nn(Lt),Ze.type==="SUBJECTIVE"&&Gn(Lt),["PROGRAM","PROGRAM_CORRECTION","PROGRAM_COMPLETION"].includes(Ze.type)&&je(Lt),Ze.type==="COMBINATION"&&Et(Lt,wt),Ze.type==="PRACTICAL"&&sn(Lt,wt),g.a.createElement("div",null))}))})),g.a.createElement("div",{className:S.a.btnsElse,id:"preview_btns_else"},Ne?d():p()),g.a.createElement("div",{className:S.a.btnsWrap,id:"preview_btns"},g.a.createElement("div",{className:S.a.btns},Ne?d():p()))))},Be=Ie.a=kt},sboe:function(it,Ie,l){"use strict";l.d(Ie,"a",function(){return ge});var oe=l("q1tI"),Le=l.n(oe),ge=oe.createContext(null)},tmPe:function(it,Ie,l){it.exports={flex_box_center:"flex_box_center___ivyUy",flex_space_between:"flex_space_between___1h8Qq",flex_box_vertical_center:"flex_box_vertical_center___3eC95",flex_box_center_end:"flex_box_center_end___nrhvX",flex_box_column:"flex_box_column___2po4_",customTree:"customTree___1LpRW",name:"name___17ZTs"}},vHTk:function(it,Ie,l){it.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);