(window.webpackJsonp=window.webpackJsonp||[]).push([[175,7,8],{"+NIl":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Ae,me){"use strict";function Me(X,D){X.cmdState.push(D)}function xe(X){return X.cmdState.length>0?X.cmdState[X.cmdState.length-1]:null}function Ce(X){var D=X.cmdState.pop();D&&D.closeBracket()}function Y(X){for(var D=X.cmdState,$=D.length-1;$>=0;$--){var L=D[$];if(L.name=="DEFAULT")continue;return L}return{styleIdentifier:function(){return null}}}function I(X,D,$){return function(){this.name=X,this.bracketNo=0,this.style=D,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 V={};V.importmodule=I("importmodule","tag",["string","builtin"]),V.documentclass=I("documentclass","tag",["","atom"]),V.usepackage=I("usepackage","tag",["atom"]),V.begin=I("begin","tag",["atom"]),V.end=I("end","tag",["atom"]),V.label=I("label","tag",["atom"]),V.ref=I("ref","tag",["atom"]),V.eqref=I("eqref","tag",["atom"]),V.cite=I("cite","tag",["atom"]),V.bibitem=I("bibitem","tag",["atom"]),V.Bibitem=I("Bibitem","tag",["atom"]),V.RBibitem=I("RBibitem","tag",["atom"]),V.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function J(X,D){X.f=D}function j(X,D){var $;if(X.match(/^\\[a-zA-Z@]+/)){var L=X.current().slice(1);return $=V.hasOwnProperty(L)?V[L]:V.DEFAULT,$=new $,Me(D,$),J(D,se),$.style}if(X.match(/^\\[$&%#{}_]/))return"tag";if(X.match(/^\\[,;!\/\\]/))return"tag";if(X.match("\\["))return J(D,function(_,de){return F(_,de,"\\]")}),"keyword";if(X.match("\\("))return J(D,function(_,de){return F(_,de,"\\)")}),"keyword";if(X.match("$$"))return J(D,function(_,de){return F(_,de,"$$")}),"keyword";if(X.match("$"))return J(D,function(_,de){return F(_,de,"$")}),"keyword";var te=X.next();if(te=="%")return X.skipToEnd(),"comment";if(te=="}"||te=="]"){if($=xe(D),$)$.closeBracket(te),J(D,se);else return"error";return"bracket"}else return te=="{"||te=="["?($=V.DEFAULT,$=new $,Me(D,$),"bracket"):/\d/.test(te)?(X.eatWhile(/[\w.%]/),"atom"):(X.eatWhile(/[\w\-_]/),$=Y(D),$.name=="begin"&&($.argument=X.current()),$.styleIdentifier())}function F(X,D,$){if(X.eatSpace())return null;if($&&X.match($))return J(D,j),"keyword";if(X.match(/^\\[a-zA-Z@]+/))return"tag";if(X.match(/^[a-zA-Z]+/))return"variable-2";if(X.match(/^\\[$&%#{}_]/))return"tag";if(X.match(/^\\[,;!\/]/))return"tag";if(X.match(/^[\^_&]/))return"tag";if(X.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(X.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var L=X.next();return L=="{"||L=="}"||L=="["||L=="]"||L=="("||L==")"?"bracket":L=="%"?(X.skipToEnd(),"comment"):"error"}function se(X,D){var $=X.peek(),L;return $=="{"||$=="["?(L=xe(D),L.openBracket($),X.eat($),J(D,j),"bracket"):/[ \t\r]/.test($)?(X.eat($),null):(J(D,j),Ce(D),j(X,D))}return{startState:function(){var X=me.inMathMode?function(D,$){return F(D,$)}:j;return{cmdState:[],f:X}},copyState:function(X){return{cmdState:X.cmdState.slice(),f:X.f}},token:function(X,D){return D.f(X,D)},blankLine:function(X){X.f=j,X.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+RXH":function(at,Ge,p){at.exports=p.p+"static/shu.a39bf729.svg"},"+yhJ":function(at,Ge,p){at.exports=p.p+"static/xixi.d492fb65.svg"},"0eGx":function(at,Ge,p){at.exports=p.p+"static/zhong.c1924b73.svg"},"19Vz":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(I,V,J){var j=J&&J!=ie.Init;if(V&&!j)I.on("blur",xe),I.on("change",Ce),I.on("swapDoc",Ce),ie.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){Me(I)}),Ce(I);else if(!V&&j){I.off("blur",xe),I.off("change",Ce),I.off("swapDoc",Ce),ie.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),Ae(I);var F=I.getWrapperElement();F.className=F.className.replace(" CodeMirror-empty","")}V&&!I.hasFocus()&&xe(I)});function Ae(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function me(I){Ae(I);var V=I.state.placeholder=document.createElement("pre");V.style.cssText="height: 0; overflow: visible",V.style.direction=I.getOption("direction"),V.className="CodeMirror-placeholder CodeMirror-line-like";var J=I.getOption("placeholder");typeof J=="string"&&(J=document.createTextNode(J)),V.appendChild(J),I.display.lineSpace.insertBefore(V,I.display.lineSpace.firstChild)}function Me(I){setTimeout(function(){var V=!1,J=I.getInputField();J.nodeName=="TEXTAREA"?V=!J.value:I.lineCount()==1&&(V=!/[^\u200b]/.test(J.querySelector(".CodeMirror-line").textContent)),V?me(I):Ae(I)},20)}function xe(I){Y(I)&&me(I)}function Ce(I){var V=I.getWrapperElement(),J=Y(I);V.className=V.className.replace(" CodeMirror-empty","")+(J?" CodeMirror-empty":""),J?me(I):Ae(I)}function Y(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1eCo":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";var Ae={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},me={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Me,xe){var Ce=Me.indentUnit,Y={},I=xe.htmlMode?Ae:me;for(var V in I)Y[V]=I[V];for(var V in xe)Y[V]=xe[V];var J,j;function F(b,z){function A(be){return z.tokenize=be,be(b,z)}var k=b.next();if(k=="<")return b.eat("!")?b.eat("[")?b.match("CDATA[")?A(D("atom","]]>")):null:b.match("--")?A(D("comment","-->")):b.match("DOCTYPE",!0,!0)?(b.eatWhile(/[\w\._\-]/),A($(1))):null:b.eat("?")?(b.eatWhile(/[\w\._\-]/),z.tokenize=D("meta","?>"),"meta"):(J=b.eat("/")?"closeTag":"openTag",z.tokenize=se,"tag bracket");if(k=="&"){var Z;return b.eat("#")?b.eat("x")?Z=b.eatWhile(/[a-fA-F\d]/)&&b.eat(";"):Z=b.eatWhile(/[\d]/)&&b.eat(";"):Z=b.eatWhile(/[\w\.\-:]/)&&b.eat(";"),Z?"atom":"error"}else return b.eatWhile(/[^&<]/),null}F.isInText=!0;function se(b,z){var A=b.next();if(A==">"||A=="/"&&b.eat(">"))return z.tokenize=F,J=A==">"?"endTag":"selfcloseTag","tag bracket";if(A=="=")return J="equals",null;if(A=="<"){z.tokenize=F,z.state=de,z.tagName=z.tagStart=null;var k=z.tokenize(b,z);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(A)?(z.tokenize=X(A),z.stringStartCol=b.column(),z.tokenize(b,z)):(b.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function X(b){var z=function(A,k){for(;!A.eol();)if(A.next()==b){k.tokenize=se;break}return"string"};return z.isInAttribute=!0,z}function D(b,z){return function(A,k){for(;!A.eol();){if(A.match(z)){k.tokenize=F;break}A.next()}return b}}function $(b){return function(z,A){for(var k;(k=z.next())!=null;){if(k=="<")return A.tokenize=$(b+1),A.tokenize(z,A);if(k==">")if(b==1){A.tokenize=F;break}else return A.tokenize=$(b-1),A.tokenize(z,A)}return"meta"}}function L(b,z,A){this.prev=b.context,this.tagName=z,this.indent=b.indented,this.startOfLine=A,(Y.doNotIndent.hasOwnProperty(z)||b.context&&b.context.noIndent)&&(this.noIndent=!0)}function te(b){b.context&&(b.context=b.context.prev)}function _(b,z){for(var A;;){if(!b.context)return;if(A=b.context.tagName,!Y.contextGrabbers.hasOwnProperty(A)||!Y.contextGrabbers[A].hasOwnProperty(z))return;te(b)}}function de(b,z,A){return b=="openTag"?(A.tagStart=z.column(),_e):b=="closeTag"?ce:de}function _e(b,z,A){return b=="word"?(A.tagName=z.current(),j="tag",ee):Y.allowMissingTagName&&b=="endTag"?(j="tag bracket",ee(b,z,A)):(j="error",_e)}function ce(b,z,A){if(b=="word"){var k=z.current();return A.context&&A.context.tagName!=k&&Y.implicitlyClosed.hasOwnProperty(A.context.tagName)&&te(A),A.context&&A.context.tagName==k||Y.matchClosing===!1?(j="tag",M):(j="tag error",g)}else return Y.allowMissingTagName&&b=="endTag"?(j="tag bracket",M(b,z,A)):(j="error",g)}function M(b,z,A){return b!="endTag"?(j="error",M):(te(A),de)}function g(b,z,A){return j="error",M(b,z,A)}function ee(b,z,A){if(b=="word")return j="attribute",S;if(b=="endTag"||b=="selfcloseTag"){var k=A.tagName,Z=A.tagStart;return A.tagName=A.tagStart=null,b=="selfcloseTag"||Y.autoSelfClosers.hasOwnProperty(k)?_(A,k):(_(A,k),A.context=new L(A,k,Z==A.indented)),de}return j="error",ee}function S(b,z,A){return b=="equals"?B:(Y.allowMissing||(j="error"),ee(b,z,A))}function B(b,z,A){return b=="string"?x:b=="word"&&Y.allowUnquoted?(j="string",ee):(j="error",ee(b,z,A))}function x(b,z,A){return b=="string"?x:ee(b,z,A)}return{startState:function(b){var z={tokenize:F,state:de,indented:b||0,tagName:null,tagStart:null,context:null};return b!=null&&(z.baseIndent=b),z},token:function(b,z){if(!z.tagName&&b.sol()&&(z.indented=b.indentation()),b.eatSpace())return null;J=null;var A=z.tokenize(b,z);return(A||J)&&A!="comment"&&(j=null,z.state=z.state(J||A,b,z),j&&(A=j=="error"?A+" error":j)),A},indent:function(b,z,A){var k=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+Ce;if(k&&k.noIndent)return ie.Pass;if(b.tokenize!=se&&b.tokenize!=F)return A?A.match(/^(\s*)/)[0].length:0;if(b.tagName)return Y.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+Ce*(Y.multilineTagIndentFactor||1);if(Y.alignCDATA&&/$/,blockCommentStart:"",configuration:Y.htmlMode?"html":"xml",helperType:Y.htmlMode?"html":"xml",skipAttribute:function(b){b.state==B&&(b.state=ee)},xmlCurrentTag:function(b){return b.tagName?{name:b.tagName,close:b.type=="closeTag"}:null},xmlCurrentContext:function(b){for(var z=[],A=b.context;A;A=A.prev)A.tagName&&z.push(A.tagName);return z.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2sxD":function(at,Ge,p){at.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(at,Ge,p){at.exports=p.p+"static/sc.c1696770.svg"},"5MlY":function(at,Ge,p){at.exports=p.p+"static/sm.8ccb50bf.svg"},"6+eU":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return M});var ie=p("wx14"),Ae=p("rePB"),me=p("VTBJ"),Me=p("1OyB"),xe=p("vuIU"),Ce=p("Ji7U"),Y=p("LK+K"),I=p("q1tI"),V=p.n(I),J=p("TSYQ"),j=p.n(J),F=function(ee){var S,B="".concat(ee.rootPrefixCls,"-item"),x=j()(B,"".concat(B,"-").concat(ee.page),(S={},Object(Ae.a)(S,"".concat(B,"-active"),ee.active),Object(Ae.a)(S,ee.className,!!ee.className),Object(Ae.a)(S,"".concat(B,"-disabled"),!ee.page),S)),b=function(){ee.onClick(ee.page)},z=function(k){ee.onKeyPress(k,ee.onClick,ee.page)};return V.a.createElement("li",{title:ee.showTitle?ee.page:null,className:x,onClick:b,onKeyPress:z,tabIndex:"0"},ee.itemRender(ee.page,"page",V.a.createElement("a",{rel:"nofollow"},ee.page)))},se=F,X={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},D=function(g){Object(Ce.a)(S,g);var ee=Object(Y.a)(S);function S(){var B;Object(Me.a)(this,S);for(var x=arguments.length,b=new Array(x),z=0;z=0||A.relatedTarget.className.indexOf("".concat(ae,"-next"))>=0))return;B.setState({goInputText:""}),be(B.getValidValue())},B.go=function(A){var k=B.state.goInputText;if(k==="")return;(A.keyCode===X.ENTER||A.type==="click")&&(B.setState({goInputText:""}),B.props.quickGo(B.getValidValue()))},B}return Object(xe.a)(S,[{key:"getValidValue",value:function(){var x=this.state,b=x.goInputText,z=x.current;return!b||isNaN(b)?z:Number(b)}},{key:"getPageSizeOptions",value:function(){var x=this.props,b=x.pageSize,z=x.pageSizeOptions;return z.some(function(A){return A.toString()===b.toString()})?z:z.concat([b.toString()]).sort(function(A,k){var Z=isNaN(Number(A))?0:Number(A),be=isNaN(Number(k))?0:Number(k);return Z-be})}},{key:"render",value:function(){var x=this,b=this.props,z=b.pageSize,A=b.locale,k=b.rootPrefixCls,Z=b.changeSize,be=b.quickGo,ae=b.goButton,Te=b.selectComponentClass,P=b.buildOptionText,v=b.selectPrefixCls,le=b.disabled,He=this.state.goInputText,je="".concat(k,"-options"),Je=Te,we=null,Ee=null,G=null;if(!Z&&!be)return null;var U=this.getPageSizeOptions();if(Z&&Je){var ue=U.map(function(T,E){return V.a.createElement(Je.Option,{key:E,value:T.toString()},(P||x.buildOptionText)(T))});we=V.a.createElement(Je,{disabled:le,prefixCls:v,showSearch:!1,className:"".concat(je,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(z||U[0]).toString(),onChange:this.changeSize,getPopupContainer:function(E){return E.parentNode}},ue)}return be&&(ae&&(G=typeof ae=="boolean"?V.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:le,className:"".concat(je,"-quick-jumper-button")},A.jump_to_confirm):V.a.createElement("span",{onClick:this.go,onKeyUp:this.go},ae)),Ee=V.a.createElement("div",{className:"".concat(je,"-quick-jumper")},A.jump_to,V.a.createElement("input",{disabled:le,type:"text",value:He,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),A.page,G)),V.a.createElement("li",{className:"".concat(je)},we,Ee)}}]),S}(V.a.Component);D.defaultProps={pageSizeOptions:["10","20","50","100"]};var $=D,L=p("N2Kk");function te(){}function _(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function de(g,ee,S){return S}function _e(g,ee,S){var B=typeof g=="undefined"?ee.pageSize:g;return Math.floor((S.total-1)/B)+1}var ce=function(g){Object(Ce.a)(S,g);var ee=Object(Y.a)(S);function S(B){var x;Object(Me.a)(this,S),x=ee.call(this,B),x.getJumpPrevPage=function(){return Math.max(1,x.state.current-(x.props.showLessItems?3:5))},x.getJumpNextPage=function(){return Math.min(_e(void 0,x.state,x.props),x.state.current+(x.props.showLessItems?3:5))},x.getItemIcon=function(Z,be){var ae=x.props.prefixCls,Te=Z||V.a.createElement("button",{type:"button","aria-label":be,className:"".concat(ae,"-item-link")});return typeof Z=="function"&&(Te=V.a.createElement(Z,Object(me.a)({},x.props))),Te},x.savePaginationNode=function(Z){x.paginationNode=Z},x.isValid=function(Z){return _(Z)&&Z!==x.state.current},x.shouldDisplayQuickJumper=function(){var Z=x.props,be=Z.showQuickJumper,ae=Z.pageSize,Te=Z.total;return Te<=ae?!1:be},x.handleKeyDown=function(Z){(Z.keyCode===X.ARROW_UP||Z.keyCode===X.ARROW_DOWN)&&Z.preventDefault()},x.handleKeyUp=function(Z){var be=x.getValidValue(Z),ae=x.state.currentInputValue;be!==ae&&x.setState({currentInputValue:be}),Z.keyCode===X.ENTER?x.handleChange(be):Z.keyCode===X.ARROW_UP?x.handleChange(be-1):Z.keyCode===X.ARROW_DOWN&&x.handleChange(be+1)},x.changePageSize=function(Z){var be=x.state.current,ae=_e(Z,x.state,x.props);be=be>ae?ae:be,ae===0&&(be=x.state.current),typeof Z=="number"&&("pageSize"in x.props||x.setState({pageSize:Z}),"current"in x.props||x.setState({current:be,currentInputValue:be})),x.props.onShowSizeChange(be,Z),"onChange"in x.props&&x.props.onChange&&x.props.onChange(be,Z)},x.handleChange=function(Z){var be=x.props.disabled,ae=Z;if(x.isValid(ae)&&!be){var Te=_e(void 0,x.state,x.props);ae>Te?ae=Te:ae<1&&(ae=1),"current"in x.props||x.setState({current:ae,currentInputValue:ae});var P=x.state.pageSize;return x.props.onChange(ae,P),ae}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<_e(void 0,x.state,x.props)},x.runIfEnter=function(Z,be){if(Z.key==="Enter"||Z.charCode===13){for(var ae=arguments.length,Te=new Array(ae>2?ae-2:0),P=2;P=z?k=z:k=Number(b),k}},{key:"getShowSizeChanger",value:function(){var x=this.props,b=x.showSizeChanger,z=x.total,A=x.totalBoundaryShowSizeChanger;return typeof b!="undefined"?b:z>A}},{key:"renderPrev",value:function(x){var b=this.props,z=b.prevIcon,A=b.itemRender,k=A(x,"prev",this.getItemIcon(z,"prev page")),Z=!this.hasPrev();return Object(I.isValidElement)(k)?Object(I.cloneElement)(k,{disabled:Z}):k}},{key:"renderNext",value:function(x){var b=this.props,z=b.nextIcon,A=b.itemRender,k=A(x,"next",this.getItemIcon(z,"next page")),Z=!this.hasNext();return Object(I.isValidElement)(k)?Object(I.cloneElement)(k,{disabled:Z}):k}},{key:"render",value:function(){var x=this,b=this.props,z=b.prefixCls,A=b.className,k=b.style,Z=b.disabled,be=b.hideOnSinglePage,ae=b.total,Te=b.locale,P=b.showQuickJumper,v=b.showLessItems,le=b.showTitle,He=b.showTotal,je=b.simple,Je=b.itemRender,we=b.showPrevNextJumpers,Ee=b.jumpPrevIcon,G=b.jumpNextIcon,U=b.selectComponentClass,ue=b.selectPrefixCls,T=b.pageSizeOptions,E=this.state,he=E.current,Le=E.pageSize,Ze=E.currentInputValue;if(be===!0&&ae<=Le)return null;var ke=_e(void 0,this.state,this.props),Ue=[],ge=null,Re=null,Be=null,Qe=null,it=null,Xe=P&&P.goButton,De=v?1:2,Et=he-1>0?he-1:0,pt=he+1=De*2&&he!==1+2&&(Ue[0]=Object(I.cloneElement)(Ue[0],{className:"".concat(z,"-item-after-jump-prev")}),Ue.unshift(ge)),ke-he>=De*2&&he!==ke-2&&(Ue[Ue.length-1]=Object(I.cloneElement)(Ue[Ue.length-1],{className:"".concat(z,"-item-before-jump-next")}),Ue.push(Re)),Ut!==1&&Ue.unshift(Be),kt!==ke&&Ue.push(Qe)}var N=null;He&&(N=V.a.createElement("li",{className:"".concat(z,"-total-text")},He(ae,[ae===0?0:(he-1)*Le+1,he*Le>ae?ae:he*Le])));var H=!this.hasPrev()||!ke,K=!this.hasNext()||!ke;return V.a.createElement("ul",Object(ie.a)({className:j()(z,A,Object(Ae.a)({},"".concat(z,"-disabled"),Z)),style:k,unselectable:"unselectable",ref:this.savePaginationNode},bt),N,V.a.createElement("li",{title:le?Te.prev_page:null,onClick:this.prev,tabIndex:H?null:0,onKeyPress:this.runIfEnterPrev,className:j()("".concat(z,"-prev"),Object(Ae.a)({},"".concat(z,"-disabled"),H)),"aria-disabled":H},this.renderPrev(Et)),Ue,V.a.createElement("li",{title:le?Te.next_page:null,onClick:this.next,tabIndex:K?null:0,onKeyPress:this.runIfEnterNext,className:j()("".concat(z,"-next"),Object(Ae.a)({},"".concat(z,"-disabled"),K)),"aria-disabled":K},this.renderNext(pt)),V.a.createElement($,{disabled:Z,locale:Te,rootPrefixCls:z,selectComponentClass:U,selectPrefixCls:ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:he,pageSize:Le,pageSizeOptions:T,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Xe}))}}],[{key:"getDerivedStateFromProps",value:function(x,b){var z={};if("current"in x&&(z.current=x.current,x.current!==b.current&&(z.currentInputValue=z.current)),"pageSize"in x&&x.pageSize!==b.pageSize){var A=b.current,k=_e(x.pageSize,b,x);A=A>k?k:A,"current"in x||(z.current=A,z.currentInputValue=A),z.pageSize=x.pageSize}return z}}]),S}(V.a.Component);ce.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:L.a,style:{},itemRender:de,totalBoundaryShowSizeChanger:50};var M=ce},"6K3P":function(at,Ge,p){at.exports=p.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(at,Ge,p){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Ae=new Uint8Array(16);function me(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(Ae)}var Me=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function xe(se){return typeof se=="string"&&Me.test(se)}for(var Ce=xe,Y=[],I=0;I<256;++I)Y.push((I+256).toString(16).substr(1));function V(se){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=(Y[se[X+0]]+Y[se[X+1]]+Y[se[X+2]]+Y[se[X+3]]+"-"+Y[se[X+4]]+Y[se[X+5]]+"-"+Y[se[X+6]]+Y[se[X+7]]+"-"+Y[se[X+8]]+Y[se[X+9]]+"-"+Y[se[X+10]]+Y[se[X+11]]+Y[se[X+12]]+Y[se[X+13]]+Y[se[X+14]]+Y[se[X+15]]).toLowerCase();if(!Ce(D))throw TypeError("Stringified UUID is invalid");return D}var J=V;function j(se,X,D){se=se||{};var $=se.random||(se.rng||me)();if($[6]=$[6]&15|64,$[8]=$[8]&63|128,X){D=D||0;for(var L=0;L<16;++L)X[D+L]=$[L];return X}return J($)}var F=Ge.a=j},"7ahc":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return _e});var ie=p("k1fw"),Ae=p("0Owb"),me=p("+L6B"),Me=p("2/Rp"),xe=p("y8nQ"),Ce=p("Vl3Y"),Y=p("tJVT"),I=p("OaEy"),V=p("2fM7"),J=p("q1tI"),j=p.n(J),F=p("VrN/"),se=p.n(F),X=p("p77/"),D=p.n(X),$=p("c5Ni"),L=p.n($),te=V.a.Option,_={labelCol:{span:4},wrapperCol:{span:20}},de={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"]};Ge.b=function(ce){var M=ce.callback,g=ce.onCancel,ee=Object(J.useState)("python"),S=Object(Y.a)(ee,2),B=S[0],x=S[1];function b(A){x(de[A][1])}function z(A){M(A)}return j.a.createElement(Ce.a,Object(Ae.a)({},_,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:z}),j.a.createElement(Ce.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},j.a.createElement(V.a,{onChange:b},Object.keys(de).map(function(A){return j.a.createElement(te,{key:A,value:A},de[A][0])}))),j.a.createElement(Ce.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},j.a.createElement(_e,{mode:B})),j.a.createElement("div",{className:"flex-container flex-end"},j.a.createElement(Me.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),j.a.createElement(Me.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function _e(ce){var M=ce.value,g=ce.onChange,ee=ce.mode,S=ce.options,B=S===void 0?{}:S,x=Object(J.useRef)(),b=Object(J.useState)(),z=Object(Y.a)(b,2),A=z[0],k=z[1];return Object(J.useEffect)(function(){if(A){function Z(be){var ae=be.getValue();g&&g(ae)}return A.on("change",Z),function(){A.off("change",Z)}}},[A,g]),Object(J.useEffect)(function(){A&&A.setOption("mode",ee)},[A,ee]),Object(J.useEffect)(function(){A&&((M!==A.getValue()||M==="")&&setTimeout(function(){A.setValue(M||" ")},300))},[A,M]),Object(J.useEffect)(function(){if(x.current&&!A){var Z=se.a.fromTextArea(x.current,Object(ie.a)({mode:ee,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},B));k(Z)}},[x.current,A]),j.a.createElement("div",{className:"my-codemirror-container"},j.a.createElement("textarea",{ref:x}))}},"7ixt":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return me});var ie={adjustX:1,adjustY:1},Ae=[0,0],me={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:Ae},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:Ae},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:Ae},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:Ae},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:Ae},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:Ae},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:Ae},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:Ae},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:Ae},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:Ae},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:Ae},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:Ae}},Me=me},"7qnI":function(at,Ge,p){"use strict";var ie=p("5Dmo"),Ae=p("3S7+"),me=p("fWQN"),Me=p("mtLc"),xe=p("yKVA"),Ce=p("879j"),Y=p("5NDa"),I=p("5rEg"),V=p("q1tI"),J=p.n(V),j=p("O2Wb"),F=p.n(j),se=I.a.TextArea,X=function(D){Object(xe.a)(L,D);var $=Object(Ce.a)(L);function L(){return Object(me.a)(this,L),$.apply(this,arguments)}return Object(Me.a)(L,[{key:"render",value:function(){var _=this,de=this.props,_e=de.index,ce=de.onAnswerChange,M=de.addChildAnswer,g=de.exerciseIsPublish,ee=de.answers,S=de.activeOptionErrorIndex,B=de.flex,x=B===void 0?"0 0 1000px":B;return J.a.createElement("div",{className:F.a.flex},J.a.createElement("div",{className:"".concat(F.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",_e+1,"):"),J.a.createElement("div",{className:"".concat(F.a.flex," ").concat(F.a.flex1),style:{flexDirection:"column"}},ee.map(function(b,z){var A="".concat(_e,"-").concat(z);return J.a.createElement("div",{className:"".concat(F.a.flex," ").concat(F.a.flex1),key:z},J.a.createElement("div",{className:F.a.flex1,style:{flex:x}},J.a.createElement("div",null,J.a.createElement(se,{className:A===S?F.a.error:"",spellCheck:!1,rows:4,value:b||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(z==0?"":"(\u53EF\u9009)"),onChange:function(Z){return ce(_e,z,Z.target.value)},style:{minHeight:95}}))),!g&&J.a.createElement(J.a.Fragment,null,z!=0&&J.a.createElement(Ae.a,{title:"\u5220\u9664"},J.a.createElement("i",{className:"".concat(F.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _.props.deleteChildAnswer(_e,z)},style:{float:"right"}})),z===0&&J.a.createElement(Ae.a,{title:"\u5220\u9664"},J.a.createElement("i",{className:"".concat(F.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _.props.deleteChildAnswermain(_e,z)},style:{float:"right"}})),J.a.createElement(Ae.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},J.a.createElement("i",{className:"".concat(F.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return M(_e)},style:{float:"right",visibility:z==ee.length-1?"":"hidden"}}))))})))}}]),L}(V.Component);Ge.a=X},"815F":function(at,Ge,p){"use strict";p.d(Ge,"e",function(){return Y}),p.d(Ge,"c",function(){return V}),p.d(Ge,"d",function(){return J}),p.d(Ge,"a",function(){return F}),p.d(Ge,"f",function(){return se}),p.d(Ge,"b",function(){return X});var ie=p("KQm4"),Ae=p("VTBJ"),me=p("Ff2n"),Me=p("Zm9Q"),xe=p("Kwbf"),Ce=p("OZM5");function Y(D,$){return D!=null?D:$}function I(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=new Map;function L(te){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(te||[]).forEach(function(de){var _e=de.key,ce=de.children;Object(xe.a)(_e!=null,"Tree node must have a certain key: [".concat(_).concat(_e,"]"));var M=String(_e);Object(xe.a)(!$.has(M)||_e===null||_e===void 0,"Same 'key' exist in the Tree: ".concat(M)),$.set(M,!0),L(ce,"".concat(_).concat(M," > "))})}L(D)}function V(D){function $(L){var te=Object(Me.a)(L);return te.map(function(_){if(!Object(Ce.i)(_))return Object(xe.a)(!_,"Tree/TreeNode can only accept TreeNode as children."),null;var de=_.key,_e=_.props,ce=_e.children,M=Object(me.a)(_e,["children"]),g=Object(Ae.a)({key:de},M),ee=$(ce);return ee.length&&(g.children=ee),g}).filter(function(_){return _})}return $(D)}function J(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=new Set($===!0?[]:$),te=[];function _(de){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return de.map(function(ce,M){var g=Object(Ce.h)(_e?_e.pos:"0",M),ee=Y(ce.key,g),S=Object(Ae.a)(Object(Ae.a)({},ce),{},{parent:_e,pos:g,children:null,data:ce,isStart:[].concat(Object(ie.a)(_e?_e.isStart:[]),[M===0]),isEnd:[].concat(Object(ie.a)(_e?_e.isEnd:[]),[M===de.length-1])});return te.push(S),$===!0||L.has(ee)?S.children=_(ce.children||[],S):S.children=[],S})}return _(D),te}function j(D,$,L){var te;L?typeof L=="string"?te=function(_e){return _e[L]}:typeof L=="function"&&(te=function(_e){return L(_e)}):te=function(_e,ce){return Y(_e.key,ce)};function _(de,_e,ce){var M=de?de.children:D,g=de?Object(Ce.h)(ce.pos,_e):"0";if(de){var ee=te(de,g),S={node:de,index:_e,pos:g,key:ee,parentPos:ce.node?ce.pos:null,level:ce.level+1};$(S)}M&&M.forEach(function(B,x){_(B,x,{node:de,pos:g,level:ce?ce.level+1:-1})})}_(null)}function F(D){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=$.initWrapper,te=$.processEntity,_=$.onProcessFinished,de=arguments.length>2?arguments[2]:void 0,_e={},ce={},M={posEntities:_e,keyEntities:ce};return L&&(M=L(M)||M),j(D,function(g){var ee=g.node,S=g.index,B=g.pos,x=g.key,b=g.parentPos,z=g.level,A={node:ee,index:S,key:x,pos:B,level:z},k=Y(x,B);_e[B]=A,ce[k]=A,A.parent=_e[b],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),te&&te(A,M)},de),_&&_(M),M}function se(D,$){var L=$.expandedKeys,te=$.selectedKeys,_=$.loadedKeys,de=$.loadingKeys,_e=$.checkedKeys,ce=$.halfCheckedKeys,M=$.dragOverNodeKey,g=$.dropPosition,ee=$.keyEntities,S=ee[D],B={eventKey:D,expanded:L.indexOf(D)!==-1,selected:te.indexOf(D)!==-1,loaded:_.indexOf(D)!==-1,loading:de.indexOf(D)!==-1,checked:_e.indexOf(D)!==-1,halfChecked:ce.indexOf(D)!==-1,pos:String(S?S.pos:""),dragOver:M===D&&g===0,dragOverGapTop:M===D&&g===-1,dragOverGapBottom:M===D&&g===1};return B}function X(D){var $=D.data,L=D.expanded,te=D.selected,_=D.checked,de=D.loaded,_e=D.loading,ce=D.halfChecked,M=D.dragOver,g=D.dragOverGapTop,ee=D.dragOverGapBottom,S=D.pos,B=D.active,x=Object(Ae.a)(Object(Ae.a)({},$),{},{expanded:L,selected:te,checked:_,loaded:de,loading:_e,halfChecked:ce,dragOver:M,dragOverGapTop:g,dragOverGapBottom:ee,pos:S,active:B});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(xe.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),D}}),x}},"8EBN":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";ie.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Ae=0;Ae-1&&Me.substring(Y+1,Me.length);if(I)return ie.findModeByExtension(I)},ie.findModeByName=function(Me){Me=Me.toLowerCase();for(var xe=0;xe=u.length?h.slice(u.length):h}).join(` `)}var L=[],te=["
    "],_=new X.a.Renderer,de=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _e(){L.length=0,te=["
      "]}var ce={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function M(c,o,r,u){if(o>=c.length||c[o].level<=r)return o;var h=c[o];u.push("
    • "+h.text+""),o++;var d=[];return o=M(c,o,h.level,d),d.length>0&&(u.push("
        "),d.forEach(function(q){u.push(q)}),u.push("
      ")),u.push("
    • "),o=M(c,o,r,u),o}function g(){return M(L,0,0,te),te.push("
    "),te.join("")}var ee={heading:function(o){var r=de.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 u=r[0],h=$(u,r[3]||""),d=r[2]?r[2].trim():r[2];if(["latex","katex","math"].indexOf(d)>=0){var q=x(),Ye=h;h=q,b[q]={type:"block",expression:Ye}}return{type:"code",raw:u,lang:d,text:h}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,B=0,x=function(){return"__special_katext_id_".concat(B++,"__")},b={};function z(){return b}function A(){B=0,b={}}function k(c){return c=c.replace(S,function(o,r){var u=x();return b[u]={type:"inline",expression:r},u}),c}var Z=_.listitem;_.listitem=function(c){return Z(k(c))};var be=_.paragraph;_.paragraph=function(c){return be(k(c))};var ae=_.tablecell;_.tablecell=function(c,o){return ae(k(c),o)},_.code=function(c,o,r){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"

    ".concat(c,"

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

    ",g()),_e()),pn=pn.replace(/(__special_katext_id_\d+__)/g,function(di,Yn){var Ci=Hn[Yn],fa=Ci.type,na=Ci.expression;return Object(je.renderToString)(On(na)||"",{displayMode:fa==="block",throwOnError:!1,output:"html"})}),pn=pn.replace(/▁/g,"\u2581\u2581\u2581"),A(),q){var Cn=document.createElement("div");return Cn.innerHTML=pn,Cn.innerText}return setTimeout(function(){return ra()},500),pn},[St]),Tn=Object(J.useRef)();ce.WebkitLineClamp=Ye,Ye&&(Ve=Object(xe.a)(Object(xe.a)({},Ve),ce));function Fi(zn){var gn=zn.target;if(gn.tagName.toUpperCase()==="IMG"){if(Nt){var li=gn.getAttribute("src");An(li),Xn("image")}}else if(gn.tagName.toUpperCase()==="A"){var pn=gn.getAttribute("href");if(pn.indexOf("office")>-1)zn.preventDefault(),An(pn),Xn("office");else if(pn.indexOf("application/pdf")>-1)zn.preventDefault(),An(pn),Xn("pdf");else if(pn.indexOf("type=text")>-1)zn.preventDefault(),An(pn),Xn("html");else if(pn.startsWith("#")){zn.preventDefault();var Hn=document.getElementById(pn.replace("#",""));Hn&&Hn.scrollIntoView(!0)}}}var ra=function(){var gn,li=(gn=Tn.current)===null||gn===void 0?void 0:gn.querySelectorAll("video");li==null||li.forEach(function(pn){if(pn.oncontextmenu=function(){return!1},pn.src.indexOf(".m3u8")>-1&&!pn.canPlayType("application/vnd.apple.mpegurl")){if(le.a.isSupported()){var Hn=new le.a;Hn.loadSource(pn.src),Hn.attachMedia(pn)}}})};Object(J.useEffect)(function(){if(Tn.current&&Ei&&(Ei.match(En)&&window.PR.prettyPrint()),Tn.current)return Tn.current.addEventListener("click",Fi),function(){Tn.current.removeEventListener("click",Fi),A(),_e()}},[Ei,Tn.current,Fi]);var pa=function(gn){if(!h)return;gn.target.nodeName==="IMG"?(At.current.style.display="flex",At.current.style.width=gn.target.clientWidth+"px",At.current.style.height=gn.target.clientHeight+"px",At.current.style.top=gn.target.offsetTop+"px",At.current.style.left=gn.target.offsetLeft+"px",cn.current.src=gn.target.getAttribute("src")):At.current.style.display="none"};return j.a.createElement("div",{style:{position:"relative"}},j.a.createElement("div",{ref:Tn,style:Object(xe.a)({},Ve),className:"".concat(d||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:pa,dangerouslySetInnerHTML:{__html:Ei}}),j.a.createElement("div",{ref:At,className:mn.a.button},j.a.createElement(Ae.a,null,j.a.createElement(Me.a,{onClick:function(){return $n()}},"\u88C1\u526A"),j.a.createElement(Me.a,{onClick:function(){return $i()}},"\u7F16\u8F91"))),j.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),j.a.createElement(Je.a,{close:!0,data:yn,hasMask:ve,type:yn!=null&&yn.length?wi:"",style:Object(xe.a)({},Tt),onClose:function(){return An("")}}))}},"9VGf":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return me});var ie=p("q1tI"),Ae=p.n(ie);function me(Me,xe){var Ce=Object(ie.useRef)();Object(ie.useEffect)(function(){Ce.current=Me}),Object(ie.useEffect)(function(){function Y(){Ce.current()}if(xe!==null){var I=setInterval(Y,xe);return function(){return clearInterval(I)}}},[xe])}},"A+k2":function(at,Ge,p){at.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(at,Ge,p){(function(ie){ie(p("VrN/"),p("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(V,J,j){if(j!=ie.Init&&j&&V.removeKeyMap("autoCloseTags"),!J)return;var F={name:"autoCloseTags"};(typeof J!="object"||J.whenClosing!==!1)&&(F["'/'"]=function(se){return Ce(se)}),(typeof J!="object"||J.whenOpening!==!1)&&(F["'>'"]=function(se){return Me(se)}),V.addKeyMap(F)});var Ae=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],me=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Me(V){if(V.getOption("disableInput"))return ie.Pass;for(var J=V.listSelections(),j=[],F=V.getOption("autoCloseTags"),se=0;seX.ch&&(_=_.slice(0,_.length-D.end+X.ch));var M=_.toLowerCase();if(!_||D.type=="string"&&(D.end!=X.ch||!/[\"\']/.test(D.string.charAt(D.string.length-1))||D.string.length==1)||D.type=="tag"&&te.close||D.string.indexOf("/")==X.ch-D.start-1||_e&&Y(_e,M)>-1||I(V,$.mode.xmlCurrentContext&&$.mode.xmlCurrentContext(L)||[],_,X,!0))return ie.Pass;var g=typeof F=="object"&&F.emptyTags;if(g&&Y(g,_)>-1){j[se]={text:"/>",newPos:ie.Pos(X.line,X.ch+2)};continue}var ee=ce&&Y(ce,M)>-1;j[se]={indent:ee,text:">"+(ee?` `:"")+"",newPos:ee?ie.Pos(X.line+1,0):ie.Pos(X.line,X.ch+1)}}for(var S=typeof F=="object"&&F.dontIndentOnAutoClose,se=J.length-1;se>=0;se--){var B=j[se];V.replaceRange(B.text,J[se].head,J[se].anchor,"+insert");var x=V.listSelections().slice(0);x[se]={head:B.newPos,anchor:B.newPos},V.setSelections(x),!S&&B.indent&&(V.indentLine(B.newPos.line,null,!0),V.indentLine(B.newPos.line+1,null,!0))}}function xe(V,J){for(var j=V.listSelections(),F=[],se=J?"/":""&&(_e+=">"),F[$]=_e}if(V.replaceSelections(F),j=V.listSelections(),!D)for(var $=0;$=0&&J[L]==j;L--)++$;F=D.to;for(var L=1;L<$;L++){var te=ie.scanForClosingTag(V,F,null,X);if(!te||te.tag!=j)return!1;F=te.to}return!0}})},BjJ7:function(at,Ge,p){"use strict";p.d(Ge,"d",function(){return Ae}),p.d(Ge,"c",function(){return me}),p.d(Ge,"e",function(){return Me}),p.d(Ge,"b",function(){return xe}),p.d(Ge,"a",function(){return Y});var ie=p("m3rI");function Ae(I){var V=!0;if(I.length>0){for(var J=0;J1&&arguments[1]!==void 0?arguments[1]:"",J=[],j=0;jN.length)&&(H=N.length);for(var K=0,C=new Array(H);K=N.length?{done:!0}:{done:!1,value:N[C++]}}}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 K=N[Symbol.iterator](),K.next.bind(K)}function Ce(N,H){return H={exports:{}},N(H,H.exports),H.exports}var Y=Ce(function(N){function H(){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 K(C){N.exports.defaults=C}N.exports={defaults:H(),getDefaults:H,changeDefaults:K}}),I=Y.defaults,V=Y.getDefaults,J=Y.changeDefaults,j=/[&<>"']/,F=/[&<>"']/g,se=/[<>"']|&(?!#?\w+;)/,X=/[<>"']|&(?!#?\w+;)/g,D={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(H){return D[H]};function L(N,H){if(H){if(j.test(N))return N.replace(F,$)}else if(se.test(N))return N.replace(X,$);return N}var te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _(N){return N.replace(te,function(H,K){return K=K.toLowerCase(),K==="colon"?":":K.charAt(0)==="#"?K.charAt(1)==="x"?String.fromCharCode(parseInt(K.substring(2),16)):String.fromCharCode(+K.substring(1)):""})}var de=/(^|[^\[])\^/g;function _e(N,H){N=N.source||N,H=H||"";var K={replace:function(w,O){return O=O.source||O,O=O.replace(de,"$1"),N=N.replace(w,O),K},getRegex:function(){return new RegExp(N,H)}};return K}var ce=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(N,H,K){if(N){var C;try{C=decodeURIComponent(_(K)).replace(ce,"").toLowerCase()}catch(w){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}H&&!M.test(K)&&(K=b(H,K));try{K=encodeURI(K).replace(/%25/g,"%")}catch(w){return null}return K}var ee={},S=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(N,H){ee[" "+N]||(S.test(N)?ee[" "+N]=N+"/":ee[" "+N]=Z(N,"/",!0)),N=ee[" "+N];var K=N.indexOf(":")===-1;return H.substring(0,2)==="//"?K?H:N.replace(B,"$1")+H:H.charAt(0)==="/"?K?H:N.replace(x,"$1")+H:N+H}var z={exec:function(){}};function A(N){for(var H=1,K,C;H=0&&re[pe]==="\\";)ne=!ne;return ne?"|":" |"}),C=K.split(/ \|/),w=0;if(C.length>H)C.splice(H);else for(;C.length=C.length?w.slice(C.length):w}).join(` `)}var Ee=function(){function N(K){this.options=K||P}var H=N.prototype;return H.space=function(C){var w=this.rules.block.newline.exec(C);if(w)return w[0].length>1?{type:"space",raw:w[0]}:{raw:` `}},H.code=function(C,w){var O=this.rules.block.code.exec(C);if(O){var R=w[w.length-1];if(R&&R.type==="paragraph")return{raw:O[0],text:O[0].trimRight()};var re=O[0].replace(/^ {4}/gm,"");return{type:"code",raw:O[0],codeBlockStyle:"indented",text:this.options.pedantic?re:v(re,` `)}}},H.fences=function(C){var w=this.rules.block.fences.exec(C);if(w){var O=w[0],R=we(O,w[3]||"");return{type:"code",raw:O,lang:w[2]?w[2].trim():w[2],text:R}}},H.heading=function(C){var w=this.rules.block.heading.exec(C);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},H.nptable=function(C){var w=this.rules.block.nptable.exec(C);if(w){var O={type:"table",header:le(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(` `):[],raw:w[0]};if(O.header.length===O.align.length){var R=O.align.length,re;for(re=0;re ?/gm,"");return{type:"blockquote",raw:w[0],text:O}}},H.list=function(C){var w=this.rules.block.list.exec(C);if(w){for(var O=w[0],R=w[2],re=R.length>1,ne=R[R.length-1]===")",pe={type:"list",raw:O,ordered:re,start:re?+R.slice(0,-1):"",loose:!1,items:[]},nt=w[0].match(this.rules.block.item),Ke=!1,Se,gt,jt,ot,Xt,tt,Ht,It=nt.length,Rt=0;Rt1||this.options.smartLists&&jt!==R)&&(ot=nt.slice(Rt+1).join(` `),pe.raw=pe.raw.substring(0,pe.raw.length-ot.length),Rt=It-1)),Xt=Ke||/\n\n(?!\s*$)/.test(Se),Rt!==It-1&&(Ke=Se.charAt(Se.length-1)===` `,Xt||(Xt=Ke)),Xt&&(pe.loose=!0),tt=/^\[[ xX]\] /.test(Se),Ht=void 0,tt&&(Ht=Se[1]!==" ",Se=Se.replace(/^\[[ xX]\] +/,"")),pe.items.push({type:"list_item",raw:O,task:tt,checked:Ht,loose:Xt,text:Se});return pe}},H.html=function(C){var w=this.rules.block.html.exec(C);if(w)return{type:this.options.sanitize?"paragraph":"html",raw:w[0],pre:!this.options.sanitizer&&(w[1]==="pre"||w[1]==="script"||w[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(w[0]):He(w[0]):w[0]}},H.def=function(C){var w=this.rules.block.def.exec(C);if(w){w[3]&&(w[3]=w[3].substring(1,w[3].length-1));var O=w[1].toLowerCase().replace(/\s+/g," ");return{tag:O,raw:w[0],href:w[2],title:w[3]}}},H.table=function(C){var w=this.rules.block.table.exec(C);if(w){var O={type:"table",header:le(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(` `):[]};if(O.header.length===O.align.length){O.raw=w[0];var R=O.align.length,re;for(re=0;re/i.test(R[0])&&(w=!1),!O&&/^<(pre|code|kbd|script)(\s|>)/i.test(R[0])?O=!0:O&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(R[0])&&(O=!1),{type:this.options.sanitize?"text":"html",raw:R[0],inLink:w,inRawBlock:O,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):He(R[0]):R[0]}},H.link=function(C){var w=this.rules.inline.link.exec(C);if(w){var O=je(w[2],"()");if(O>-1){var R=w[0].indexOf("!")===0?5:4,re=R+w[1].length+O;w[2]=w[2].substring(0,O),w[0]=w[0].substring(0,re).trim(),w[3]=""}var ne=w[2],pe="";if(this.options.pedantic){var nt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ne);nt?(ne=nt[1],pe=nt[3]):pe=""}else pe=w[3]?w[3].slice(1,-1):"";ne=ne.trim().replace(/^<([\s\S]*)>$/,"$1");var Ke=Je(w,{href:ne&&ne.replace(this.rules.inline._escapes,"$1"),title:pe&&pe.replace(this.rules.inline._escapes,"$1")},w[0]);return Ke}},H.reflink=function(C,w){var O;if((O=this.rules.inline.reflink.exec(C))||(O=this.rules.inline.nolink.exec(C))){var R=(O[2]||O[1]).replace(/\s+/g," ");if(R=w[R.toLowerCase()],!R||!R.href){var re=O[0].charAt(0);return{type:"text",raw:re,text:re}}var ne=Je(O,R,O[0]);return ne}},H.strong=function(C,w,O){O===void 0&&(O="");var R=this.rules.inline.strong.start.exec(C);if(R&&(!R[1]||R[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){w=w.slice(-1*C.length);var re=R[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;re.lastIndex=0;for(var ne;(R=re.exec(w))!=null;)if(ne=this.rules.inline.strong.middle.exec(w.slice(0,R.index+3)),ne)return{type:"strong",raw:C.slice(0,ne[0].length),text:C.slice(2,ne[0].length-2)}}},H.em=function(C,w,O){O===void 0&&(O="");var R=this.rules.inline.em.start.exec(C);if(R&&(!R[1]||R[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){w=w.slice(-1*C.length);var re=R[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;re.lastIndex=0;for(var ne;(R=re.exec(w))!=null;)if(ne=this.rules.inline.em.middle.exec(w.slice(0,R.index+2)),ne)return{type:"em",raw:C.slice(0,ne[0].length),text:C.slice(1,ne[0].length-1)}}},H.codespan=function(C){var w=this.rules.inline.code.exec(C);if(w){var O=w[2].replace(/\n/g," "),R=/[^ ]/.test(O),re=O.startsWith(" ")&&O.endsWith(" ");return R&&re&&(O=O.substring(1,O.length-1)),O=He(O,!0),{type:"codespan",raw:w[0],text:O}}},H.br=function(C){var w=this.rules.inline.br.exec(C);if(w)return{type:"br",raw:w[0]}},H.del=function(C){var w=this.rules.inline.del.exec(C);if(w)return{type:"del",raw:w[0],text:w[1]}},H.autolink=function(C,w){var O=this.rules.inline.autolink.exec(C);if(O){var R,re;return O[2]==="@"?(R=He(this.options.mangle?w(O[1]):O[1]),re="mailto:"+R):(R=He(O[1]),re=R),{type:"link",raw:O[0],text:R,href:re,tokens:[{type:"text",raw:R,text:R}]}}},H.url=function(C,w){var O;if(O=this.rules.inline.url.exec(C)){var R,re;if(O[2]==="@")R=He(this.options.mangle?w(O[0]):O[0]),re="mailto:"+R;else{var ne;do ne=O[0],O[0]=this.rules.inline._backpedal.exec(O[0])[0];while(ne!==O[0]);R=He(O[0]),O[1]==="www."?re="http://"+R:re=R}return{type:"link",raw:O[0],text:R,href:re,tokens:[{type:"text",raw:R,text:R}]}}},H.inlineText=function(C,w,O){var R=this.rules.inline.text.exec(C);if(R){var re;return w?re=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):He(R[0]):R[0]:re=He(this.options.smartypants?O(R[0]):R[0]),{type:"text",raw:R[0],text:re}}},N}(),G=Te.noopTest,U=Te.edit,ue=Te.merge,T={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:G,table:G,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};T._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,T._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,T.def=U(T.def).replace("label",T._label).replace("title",T._title).getRegex(),T.bullet=/(?:[*+-]|\d{1,9}[.)])/,T.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,T.item=U(T.item,"gm").replace(/bull/g,T.bullet).getRegex(),T.list=U(T.list).replace(/bull/g,T.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+T.def.source+")").getRegex(),T._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",T._comment=//,T.html=U(T.html,"i").replace("comment",T._comment).replace("tag",T._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),T.paragraph=U(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",T._tag).getRegex(),T.blockquote=U(T.blockquote).replace("paragraph",T.paragraph).getRegex(),T.normal=ue({},T),T.gfm=ue({},T.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*|$)"}),T.gfm.nptable=U(T.gfm.nptable).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",T._tag).getRegex(),T.gfm.table=U(T.gfm.table).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",T._tag).getRegex(),T.pedantic=ue({},T.normal,{html:U(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:G,paragraph:U(T.normal._paragraph).replace("hr",T.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",T.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var E={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:G,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:G,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",E.punctuation=U(E.punctuation).replace(/punctuation/g,E._punctuation).getRegex(),E._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",E._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",E.em.start=U(E.em.start).replace(/punctuation/g,E._punctuation).getRegex(),E.em.middle=U(E.em.middle).replace(/punctuation/g,E._punctuation).replace(/overlapSkip/g,E._overlapSkip).getRegex(),E.em.endAst=U(E.em.endAst,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.em.endUnd=U(E.em.endUnd,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.strong.start=U(E.strong.start).replace(/punctuation/g,E._punctuation).getRegex(),E.strong.middle=U(E.strong.middle).replace(/punctuation/g,E._punctuation).replace(/blockSkip/g,E._blockSkip).getRegex(),E.strong.endAst=U(E.strong.endAst,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.strong.endUnd=U(E.strong.endUnd,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.blockSkip=U(E._blockSkip,"g").getRegex(),E.overlapSkip=U(E._overlapSkip,"g").getRegex(),E._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,E._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,E._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])?)+(?![-_])/,E.autolink=U(E.autolink).replace("scheme",E._scheme).replace("email",E._email).getRegex(),E._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,E.tag=U(E.tag).replace("comment",T._comment).replace("attribute",E._attribute).getRegex(),E._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,E._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,E._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,E.link=U(E.link).replace("label",E._label).replace("href",E._href).replace("title",E._title).getRegex(),E.reflink=U(E.reflink).replace("label",E._label).getRegex(),E.reflinkSearch=U(E.reflinkSearch,"g").replace("reflink",E.reflink).replace("nolink",E.nolink).getRegex(),E.normal=ue({},E),E.pedantic=ue({},E.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:U(/^!?\[(label)\]\((.*?)\)/).replace("label",E._label).getRegex(),reflink:U(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",E._label).getRegex()}),E.gfm=ue({},E.normal,{escape:U(E.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(C="x"+C.toString(16)),H+="&#"+C+";";return H}var Re=function(){function N(K){this.tokens=[],this.tokens.links=Object.create(null),this.options=K||Le,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var C={block:Ze.normal,inline:ke.normal};this.options.pedantic?(C.block=Ze.pedantic,C.inline=ke.pedantic):this.options.gfm&&(C.block=Ze.gfm,this.options.breaks?C.inline=ke.breaks:C.inline=ke.gfm),this.tokenizer.rules=C}N.lex=function(C,w){var O=new N(w);return O.lex(C)};var H=N.prototype;return H.lex=function(C){return C=C.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(C,this.tokens,!0),this.inline(this.tokens),this.tokens},H.blockTokens=function(C,w,O){w===void 0&&(w=[]),O===void 0&&(O=!0),C=C.replace(/^ +$/gm,"");for(var R,re,ne,pe;C;){if(R=this.tokenizer.space(C)){C=C.substring(R.raw.length),R.type&&w.push(R);continue}if(R=this.tokenizer.code(C,w)){C=C.substring(R.raw.length),R.type?w.push(R):(pe=w[w.length-1],pe.raw+=` `+R.raw,pe.text+=` `+R.text);continue}if(R=this.tokenizer.fences(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.heading(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.nptable(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.hr(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.blockquote(C)){C=C.substring(R.raw.length),R.tokens=this.blockTokens(R.text,[],O),w.push(R);continue}if(R=this.tokenizer.list(C)){for(C=C.substring(R.raw.length),ne=R.items.length,re=0;re0)for(;(nt=this.tokenizer.rules.inline.reflinkSearch.exec(pe))!=null;)Ke.includes(nt[0].slice(nt[0].lastIndexOf("[")+1,-1))&&(pe=pe.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(nt=this.tokenizer.rules.inline.blockSkip.exec(pe))!=null;)pe=pe.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;C;){if(ne=this.tokenizer.escape(C)){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.tag(C,O,R)){C=C.substring(ne.raw.length),O=ne.inLink,R=ne.inRawBlock,w.push(ne);continue}if(ne=this.tokenizer.link(C)){C=C.substring(ne.raw.length),ne.type==="link"&&(ne.tokens=this.inlineTokens(ne.text,[],!0,R)),w.push(ne);continue}if(ne=this.tokenizer.reflink(C,this.tokens.links)){C=C.substring(ne.raw.length),ne.type==="link"&&(ne.tokens=this.inlineTokens(ne.text,[],!0,R)),w.push(ne);continue}if(ne=this.tokenizer.strong(C,pe,re)){C=C.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],O,R),w.push(ne);continue}if(ne=this.tokenizer.em(C,pe,re)){C=C.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],O,R),w.push(ne);continue}if(ne=this.tokenizer.codespan(C)){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.br(C)){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.del(C)){C=C.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],O,R),w.push(ne);continue}if(ne=this.tokenizer.autolink(C,ge)){C=C.substring(ne.raw.length),w.push(ne);continue}if(!O&&(ne=this.tokenizer.url(C,ge))){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.inlineText(C,R,Ue)){C=C.substring(ne.raw.length),re=ne.raw.slice(-1),w.push(ne);continue}if(C){var Se="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(Se);break}else throw new Error(Se)}}return w},Ae(N,null,[{key:"rules",get:function(){return{block:Ze,inline:ke}}}]),N}(),Be=Y.defaults,Qe=Te.cleanUrl,it=Te.escape,Xe=function(){function N(K){this.options=K||Be}var H=N.prototype;return H.code=function(C,w,O){var R=(w||"").match(/\S*/)[0];if(this.options.highlight){var re=this.options.highlight(C,R);re!=null&&re!==C&&(O=!0,C=re)}return R?'
    '+(O?C:it(C,!0))+`
    `:"
    "+(O?C:it(C,!0))+`
    `},H.blockquote=function(C){return`
    `+C+`
    `},H.html=function(C){return C},H.heading=function(C,w,O,R){return this.options.headerIds?"'+C+" `:""+C+" `},H.hr=function(){return this.options.xhtml?`
    `:`
    `},H.list=function(C,w,O){var R=w?"ol":"ul",re=w&&O!==1?' start="'+O+'"':"";return"<"+R+re+`> `+C+" `},H.listitem=function(C){return"
  • "+C+`
  • `},H.checkbox=function(C){return" "},H.paragraph=function(C){return"

    "+C+`

    `},H.table=function(C,w){return w&&(w=""+w+""),` `+C+` `+w+`
    `},H.tablerow=function(C){return` `+C+` `},H.tablecell=function(C,w){var O=w.header?"th":"td",R=w.align?"<"+O+' align="'+w.align+'">':"<"+O+">";return R+C+" `},H.strong=function(C){return""+C+""},H.em=function(C){return""+C+""},H.codespan=function(C){return""+C+""},H.br=function(){return this.options.xhtml?"
    ":"
    "},H.del=function(C){return""+C+""},H.link=function(C,w,O){if(C=Qe(this.options.sanitize,this.options.baseUrl,C),C===null)return O;var R='",R},H.image=function(C,w,O){if(C=Qe(this.options.sanitize,this.options.baseUrl,C),C===null)return O;var R=''+O+'":">",R},H.text=function(C){return C},N}(),De=function(){function N(){}var H=N.prototype;return H.strong=function(C){return C},H.em=function(C){return C},H.codespan=function(C){return C},H.del=function(C){return C},H.html=function(C){return C},H.text=function(C){return C},H.link=function(C,w,O){return""+O},H.image=function(C,w,O){return""+O},H.br=function(){return""},N}(),Et=function(){function N(){this.seen={}}var H=N.prototype;return H.slug=function(C){var w=C.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(w)){var O=w;do this.seen[O]++,w=O+"-"+this.seen[O];while(this.seen.hasOwnProperty(w))}return this.seen[w]=0,w},N}(),pt=Y.defaults,bt=Te.unescape,ct=function(){function N(K){this.options=K||pt,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new Et}N.parse=function(C,w){var O=new N(w);return O.parse(C)};var H=N.prototype;return H.parse=function(C,w){w===void 0&&(w=!0);var O="",R,re,ne,pe,nt,Ke,Se,gt,jt,ot,Xt,tt,Ht,It,Rt,Jt,Ft,We,lt=C.length;for(R=0;R0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=We+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=We+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:We}):It+=We),It+=this.parse(Rt.tokens,Ht),jt+=this.renderer.listitem(It,Ft,Jt);O+=this.renderer.list(jt,Xt,tt);continue}case"html":{O+=this.renderer.html(ot.text);continue}case"paragraph":{O+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(jt=ot.tokens?this.parseInline(ot.tokens):ot.text;R+1An error occurred:

    "+Ct(ne.message+"",!0)+"
    ";throw ne}}Ne.options=Ne.setOptions=function(N){return Mt(Ne.defaults,N),Ut(Ne.defaults),Ne},Ne.getDefaults=Pe,Ne.defaults=kt,Ne.use=function(N){var H=Mt({},N);if(N.renderer&&function(){var C=Ne.defaults.renderer||new Xe,w=function(re){var ne=C[re];C[re]=function(){for(var pe=arguments.length,nt=new Array(pe),Ke=0;KeWe.length){var on=Object(De.xor)(Gt,We);console.log(on,"newLevel"),Kt=Kt.filter(function(Vt){return!on.includes(Vt)})}nt(Kt),tt(We.length===(Ke==null||((qe=Ke.tag_disciplines)===null||qe===void 0)?void 0:qe.length))},It=function(We){var lt,qe=Ke==null||((lt=Ke.tag_disciplines)===null||lt===void 0)?void 0:lt.map(function(dt){return dt.id});nt(We.target.checked?Object(De.uniq)([].concat(Object(Te.a)(pe),Object(Te.a)(qe))):pe==null?void 0:pe.filter(function(dt){return!qe.includes(dt)})),tt(We.target.checked)};console.log(Ke,"options");var Rt=function(){var We,lt,qe=(Ke==null?void 0:Ke.tag_disciplines)||[];if(Se){var dt;qe=(dt=qe)===null||dt===void 0?void 0:dt.filter(function(Gt){var Kt;return Gt==null||((Kt=Gt.name)===null||Kt===void 0)?void 0:Kt.includes(Se)})}return qe=(We=qe)===null||We===void 0?void 0:We.map(function(Gt){return Object(J.a)(Object(J.a)({},Gt),{},{label:"".concat(Gt.name,"(".concat(Gt==null?void 0:Gt.item_count,")")),value:Gt.id})}),qe=(lt=qe)===null||lt===void 0?void 0:lt.filter(function(Gt){return Gt.item_count!==0}),qe},Jt=function(){var We=!1;if(!Se)We=!0;else{var lt;(lt=Ke.tag_disciplines)===null||lt===void 0||lt.forEach(function(qe){if(!We){var dt;We=((dt=qe.name)===null||dt===void 0?void 0:dt.includes(Se))&&qe.item_count!==0}})}return We};return(Ke==null?void 0:Ke.item_count)===0||!Jt()?_.a.createElement(_.a.Fragment,null):_.a.createElement("div",{className:Xe.a.cInput},_.a.createElement("div",{className:Xe.a.cl},_.a.createElement(A.a,{checked:Xt,onChange:It},_.a.createElement("span",{className:Xe.a.box},_.a.createElement("span",{className:"font14 c-light-primary"},_.a.createElement("span",{title:Ke==null?void 0:Ke.name,className:Xe.a.box1}," ",Ke==null?void 0:Ke.name),_.a.createElement("span",null," ","(".concat(Ke==null?void 0:Ke.item_count,")"))),_.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),_.a.createElement("div",{className:Xe.a.cr},_.a.createElement(Et,{options:Rt(),value:pe,onChange:Ht})))},bt=pt,ct=p("ErOA"),Mt=p("ozfa"),Ot=p("MJZm"),Ct=p("0Owb"),Pe=p("tmPe"),Ut=p.n(Pe),kt=function(re){var ne=re.value,pe=re.onChange,nt=re.defaultValue,Ke=re.treeData,Se=Ke===void 0?[]:Ke,gt=Object(Qe.a)(re,["value","onChange","defaultValue","treeData"]);return _.a.createElement("div",{className:Ut.a.customTree},_.a.createElement(Ot.a,Object(Ct.a)({multiple:!0,showIcon:!0,selectedKeys:ne,defaultExpandedKeys:nt,treeData:Se,onSelect:pe},gt)))},Ne=kt,Fe=p("sbIO"),N=D.a.Search,H=function(re){var ne,pe=re.formValue,nt=re.setFatherTabs,Ke=re.tabs,Se=re.editData,gt=re.dispatch,jt=Object(de.i)().id,ot=Object(te.useState)(["mine"]),Xt=Object(se.a)(ot,2),tt=Xt[0],Ht=Xt[1],It=Object(te.useState)(!0),Rt=Object(se.a)(It,2),Jt=Rt[0],Ft=Rt[1],We=Object(te.useState)(!1),lt=Object(se.a)(We,2),qe=lt[0],dt=lt[1],Gt=Object(te.useState)(!1),Kt=Object(se.a)(Gt,2),on=Kt[0],Vt=Kt[1],_t=Object(te.useState)(""),tn=Object(se.a)(_t,2),Lt=tn[0],un=tn[1],zt=Object(te.useState)(!1),dn=Object(se.a)(zt,2),In=dn[0],nn=dn[1],$e=Object(te.useState)(!1),ut=Object(se.a)($e,2),mn=ut[0],En=ut[1],On=Object(te.useState)({}),Bn=Object(se.a)(On,2),c=Bn[0],o=Bn[1],r=Object(te.useState)([]),u=Object(se.a)(r,2),h=u[0],d=u[1],q=Object(te.useState)([]),Ye=Object(se.a)(q,2),st=Ye[0],Nt=Ye[1],ve=Object(te.useState)([]),oe=Object(se.a)(ve,2),Ve=oe[0],Pt=oe[1],Tt=Object(te.useState)([]),St=Object(se.a)(Tt,2),At=St[0],cn=St[1],Nn=Object(te.useState)(null),wn=Object(se.a)(Nn,2),yn=wn[0],An=wn[1],Dn=Object(te.useRef)([]),ti=Object(te.useState)(!1),wi=Object(se.a)(ti,2),Xn=wi[0],$n=wi[1],$i=Object(te.useState)([]),Ei=Object(se.a)($i,2),Tn=Ei[0],Fi=Ei[1],ra=Object(te.useState)([0]),pa=Object(se.a)(ra,2),zn=pa[0],gn=pa[1],li=Object(te.useState)([]),pn=Object(se.a)(li,2),Hn=pn[0],Cn=pn[1],di=Object(te.useRef)([]),Yn=Object(te.useState)(!1),Ci=Object(se.a)(Yn,2),fa=Ci[0],na=Ci[1],ia=Object(te.useState)([]),Sa=Object(se.a)(ia,2),bn=Sa[0],Ji=Sa[1],Vi=Object(te.useState)([]),sa=Object(se.a)(Vi,2),Zi=sa[0],la=sa[1],ua=Object(te.useRef)([]),no=Object(te.useState)([]),Wt=Object(se.a)(no,2),qt=Wt[0],$t=Wt[1],rn=Object(te.useState)(!1),vn=Object(se.a)(rn,2),Sn=vn[0],fn=vn[1],Kn=Object(te.useRef)([]),Si=Object(te.useState)(0),sn=Object(se.a)(Si,2),aa=sn[0],hn=sn[1],Jn=Hn==null?void 0:Hn.filter(function(mt){return Tn==null?void 0:Tn.includes(mt.id)}),Wi=Zi==null?void 0:Zi.filter(function(mt){return bn==null?void 0:bn.includes(mt.id)});Object(te.useEffect)(function(){ka()},[]),Object(te.useEffect)(function(){return Ke===1&&(gt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),gt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){gt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),gt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[Ke]),Object(te.useEffect)(function(){jt?Se&&ui():(Fa(tt),ma(),Ft(!1))},[Se]),Object(te.useEffect)(function(){Lt&&zi()},[Lt]);var zi=function(){var rt=null;st==null||st.forEach(function(Ie){var Oe;(Oe=Ie.sub_disciplines)===null||Oe===void 0||Oe.forEach(function(vt){var ft;(ft=vt.tag_disciplines)===null||ft===void 0||ft.forEach(function(yt){var Zt,an=((Zt=yt.name)===null||Zt===void 0?void 0:Zt.includes(Lt))&&yt.item_count!==0;an&&!rt&&(rt=Ie.id)})})}),rt&&An(rt)},Ba=function(rt){function Ie(Oe){var vt=Oe.children,ft=Array.isArray(vt)&&vt.length>0,yt=Oe==null?void 0:Oe.group_id;return Kn.current.push({name:Oe==null?void 0:Oe.name,id:yt,count:Oe==null?void 0:Oe.count}),{title:_.a.createElement("div",{title:Oe==null?void 0:Oe.name,className:v.a.name},Oe==null?void 0:Oe.name,"\uFF08".concat(Oe==null?void 0:Oe.count,"\uFF09")),value:yt,name:Oe==null?void 0:Oe.name,key:yt,count:Oe==null?void 0:Oe.count,id:yt,icon:_.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:ft?vt==null?void 0:vt.map(function(Zt){return Ie(Zt)}):[]}}return rt==null?void 0:rt.map(function(Oe){return Ie(Oe)})},ka=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie,Oe;return L.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(le.x)({});case 2:Ie=ft.sent,Kn.current=[{id:0,name:"\u6839\u76EE\u5F55",count:Ie==null?void 0:Ie.root_count}],Ie!=null&&Ie.data&&(Oe=[{title:_.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:v.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((Ie==null?void 0:Ie.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:Ie==null?void 0:Ie.root_count,name:"\u6839\u76EE\u5F55",icon:_.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Ba(Ie.data||[])}],Cn(Kn.current),$t(Oe));case 5:case"end":return ft.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),ui=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie,Oe,vt,ft,yt,Zt,an,Pn,kn,Mn,xn,ni,Fn,Wn,hi,ai,qn,pi;return L.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return Mn=Se==null||((Ie=Se.tag_disciplines)===null||Ie===void 0)?void 0:Ie.map(function(_n){return _n.tag_discipline_id}),xn=Se==null||((Oe=Se.groups)===null||Oe===void 0)?void 0:Oe.map(function(_n){return _n.id}),ni={source:Se==null||((vt=Se.examination_bank)===null||vt===void 0)?void 0:vt.source,group_ids:xn,tag_discipline_ids:Mn,teach_group_ids:Se==null?void 0:Se.teach_group_ids},en.next=5,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ni});case 5:if(Fn=en.sent,!((Fn==null?void 0:Fn.status)===-1)){en.next=8;break}return en.abrupt("return");case 8:Wn=Fn==null?void 0:Fn.filter(function(_n){var Zn;return!!(_n!=null&&(Zn=_n.item_banks)!==null&&Zn!==void 0&&Zn.length)}),Wn=Wn.map(function(_n){return Object(J.a)(Object(J.a)({},_n),{},{scoreTotal:0,score:0,questionTotal:0})}),Wn=(ft=Wn)===null||ft===void 0?void 0:ft.map(function(_n,Zn){var fi,oi,Pi;return Object(J.a)(Object(J.a)({},_n),{},{score:(Se==null||((fi=Se.score_settings)===null||fi===void 0||((oi=fi.find(function(Ai){return Ai.item_type===(_n==null?void 0:_n.item_type)}))===null||oi===void 0))?void 0:oi.score)||0,item_banks:_n==null||((Pi=_n.item_banks)===null||Pi===void 0)?void 0:Pi.map(function(Ai){var jn;return Object(J.a)(Object(J.a)({},Ai),{},{tag_disciplines:Ai==null||((jn=Ai.tag_disciplines)===null||jn===void 0)?void 0:jn.map(function(Vn){var mi;return Object(J.a)(Object(J.a)({},Vn),{},{difficulties:Vn==null||((mi=Vn.difficulties)===null||mi===void 0)?void 0:mi.map(function(ki){var vi=Se==null?void 0:Se.contents.find(function(Ni){return Ni.item_type===_n.item_type&&Ni.sub_discipline_id===Ai.sub_discipline_id&&Ni.tag_discipline_id===Vn.tag_discipline_id&&Ni.difficulty===ki.difficulty});return vi?Object(J.a)(Object(J.a)({},ki),{},{num:vi==null?void 0:vi.quanlity}):Object(J.a)({},ki)})})})})})})}),hi=Ra(Wn),ai=hi.panel,qn=hi.score_num_item,Wn=(yt=Wn)===null||yt===void 0?void 0:yt.map(function(_n,Zn){var fi,oi=(ai==null||((fi=ai[Zn])===null||fi===void 0)?void 0:fi.reduce(function(Pi,Ai){return Pi+Ai},0))||0;return Object(J.a)(Object(J.a)({},_n),{},{scoreTotal:oi*(qn[Zn]||0),questionTotal:oi})}),pi=[],Se==null||((Zt=Se.sort_by_item_type)===null||Zt===void 0)||Zt.forEach(function(_n){var Zn=Wn.find(function(fi){var oi,Pi=(oi=Oa.find(function(Ai){return Ai.type===(fi==null?void 0:fi.item_type)}))===null||oi===void 0?void 0:oi.name;return Pi===_n});pi.push(Zn)}),pi=Object(De.compact)(pi),Fa(Se==null||((an=Se.examination_bank)===null||an===void 0)?void 0:an.source),ma(),Ht(Se==null||((Pn=Se.examination_bank)===null||Pn===void 0)?void 0:Pn.source),cn(Mn),Dn.current=Mn,Fi(xn),Ji((Se==null?void 0:Se.teach_group_ids)||[]),hn(Se==null||((kn=Se.groups)===null||kn===void 0)?void 0:kn.map(function(_n){return _n.count}).reduce(function(_n,Zn){return _n+Zn},0)),di.current=xn,gn(xn!=null&&xn.length?xn:[0]),d(Object(De.cloneDeep)(pi)),Ft(!1);case 29:case"end":return en.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),qo=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie;return L.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:Ie={source:tt,group_ids:Tn,tag_discipline_ids:At,teach_group_ids:bn},ca(Ie),Dn.current=At,nn(!1);case 4:case"end":return vt.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),Fa=function(){var mt=Object(V.a)(L.a.mark(function rt(Ie){var Oe,vt,ft,yt,Zt,an;return L.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(ct.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:Ie}});case 2:ft=kn.sent,yt=[],ft==null||((Oe=ft.disciplines)===null||Oe===void 0)||Oe.forEach(function(Mn){var xn;Mn==null||((xn=Mn.sub_disciplines)===null||xn===void 0)||xn.forEach(function(ni){yt=yt.concat((ni==null?void 0:ni.tag_disciplines)||[])})}),Zt=null,an=ft==null||((vt=ft.disciplines)===null||vt===void 0)?void 0:vt.map(function(Mn){var xn,ni=Mn==null||((xn=Mn.sub_disciplines)===null||xn===void 0)?void 0:xn.reduce(function(Fn,Wn){return Fn+Wn.item_count},0);return!Zt&&ni!==0&&(Zt=Mn.id),Object(J.a)(Object(J.a)({},Mn),{},{item_count:ni})}),console.log(an,48767874),Nt(an),Pt(yt),An(Zt);case 11:case"end":return kn.stop()}},rt)}));return function(Ie){return mt.apply(this,arguments)}}(),ma=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie;return L.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,Object(ct.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:Ie=vt.sent,la((Ie==null?void 0:Ie.groups)||[]);case 4:case"end":return vt.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),ca=function(){var mt=Object(V.a)(L.a.mark(function rt(Ie){var Oe,vt;return L.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return Ft(!0),yt.next=3,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:Ie});case 3:Oe=yt.sent,vt=Oe==null?void 0:Oe.filter(function(Zt){var an;return!!(Zt!=null&&(an=Zt.item_banks)!==null&&an!==void 0&&an.length)}),vt=vt.map(function(Zt){return Object(J.a)(Object(J.a)({},Zt),{},{scoreTotal:0,score:0,questionTotal:0})}),d(vt),Ft(!1);case 8:case"end":return yt.stop()}},rt)}));return function(Ie){return mt.apply(this,arguments)}}(),To=function(){cn(Dn.current),nn(!1),un("")},er=function(rt){cn(rt)},io=function(){for(var rt=Ve==null?void 0:Ve.filter(function(Pn){return At==null?void 0:At.includes(Pn.id)}),Ie=Object(Te.a)(rt),Oe=0,vt=[],ft=0;ft1&&rt!==0&&(Ie=va(Oe,rt,rt-1)),d(Ie)},Wa=function(rt){var Ie=[],Oe=Object(De.cloneDeep)(h);Oe.length>1&&rt!==Oe.length-1&&(Ie=va(Oe,rt,rt+1)),d(Ie)},Ta=function(){var mt=Object(V.a)(L.a.mark(function rt(Ie){var Oe,vt,ft,yt;return L.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(ft=Object(Te.a)(tt),tt.includes(Ie)?ft=ft.filter(function(Pn){return Pn!==Ie}):ft.push(Ie),!(ft.length===0)){an.next=5;break}return ae.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),an.abrupt("return");case 5:(Oe=ft)!==null&&Oe!==void 0&&Oe.includes("mine")||(Fi([]),di.current=[]),(vt=ft)!==null&&vt!==void 0&&vt.includes("teach_groups")||(Ji([]),ua.current=[]),Ht(ft),Fa(ft),cn([]),Dn.current=[],yt={source:ft,group_ids:di.current,tag_discipline_ids:[],teach_group_ids:ua.current},ca(yt);case 13:case"end":return an.stop()}},rt)}));return function(Ie){return mt.apply(this,arguments)}}(),Mo=function(rt){var Ie={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!rt)return;var Oe=rt||{},vt=Oe.exam,ft=Oe.single_questions,yt=Oe.multiple_questions,Zt=Oe.judgement_questions,an=Oe.program_questions,Pn=Oe.completion_questions,kn=Oe.subjective_questions,Mn=Oe.practical_questions,xn=Oe.combination_questions,ni=[Object(J.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},ft),Object(J.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},yt),Object(J.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Pn),Object(J.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Zt),Object(J.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},kn),Object(J.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},an),Object(J.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Mn),Object(J.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},xn)],Fn=[],Wn=0,hi=0,ai=ni.filter(function(qn){return qn.questions_count>0}).map(function(qn,pi){var Ti;return(Ti=qn.questions)===null||Ti===void 0||Ti.forEach(function(en){Fn.push(en.id),Wn=Wn+en.score,hi=hi+1}),Object(J.a)(Object(J.a)({},qn),{number:Ie[pi+1]})});return{all_questions_count:hi,all_score:Wn,questionList:ai,ids:Fn,exam:vt}},Yi=function(rt){var Ie,Oe,vt=Object(De.cloneDeep)(c),ft=Object(De.cloneDeep)(h);vt.questionList=vt==null||((Ie=vt.questionList)===null||Ie===void 0)?void 0:Ie.map(function(yt){return yt.type===rt.type?Object(J.a)(Object(J.a)({},yt),{},{questions_score:rt.scoreTotal}):yt}),ft=(Oe=ft)===null||Oe===void 0?void 0:Oe.map(function(yt){return yt.item_type===rt.type?Object(J.a)(Object(J.a)({},yt),{},{score:rt.score,scoreTotal:rt.scoreTotal}):yt}),d(ft),o(vt),console.log(rt,c,h)},qi=st==null||((ne=st.find(function(mt){return mt.id===yn}))===null||ne===void 0)?void 0:ne.sub_disciplines,Pa=io();return mn?_.a.createElement(Fe.a,{loading:qe,submit:Ao,goBack:function(){return En(!1)},data:c,onTypeScore:Yi,onExchange:ao}):_.a.createElement("section",{className:v.a.wrap,style:{display:Ke?"flex":"none"}},_.a.createElement("div",{id:"id_left",className:v.a.left,onMouseEnter:function(rt){var Ie=document.getElementById("id_left");Ie.style.overflowY="auto"},onMouseLeave:function(rt){var Ie=document.getElementById("id_left");Ie.style.overflowY="hidden"}},_.a.createElement(Ae.a,{loading:Jt,active:!0,paragraph:{rows:5}},h.map(function(mt,rt){var Ie;return _.a.createElement("div",{className:v.a.list,key:rt},_.a.createElement("div",{className:v.a.name},_.a.createElement("b",null),_.a.createElement("span",null,(Ie=Oa.find(function(Oe){return Oe.type===(mt==null?void 0:mt.item_type)}))===null||Ie===void 0?void 0:Ie.name)),_.a.createElement("aside",null,_.a.createElement("div",null,"\u5171",_.a.createElement("span",{className:v.a.b},mt.questionTotal),"\u9898",_.a.createElement("span",{className:v.a.l},"|"),"\u5171",_.a.createElement("span",{className:v.a.r},mt.scoreTotal),"\u5206"),_.a.createElement("div",null,rt>0?_.a.createElement(Z.a,{getPopupContainer:function(vt){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},_.a.createElement("span",{onClick:function(){return Qi(rt)},className:"mb20",style:{transform:"rotate(270deg)"}}," ",_.a.createElement("i",{className:"icon-jiantou1"}))):_.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}}," ",_.a.createElement("i",{className:"icon-jiantou1"})),rt"),_.a.createElement("span",{className:"current",onClick:function(){return _e.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),_.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),jt===0&&_.a.createElement(B,{value:jt,onChange:un}),jt===0&&_.a.createElement("section",{className:M.a.oneWrap},_.a.createElement("div",{className:M.a.title},_.a.createElement("b",null),_.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),_.a.createElement("div",null,"STEP1")," "),_.a.createElement(F.a,{className:M.a.formWrap,form:Ht,layout:"horizontal",onValuesChange:tn},_.a.createElement(F.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"}]},_.a.createElement(D.a,{className:M.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),_.a.createElement("div",{style:{position:"relative"}},_.a.createElement(F.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},_.a.createElement(I.a,{min:1,parser:zt,max:9999,placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F",style:{width:190}})),_.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),_.a.createElement(F.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},_.a.createElement(Ce.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},_.a.createElement(Ce.a.Button,{className:M.a.rb,value:1},"\u7B80\u5355"),_.a.createElement(Ce.a.Button,{className:M.a.rb,value:2},"\u9002\u4E2D"),_.a.createElement(Ce.a.Button,{className:M.a.rb,value:3},"\u56F0\u96BE"))),_.a.createElement(F.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},_.a.createElement(C,{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}))),_.a.createElement("div",{className:M.a.btns},_.a.createElement(Me.a,{className:"mr40",onClick:function(){return _e.d.push("/paperlibrary")}},"\u8FD4\u56DE"),_.a.createElement(Me.a,{type:"primary",onClick:Object(V.a)(L.a.mark(function dn(){return L.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Ht.validateFields();case 2:ot(1);case 3:case"end":return nn.stop()}},dn)}))},"\u4E0B\u4E00\u6B65"))),_.a.createElement(K,{tabs:jt,dispatch:Ke,editData:on,setFatherTabs:ot,formValue:Jt})))},O=Ge.default=Object(_e.a)(function(R){var re=R.paperlibrary,ne=R.user,pe=R.globalSetting;return{paperlibrary:re,user:ne,globalSetting:pe}})(w)},"E/GV":function(at,Ge,p){at.exports=p.p+"static/swenjianjia.1640bf70.svg"},ELLl:function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){var Ae={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},me=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(D,$,L){L&&L!=ie.Init&&(D.removeKeyMap(xe),D.state.closeBrackets=null),$&&(Ce(Me($,"pairs")),D.state.closeBrackets=$,D.addKeyMap(xe))});function Me(D,$){return $=="pairs"&&typeof D=="string"?D:typeof D=="object"&&D[$]!=null?D[$]:Ae[$]}var xe={Backspace:V,Enter:J};function Ce(D){for(var $=0;$=0;_--){var _e=te[_].head;D.replaceRange("",me(_e.line,_e.ch-1),me(_e.line,_e.ch+1),"+delete")}}function J(D){var $=I(D),L=$&&Me($,"explode");if(!L||D.getOption("disableInput"))return ie.Pass;for(var te=D.listSelections(),_=0;_0;return{anchor:new me(D.anchor.line,D.anchor.ch+($?-1:1)),head:new me(D.head.line,D.head.ch+($?1:-1))}}function F(D,$){var L=I(D);if(!L||D.getOption("disableInput"))return ie.Pass;var te=Me(L,"pairs"),_=te.indexOf($);if(_==-1)return ie.Pass;for(var de=Me(L,"closeBefore"),_e=Me(L,"triples"),ce=te.charAt(_+1)==$,M=D.listSelections(),g=_%2==0,ee,S=0;S=0&&D.getRange(x,me(x.line,x.ch+3))==$+$+$?b="skipThree":b="skip";else if(ce&&x.ch>1&&_e.indexOf($)>=0&&D.getRange(me(x.line,x.ch-2),x)==$+$){if(x.ch>2&&/\bstring/.test(D.getTokenTypeAt(me(x.line,x.ch-2))))return ie.Pass;b="addFour"}else if(ce){var A=x.ch==0?" ":D.getRange(me(x.line,x.ch-1),x);if(!ie.isWordChar(z)&&A!=$&&!ie.isWordChar(A))b="both";else return ie.Pass}else if(g&&(z.length===0||/\s/.test(z)||de.indexOf(z)>-1))b="both";else return ie.Pass;if(!ee)ee=b;else if(ee!=b)return ie.Pass}var k=_%2?te.charAt(_-1):$,Z=_%2?$:te.charAt(_+1);D.operation(function(){if(ee=="skip")D.execCommand("goCharRight");else if(ee=="skipThree")for(var be=0;be<3;be++)D.execCommand("goCharRight");else if(ee=="surround"){for(var ae=D.getSelections(),be=0;be1&&arguments[1]!==void 0?arguments[1]:1,K=De.length,C=0;C1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(v).map(function(He,je){if(!xe.isValidElement(He)||!He.type)return null;var Je=He.type.isSelectOptGroup,we=He.key,Ee=He.props,G=Ee.children,U=Object(Y.a)(Ee,["children"]);return le||!Je?ee(He):Object(M.a)(Object(M.a)({key:"__RC_SELECT_GRP__".concat(we===null?je:we,"__"),label:we},U),{},{options:S(G)})}).filter(function(He){return He})}var B=p("2Qr1"),x=p("qNPg"),b=p("U8pU"),z=p("Kwbf"),A=p("WKfj");function k(v){var le=v.mode,He=v.options,je=v.children,Je=v.backfill,we=v.allowClear,Ee=v.placeholder,G=v.getInputElement,U=v.showSearch,ue=v.onSearch,T=v.defaultOpen,E=v.autoFocus,he=v.labelInValue,Le=v.value,Ze=v.inputValue,ke=v.optionLabelProp,Ue=le==="multiple"||le==="tags",ge=U!==void 0?U:Ue||le==="combobox",Re=He||S(je);if(Object(z.a)(le!=="tags"||Re.every(function(Xe){return!Xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),le==="tags"||le==="combobox"){var Be=Re.some(function(Xe){return Xe.options?Xe.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in Xe?Xe.value:Xe.key)=="number"});Object(z.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(z.a)(le!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(z.a)(le==="combobox"||!Je,"`backfill` only works with `combobox` mode."),Object(z.a)(le==="combobox"||!G,"`getInputElement` only work with `combobox` mode."),Object(z.b)(le!=="combobox"||!G||!we||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!ge&&le!=="combobox"&&le!=="tags"&&Object(z.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(z.b)(!T||E,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Le!=null){var Qe=Object(A.d)(Le);Object(z.a)(!he||Qe.every(function(Xe){return Object(b.a)(Xe)==="object"&&("key"in Xe||"value"in Xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(z.a)(!Ue||Array.isArray(Le),"`value` should be array when `mode` is `multiple` or `tags`")}if(je){var it=null;Object(g.a)(je).some(function(Xe){if(!xe.isValidElement(Xe)||!Xe.type)return!1;var De=Xe.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var Et=Object(g.a)(Xe.props.children).every(function(pt){return!xe.isValidElement(pt)||!Xe.type||pt.type.isSelectOption?!0:(it=pt.type,!1)});return!Et}return it=De,!0}),it&&Object(z.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(it.displayName||it.name||it,"`.")),Object(z.a)(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var Z=k,be=Object(x.a)({prefixCls:"rc-select",components:{optionList:te},convertChildrenToData:S,flattenOptions:B.d,getLabeledValue:B.e,filterOptions:B.b,isValueDisabled:B.g,findValueOption:B.c,warningProps:Z,fillOptionsWithMissingValue:B.a}),ae=function(v){Object(me.a)(He,v);var le=Object(Me.a)(He);function He(){var je;return Object(ie.a)(this,He),je=le.apply(this,arguments),je.selectRef=xe.createRef(),je.focus=function(){je.selectRef.current.focus()},je.blur=function(){je.selectRef.current.blur()},je}return Object(Ae.a)(He,[{key:"render",value:function(){return xe.createElement(be,Object.assign({ref:this.selectRef},this.props))}}]),He}(xe.Component);ae.Option=de,ae.OptGroup=ce;var Te=ae,P=Ge.c=Te},M8RZ:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return V});var ie=p("fWQN"),Ae=p("mtLc"),me=p("yKVA"),Me=p("879j"),xe=p("q1tI"),Ce=p.n(xe),Y=p("i8i4"),I=p.n(Y),V=function(J){Object(me.a)(F,J);var j=Object(Me.a)(F);function F(se){var X;Object(ie.a)(this,F),X=j.call(this,se);var D=window.document;return X.node=D.createElement("div"),D.body.appendChild(X.node),X}return Object(Ae.a)(F,[{key:"render",value:function(){var X=this.props.children;return Object(Y.createPortal)(X,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),F}(Ce.a.Component)},NvD2:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return Ce});var ie=p("Kwbf");function Ae(Y,I){var V=new Set;return Y.forEach(function(J){I.has(J)||V.add(J)}),V}function me(Y){var I=Y||{},V=I.disabled,J=I.disableCheckbox,j=I.checkable;return!!(V||J)||j===!1}function Me(Y,I,V,J){for(var j=new Set(Y),F=new Set,se=0;se<=V;se+=1){var X=I.get(se)||new Set;X.forEach(function(te){var _=te.key,de=te.node,_e=te.children,ce=_e===void 0?[]:_e;j.has(_)&&!J(de)&&ce.filter(function(M){return!J(M.node)}).forEach(function(M){j.add(M.key)})})}for(var D=new Set,$=V;$>=0;$-=1){var L=I.get($)||new Set;L.forEach(function(te){var _=te.parent,de=te.node;if(J(de)||!te.parent||D.has(te.parent.key))return;if(J(te.parent.node)){D.add(_.key);return}var _e=!0,ce=!1;(_.children||[]).filter(function(M){return!J(M.node)}).forEach(function(M){var g=M.key,ee=j.has(g);_e&&!ee&&(_e=!1),!ce&&(ee||F.has(g))&&(ce=!0)}),_e&&j.add(_.key),ce&&F.add(_.key),D.add(_.key)})}return{checkedKeys:Array.from(j),halfCheckedKeys:Array.from(Ae(F,j))}}function xe(Y,I,V,J,j){for(var F=new Set(Y),se=new Set(I),X=0;X<=J;X+=1){var D=V.get(X)||new Set;D.forEach(function(_){var de=_.key,_e=_.node,ce=_.children,M=ce===void 0?[]:ce;!F.has(de)&&!se.has(de)&&!j(_e)&&M.filter(function(g){return!j(g.node)}).forEach(function(g){F.delete(g.key)})})}se=new Set;for(var $=new Set,L=J;L>=0;L-=1){var te=V.get(L)||new Set;te.forEach(function(_){var de=_.parent,_e=_.node;if(j(_e)||!_.parent||$.has(_.parent.key))return;if(j(_.parent.node)){$.add(de.key);return}var ce=!0,M=!1;(de.children||[]).filter(function(g){return!j(g.node)}).forEach(function(g){var ee=g.key,S=F.has(ee);ce&&!S&&(ce=!1),!M&&(S||se.has(ee))&&(M=!0)}),ce||F.delete(de.key),M&&se.add(de.key),$.add(de.key)})}return{checkedKeys:Array.from(F),halfCheckedKeys:Array.from(Ae(se,F))}}function Ce(Y,I,V,J){var j=[],F;J?F=J:F=me;var se=new Set(Y.filter(function(L){var te=!!V[L];return te||j.push(L),te})),X=new Map,D=0;Object.keys(V).forEach(function(L){var te=V[L],_=te.level,de=X.get(_);de||(de=new Set,X.set(_,de)),de.add(te),D=Math.max(D,_)}),Object(ie.a)(!j.length,"Tree missing follow keys: ".concat(j.slice(0,100).map(function(L){return"'".concat(L,"'")}).join(", ")));var $;return I===!0?$=Me(se,X,D,F):$=xe(se,I.halfCheckedKeys,X,D,F),$}},O2Wb:function(at,Ge,p){at.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(at,Ge,p){"use strict";var ie=p("U8pU"),Ae=p("VTBJ"),me=p("Ff2n"),Me=p("q1tI"),xe=p("uciX"),Ce=p("7ixt"),Y=function(se){var X=se.overlay,D=se.prefixCls,$=se.id,L=se.overlayInnerStyle;return Me.createElement("div",{className:"".concat(D,"-inner"),id:$,role:"tooltip",style:L},typeof X=="function"?X():X)},I=Y,V=function(se,X){var D=se.overlayClassName,$=se.trigger,L=$===void 0?["hover"]:$,te=se.mouseEnterDelay,_=te===void 0?0:te,de=se.mouseLeaveDelay,_e=de===void 0?.1:de,ce=se.overlayStyle,M=se.prefixCls,g=M===void 0?"rc-tooltip":M,ee=se.children,S=se.onVisibleChange,B=se.afterVisibleChange,x=se.transitionName,b=se.animation,z=se.placement,A=z===void 0?"right":z,k=se.align,Z=k===void 0?{}:k,be=se.destroyTooltipOnHide,ae=be===void 0?!1:be,Te=se.defaultVisible,P=se.getTooltipContainer,v=se.overlayInnerStyle,le=Object(me.a)(se,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),He=Object(Me.useRef)(null);Object(Me.useImperativeHandle)(X,function(){return He.current});var je=Object(Ae.a)({},le);"visible"in se&&(je.popupVisible=se.visible);var Je=function(){var ue=se.arrowContent,T=ue===void 0?null:ue,E=se.overlay,he=se.id;return[Me.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},T),Me.createElement(I,{key:"content",prefixCls:g,id:he,overlay:E,overlayInnerStyle:v})]},we=!1,Ee=!1;if(typeof ae=="boolean")we=ae;else if(ae&&Object(ie.a)(ae)==="object"){var G=ae.keepParent;we=G===!0,Ee=G===!1}return Me.createElement(xe.a,Object.assign({popupClassName:D,prefixCls:g,popup:Je,action:L,builtinPlacements:Ce.a,popupPlacement:A,ref:He,popupAlign:Z,getPopupContainer:P,onPopupVisibleChange:S,afterPopupVisibleChange:B,popupTransitionName:x,popupAnimation:b,defaultPopupVisible:Te,destroyPopupOnHide:we,autoDestroy:Ee,mouseLeaveDelay:_e,popupStyle:ce,mouseEnterDelay:_},je),ee)},J=Object(Me.forwardRef)(V),j=Ge.a=J},OZM5:function(at,Ge,p){"use strict";p.d(Ge,"b",function(){return J}),p.d(Ge,"a",function(){return j}),p.d(Ge,"k",function(){return F}),p.d(Ge,"h",function(){return se}),p.d(Ge,"i",function(){return X}),p.d(Ge,"g",function(){return D}),p.d(Ge,"c",function(){return $}),p.d(Ge,"d",function(){return L}),p.d(Ge,"j",function(){return de}),p.d(Ge,"e",function(){return _e}),p.d(Ge,"f",function(){return ce});var ie=p("KQm4"),Ae=p("U8pU"),me=p("Ff2n"),Me=p("q1tI"),xe=p.n(Me),Ce=p("Kwbf"),Y=p("WaYH"),I=.25,V=2;function J(M,g){var ee=M.slice(),S=ee.indexOf(g);return S>=0&&ee.splice(S,1),ee}function j(M,g){var ee=M.slice();return ee.indexOf(g)===-1&&ee.push(g),ee}function F(M){return M.split("-")}function se(M,g){return"".concat(M,"-").concat(g)}function X(M){return M&&M.type&&M.type.isTreeNode}function D(M,g){var ee=[M],S=g[M];function B(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(b){var z=b.key,A=b.children;ee.push(z),B(A)})}return B(S.children),ee}function $(M,g){var ee=M.clientY,S=g.selectHandle.getBoundingClientRect(),B=S.top,x=S.bottom,b=S.height,z=Math.max(b*I,V);return ee<=B+z?-1:ee>=x-z?1:0}function L(M,g){if(!M)return;var ee=g.multiple;return ee?M.slice():M.length?[M[0]]:M}var te=function(g){return g};function _(M,g){if(!M)return[];var ee=g||{},S=ee.processProps,B=S===void 0?te:S,x=Array.isArray(M)?M:[M];return x.map(function(b){var z=b.children,A=Object(me.a)(b,["children"]),k=_(z,g);return xe.a.createElement(Y.a,Object.assign({},B(A)),k)})}function de(M){if(!M)return null;var g;if(Array.isArray(M))g={checkedKeys:M,halfCheckedKeys:void 0};else if(Object(Ae.a)(M)==="object")g={checkedKeys:M.checked||void 0,halfCheckedKeys:M.halfChecked||void 0};else return Object(Ce.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function _e(M,g){var ee=new Set;function S(B){if(ee.has(B))return;var x=g[B];if(!x)return;ee.add(B);var b=x.parent,z=x.node;if(z.disabled)return;b&&S(b.key)}return(M||[]).forEach(function(B){S(B)}),Object(ie.a)(ee)}function ce(M){var g={};return Object.keys(M).forEach(function(ee){(ee.startsWith("data-")||ee.startsWith("aria-"))&&(g[ee]=M[ee])}),g}},Ot1p:function(at,Ge,p){"use strict";var ie=p("2qtc"),Ae=p("kLXV"),me=p("rAM+"),Me=p("miYZ"),xe=p("tsqr"),Ce=p("9og8"),Y=p("tJVT"),I=p("jrin"),V=p("WmNS"),J=p.n(V),j=p("q1tI"),F=p.n(j),se=p("VrN/"),X=p.n(se),D=p("bdgK"),$=p("p77/"),L=p("Bd2K"),te=p("ELLl"),_=p("19Vz"),de=p("lZu9"),_e=p("+NIl"),ce=p("kSUc"),M=p("9Bee"),g=function(ne){var pe=ne.value,nt=pe===void 0?"":pe,Ke=ne.className,Se=ne.showTextOnly,gt=ne.showLines,jt=ne.style,ot=jt===void 0?{}:jt,Xt=Object(j.useMemo)(function(){return""},[nt]);return F.a.createElement(F.a.Fragment,null,F.a.createElement("div",{dangerouslySetInnerHTML:{__html:Xt}}))},ee=p("0Owb"),S=p("dejd"),B=p("C+DQ"),x=p("1vsH"),b=p("m3rI"),z=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function A(ne){var pe=ne.onActionCallback,nt=ne.title,Ke=ne.icon,Se=ne.actionName,gt=ne.className,jt=gt===void 0?"":gt,ot=ne.children;function Xt(){pe(Se)}return F.a.createElement("a",{title:nt,className:jt,onClick:Xt},F.a.createElement("i",{className:"md-iconfont ".concat(Ke)}),ot)}var k=function(ne){var pe=ne.watch,nt=ne.showNullButton,Ke=ne.onActionCallback,Se=ne.fullScreen,gt=ne.insertTemp,jt=ne.hidetoolBar,ot=ne.uuid,Xt=ne.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.E)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(b.a.PROXY_SERVER)));var tt=[].concat(z,[{title:"".concat(pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(pe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return F.a.createElement("ul",{className:"markdown-toolbar-container"},!jt&&tt.map(function(Ht,It){return F.a.createElement("li",{key:It},Ht.actionName?F.a.createElement(A,Object(ee.a)({},Ht,{onActionCallback:Ke})):F.a.createElement("span",{className:"v-line"}))}),nt?F.a.createElement("li",null,F.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ke},F.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,gt&&F.a.createElement("li",null,F.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(gt),onActionCallback:Ke},F.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),F.a.createElement("li",{className:"btn-full-screen"},F.a.createElement(A,{icon:"".concat(Se?"icon-shrink":"icon-enlarge"),title:Se?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ke})))},Z=p("M8RZ"),be=p("+L6B"),ae=p("2/Rp"),Te=p("y8nQ"),P=p("Vl3Y"),v=p("5NDa"),le=p("5rEg"),He={labelCol:{span:4},wrapperCol:{span:20}},je=function(ne){var pe=ne.callback,nt=ne.onCancel;function Ke(Se){pe(Se)}return F.a.createElement(P.a,Object(ee.a)({},He,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ke}),F.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},F.a.createElement(le.a,null)),F.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},F.a.createElement(le.a,null)),F.a.createElement("div",{className:"flex-container flex-end"},F.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(ae.a,{type:"ghost",onClick:nt},"\u53D6\u6D88")))},Je=p("7ahc"),we=p("k1fw"),Ee=p("HmJG"),G=p("BjJ7"),U=P.a.useForm,ue={width:280,marginRight:10},T={labelCol:{span:5},wrapperCol:{span:19}},E=function(ne){var pe=ne.callback,nt=ne.onCancel,Ke=U(),Se=Object(Y.a)(Ke,1),gt=Se[0],jt=Object(j.useRef)();function ot(Ht){pe(Object(we.a)(Object(we.a)({},Ht),{},{name:jt.current}))}function Xt(Ht,It){gt.setFieldsValue({src:"/api/attachments/".concat(Ht.id,"?type=").concat(Ht.content_type),type:It.type})}function tt(Ht){var It=Ht.target.files[0];jt.current=It.name,Le(It,Xt)}return F.a.createElement(P.a,Object(ee.a)({form:gt},T,{className:"upload-image-panel",onFinish:ot}),F.a.createElement(P.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},F.a.createElement("div",{className:"flex-container"},F.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},F.a.createElement(le.a,{style:ue})),F.a.createElement(he,{onFileChange:tt}))),F.a.createElement(P.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},F.a.createElement(le.a,{style:{width:264}})),F.a.createElement(P.a.Item,{style:{textAlign:"right"}},F.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(ae.a,{type:"ghost",onClick:nt},"\u53D6\u6D88")))};function he(ne){var pe=ne.onFileChange;return F.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",F.a.createElement("input",{type:"file",onChange:pe}))}function Le(ne,pe){if(!ne)throw new String("\u6CA1\u6709\u6587\u4EF6");var nt=new FormData;nt.append("editormd-image-file",ne),nt.append("file_param_name","editormd-image-file"),nt.append("byxhr","true");var Ke=new window.XMLHttpRequest;Ke.withCredentials=!0,Ke.addEventListener("load",function(Se){pe(JSON.parse(Se.target.responseText),ne)},!1),Ke.addEventListener("error",function(Se){console.error(Se)},!1),Ke.open("POST","".concat(G.a,"/api/attachments.json")),Ke.send(nt)}var Ze=p("giR+"),ke=p("fyUT"),Ue=p("7Kak"),ge=p("9yH6"),Re=ge.a.Group,Be={margin:"0 8px"},Qe=function(ne){var pe=ne.callback,nt=ne.onCancel;function Ke(Se){pe(Se)}return F.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ke},F.a.createElement("div",{className:"flex-container"},F.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),F.a.createElement("span",{style:Be},"\u884C\u6570"),F.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},F.a.createElement(ke.a,null)),F.a.createElement("span",{style:Be},"\u5217\u6570"),F.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},F.a.createElement(ke.a,null))),F.a.createElement("div",{className:"flex-container",style:{marginTop:12}},F.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),F.a.createElement(P.a.Item,{name:"align"},F.a.createElement(Re,null,F.a.createElement(ge.a,{value:"default"},F.a.createElement("i",{className:"fa fa-align-justify"})),F.a.createElement(ge.a,{value:"left"},F.a.createElement("i",{className:"fa fa-align-left"})),F.a.createElement(ge.a,{value:"center"},F.a.createElement("i",{className:"fa fa-align-center"})),F.a.createElement(ge.a,{value:"right"},F.a.createElement("i",{className:"fa fa-align-right"}))))),F.a.createElement("div",{className:"flex-container flex-end"},F.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(ae.a,{type:"ghost",onClick:nt},"\u53D6\u6D88")))},it=p("ErOA"),Xe=p("7Cbv"),De="link",Et="upload-image",pt="code-block",bt="add-table",ct="------------",Mt={default:ct,left:":".concat(ct),center:":".concat(ct,":"),right:"".concat(ct,":")},Ot=p("9VGf"),Ct,Pe;function Ut(){}var kt=0,Ne=1e4,Fe="\u2581",N=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function H(ne){return/^\d+$/.test(ne)?"".concat(ne,"px"):ne}var K=navigator.platform.toUpperCase().indexOf("MAC")>=0,C=K?"Cmd":"Ctrl",w=["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"],O=(Ct={},Object(I.a)(Ct,C+"-B","bold"),Object(I.a)(Ct,C+"-I","italic"),Ct),R=(Pe={},Object(I.a)(Pe,De,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(Pe,pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(Pe,Et,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(Pe,bt,"\u6DFB\u52A0\u8868\u683C"),Pe),re=Ge.a=function(ne){var pe=ne.defaultValue,nt=pe===void 0?"":pe,Ke=ne.onChange,Se=ne.width,gt=Se===void 0?"100%":Se,jt=ne.height,ot=jt===void 0?400:jt,Xt=ne.miniToolbar,tt=Xt===void 0?!1:Xt,Ht=ne.isFocus,It=Ht===void 0?!1:Ht,Rt=ne.watch,Jt=ne.insertTemp,Ft=ne.mode,We=Ft===void 0?"markdown":Ft,lt=ne.id,qe=lt===void 0?"markdown-editor-id":lt,dt=ne.showResizeBar,Gt=dt===void 0?!1:dt,Kt=ne.noStorage,on=Kt===void 0?!1:Kt,Vt=ne.showNullButton,_t=Vt===void 0?!1:Vt,tn=ne.hidetoolBar,Lt=tn===void 0?!1:tn,un=ne.fullScreen,zt=un===void 0?!1:un,dn=ne.onBlur,In=ne.onCMBeforeChange,nn=ne.onFullScreen,$e=ne.className,ut=$e===void 0?"":$e,mn=ne.disablePaste,En=mn===void 0?!1:mn,On=ne.placeholder,Bn=On===void 0?"":On,c=ne.values,o=c===void 0?"":c,r=Object(j.useState)(null),u=Object(Y.a)(r,2),h=u[0],d=u[1],q=Object(j.useState)(nt),Ye=Object(Y.a)(q,2),st=Ye[0],Nt=Ye[1],ve=Object(j.useState)(Rt),oe=Object(Y.a)(ve,2),Ve=oe[0],Pt=oe[1],Tt=Object(j.useState)(zt),St=Object(Y.a)(Tt,2),At=St[0],cn=St[1],Nn=Object(j.useState)(""),wn=Object(Y.a)(Nn,2),yn=wn[0],An=wn[1],Dn=Object(j.useState)(0),ti=Object(Y.a)(Dn,2),wi=ti[0],Xn=ti[1],$n=Object(j.useState)(ot),$i=Object(Y.a)($n,2),Ei=$i[0],Tn=$i[1],Fi=Object(j.useState)(!1),ra=Object(Y.a)(Fi,2),pa=ra[0],zn=ra[1],gn=Object(j.useRef)(Object(Xe.a)()),li=Object(j.useRef)(!1),pn=Object(j.useRef)(),Hn=Object(j.useRef)(),Cn=Object(j.useRef)(),di=Object(j.useRef)(),Yn=Object(j.useRef)(),Ci=function(){var Wt=Object(Ce.a)(J.a.mark(function qt(){var $t,rn;return J.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(it.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:gn.current}});case 2:rn=Sn.sent,rn!=null&&($t=rn.attachments)!==null&&$t!==void 0&&$t.length&&(console.log("cm:",h,Hn),rn.attachments.map(function(fn){fn.content_type.indexOf("image")>-1?h.replaceSelection("![,](/api/attachments/".concat(fn.id,"?type=").concat(fn.content_type,")")):fn.content_type.indexOf("video")>-1?h.replaceSelection('')):fn.content_type.indexOf("pdf")>-1?h.replaceSelection('
    ').concat(fn.name,"")):h.replaceSelection("[".concat(fn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(fn.id,"?type=").concat(fn.content_type,")"))}));case 4:case"end":return Sn.stop()}},qt)}));return function(){return Wt.apply(this,arguments)}}();Object(j.useEffect)(function(){Nt(o),h==null||h.setValue(o)},[o]),Object(j.useEffect)(function(){nn==null||nn(At)},[At]),Object(j.useEffect)(function(){if(Hn.current){var Wt=X.a.fromTextArea(Hn.current,{mode:We,lineNumbers:!tt,lineWrapping:!0,value:nt,autoCloseTags:!0,autoCloseBrackets:!0});It&&Wt.focus();function qt($t,rn){if(En){rn.preventDefault();return}var vn=rn.clipboardData;if(vn){var Sn=vn.types.toString(),fn=vn.items;if(Sn==="Files"||vn.types.indexOf("Files")>-1){if(rn.preventDefault(),We=="stex")return;try{var Kn,Si=fn[1];((Kn=fn[0])===null||Kn===void 0?void 0:Kn.kind)==="file"&&(Si=fn[0]);var sn=Si.getAsFile(),aa=sn.name.split(".").pop();Le(sn,function(hn){if(hn.id){var Jn,Wi,zi;(sn==null||((Jn=sn.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?Wt.replaceSelection("![,](/api/attachments/".concat(hn.id,"?type=").concat(hn.content_type,")")):(sn==null||((Wi=sn.type)===null||Wi===void 0)?void 0:Wi.indexOf("video"))>-1?Wt.replaceSelection('')):(sn==null||((zi=sn.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Wt.replaceSelection('').concat(sn.name,"")):w.includes(aa)?Wt.replaceSelection('').concat(sn.name,"")):Wt.replaceSelection("[".concat(sn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,")"))}else(hn==null?void 0:hn.status)===401&&(document.location.href="/user/login")})}catch(hn){xe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Wt.on("paste",qt),Wt.on("dragleave",function($t,rn){Cn.current.classList.remove("mouse-hover-md")}),Wt.on("dragover",function($t,rn){Cn.current.classList.add("mouse-hover-md")}),Wt.on("drop",function($t,rn){Cn.current.classList.add("mouse-hover-md");var vn;if(vn=rn.dataTransfer.files,vn.length>0){rn.preventDefault(),rn.stopPropagation();for(var Sn=function(Si){var sn=vn[Si],aa=sn.name.split(".").pop();Le(sn,function(hn){if(hn.id){var Jn,Wi,zi;(sn==null||((Jn=sn.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?Wt.replaceSelection("![,](/api/attachments/".concat(hn.id,"?type=").concat(hn.content_type,")")):(sn==null||((Wi=sn.type)===null||Wi===void 0)?void 0:Wi.indexOf("video"))>-1?Wt.replaceSelection('')):(sn==null||((zi=sn.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Wt.replaceSelection('').concat(sn.name,"")):w.includes(aa)?Wt.replaceSelection('').concat(sn.name,"")):Wt.replaceSelection("[".concat(sn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,")"))}else(hn==null?void 0:hn.status)===401&&(document.location.href="/user/login")})},fn=0;fn0||fn.target.offsetWidth>0)&&(fa(),h.setSize("100%","100%"),h.refresh())}}catch(Kn){vn.e(Kn)}finally{vn.f()}});return $t.observe(Hn.current.parentElement),$t}if(h){var qt=Wt();return function(){qt.unobserve(Hn.current.parentElement)}}},[h,fa]),Object(j.useEffect)(function(){if(h){for(var Wt=[],qt=function(){var fn=rn[$t];vn=Object(Y.a)(fn,2);var Kn=vn[0],Si=vn[1],sn=Object(I.a)({},Kn,function(){na(Si)});Wt.push(sn),h.addKeyMap(sn)},$t=0,rn=Object.entries(O);$t0){var Wt=new Date().getTime(),qt=window.sessionStorage.getItem(qe);Wt>=wi+Ne&&(!qt||qt!==st)&&(window.sessionStorage.setItem(qe,st),zn(!0))}},Ne),Object(j.useEffect)(function(){Pt(Rt)},[h,Rt]),Object(j.useEffect)(function(){h&&(It&&h.focus())},[h,It]),Object(j.useEffect)(function(){if(Ve&&h){var Wt=h.getScrollerElement();function qt($t){var rn=$t.target;if(Yn.current){var vn=rn.scrollTop/rn.scrollHeight;Yn.current.scrollTop=Yn.current.scrollHeight*vn}}return Wt.addEventListener("scroll",qt),function(){Wt.removeEventListener("scroll",qt)}}},[h,Ve]),Object(j.useEffect)(function(){if(h&&In){function Wt(qt,$t){In(qt,$t)}return h.on("beforeChange",Wt),function(){h.off("beforeChange",Wt)}}},[h,In]),Object(j.useEffect)(function(){if(h&&dn){function Wt(){dn(h.getValue())}return h.on("blur",Wt),function(){h.off("blur",Wt)}}},[h,dn]),Object(j.useEffect)(function(){if(h){function Wt(qt){var $t=qt.getValue();Nt($t),Xn(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ke&&Ke($t)}return h.on("change",Wt),function(){h.off("change",Wt)}}},[h,Ke]),Object(j.useEffect)(function(){h&&(nt==null?(h.setValue(""),Nt("")):nt!==h.getValue()&&(h.setValue(nt),Nt(nt),h.setCursor(h.lineCount(),0)))},[h,nt]);var na=Object(j.useCallback)(function(Wt){var qt=h.getCursor(),$t=h.getSelection(),rn=$t.split(` `);switch(Wt){case"bold":return h.replaceSelection("**"+$t+"**"),$t===""&&h.setCursor(qt.line,qt.ch+2),h.focus();case"italic":return h.replaceSelection("*"+$t+"*"),$t===""&&h.setCursor(qt.line,qt.ch+1),h.focus();case"code":return h.replaceSelection("`"+$t+"`"),$t===""&&h.setCursor(qt.line,qt.ch+1),h.focus();case"inline-latex":return h.replaceSelection("`$$"+$t+"$$`"),$t===""&&h.setCursor(qt.line,qt.ch+3),h.focus();case"latex":return h.replaceSelection("```latex\n"+$t+"\n```"),h.setCursor(qt.line+1,$t.length+1),h.focus();case"line-break":return h.replaceSelection(`
    `),h.focus();case"list-ul":return $t===""?h.replaceSelection("- "+$t):h.replaceSelection(rn.map(function(vn){return vn===""?"":"- ".concat(vn)}).join(` `)),h.focus();case"list-ol":return $t===""?h.replaceSelection("1. "+$t):h.replaceSelection(rn.map(function(vn,Sn){return vn===""?"":"".concat(Sn+1,". ").concat(vn)}).join(` `)),h.focus();case"add-null-ch":return $t===""&&h.setCursor(qt.line,qt.ch+1),h.replaceSelection(Fe),h.focus();case"inster-template-1":return $t===""&&h.setCursor(qt.line,qt.ch),h.replaceSelection(N),h.focus();case"eraser":return h.setValue(""),h.focus();case"trigger-watch":return Pt(!Ve),h.focus();case"trigger-full-screen":return cn(!At),h.focus();case De:An(De);return;case pt:An(pt);return;case Et:An(Et);return;case bt:An(bt);return;default:throw new Error}},[h,Ve,At]),ia=Object(j.useCallback)(function(Wt){An("");switch(yn){case De:var qt=Wt.title,$t=Wt.link;return h.replaceSelection("[".concat(qt,"](").concat($t,")")),h.focus();case pt:var rn=Wt.language,vn=Wt.content;return h.replaceSelection(["```"+rn,vn,"```"].join(` `)),h.focus();case Et:var Sn=Wt.src,fn=Wt.alt,Kn=Wt.name;return Sn.indexOf("type=image")>-1?h.replaceSelection("![ ".concat(fn||""," ]( ").concat(Sn,' "').concat(fn||"",'" )')):Sn.indexOf("type=application/pdf")>-1?h.replaceSelection('').concat(Kn,"")):h.replaceSelection('').concat(Kn,"")),h.focus();case bt:for(var Si=Wt.row,sn=Wt.col,aa=Wt.align,hn=` `,Jn=0;Jn300&&(Kn=300);var Si=ot+Kn+"px";Tn(Si)}}return Wt.addEventListener("mousedown",rn),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",vn),function(){Wt.removeEventListener("mousedown",rn),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",vn)}}},[h,di]),Object(j.useEffect)(function(){Tn(ot)},[ot]);var Ji=H(gt),Vi=H(Ei),sa={width:Ji,height:Vi},Zi=Object(j.useMemo)(function(){if(wi){var Wt=new Date(wi),qt=Wt.getHours(),$t=Wt.getMinutes(),rn=Wt.getSeconds();return qt=qt<10?"0"+qt:qt,$t=$t<10?"0"+$t:$t,rn=rn<10?"0"+rn:rn,"".concat(qt,":").concat($t,":").concat(rn)}return 0},[wi]);function la(){window.sessionStorage.removeItem(qe),zn(!1),Xn(0)}function ua(){zn(!1),Xn(0),h.setValue(window.sessionStorage.getItem(qe))}function no(Wt,qt){var $t=h.getValue();$t=$t.replace(Wt,qt),Nt($t),h==null||h.setValue($t)}return F.a.createElement(j.Fragment,null,F.a.createElement("div",{className:"markdown-editor-wrapper",ref:Cn},F.a.createElement("div",{className:"markdown-editor-container ".concat(ut," ").concat(Ve?"on-preview":""," ").concat(tt?"mini":""," ").concat(At?"full-screen":""),style:sa},F.a.createElement(k,{insertTemp:Jt,watch:Ve,fullScreen:At,showNullButton:_t,onActionCallback:na,hidetoolBar:Lt,uuid:gn.current,setOpenPhones:function(){li.current=!0}}),F.a.createElement("div",{className:"markdown-editor-body"},F.a.createElement("div",{className:"codemirror-container"},F.a.createElement("textarea",{ref:Hn,placeholder:Bn})),Ve?F.a.createElement("div",{ref:Yn,className:"preview-container"},We==="stex"&&F.a.createElement(g,{value:st}),We!=="stex"&&F.a.createElement(M.a,{edit:!0,value:st,replaces:no})):null))),Gt?F.a.createElement("a",{ref:di,className:"editor-resize"}):null,F.a.createElement(Z.a,null,R[yn]?F.a.createElement(Ae.a,{centered:!0,title:R[yn],visible:!0,onCancel:bn,footer:null},Sa):null))}},PGNT:function(at,Ge,p){at.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(at,Ge,p){at.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(at,Ge,p){at.exports=p.p+"static/wenhao.50b63ac4.svg"},"RZ/O":function(at,Ge,p){at.exports=p.p+"static/bi.9c9b0364.svg"},SJMd:function(at,Ge){/** * @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 p,ie,Ae,me=!1,Me,xe;window.PR_SHOULD_USE_CONTINUATION=!0;var Ce,Y;(function(){var I=window,V=["break,continue,do,else,for,if,return,while"],J=[V,"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"],j=[J,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[j,"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"],se=[j,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],X=[j,"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"],D="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",$=[j,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],L="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=[V,"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"],_=[V,"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"],de=[V,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],_e=[F,X,se,$,L,te,_,de],ce=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,M="str",g="kwd",ee="com",S="typ",B="lit",x="pun",b="pln",z="tag",A="dec",k="src",Z="atn",be="atv",ae="nocode",Te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(ge){for(var Re=0,Be=!1,Qe=!1,it=0,Xe=ge.length;it122||(C<65||K>90||Ut.push([Math.max(65,K)|32,Math.min(C,90)|32]),C<97||K>122||Ut.push([Math.max(97,K)&~32,Math.min(C,122)&~32]))}}Ut.sort(function(re,ne){return re[0]-ne[0]||ne[1]-re[1]});for(var w=[],O=[],Fe=0;FeR[0]&&(R[1]+1>R[0]&&Ne.push("-"),Ne.push(bt(R[1])))}return Ne.push("]"),Ne.join("")}function Mt(Ct){for(var Pe=Ct.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")),Ut=Pe.length,kt=[],Ne=0,Fe=0;Ne=2&&K==="["?Pe[Ne]=ct(N):K!=="\\"&&(Pe[Ne]=N.replace(/[a-zA-Z]/g,function(O){var R=O.charCodeAt(0);return"["+String.fromCharCode(R&~32,R|32)+"]"}))}return Pe.join("")}for(var Ot=[],it=0,Xe=ge.length;it=0;)Be[Ot.charAt(Ct)]=Mt;var Pe=Mt[1],Ut=""+Pe;pt.hasOwnProperty(Ut)||(Et.push(Pe),pt[Ut]=null)}Et.push(/[\0-\uffff]/),Qe=P(Et)})();var it=Re.length,Xe=function(De){for(var Et=De.sourceCode,pt=De.basePos,bt=De.sourceNode,ct=[pt,b],Mt=0,Ot=Et.match(Qe)||[],Ct={},Pe=0,Ut=Ot.length;Pe=5&&Ne.substring(0,5)==="lang-",N&&!(Fe&&typeof Fe[1]=="string")&&(N=!1,Ne=k),N||(Ct[kt]=Ne)}var C=Mt;if(Mt+=kt.length,!N)ct.push(pt+C,Ne);else{var w=Fe[1],O=kt.indexOf(w),R=O+w.length;Fe[2]&&(R=kt.length-Fe[2].length,O=R-w.length);var re=Ne.substring(5);le(bt,pt+C,kt.substring(0,O),Xe,ct),le(bt,pt+C+O,w,E(re,w),ct),le(bt,pt+C+R,kt.substring(R),Xe,ct)}}De.decorations=ct};return Xe}function we(ge){var Re=[],Be=[];ge.tripleQuotedStrings?Re.push([M,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ge.multiLineStrings?Re.push([M,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([M,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ge.verbatimStrings&&Be.push([M,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Qe=ge.hashComments;Qe&&(ge.cStyleComments?(Qe>1?Re.push([ee,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([ee,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([M,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([ee,/^#[^\r\n]*/,null,"#"])),ge.cStyleComments&&(Be.push([ee,/^\/\/[^\r\n]*/,null]),Be.push([ee,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var it=ge.regexLiterals;if(it){var Xe=it>1?"":` \r`,De=Xe?".":"[\\S\\s]",Et="/(?=[^/*"+Xe+"])(?:[^/\\x5B\\x5C"+Xe+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+Xe+"]|\\x5C"+De+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+Te+"("+Et+")")])}var pt=ge.types;pt&&Be.push([S,pt]);var bt=(""+ge.keywords).replace(/^ | $/g,"");bt.length&&Be.push([g,new RegExp("^(?:"+bt.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([b,/^\s+/,null,` \r \xA0`]);var ct="^.[^\\s\\w.$@'\"`/\\\\]*";return ge.regexLiterals&&(ct+="(?!s*/)"),Be.push([B,/^@[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],[B,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(ct),null]),Je(Re,Be)}var Ee=we({keywords:_e,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function G(ge,Re,Be){for(var Qe=/(?:^|\s)nocode(?:\s|$)/,it=/\r\n?|\n/,Xe=ge.ownerDocument,De=Xe.createElement("li");ge.firstChild;)De.appendChild(ge.firstChild);var Et=[De];function pt(Pe){var Ut=Pe.nodeType;if(Ut==1&&!Qe.test(Pe.className))if(Pe.nodeName==="br")bt(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var kt=Pe.firstChild;kt;kt=kt.nextSibling)pt(kt);else if((Ut==3||Ut==4)&&Be){var Ne=Pe.nodeValue,Fe=Ne.match(it);if(Fe){var N=Ne.substring(0,Fe.index);Pe.nodeValue=N;var H=Ne.substring(Fe.index+Fe[0].length);if(H){var K=Pe.parentNode;K.insertBefore(Xe.createTextNode(H),Pe.nextSibling)}bt(Pe),N||Pe.parentNode.removeChild(Pe)}}}function bt(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function Ut(Fe,N){var H=N?Fe.cloneNode(!1):Fe,K=Fe.parentNode;if(K){var C=Ut(K,1),w=Fe.nextSibling;C.appendChild(H);for(var O=w;O;O=w)w=O.nextSibling,C.appendChild(O)}return H}for(var kt=Ut(Pe.nextSibling,0),Ne;(Ne=kt.parentNode)&&Ne.nodeType===1;)kt=Ne;Et.push(kt)}for(var ct=0;ct=K&&(pt+=2),Xe>=C&&(Mt+=2)}}finally{Ne&&(Ne.style.display=Fe)}}var ue={};function T(ge,Re){for(var Be=Re.length;--Be>=0;){var Qe=Re[Be];ue.hasOwnProperty(Qe)?I.console&&console.warn("cannot override language handler %s",Qe):ue[Qe]=ge}}function E(ge,Re){return ge&&ue.hasOwnProperty(ge)||(ge=/^\s*]*(?:>|$)/],[ee,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),T(Je([[b,/^[\s]+/,null,` \r `],[be,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[z,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Z,/^(?!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"]),T(Je([],[[be,/^[\s\S]+/]]),["uq.val"]),T(we({keywords:F,hashComments:!0,cStyleComments:!0,types:ce}),["c","cc","cpp","cxx","cyc","m"]),T(we({keywords:"null,true,false"}),["json"]),T(we({keywords:X,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ce}),["cs"]),T(we({keywords:se,cStyleComments:!0}),["java"]),T(we({keywords:de,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),T(we({keywords:te,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),T(we({keywords:L,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),T(we({keywords:_,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),T(we({keywords:$,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),T(we({keywords:D,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),T(Je([],[[M,/^[\s\S]+/]]),["regex"]);function he(ge){var Re=ge.langExtension;try{var Be=v(ge.sourceNode,ge.pre),Qe=Be.sourceCode;ge.sourceCode=Qe,ge.spans=Be.spans,ge.basePos=0,E(Re,Qe)(ge),U(ge)}catch(it){I.console&&console.log(it&&it.stack||it)}}function Le(ge,Re,Be){var Qe=Be||!1,it=Re||null,Xe=document.createElement("div");Xe.innerHTML="
    "+ge+"
    ",Xe=Xe.firstChild,Qe&&G(Xe,Qe,!0);var De={langExtension:it,numberLines:Qe,sourceNode:Xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return he(De),Xe.innerHTML}function Ze(ge,Re){var Be=Re||document.body,Qe=Be.ownerDocument||document;function it(H){return Be.getElementsByTagName(H)}for(var Xe=[it("pre"),it("code"),it("xmp")],De=[],Et=0;Et=15&&(F=!1,V=!0);var M=_&&(J||F&&(ce==null||ce<12.11)),g=me||Y&&I>=9;function ee(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var i=e.className,n=ee(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 B(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return B(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)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var He=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};He.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},He.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return n+Math.min(l,t-a);if(a+=s-n,a+=i-a%i,n=s+1,a>=t)return n}}var T=[""];function E(e){for(;T.length<=e;)T.push(he(T)+" ");return T[e]}function he(e){return e[e.length-1]}function Le(e,t){for(var i=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ge.test(e))}function Be(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function Qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var it=/[\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 Xe(e){return e.charCodeAt(0)>=768&&it.test(e)}function De(e,t,i){for(;(i<0?t>0:ti?-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 pt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var a=!1,s=0;st||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),a=!0)}a||n(t,i,"ltr")}var bt=null;function ct(e,t,i){var n;bt=null;for(var a=0;at)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 Mt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(y){return y<=247?e.charAt(y):1424<=y&&y<=1524?"R":1536<=y&&y<=1785?t.charAt(y-1536):1774<=y&&y<=2220?"r":8192<=y&&y<=8203?"w":y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(y,W,Q){this.level=y,this.from=W,this.to=Q}return function(y,W){var Q=W=="ltr"?"L":"R";if(y.length==0||W=="ltr"&&!n.test(y))return!1;for(var ye=y.length,fe=[],ze=0;ze-1&&(n[t]=a.slice(0,s).concat(a.slice(s+1)))}}}function Ne(e,t){var i=Ut(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),a=0;a0}function K(e){e.prototype.on=function(t,i){Pe(this,t,i)},e.prototype.off=function(t,i){kt(this,t,i)}}function C(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function w(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function R(e){C(e),w(e)}function re(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.ctrlKey&&t==1&&(t=3),t}var pe=function(){if(Y&&I<9)return!1;var e=b("div");return"draggable"in e||"dragDrop"in e}(),nt;function Ke(e){if(nt==null){var t=b("span","\u200B");x(e,b("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(nt=t.offsetWidth<=1&&t.offsetHeight>2&&!(Y&&I<8))}var i=nt?b("span","\u200B"):b("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Se;function gt(e){if(Se!=null)return Se;var t=x(e,document.createTextNode("A\u062EA")),i=A(t,0,1).getBoundingClientRect(),n=A(t,1,2).getBoundingClientRect();return B(e),!i||i.left==i.right?!1:Se=n.right-i.right<3}var jt=` 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),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=a+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ot=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},Xt=function(){var e=b("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),tt=null;function Ht(e){if(tt!=null)return tt;var t=x(e,b("span","x")),i=t.getBoundingClientRect(),n=A(t,0,1).getBoundingClientRect();return tt=Math.abs(i.left-n.left)>1}var It={},Rt={};function Jt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),It[e]=t}function Ft(e,t){Rt[e]=t}function We(e){if(typeof e=="string"&&Rt.hasOwnProperty(e))e=Rt[e];else if(e&&typeof e.name=="string"&&Rt.hasOwnProperty(e.name)){var t=Rt[e.name];typeof t=="string"&&(t={name:t}),e=Ue(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function lt(e,t){t=We(t);var i=It[t.name];if(!i)return lt(e,"text/plain");var n=i(e,t);if(qe.hasOwnProperty(t.name)){var a=qe[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 l in t.modeProps)n[l]=t.modeProps[l];return n}var qe={};function dt(e,t){var i=qe.hasOwnProperty(e)?qe[e]:qe[e]={};v(t,i)}function Gt(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 Kt(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 on(e,t,i){return e.startState?e.startState(t,i):!0}var Vt=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};Vt.prototype.eol=function(){return this.pos>=this.string.length},Vt.prototype.sol=function(){return this.pos==this.lineStart},Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vt.prototype.next=function(){if(this.post},Vt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Vt.prototype.skipToEnd=function(){this.pos=this.string.length},Vt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Vt.prototype.backUp=function(e){this.pos-=e},Vt.prototype.column=function(){return this.lastColumnPos0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Vt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Vt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function _t(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=e.first&&ti?$e(i,_t(e,i).text.length):r(t,_t(e,t.line).text.length)}function r(e,t){var i=e.ch;return i==null||i>t?$e(e.line,t):i<0?$e(e.line,0):e}function u(e,t){for(var i=[],n=0;nthis.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 h?new d(e,Gt(e.mode,t.state),i,t.lookAhead):new d(e,Gt(e.mode,t),i)},d.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new h(t,this.maxLookAhead):t};function q(e,t,i,n){var a=[e.state.modeGen],s={};St(e,t.text,e.doc.mode,i,function(y,W){return a.push(y,W)},s,n);for(var l=i.state,f=function(y){i.baseTokens=a;var W=e.state.overlays[y],Q=1,ye=0;i.state=!0,St(e,t.text,W.mode,i,function(fe,ze){for(var et=Q;yefe&&a.splice(Q,1,fe,a[Q+1],ht),Q+=2,ye=Math.min(fe,ht)}if(!ze)return;if(W.opaque)a.splice(et,Q-et,fe,"overlay "+ze),Q=et+2;else for(;ete.options.maxHighlightLength&&Gt(e.doc.mode,n.state),s=q(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 st(e,t,i){var n=e.doc,a=e.display;if(!n.mode.startState)return new d(n,!0,t);var s=At(e,t,i),l=s>n.first&&_t(n,s-1).stateAfter,f=l?d.fromSaved(n,l,s):new d(n,on(n.mode),s);return n.iter(s,t,function(m){Nt(e,m.text,f);var y=f.line;m.stateAfter=y==t-1||y%5==0||y>=a.viewFrom&&yt.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ve=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Pt(e,t,i,n){var a=e.doc,s=a.mode,l;t=o(a,t);var f=_t(a,t.line),m=st(e,t.line,i),y=new Vt(f.text,e.options.tabSize,m),W;for(n&&(W=[]);(n||y.pose.options.maxHighlightLength?(f=!1,l&&Nt(e,t,n,W.pos),W.pos=t.length,Q=null):Q=Tt(oe(i,W,n.state,ye),s),ye){var fe=ye[0].name;fe&&(Q="m-"+(Q?fe+" "+Q:fe))}if(!f||y!=Q){for(;ml;--f){if(f<=s.first)return s.first;var m=_t(s,f-1),y=m.stateAfter;if(y&&(!i||f+(y instanceof h?y.lookAhead:0)<=s.modeFrontier))return f;var W=le(m.text,null,e.options.tabSize);(a==null||n>W)&&(a=f-1,n=W)}return a}function cn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;n--){var a=_t(e,n).stateAfter;if(a&&(!(a instanceof h)||n+a.lookAhead=t:s.to>t);(n||(n=[])).push(new Dn(l,s.from,m?null:s.to))}}return n}function $i(e,t,i){var n;if(e)for(var a=0;a=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from0&&f)for(var Bt=0;Bt0)continue;var W=[m,1],Q=ut(y.from,f.from),ye=ut(y.to,f.to);(Q<0||!l.inclusiveLeft&&!Q)&&W.push({from:y.from,to:f.from}),(ye>0||!l.inclusiveRight&&!ye)&&W.push({from:f.to,to:y.to}),a.splice.apply(a,W),m+=W.length-3}return a}function ra(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!n||li(n,s.marker)<0)&&(n=s.marker)}return n}function Yn(e,t,i,n,a){var s=_t(e,t),l=wn&&s.markedSpans;if(l)for(var f=0;f=0&&Q<=0||W<=0&&Q>=0)continue;if(W<=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?ut(y.to,i)>=0:ut(y.to,i)>0)||W>=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?ut(y.from,n)<=0:ut(y.from,n)<0))return!0}}function Ci(e){for(var t;t=Hn(e);)e=t.find(-1,!0).line;return e}function fa(e){for(var t;t=Cn(e);)e=t.find(1,!0).line;return e}function na(e){for(var t,i;t=Cn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ia(e,t){var i=_t(e,t),n=Ci(i);return i==n?t:zt(n)}function Sa(e,t){if(t>e.lastLine())return t;var i=_t(e,t),n;if(!bn(e,i))return t;for(;n=Cn(i);)i=n.find(1,!0).line;return zt(i)+1}function bn(e,t){var i=wn&&t.markedSpans;if(i)for(var n=void 0,a=0;at.maxLineLength&&(t.maxLineLength=a,t.maxLine=n)})}var la=function(e,t,i){this.text=e,pa(this,t),this.height=i?i(this):1};la.prototype.lineNo=function(){return zt(this)},K(la);function ua(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ra(e),pa(e,i);var a=n?n(e):1;a!=e.height&&un(e,a)}function no(e){e.parent=null,ra(e)}var Wt={},qt={};function $t(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?qt:Wt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function rn(e,t){var i=z("span",null,null,V?"padding-right: .1px":null),n={pre:z("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,l=void 0;n.pos=0,n.addToken=Sn,gt(e.display.measure)&&(l=Ot(s,e.doc.direction))&&(n.addToken=Kn(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&zt(s);sn(s,n,Ye(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=ae(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=ae(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Ke(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(V){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=ae(n.pre.className,n.textClass||"")),n}function vn(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 Sn(e,t,i,n,a,s,l){if(!t)return;var f=e.splitSpaces?fn(t,e.trailingSpace):t,m=e.cm.state.specialChars,y=!1,W;if(!m.test(t))e.col+=t.length,W=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,W),Y&&I<9&&(y=!0),e.pos+=t.length;else{W=document.createDocumentFragment();for(var Q=0;;){m.lastIndex=Q;var ye=m.exec(t),fe=ye?ye.index-Q:t.length-Q;if(fe){var ze=document.createTextNode(f.slice(Q,Q+fe));Y&&I<9?W.appendChild(b("span",[ze])):W.appendChild(ze),e.map.push(e.pos,e.pos+fe,ze),e.col+=fe,e.pos+=fe}if(!ye)break;Q+=fe+1;var et=void 0;if(ye[0]==" "){var ht=e.cm.options.tabSize,xt=ht-e.col%ht;et=W.appendChild(b("span",E(xt),"cm-tab")),et.setAttribute("role","presentation"),et.setAttribute("cm-text"," "),e.col+=xt}else ye[0]=="\r"||ye[0]==` `?(et=W.appendChild(b("span",ye[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),et.setAttribute("cm-text",ye[0]),e.col+=1):(et=e.cm.options.specialCharPlaceholder(ye[0]),et.setAttribute("cm-text",ye[0]),Y&&I<9?W.appendChild(b("span",[et])):W.appendChild(et),e.col+=1);e.map.push(e.pos,e.pos+1,et),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||a||y||s||l){var Dt=i||"";n&&(Dt+=n),a&&(Dt+=a);var wt=b("span",[W],Dt,s);if(l)for(var Bt in l)l.hasOwnProperty(Bt)&&Bt!="style"&&Bt!="class"&&wt.setAttribute(Bt,l[Bt]);return e.content.appendChild(wt)}e.content.appendChild(W)}function fn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",a=0;ay&&Q.from<=y);ye++);if(Q.to>=W)return e(i,n,a,s,l,f,m);e(i,n.slice(0,Q.to-y),a,s,null,f,m),s=null,n=n.slice(Q.to-y),y=Q.to}}}function Si(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 sn(e,t,i){var n=e.markedSpans,a=e.text,s=0;if(!n){for(var l=1;lm||ln.collapsed&&Yt.to==m&&Yt.from==m)){if(Yt.to!=null&&Yt.to!=m&&fe>Yt.to&&(fe=Yt.to,et=""),ln.className&&(ze+=" "+ln.className),ln.css&&(ye=(ye?ye+";":"")+ln.css),ln.startStyle&&Yt.from==m&&(ht+=" "+ln.startStyle),ln.endStyle&&Yt.to==fe&&(Bt||(Bt=[])).push(ln.endStyle,Yt.to),ln.title&&((Dt||(Dt={})).title=ln.title),ln.attributes)for(var Un in ln.attributes)(Dt||(Dt={}))[Un]=ln.attributes[Un];ln.collapsed&&(!xt||li(xt.marker,ln)<0)&&(xt=Yt)}else Yt.from>m&&fe>Yt.from&&(fe=Yt.from)}if(Bt)for(var bi=0;bi=f)break;for(var Ki=Math.min(f,fe);;){if(W){var Ui=m+W.length;if(!xt){var ri=Ui>Ki?W.slice(0,Ki-m):W;t.addToken(t,ri,Q?Q+ze:ze,ht,m+ri.length==fe?et:"",ye,Dt)}if(Ui>=Ki){W=W.slice(Ki-m),m=Ki;break}m=Ui,ht=""}W=a.slice(s,s=i[y++]),Q=$t(i[y++],t.cm.options)}}}function aa(e,t,i){this.line=t,this.rest=na(t),this.size=this.rest?zt(he(this.rest))-i+1:1,this.node=this.text=null,this.hidden=bn(e,t)}function hn(e,t,i){for(var n=[],a,s=t;s2&&s.push((m.bottom+y.top)/2-i.top)}}s.push(i.bottom-i.top)}}function rt(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;ni)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function Ie(e,t){t=Ci(t);var i=zt(t),n=e.display.externalMeasured=new aa(e.doc,t,i);n.lineN=i;var a=n.built=rn(e,n);return n.text=a.pre,x(e.display.lineMeasure,a.pre),n}function Oe(e,t,i,n){return yt(e,ft(e,t),i,n)}function vt(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(s=m-f,a=s-1,t>=m&&(l="right")),a!=null){if(n=e[y+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&a==0)for(;y&&e[y-2]==e[y-3]&&e[y-1].insertLeft;)n=e[(y-=3)+2],l="left";if(i=="right"&&a==m-f)for(;y=0&&!((i=e[a]).left!=i.right);a--);return i}function kn(e,t,i,n){var a=an(t.map,i,n),s=a.node,l=a.start,f=a.end,m=a.collapse,y;if(s.nodeType==3){for(var W=0;W<4;W++){for(;l&&Xe(t.line.text.charAt(a.coverStart+l));)--l;for(;a.coverStart+f0&&(m=n="right");var Q;e.options.lineWrapping&&(Q=s.getClientRects()).length>1?y=Q[n=="right"?Q.length-1:0]:y=s.getBoundingClientRect()}if(Y&&I<9&&!l&&(!y||!y.left&&!y.right)){var ye=s.parentNode.getClientRects()[0];ye?y={left:ye.left,right:ye.left+Ni(e.display),top:ye.top,bottom:ye.bottom}:y=Zt}for(var fe=y.top-t.rect.top,ze=y.bottom-t.rect.top,et=(fe+ze)/2,ht=t.view.measure.heights,xt=0;xt=n.text.length?(m=n.text.length,y="before"):m<=0&&(m=0,y="after"),!f)return l(y=="before"?m-1:m,y=="before");function W(ze,et,ht){var xt=f[et],Dt=xt.level==1;return l(ht?ze-1:ze,Dt!=ht)}var Q=ct(f,m,y),ye=bt,fe=W(m,Q,y=="before");return ye!=null&&(fe.other=W(m,ye,y!="before")),fe}function _n(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Ni(e.display)*t.ch);var n=_t(e.doc,t.line),a=Vi(n)+Wa(e.display);return{left:i,right:i,top:a,bottom:a+n.height}}function Zn(e,t,i,n,a){var s=$e(e,t,i);return s.xRel=a,n&&(s.outside=n),s}function fi(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return Zn(n.first,0,null,-1,-1);var a=dn(n,i),s=n.first+n.size-1;if(a>s)return Zn(n.first+n.size-1,_t(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=_t(n,a);;){var f=jn(e,l,a,t,i),m=di(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var y=m.find(1);if(y.line==a)return y;l=_t(n,a=y.line)}}function oi(e,t,i,n){n-=ai(t);var a=t.text.length,s=Et(function(l){return yt(e,i,l-1).bottom<=n},a,0);return a=Et(function(l){return yt(e,i,l).top>n},s,a),{begin:s,end:a}}function Pi(e,t,i,n){i||(i=ft(e,t));var a=qn(e,t,yt(e,i,n),"line").top;return oi(e,t,i,a)}function Ai(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function jn(e,t,i,n,a){a-=Vi(t);var s=ft(e,t),l=ai(t),f=0,m=t.text.length,y=!0,W=Ot(t,e.doc.direction);if(W){var Q=(e.options.lineWrapping?mi:Vn)(e,t,i,s,W,n,a);y=Q.level!=1,f=y?Q.from:Q.to-1,m=y?Q.to:Q.from-1}var ye=null,fe=null,ze=Et(function(Qt){var Yt=yt(e,s,Qt);return Yt.top+=l,Yt.bottom+=l,Ai(Yt,n,a,!1)?(Yt.top<=a&&Yt.left<=n&&(ye=Qt,fe=Yt),!0):!1},f,m),et,ht,xt=!1;if(fe){var Dt=n-fe.left=Bt.bottom?1:0}return ze=De(t.text,ze,1),Zn(i,ze,ht,xt,n-et)}function Vn(e,t,i,n,a,s,l){var f=Et(function(Q){var ye=a[Q],fe=ye.level!=1;return Ai(en(e,$e(i,fe?ye.to:ye.from,fe?"before":"after"),"line",t,n),s,l,!0)},0,a.length-1),m=a[f];if(f>0){var y=m.level!=1,W=en(e,$e(i,y?m.from:m.to,y?"after":"before"),"line",t,n);Ai(W,s,l,!0)&&W.top>l&&(m=a[f-1])}return m}function mi(e,t,i,n,a,s,l){var f=oi(e,t,n,l),m=f.begin,y=f.end;/\s/.test(t.text.charAt(y-1))&&y--;for(var W=null,Q=null,ye=0;ye=y||fe.to<=m)continue;var ze=fe.level!=1,et=yt(e,n,ze?Math.min(y,fe.to)-1:Math.max(m,fe.from)).right,ht=etht)&&(W=fe,Q=ht)}return W||(W=a[a.length-1]),W.fromy&&(W={from:W.from,to:y,level:W.level}),W}var ki;function vi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ki==null){ki=b("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ki.appendChild(document.createTextNode("x")),ki.appendChild(b("br"));ki.appendChild(document.createTextNode("x"))}x(e.measure,ki);var i=ki.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),B(e.measure),i||1}function Ni(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 oo(e){for(var t=e.display,i={},n={},a=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+a,n[f]=s.clientWidth}return{fixedPos:ro(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ro(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Tr(e){var t=vi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Ni(e.display)-3);return function(a){if(bn(e.doc,a))return 0;var s=0;if(a.widgets)for(var l=0;l0&&(y=_t(e.doc,m.line).text).length==m.ch){var W=le(y,y.length,e.options.tabSize)-y.length;m=$e(m.line,Math.max(0,Math.round((s-Mo(e.display).left)/Ni(e.display))-W))}return m}function Ma(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;nt)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)wn&&ia(e.doc,t)a.viewFrom?ya(e):(a.viewFrom+=n,a.viewTo+=n);else if(t<=a.viewFrom&&i>=a.viewTo)ya(e);else if(t<=a.viewFrom){var s=Lo(e,i,i+n,1);s?(a.view=a.view.slice(s.index),a.viewFrom=s.lineN,a.viewTo+=n):ya(e)}else if(i>=a.viewTo){var l=Lo(e,t,t,-1);l?(a.view=a.view.slice(0,l.index),a.viewTo=l.lineN):ya(e)}else{var f=Lo(e,t,t,-1),m=Lo(e,i,i+n,1);f&&m?(a.view=a.view.slice(0,f.index).concat(hn(e,f.lineN,m.lineN)).concat(a.view.slice(m.index)),a.viewTo+=n):ya(e)}var y=a.externalMeasured;y&&(i=a.lineN&&t=n.viewTo)return;var s=n.view[Ma(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);je(l,i)==-1&&l.push(i)}function ya(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Lo(e,t,i,n){var a=Ma(e,t),s,l=e.display.view;if(!wn||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var f=e.display.viewFrom,m=0;m0){if(a==l.length-1)return null;s=f+l[a].size-t,a++}else s=f-t;t+=s,i+=s}for(;ia(e.doc,i)!=i;){if(a==(n<0?0:l.length-1))return null;i+=n*l[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:i}}function Gs(e,t,i){var n=e.display,a=n.view;a.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=hn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=hn(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Ma(e,i)))),n.viewTo=i}function Pr(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||f.to().line0?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 Lr(e){e.state.focused||(e.display.input.focus(),ar(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,za(e))},100)}function ar(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,be(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),V&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ir(e)}function za(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(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 Do(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n.005||W<-.005)&&(un(a.line,l),Dr(a.line),a.rest))for(var Q=0;Qe.display.sizerWidth){var ye=Math.ceil(f/Ni(e.display));ye>e.display.maxLineLength&&(e.display.maxLineLength=ye,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}function Dr(e){if(e.widgets)for(var t=0;t=l&&(s=dn(t,Vi(_t(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(Fe(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&&!D){var s=b("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-Wa(e.display))+`px; height: `+(t.bottom-t.top+Yi(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?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=en(e,t),m=!i||i==t?f:en(e,i);a={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var y=or(e,a),W=e.doc.scrollTop,Q=e.doc.scrollLeft;if(y.scrollTop!=null&&(uo(e,y.scrollTop),Math.abs(e.doc.scrollTop-W)>1&&(l=!0)),y.scrollLeft!=null&&(La(e,y.scrollLeft),Math.abs(e.doc.scrollLeft-Q)>1&&(l=!0)),!l)break}return a}function Js(e,t){var i=or(e,t);i.scrollTop!=null&&uo(e,i.scrollTop),i.scrollLeft!=null&&La(e,i.scrollLeft)}function or(e,t){var i=e.display,n=vi(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=Pa(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+Ta(i),m=t.topf-n;if(t.topa+s){var W=Math.min(t.top,(y?f:t.bottom)-s);W!=a&&(l.scrollTop=W)}var Q=e.options.fixedGutter?0:i.gutters.offsetWidth,ye=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Q,fe=qi(e)-i.gutters.offsetWidth,ze=t.right-t.left>fe;return ze&&(t.right=t.left+fe),t.left<10?l.scrollLeft=0:t.leftfe+ye-3&&(l.scrollLeft=t.right+(ze?0:10)-fe),l}function rr(e,t){if(t==null)return;Uo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ha(e){Uo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function lo(e,t,i){(t!=null||i!=null)&&Uo(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Uo(e),e.curOp.scrollToPos=t}function Uo(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=_n(e,t.from),n=_n(e,t.to);jr(e,i,n,t.margin)}}function jr(e,t,i,n){var a=or(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});lo(e,a.scrollLeft,a.scrollTop)}function uo(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;me||lr(e,{top:t}),Ur(e,t,!0),me&&lr(e),po(e,100)}function Ur(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 La(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,zr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function co(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ta(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+Yi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Na=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),Pe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Pe(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Y&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Na.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}},Na.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Na.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Na.prototype.zeroWidthHack=function(){var e=_&&!X?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new He,this.disableVert=new He},Na.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)},Na.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ho=function(){};ho.prototype.update=function(){return{bottom:0,right:0}},ho.prototype.setScrollLeft=function(){},ho.prototype.setScrollTop=function(){},ho.prototype.clear=function(){};function Ka(e,t){t||(t=co(e));var i=e.display.barWidth,n=e.display.barHeight;Ir(e,t);for(var a=0;a<4&&i!=e.display.barWidth||n!=e.display.barHeight;a++)i!=e.display.barWidth&&e.options.lineWrapping&&Do(e),Ir(e,co(e)),i=e.display.barWidth,n=e.display.barHeight}function Ir(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 Br={native:Na,null:ho};function Fr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Br[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pe(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"?La(e,t):uo(e,t)},e),e.display.scrollbars.addClass&&be(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Da(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},Wi(e.curOp)}function ja(e){var t=e.curOp;t&&Ba(t,function(i){for(var n=0;n=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&sr(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Do(t),e.barMeasure=co(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Oe(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+Yi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-qi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=st(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 l=s.styles,f=s.text.length>e.options.maxHighlightLength?Gt(t.mode,n.state):null,m=q(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var y=s.styleClasses,W=m.classes;W?s.styleClasses=W:y&&(s.styleClasses=null);for(var Q=!l||l.length!=s.styles.length||y!=W&&(!y||!W||y.bgClass!=W.bgClass||y.textClass!=W.textClass),ye=0;!Q&&yei)return po(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),a.length&&Hi(e,function(){for(var s=0;s=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Pr(e)==0)return!1;Hr(e)&&(ya(e),t.dims=oo(e));var a=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(a,t.visible.to+e.options.viewportMargin);i.viewFroml&&i.viewTo-l<20&&(l=Math.min(a,i.viewTo)),wn&&(s=ia(e.doc,s),l=Sa(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Gs(e,s,l),i.viewOffset=Vi(_t(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=Pr(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var y=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(y),B(i.cursorDiv),B(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,po(e,400)),i.updateLineNumbers=null,!0}function Wr(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==qi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Ta(e.display)-Pa(e),i.top)}),t.visible=jo(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=jo(e.display,e.doc,i));if(!sr(e,t))break;Do(e);var a=co(e);so(e),Ka(e,a),cr(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 lr(e,t){var i=new Io(e,t);if(sr(e,i)){Do(e),Wr(e,i);var n=co(e);so(e),Ka(e,n),cr(e,n),i.finish()}}function ul(e,t,i){var n=e.display,a=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(ze){var et=ze.nextSibling;return V&&_&&e.display.currentWheelTarget==ze?ze.style.display="none":ze.parentNode.removeChild(ze),et}for(var m=n.view,y=n.viewFrom,W=0;W-1&&(fe=!1),Fa(e,Q,y,i)),fe&&(B(Q.lineNumber),Q.lineNumber.appendChild(document.createTextNode(nn(e.options,y)))),l=Q.node.nextSibling}y+=Q.size}for(;l;)l=f(l)}function ur(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cr(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+Yi(e)+"px"}function zr(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ro(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,s=n+"px",l=0;ll.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||a&&m))return;if(a&&_&&V){e:for(var y=t.target,W=s.view;y!=l;y=y.parentNode)for(var Q=0;Q=0&&ut(e,n.to())<=0)return i}return-1};var Rn=function(e,t){this.anchor=e,this.head=t};Rn.prototype.from=function(){return Bn(this.anchor,this.head)},Rn.prototype.to=function(){return On(this.anchor,this.head)},Rn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ea(e,t,i){var n=e&&e.options.selectionsMayTouch,a=t[i];t.sort(function(ye,fe){return ut(ye.from(),fe.from())}),i=je(t,a);for(var s=1;s0:m>=0){var y=Bn(f.from(),l.from()),W=On(f.to(),l.to()),Q=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Rn(Q?W:y,Q?y:W))}}return new Xi(t,i)}function ba(e,t){return new Xi([new Rn(e,t||e)],0)}function _a(e){return e.text?$e(e.from.line+e.text.length-1,he(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Xr(e,t){if(ut(e,t.from)<0)return e;if(ut(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),$e(i,n)}function hr(e,t){for(var i=[],n=0;n1&&e.remove(f.line+1,ze-1),e.insert(f.line+1,xt)}ui(e,"change",e,t)}function Ea(e,t,i){function n(a,s,l){if(a.linked)for(var f=0;f1&&!e.done[e.done.length-2].ranges)return e.done.pop(),he(e.done)}function qr(e,t,i,n){var a=e.history;a.undone.length=0;var s=+new Date,l,f;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)=="*"))&&(l=fl(a,a.lastOp==n)))f=he(l.changes),ut(t.from,t.to)==0&&ut(t.from,f.to)==0?f.to=_a(t):l.changes.push(mr(e,t));else{var m=he(a.done);for((!m||!m.ranges)&&Wo(e.sel,a.done),l={changes:[mr(e,t)],generation:a.generation},a.done.push(l);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,f||Ne(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:Wo(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=i,n&&n.clearRedo!==!1&&Qr(a.undone)}function Wo(e,t){var i=he(t);i&&i.ranges&&i.equals(e)||t.push(e)}function es(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(l){l.markedSpans&&((a||(a=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function gl(e){if(!e)return null;for(var t,i=0;i-1&&(he(f)[Q]=y[Q],delete y[Q]))}}return n}function vr(e,t,i,n){if(n){var a=e.anchor;if(i){var s=ut(t,a)<0;s!=ut(i,a)<0?(a=t,t=i):s!=ut(t,i)<0&&(t=i)}return new Rn(a,t)}else return new Rn(i||t,t)}function zo(e,t,i,n,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),Ri(e,new Xi([vr(e.sel.primary(),t,i,a)],0),n)}function ns(e,t,i){for(var n=[],a=e.cm&&(e.cm.display.shift||e.extend),s=0;s=t.ch:f.to>t.ch))){if(a&&(Ne(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var Q=m.find(n<0?1:-1),ye=void 0;if((n<0?W:y)&&(Q=ls(e,Q,-n,Q&&Q.line==t.line?s:null)),Q&&Q.line==t.line&&(ye=ut(Q,i))&&(n<0?ye<0:ye>0))return Ga(e,Q,t,n,a)}var fe=m.find(n<0?-1:1);return(n<0?y:W)&&(fe=ls(e,fe,n,fe.line==t.line?s:null)),fe?Ga(e,fe,t,n,a):null}}return t}function Ko(e,t,i,n,a){var s=n||1,l=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 l||(e.cantEdit=!0,$e(e.first,0))}function ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,$e(t.line-1)):null:i>0&&t.ch==(n||_t(e,t.line)).text.length?t.line=0;--a)ds(e,{from:n[a].from,to:n[a].to,text:a?[""]:t.text,origin:t.origin});else ds(e,t)}function ds(e,t){if(t.text.length==1&&t.text[0]==""&&ut(t.from,t.to)==0)return;var i=hr(e,t);qr(e,t,i,e.cm?e.cm.curOp.id:NaN),vo(e,t,i,Ei(e,t));var n=[];Ea(e,function(a,s){!s&&je(n,a.history)==-1&&(ms(a.history,t),n.push(a.history)),vo(a,t,null,Ei(a,t))})}function Vo(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var a=e.history,s,l=e.sel,f=t=="undo"?a.done:a.undone,m=t=="undo"?a.undone:a.done,y=0;y=0;--fe){var ze=ye(fe);if(ze)return ze.v}}function hs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xi(Le(e.sel.ranges,function(a){return new Rn($e(a.anchor.line+t,a.anchor.ch),$e(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm){Di(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())return;if(t.from.lines&&(t={from:t.from,to:$e(s,_t(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tn(e,t.from,t.to),i||(i=hr(e,t)),e.cm?_l(e.cm,t,n):fr(e,t,n),Ho(e,i,Ee),e.cantEdit&&Ko(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,a=e.display,s=t.from,l=t.to,f=!1,m=s.line;e.options.lineWrapping||(m=zt(Ci(_t(n,s.line))),n.iter(m,l.line+1,function(fe){if(fe==a.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&N(e),fr(n,t,i,Tr(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(fe){var ze=sa(fe);ze>a.maxLineLength&&(a.maxLine=fe,a.maxLineLength=ze,a.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),cn(n,s.line),po(e,400);var y=t.text.length-(l.line-s.line)-1;t.full?Di(e):s.line==l.line&&t.text.length==1&&!Yr(e.doc,t)?ga(e,s.line,"text"):Di(e,s.line,l.line+1,y);var W=H(e,"changes"),Q=H(e,"change");if(Q||W){var ye={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};Q&&ui(e,"change",e,ye),W&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ye)}e.display.selForContextMenu=null}function $a(e,t,i,n,a){var s;n||(n=i),ut(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 ps(e,t,i,n){i1||!(this.children[0]instanceof yo))){var f=[];this.collapse(f),this.children=[new yo(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=a.lines.length%25+25,f=l;f10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=y,e.display.maxLineLength=W,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Di(e,n,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&rs(e.doc)),e&&ui(e,"markerCleared",e,this,n,a),t&&ja(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;a0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=z("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Yn(e,t.line,t,i,s)||t.line!=i.line&&Yn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");An()}s.addToHistory&&qr(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,y;if(e.iter(f,i.line+1,function(Q){m&&s.collapsed&&!m.options.lineWrapping&&Ci(Q)==m.display.maxLine&&(y=!0),s.collapsed&&f!=t.line&&un(Q,0),Xn(Q,new Dn(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(Q){bn(e,Q)&&un(Q,0)}),s.clearOnEnter&&Pe(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++gs,s.atomic=!0),m){if(y&&(m.curOp.updateMaxLine=!0),s.collapsed)Di(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var W=t.line;W<=i.line;W++)ga(m,W,"text");s.atomic&&rs(m.doc),ui(m,"markerAdded",m,s)}return s}var Eo=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;m--)Xa(this,n[m]);f?as(this,f):this.cm&&Ha(this.cm)}),undo:yi(function(){Vo(this,"undo")}),redo:yi(function(){Vo(this,"redo")}),undoSelection:yi(function(){Vo(this,"undo",!0)}),redoSelection:yi(function(){Vo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n=e.ch)&&t.push(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 l=s.markedSpans;if(l)for(var f=0;f=m.to||m.from==null&&a!=e.line||m.from!=null&&a==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.marker)}++a}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=s,++i}),o(this,$e(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var W=e.dataTransfer.getData("Text");if(W){var Q;if(t.state.draggingText&&!t.state.draggingText.copy&&(Q=t.listSelections()),Ho(t.doc,ba(i,i)),Q)for(var ye=0;ye=0;f--)$a(e.doc,"",n[f].from,n[f].to,"+delete");Ha(e)})}function yr(e,t,i){var n=De(e.text,t+i,i);return n<0||n>e.text.length?null:n}function br(e,t,i){var n=yr(e,t.ch,i);return n==null?null:new $e(t.line,n,i<0?"after":"before")}function _r(e,t,i,n,a){if(e){t.doc.direction=="rtl"&&(a=-a);var s=Ot(i,t.doc.direction);if(s){var l=a<0?he(s):s[0],f=a<0==(l.level==1),m=f?"after":"before",y;if(l.level>0||t.doc.direction=="rtl"){var W=ft(t,i);y=a<0?i.text.length-1:0;var Q=yt(t,W,y).top;y=Et(function(ye){return yt(t,W,ye).top==Q},a<0==(l.level==1)?l.from:l.to-1,y),m=="before"&&(y=yr(i,y,1))}else y=a<0?l.to:l.from;return new $e(n,y,m)}}return new $e(n,a<0?i.text.length:0,a<0?"before":"after")}function Nl(e,t,i,n){var a=Ot(t,e.doc.direction);if(!a)return br(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=ct(a,i.ch,i.sticky),l=a[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from=l.from&&ye>=W.begin)){var fe=Q?"before":"after";return new $e(i.line,ye,fe)}}var ze=function(xt,Dt,wt){for(var Bt=function(Un,bi){return bi?new $e(i.line,f(Un,1),"before"):new $e(i.line,Un,"after")};xt>=0&&xt0==(Qt.level!=1),ln=Yt?wt.begin:f(wt.end,-1);if(Qt.from<=ln&&ln0?W.end:f(W.begin,-1);return ht!=null&&!(n>0&&ht==t.text.length)&&(et=ze(n>0?0:a.length-1,n,y(ht)),et)?et:null}var wo={selectAll:us,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return Za(e,function(t){if(t.empty()){var i=_t(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)a=new $e(a.line,a.ch+1),e.replaceRange(s.charAt(a.ch-1)+s.charAt(a.ch-2),$e(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var l=_t(e.doc,a.line-1).text;l&&(a=new $e(a.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),$e(a.line-1,l.length-1),a,"+transpose"))}}i.push(new Rn(a,a))}e.setSelections(i)})},newlineAndIndent:function(e){return Hi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;ne&&ut(t,this.pos)==0&&i==this.button};var ko,Ro;function Wl(e,t){var i=+new Date;return Ro&&Ro.compare(i,e,t)?(ko=Ro=null,"triple"):ko&&ko.compare(i,e,t)?(Ro=new Cr(i,e,t),ko=null,"double"):(ko=new Cr(i,e,t),Ro=null,"single")}function Ls(e){var t=this,i=t.display;if(Fe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Qi(i,e)){V||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(xr(t,e))return;var n=Aa(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):re(e)==i.scroller&&C(e):a==2?(n&&zo(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,So(e,ws(s,a),a,function(l){if(typeof l=="string"&&(l=wo[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=we}finally{e.state.suppressEdits=!1}return f})}function Hl(e,t,i){var n=e.getOption("configureMouse"),a=n?n(e,t,i):{};if(a.unit==null){var s=de?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=_?i.metaKey:i.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(_?i.altKey:i.ctrlKey)),a}function Kl(e,t,i,n){Y?setTimeout(P(Lr,e),0):e.curOp.focus=Z();var a=Hl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&pe&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(ut((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(ut(l.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,l=gi(e,function(y){V&&(a.scroller.draggable=!1),e.state.draggingText=!1,kt(a.wrapper.ownerDocument,"mouseup",l),kt(a.wrapper.ownerDocument,"mousemove",f),kt(a.scroller,"dragstart",m),kt(a.scroller,"drop",l),s||(C(y),n.addNew||zo(e.doc,i,null,null,n.extend),V&&!se||Y&&I==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),f=function(y){s=s||Math.abs(t.clientX-y.clientX)+Math.abs(t.clientY-y.clientY)>=10},m=function(){return s=!0};V&&(a.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),Pe(a.wrapper.ownerDocument,"mouseup",l),Pe(a.wrapper.ownerDocument,"mousemove",f),Pe(a.scroller,"dragstart",m),Pe(a.scroller,"drop",l),Nr(e),setTimeout(function(){return a.input.focus()},20)}function Ns(e,t,i){if(i=="char")return new Rn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Rn($e(t.line,0),o(e.doc,$e(t.line+1,0)));var n=i(e,t);return new Rn(n.from,n.to)}function Gl(e,t,i,n){var a=e.display,s=e.doc;C(t);var l,f,m=s.sel,y=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=y[f]:l=new Rn(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Rn(i,i)),i=Aa(e,t,!0,!0),f=-1;else{var W=Ns(e,i,n.unit);n.extend?l=vr(l,W.anchor,W.head,n.extend):l=W}n.addNew?f==-1?(f=y.length,Ri(s,ea(e,y.concat([l]),f),{scroll:!1,origin:"*mouse"})):y.length>1&&y[f].empty()&&n.unit=="char"&&!n.extend?(Ri(s,ea(e,y.slice(0,f).concat(y.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):gr(s,f,l,G):(f=0,Ri(s,new Xi([l],0),G),m=s.sel);var Q=i;function ye(wt){if(ut(Q,wt)==0)return;if(Q=wt,n.unit=="rectangle"){for(var Bt=[],Qt=e.options.tabSize,Yt=le(_t(s,i.line).text,i.ch,Qt),ln=le(_t(s,wt.line).text,wt.ch,Qt),Un=Math.min(Yt,ln),bi=Math.max(Yt,ln),Qn=Math.min(i.line,wt.line),Ki=Math.min(e.lastLine(),Math.max(i.line,wt.line));Qn<=Ki;Qn++){var Ui=_t(s,Qn).text,ri=ue(Ui,Un,Qt);Un==bi?Bt.push(new Rn($e(Qn,ri),$e(Qn,ri))):Ui.length>ri&&Bt.push(new Rn($e(Qn,ri),$e(Qn,ue(Ui,bi,Qt))))}Bt.length||Bt.push(new Rn(i,i)),Ri(s,ea(e,m.ranges.slice(0,f).concat(Bt),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(wt)}else{var Ii=l,xi=Ns(e,wt,n.unit),ci=Ii.anchor,si;ut(xi.anchor,ci)>0?(si=xi.head,ci=Bn(Ii.from(),xi.anchor)):(si=xi.anchor,ci=On(Ii.to(),xi.head));var ei=m.ranges.slice(0);ei[f]=Xl(e,new Rn(o(s,ci),si)),Ri(s,ea(e,ei,f),G)}}var fe=a.wrapper.getBoundingClientRect(),ze=0;function et(wt){var Bt=++ze,Qt=Aa(e,wt,!0,n.unit=="rectangle");if(!Qt)return;if(ut(Qt,Q)!=0){e.curOp.focus=Z(),ye(Qt);var Yt=jo(a,s);(Qt.line>=Yt.to||Qt.linefe.bottom?20:0;ln&&setTimeout(gi(e,function(){if(ze!=Bt)return;a.scroller.scrollTop+=ln,et(wt)}),50)}}function ht(wt){e.state.selectingText=!1,ze=Infinity,wt&&(C(wt),a.input.focus()),kt(a.wrapper.ownerDocument,"mousemove",xt),kt(a.wrapper.ownerDocument,"mouseup",Dt),s.history.lastSelOrigin=null}var xt=gi(e,function(wt){wt.buttons===0||!ne(wt)?ht(wt):et(wt)}),Dt=gi(e,ht);e.state.selectingText=Dt,Pe(a.wrapper.ownerDocument,"mousemove",xt),Pe(a.wrapper.ownerDocument,"mouseup",Dt)}function Xl(e,t){var i=t.anchor,n=t.head,a=_t(e.doc,i.line);if(ut(i,n)==0&&i.sticky==n.sticky)return t;var s=Ot(a);if(!s)return t;var l=ct(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var y;if(n.line!=i.line)y=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var W=ct(s,n.ch,n.sticky),Q=W-l||(n.ch-i.ch)*(f.level==1?-1:1);W==m-1||W==m?y=Q<0:y=Q>0}var ye=s[m+(y?-1:0)],fe=y==(ye.level==1),ze=fe?ye.from:ye.to,et=fe?"after":"before";return i.ch==ze&&i.sticky==et?t:new Rn(new $e(i.line,ze,et),n)}function Ds(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(ye){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&C(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!H(e,i))return O(t);s-=f.top-l.viewOffset;for(var m=0;m=a){var W=dn(e.doc,s),Q=e.display.gutterSpecs[m];return Ne(e,i,e,W,Q.className,t),O(t)}}}function xr(e,t){return Ds(e,t,"gutterClick",!0)}function js(e,t){if(Qi(e.display,t)||$l(e,t))return;if(Fe(e,t,"contextmenu"))return;g||e.display.input.onContextMenu(t)}function $l(e,t){return H(e,"gutterContextMenu")?Ds(e,t,"gutterContextMenu",!1):!1}function Us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}var Qa={toString:function(){return"CodeMirror.Init"}},Is={},Yo={};function Yl(e){var t=e.optionHandlers;function i(n,a,s,l){e.defaults[n]=a,s&&(t[n]=l?function(f,m,y){y!=Qa&&s(f,m,y)}: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,pr(n)},!0),i("indentUnit",2,pr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){mo(n),Fn(n),Di(n)},!0),i("lineSeparator",null,function(n,a){if(n.doc.lineSep=a,!a)return;var s=[],l=n.doc.first;n.doc.iter(function(m){for(var y=0;;){var W=m.text.indexOf(a,y);if(W==-1)break;y=W+a.length,s.push($e(l,W))}l++});for(var f=s.length-1;f>=0;f--)$a(n.doc,a,s[f],$e(s[f].line,s[f].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",vn,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",!_e),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Us(n),fo(n)},!0),i("keyMap","default",function(n,a,s){var l=Xo(a),f=s!=Qa&&Xo(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,a){n.display.gutterSpecs=dr(a,n.options.lineNumbers),fo(n)},!0),i("fixedGutter",!0,function(n,a){n.display.gutters.style.left=a?ro(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Ka(n)},!0),i("scrollbarStyle","native",function(n){Fr(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=dr(n.options.gutters,a),fo(n)},!0),i("firstLineNumber",1,fo,!0),i("lineNumberFormatter",function(n){return n},fo,!0),i("showCursorWhenSelecting",!1,so,!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,so,!0),i("singleCursorHeightPerLine",!0,so,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,mo,!0),i("addModeClass",!1,mo,!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,mo,!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?Pe: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?(be(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Zi(e)),nr(e),Di(e),Fn(e),setTimeout(function(){return Ka(e)},100)}function Gn(e,t){var i=this;if(!(this instanceof Gn))return new Gn(e,t);this.options=t=t?v(t):{},v(Is,t,!1);var n=t.value;typeof n=="string"?n=new ji(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var a=new Gn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,a,t);s.wrapper.CodeMirror=this,Us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fr(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 He,keySeq:null,specialChars:null},t.autofocus&&!te&&s.input.focus(),Y&&I<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Tl(),Da(this),this.curOp.forceUpdate=!0,Jr(this,n),t.autofocus&&!te||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ar(i)},20):za(this);for(var l in Yo)Yo.hasOwnProperty(l)&&Yo[l](this,t[l],Qa);Hr(this),t.finishInit&&t.finishInit(this);for(var f=0;f20*20}Pe(t.scroller,"touchstart",function(m){if(!Fe(e,m)&&!s(m)&&!xr(e,m)){t.input.ensurePolled(),clearTimeout(i);var y=+new Date;t.activeTouch={start:y,moved:!1,prev:y-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Pe(t.scroller,"touchend",function(m){var y=t.activeTouch;if(y&&!Qi(t,m)&&y.left!=null&&!y.moved&&new Date-y.start<300){var W=e.coordsChar(t.activeTouch,"page"),Q;!y.prev||l(y,y.prev)?Q=new Rn(W,W):!y.prev.prev||l(y,y.prev.prev)?Q=e.findWordAt(W):Q=new Rn($e(W.line,0),o(e.doc,$e(W.line+1,0))),e.setSelection(Q.anchor,Q.head),e.focus(),C(m)}a()}),Pe(t.scroller,"touchcancel",a),Pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(uo(e,t.scroller.scrollTop),La(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Pe(t.scroller,"mousewheel",function(m){return Gr(e,m)}),Pe(t.scroller,"DOMMouseScroll",function(m){return Gr(e,m)}),Pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){Fe(e,m)||R(m)},over:function(m){Fe(e,m)||(Ol(e,m),R(m))},start:function(m){return Rl(e,m)},drop:gi(e,kl),leave:function(m){Fe(e,m)||_s(e)}};var f=t.input.getField();Pe(f,"keyup",function(m){return As.call(e,m)}),Pe(f,"keydown",gi(e,Ps)),Pe(f,"keypress",gi(e,Ms)),Pe(f,"focus",function(m){return ar(e,m)}),Pe(f,"blur",function(m){return za(e,m)})}var wr=[];Gn.defineInitHook=function(e){return wr.push(e)};function Oo(e,t,i,n){var a=e.doc,s;i==null&&(i="add"),i=="smart"&&(a.mode.indent?s=st(e,t).state:i="prev");var l=e.options.tabSize,f=_t(a,t),m=le(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var y=f.text.match(/^\s*/)[0],W;if(!n&&!/\S/.test(f.text))W=0,i="not";else if(i=="smart"&&(W=a.mode.indent(s,f.text.slice(y.length),f.text),W==we||W>150)){if(!n)return;i="prev"}i=="prev"?t>a.first?W=le(_t(a,t-1).text,null,l):W=0:i=="add"?W=m+e.options.indentUnit:i=="subtract"?W=m-e.options.indentUnit:typeof i=="number"&&(W=m+i),W=Math.max(0,W);var Q="",ye=0;if(e.options.indentWithTabs)for(var fe=Math.floor(W/l);fe;--fe)ye+=l,Q+=" ";if(yel,m=jt(t),y=null;if(f&&n.ranges.length>1)if(ta&&ta.text.join(` `)==t){if(n.ranges.length%ta.text.length==0){y=[];for(var W=0;W=0;ye--){var fe=n.ranges[ye],ze=fe.from(),et=fe.to();fe.empty()&&(i&&i>0?ze=$e(ze.line,ze.ch-i):e.state.overwrite&&!f?et=$e(et.line,Math.min(_t(s,et.line).text.length,et.ch+he(m).length)):f&&ta&&ta.lineWise&&ta.text.join(` `)==m.join(` `)&&(ze=et=$e(ze.line,0)));var ht={from:ze,to:et,text:y?y[ye%y.length]:m,origin:a||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};Xa(e.doc,ht),ui(e,"inputRead",e,ht)}t&&!f&&Fs(e,t),Ha(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Q),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Bs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Hi(t,function(){return Sr(t,i,0,null,"paste")}),!0}function Fs(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),l=!1;if(s.electricChars){for(var f=0;f-1){l=Oo(e,a.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(_t(e.doc,a.head.line).text.slice(0,a.head.ch))&&(l=Oo(e,a.head.line,"smart")));l&&ui(e,"electricInput",e,a.head.line)}}function Ws(e){for(var t=[],i=[],n=0;ns&&(Oo(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&Ha(this));else{var m=f.from(),y=f.to(),W=Math.max(s,m.line);s=Math.min(this.lastLine(),y.line-(y.ch?0:1))+1;for(var Q=W;Q0&&gr(this.doc,l,new Rn(m,ye[l].to()),Ee)}}}),getTokenAt:function(n,a){return Pt(this,n,a)},getLineTokens:function(n,a){return Pt(this,$e(n),a,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var a=Ye(this,_t(this.doc,n.line)),s=0,l=(a.length-1)/2,f=n.ch,m;if(f==0)m=a[2];else for(;;){var y=s+l>>1;if((y?a[y*2-1]:0)>=f)l=y;else if(a[y*2+1]m&&(n=m,l=!0),f=_t(this.doc,n)}else f=n;return qn(this,f,{top:0,left:0},a||"page",s||l).top+(l?this.doc.height-Vi(f):0)},defaultTextHeight:function(){return vi(this.display)},defaultCharWidth:function(){return Ni(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,a,s,l,f){var m=this.display;n=en(this,o(this.doc,n));var y=n.bottom,W=n.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),m.sizer.appendChild(a),l=="over")y=n.top;else if(l=="above"||l=="near"){var Q=Math.max(m.wrapper.clientHeight,this.doc.height),ye=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+a.offsetHeight>Q)&&n.top>a.offsetHeight?y=n.top-a.offsetHeight:n.bottom+a.offsetHeight<=Q&&(y=n.bottom),W+a.offsetWidth>ye&&(W=ye-a.offsetWidth)}a.style.top=y+"px",a.style.left=a.style.right="",f=="right"?(W=m.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(f=="left"?W=0:f=="middle"&&(W=(m.sizer.clientWidth-a.offsetWidth)/2),a.style.left=W+"px"),s&&Js(this,{left:W,top:y,right:W+a.offsetWidth,bottom:y+a.offsetHeight})},triggerOnKeyDown:Mi(Ps),triggerOnKeyPress:Mi(Ms),triggerOnKeyUp:As,triggerOnMouseDown:Mi(Ls),execCommand:function(n){if(wo.hasOwnProperty(n))return wo[n].call(null,this)},triggerElectric:Mi(function(n){Fs(this,n)}),findPosH:function(n,a,s,l){var f=1;a<0&&(f=-1,a=-a);for(var m=o(this.doc,n),y=0;y0&&W(s.charAt(l-1));)--l;for(;f.5||this.options.lineWrapping)&&nr(this),Ne(this,"refresh",this)}),swapDoc:Mi(function(n){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Jr(this,n),Fn(this),this.display.input.reset(),lo(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,ui(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}},K(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,l){e.registerHelper(n,a,l),i[n]._global.push({pred:s,val:l})}}function kr(e,t,i,n,a){var s=t,l=i,f=_t(e,t.line),m=a&&e.direction=="rtl"?-i:i;function y(){var Dt=t.line+m;return Dt=e.first+e.size?!1:(t=new $e(Dt,t.ch,t.sticky),f=_t(e,Dt))}function W(Dt){var wt;if(n=="codepoint"){var Bt=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Bt)?wt=null:wt=new $e(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(Bt>=55296&&Bt<56320?2:1))),-i)}else a?wt=Nl(e.cm,f,t,i):wt=br(f,t,i);if(wt==null)if(!Dt&&y())t=_r(a,e.cm,f,t.line,m);else return!1;else t=wt;return!0}if(n=="char"||n=="codepoint")W();else if(n=="column")W(!0);else if(n=="word"||n=="group")for(var Q=null,ye=n=="group",fe=e.cm&&e.cm.getHelper(t,"wordChars"),ze=!0;!(i<0&&!W(!ze));ze=!1){var et=f.text.charAt(t.ch)||` `,ht=Be(et,fe)?"w":ye&&et==` `?"n":!ye||/\s/.test(et)?null:"p";if(ye&&!ze&&!ht&&(ht="s"),Q&&Q!=ht){i<0&&(i=1,W(),t.sticky="after");break}if(ht&&(Q=ht),i>0&&!W(!ze))break}var xt=Ko(e,t,s,l,!0);return mn(s,xt)&&(xt.hitSide=!0),xt}function Ks(e,t,i,n){var a=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(f-.5*vi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var y;!(y=fi(e,s,l),!y.outside);){if(i<0?l<=0:l>=a.height){y.hitSide=!0;break}l+=i*5}return y}var Ln=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new He,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;zs(a,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Pe(a,"paste",function(f){if(!s(f)||Fe(n,f)||Bs(f,n))return;I<=11&&setTimeout(gi(n,function(){return t.updateFromDOM()}),20)}),Pe(a,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Pe(a,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Pe(a,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Pe(a,"touchstart",function(){return i.forceCompositionEnd()}),Pe(a,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Fe(n,f))return;if(n.somethingSelected())Jo({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=Ws(n);Jo({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,Ee),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var y=ta.text.join(` `);if(f.clipboardData.setData("Text",y),f.clipboardData.getData("Text")==y){f.preventDefault();return}}var W=Hs(),Q=W.firstChild;n.display.lineSpace.insertBefore(W,n.display.lineSpace.firstChild),Q.value=ta.text.join(` `);var ye=document.activeElement;Te(Q),setTimeout(function(){n.display.lineSpace.removeChild(W),ye.focus(),ye==a&&i.showPrimarySelection()},50)}Pe(a,"copy",l),Pe(a,"cut",l)},Ln.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ln.prototype.prepareSelection=function(){var e=Ar(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&&Vs(t,n)||{node:f[0].measure.map[2],offset:0},y=a.linee.firstLine()&&(n=$e(n.line-1,_t(e.doc,n.line-1).length)),a.ch==_t(e.doc,a.line).text.length&&a.linet.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ma(e,n.line))==0?(l=zt(t.view[0].line),f=t.view[0].node):(l=zt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Ma(e,a.line),y,W;if(m==t.view.length-1?(y=t.viewTo-1,W=t.lineDiv.lastChild):(y=zt(t.view[m+1].line)-1,W=t.view[m+1].node.previousSibling),!f)return!1;for(var Q=e.doc.splitLines(tu(e,f,W,l,y)),ye=tn(e.doc,$e(l,0),$e(y,_t(e.doc,y).text.length));Q.length>1&&ye.length>1;)if(he(Q)==he(ye))Q.pop(),ye.pop(),y--;else if(Q[0]==ye[0])Q.shift(),ye.shift(),l++;else break;for(var fe=0,ze=0,et=Q[0],ht=ye[0],xt=Math.min(et.length,ht.length);fen.ch&&Dt.charCodeAt(Dt.length-ze-1)==wt.charCodeAt(wt.length-ze-1);)fe--,ze++;Q[Q.length-1]=Dt.slice(0,Dt.length-ze).replace(/^\u200b+/,""),Q[0]=Q[0].slice(fe).replace(/\u200b+$/,"");var Qt=$e(l,fe),Yt=$e(y,ye.length?he(ye).length-ze:0);if(Q.length>1||Q[0]||ut(Qt,Yt))return $a(e.doc,Q,Qt,Yt,"+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())&&Hi(this.cm,function(){return Di(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()||gi(this.cm,Sr)(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 Vs(e,t){var i=vt(e,t.line);if(!i||i.hidden)return null;var n=_t(e.doc,t.line),a=rt(i,n,t.line),s=Ot(n,e.doc.direction),l="left";if(s){var f=ct(s,t.ch);l=f%2?"right":"left"}var m=an(a.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function qa(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,a){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function y(fe){return function(ze){return ze.id==fe}}function W(){l&&(s+=f,m&&(s+=f),l=m=!1)}function Q(fe){fe&&(W(),s+=fe)}function ye(fe){if(fe.nodeType==1){var ze=fe.getAttribute("cm-text");if(ze){Q(ze);return}var et=fe.getAttribute("cm-marker"),ht;if(et){var xt=e.findMarks($e(n,0),$e(a+1,0),y(+et));xt.length&&(ht=xt[0].find(0))&&Q(tn(e.doc,ht.from,ht.to).join(f));return}if(fe.getAttribute("contenteditable")=="false")return;var Dt=/^(pre|div|p|li|table|br)$/i.test(fe.nodeName);if(!/^br$/i.test(fe.nodeName)&&fe.textContent.length==0)return;Dt&&W();for(var wt=0;wt=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Pe(a,"paste",function(l){if(Fe(n,l)||Bs(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Fe(n,l))return;if(n.somethingSelected())Jo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Ws(n);Jo({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,Ee):(i.prevInput="",a.value=f.text.join(` `),Te(a))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Pe(a,"cut",s),Pe(a,"copy",s),Pe(e.scroller,"paste",function(l){if(Qi(e,l)||Fe(n,l))return;if(!a.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,a.dispatchEvent(f)}),Pe(e.lineSpace,"selectstart",function(l){Qi(e,l)||C(l)}),Pe(a,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Pe(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ii.prototype.createField=function(e){this.wrapper=Hs(),this.textarea=this.wrapper.firstChild},ii.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ii.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Ar(e);if(e.options.moveInputWithCursor){var a=en(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+l.left-s.left))}return n},ii.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")},ii.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&&Te(this.textarea),Y&&I>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",Y&&I>=9&&(this.hasSelection=null))},ii.prototype.getField=function(){return this.textarea},ii.prototype.supportsTouch=function(){return!1},ii.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!te||Z()!=this.textarea))try{this.textarea.focus()}catch(e){}},ii.prototype.blur=function(){this.textarea.blur()},ii.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ii.prototype.receivedFocus=function(){this.slowPoll()},ii.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()})},ii.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)},ii.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(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(Y&&I>=9&&this.hasSelection===a||_&&/[\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 l=0,f=Math.min(n.length,a.length);l1e3||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},ii.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ii.prototype.onKeyPress=function(){Y&&I>=9&&(this.hasSelection=null),this.fastPoll()},ii.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Aa(i,e),l=n.scroller.scrollTop;if(!s||F)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&gi(i,Ri)(i.doc,ba(s),Ee);var m=a.style.cssText,y=t.wrapper.style.cssText,W=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-W.top-5)+"px; left: "+(e.clientX-W.left-5)+`px; z-index: 1000; background: `+(Y?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Q;V&&(Q=window.scrollY),n.input.focus(),V&&window.scrollTo(null,Q),n.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=fe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ye(){if(a.selectionStart!=null){var et=i.somethingSelected(),ht="\u200B"+(et?a.value:"");a.value="\u21DA",a.value=ht,t.prevInput=et?"":"\u200B",a.selectionStart=1,a.selectionEnd=ht.length,n.selForContextMenu=i.doc.sel}}function fe(){if(t.contextMenuPending!=fe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=y,a.style.cssText=m,Y&&I<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),a.selectionStart!=null){(!Y||Y&&I<9)&&ye();var et=0,ht=function(){n.selForContextMenu==i.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="\u200B"?gi(i,us)(i):et++<10?n.detectingSelectAll=setTimeout(ht,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ht,200)}}if(Y&&I>=9&&ye(),g){R(e);var ze=function(){kt(window,"mouseup",ze),setTimeout(fe,20)};Pe(window,"mouseup",ze)}else setTimeout(fe,50)},ii.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ii.prototype.setUneditable=function(){},ii.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?v(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=Z();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var a;if(e.form&&(Pe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;a=s.submit;try{var l=s.submit=function(){n(),s.submit=a,s.submit(),s.submit=l}}catch(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(kt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var f=Gn(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function au(e){e.off=kt,e.on=Pe,e.wheelEventPixels=dl,e.Doc=ji,e.splitLines=jt,e.countColumn=le,e.findColumn=ue,e.isWordChar=Re,e.Pass=we,e.signal=Ne,e.Line=la,e.changeEnd=_a,e.scrollbarModel=Br,e.Pos=$e,e.cmpPos=ut,e.modes=It,e.mimeModes=Rt,e.resolveMode=We,e.getMode=lt,e.modeExtensions=qe,e.extendMode=dt,e.copyState=Gt,e.startState=on,e.innerMode=Kt,e.commands=wo,e.keyMap=da,e.keyName=Ss,e.isModifierKey=xs,e.lookupKey=Ja,e.normalizeKeyMap=Ll,e.StringStream=Vt,e.SharedTextMarker=Eo,e.TextMarker=Ca,e.LineWidget=_o,e.e_preventDefault=C,e.e_stopPropagation=w,e.e_stop=R,e.addClass=be,e.contains=k,e.rmClass=S,e.keyNames=xa}Yl(Gn),ql(Gn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Qo in ji.prototype)ji.prototype.hasOwnProperty(Qo)&&je(ou,Qo)<0&&(Gn.prototype[Qo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ji.prototype[Qo]));return K(ji),Gn.inputStyles={textarea:ii,contenteditable:Ln},Gn.defineMode=function(e){!Gn.defaults.mode&&e!="null"&&(Gn.defaults.mode=e),Jt.apply(this,arguments)},Gn.defineMIME=Ft,Gn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Gn.defineMIME("text/plain","null"),Gn.defineExtension=function(e,t){Gn.prototype[e]=t},Gn.defineDocExtension=function(e,t){ji.prototype[e]=t},Gn.fromTextArea=iu,au(Gn),Gn.version="5.58.2",Gn})},WaYH:function(at,Ge,p){"use strict";var ie=p("rePB"),Ae=p("Ff2n"),me=p("VTBJ"),Me=p("1OyB"),xe=p("vuIU"),Ce=p("JX7q"),Y=p("Ji7U"),I=p("LK+K"),V=p("q1tI"),J=p("TSYQ"),j=p.n(J),F=p("sboe"),se=p("OZM5"),X=function(g){var ee=g.prefixCls,S=g.level,B=g.isStart,x=g.isEnd;if(!S)return null;for(var b="".concat(ee,"-indent-unit"),z=[],A=0;A1&&arguments[1]!==void 0?arguments[1]:!1,U=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(G&&Z[U])return Z[U];var ue=window.getComputedStyle(Ee),T=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),E=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),he=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),Le=k.map(function(ke){return"".concat(ke,":").concat(ue.getPropertyValue(ke))}).join(";"),Ze={sizingStyle:Le,paddingSize:E,borderSize:he,boxSizing:T};return G&&U&&(Z[U]=Ze),Ze}function Te(Ee){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;be||(be=document.createElement("textarea"),be.setAttribute("tab-index","-1"),be.setAttribute("aria-hidden","true"),document.body.appendChild(be)),Ee.getAttribute("wrap")?be.setAttribute("wrap",Ee.getAttribute("wrap")):be.removeAttribute("wrap");var T=ae(Ee,G),E=T.paddingSize,he=T.borderSize,Le=T.boxSizing,Ze=T.sizingStyle;be.setAttribute("style","".concat(Ze,";").concat(A)),be.value=Ee.value||Ee.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,Ue=Number.MAX_SAFE_INTEGER,ge=be.scrollHeight,Re;if(Le==="border-box"?ge+=he:Le==="content-box"&&(ge-=E),U!==null||ue!==null){be.value=" ";var Be=be.scrollHeight-E;U!==null&&(ke=Be*U,Le==="border-box"&&(ke=ke+E+he),ge=Math.max(ke,ge)),ue!==null&&(Ue=Be*ue,Le==="border-box"&&(Ue=Ue+E+he),Re=ge>Ue?"":"hidden",ge=Math.min(Ue,ge))}return{height:ge,minHeight:ke,maxHeight:Ue,overflowY:Re,resize:"none"}}var P=p("Gytx"),v=p.n(P),le;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(le||(le={}));var He=function(Ee){Object(Me.a)(U,Ee);var G=Object(xe.a)(U);function U(ue){var T;return Object(Ae.a)(this,U),T=G.call(this,ue),T.nextFrameActionId=void 0,T.resizeFrameId=void 0,T.textArea=void 0,T.saveTextArea=function(E){T.textArea=E},T.handleResize=function(E){var he=T.state.resizeStatus,Le=T.props,Ze=Le.autoSize,ke=Le.onResize;if(he!==le.NONE)return;typeof ke=="function"&&ke(E),Ze&&T.resizeOnNextFrame()},T.resizeOnNextFrame=function(){cancelAnimationFrame(T.nextFrameActionId),T.nextFrameActionId=requestAnimationFrame(T.resizeTextarea)},T.resizeTextarea=function(){var E=T.props.autoSize;if(!E||!T.textArea)return;var he=E.minRows,Le=E.maxRows,Ze=Te(T.textArea,!1,he,Le);T.setState({textareaStyles:Ze,resizeStatus:le.RESIZING},function(){cancelAnimationFrame(T.resizeFrameId),T.resizeFrameId=requestAnimationFrame(function(){T.setState({resizeStatus:le.RESIZED},function(){T.resizeFrameId=requestAnimationFrame(function(){T.setState({resizeStatus:le.NONE}),T.fixFirefoxAutoScroll()})})})})},T.renderTextArea=function(){var E=T.props,he=E.prefixCls,Le=he===void 0?"rc-textarea":he,Ze=E.autoSize,ke=E.onResize,Ue=E.className,ge=E.disabled,Re=T.state,Be=Re.textareaStyles,Qe=Re.resizeStatus,it=Object(x.a)(T.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Xe=z()(Le,Ue,Object(I.a)({},"".concat(Le,"-disabled"),ge));"value"in it&&(it.value=it.value||"");var De=Object(Y.a)(Object(Y.a)(Object(Y.a)({},T.props.style),Be),Qe===le.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return Ce.createElement(B,{onResize:T.handleResize,disabled:!(Ze||ke)},Ce.createElement("textarea",Object(ie.a)({},it,{className:Xe,style:De,ref:T.saveTextArea})))},T.state={textareaStyles:{},resizeStatus:le.NONE},T}return Object(me.a)(U,[{key:"componentDidUpdate",value:function(T){(T.value!==this.props.value||!v()(T.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 T=this.textArea.selectionStart,E=this.textArea.selectionEnd;this.textArea.setSelectionRange(T,E)}}catch(he){}}},{key:"render",value:function(){return this.renderTextArea()}}]),U}(Ce.Component),je=He,Je=function(Ee){Object(Me.a)(U,Ee);var G=Object(xe.a)(U);function U(ue){var T;Object(Ae.a)(this,U),T=G.call(this,ue),T.resizableTextArea=void 0,T.focus=function(){T.resizableTextArea.textArea.focus()},T.saveTextArea=function(he){T.resizableTextArea=he},T.handleChange=function(he){var Le=T.props.onChange;T.setValue(he.target.value,function(){T.resizableTextArea.resizeTextarea()}),Le&&Le(he)},T.handleKeyDown=function(he){var Le=T.props,Ze=Le.onPressEnter,ke=Le.onKeyDown;he.keyCode===13&&Ze&&Ze(he),ke&&ke(he)};var E=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return T.state={value:E},T}return Object(me.a)(U,[{key:"setValue",value:function(T,E){"value"in this.props||this.setState({value:T},E)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return Ce.createElement(je,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(T){return"value"in T?{value:T.value}:null}}]),U}(Ce.Component),we=Ge.default=Je},YBdh:function(at,Ge,p){at.exports=p.p+"static/xiren.a6554bc1.svg"},ZW9T:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return _e});var ie=p("k1fw"),Ae=p("miYZ"),me=p("tsqr"),Me=p("rAM+"),xe=p("tJVT"),Ce=p("PpiC"),Y=p("q1tI"),I=p.n(Y),V=p("bdgK");function J(ce,M,g,ee,S){var B=M.getWordUntilPosition(g),x={startLineNumber:g.lineNumber,endLineNumber:g.lineNumber,startColumn:B.startColumn,endColumn:B.endColumn},b=ee.map(function(z){return{label:z,kind:ce.languages.CompletionItemKind.Keyword,insertText:z,insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:x}});return S.map(function(z){b.push(Object(ie.a)(Object(ie.a)({},z),{},{range:x}))}),b}var j=function(ce){var M={label:"ifelse",kind:ce.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:ce.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"];ce.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(x,b){var z=J(ce,x,b,g,[M]);return{suggestions:z}}});var ee=["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"];ce.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(x,b){var z=[{label:"print",kind:ce.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet}],A=J(ce,x,b,ee,z);return{suggestions:A}}});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"];ce.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(x,b){var z=[M,{label:"main",kind:ce.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ce.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet}],A=J(ce,x,b,S,z);return{suggestions:A}}})},F="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",se=p("LvDl");function X(ce){return/^\d+$/.test(ce)?"".concat(ce,"px"):ce}function D(){}var $=!1,L={"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 ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=ce;if(Array.isArray(ce)){for(var g=0;g0||pe.target.offsetWidth>0)&&Ue.current.instance.layout()}}catch(nt){re.e(nt)}finally{re.f()}}),O.observe(ke.current)),O}function pt(){me.b.warn(decodeURIComponent(F))}var bt=function(){var R=Ue.current.instance;if(B!=null&&R&&Xe){var re=R.getModel();re&&B!==re.getValue()&&($=!0,re.setValue(B),R.layout(),$=!1)}};Object(Y.useEffect)(function(){ge.current&&clearTimeout(ge.current),ge.current=setTimeout(function(){bt()},500)},[B,Xe,Ue.current]);function ct(){var O=Ue.current.instance;if(O){var R=O.getSelection(),re=Ue.current.pastePos||{},ne=new _.Range(re.startLineNumber||R.endLineNumber,re.startColumn||R.endColumn,re.endLineNumber||R.endLineNumber,re.endColumn||R.endColumn);setTimeout(function(){O.executeEdits("",[{range:ne,text:""}])},300)}}function Mt(O){(window.navigator.platform.match("Mac")?O.metaKey:O.ctrlKey)&&O.keyCode==83&&(O.preventDefault(),le())}var Ot=function(){if(je&&Ue.current.instance){var R=Ue.current.instance.getContentHeight();C(R0||U.target.offsetWidth>0)&&je.layout()}}catch(ue){Ee.e(ue)}finally{Ee.f()}}),Je.observe(k.current)),Je}Object(Y.useEffect)(function(){k.current&&p.e(27).then(p.t.bind(null,"M/lh",7)).then(function(je){_=je;var Je=_.editor.createDiffEditor(k.current,Object(ie.a)(Object(ie.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},A),{},{wordWrap:!0}));Te(Je);var we=P(Je);return function(){Je.dispose();var Ee=Je.getModel();Ee&&Ee.dispose(),we.unobserve(k.current)}})},[]),Object(Y.useEffect)(function(){ae&&ae.setModel({original:_.editor.createModel(B,b),modified:_.editor.createModel(x,b)})},[B,x,b,ae]);var v=X(g),le=X(S),He={width:v,height:le};return I.a.createElement("div",{className:"my-diff-editor",ref:k,style:He})}},ZpRC:function(at,Ge,p){"use strict";function ie(j){return typeof j=="object"&&j!=null&&j.nodeType===1}function Ae(j,F){return(!F||j!=="hidden")&&j!=="visible"&&j!=="clip"}function me(j,F){if(j.clientHeightF||$>j&&L=F&&te>=se?$-j-X:L>F&&tese?L-F+D:0}var xe=function(j,F){var se=window,X=F.scrollMode,D=F.block,$=F.inline,L=F.boundary,te=F.skipOverflowHiddenElements,_=typeof L=="function"?L:function(Be){return Be!==L};if(!ie(j))throw new TypeError("Invalid target");for(var de=document.scrollingElement||document.documentElement,_e=[],ce=j;ie(ce)&&_(ce);){if((ce=ce.parentElement)===de){_e.push(ce);break}ce!=null&&ce===document.body&&me(ce)&&!me(document.documentElement)||ce!=null&&me(ce,te)&&_e.push(ce)}for(var M=se.visualViewport?se.visualViewport.width:innerWidth,g=se.visualViewport?se.visualViewport.height:innerHeight,ee=window.scrollX||pageXOffset,S=window.scrollY||pageYOffset,B=j.getBoundingClientRect(),x=B.height,b=B.width,z=B.top,A=B.right,k=B.bottom,Z=B.left,be=D==="start"||D==="nearest"?z:D==="end"?k:z+x/2,ae=$==="center"?Z+b/2:$==="end"?A:Z,Te=[],P=0;P<_e.length;P++){var v=_e[P],le=v.getBoundingClientRect(),He=le.height,je=le.width,Je=le.top,we=le.right,Ee=le.bottom,G=le.left;if(X==="if-needed"&&z>=0&&Z>=0&&k<=g&&A<=M&&z>=Je&&k<=Ee&&Z>=G&&A<=we)return Te;var U=getComputedStyle(v),ue=parseInt(U.borderLeftWidth,10),T=parseInt(U.borderTopWidth,10),E=parseInt(U.borderRightWidth,10),he=parseInt(U.borderBottomWidth,10),Le=0,Ze=0,ke="offsetWidth"in v?v.offsetWidth-v.clientWidth-ue-E:0,Ue="offsetHeight"in v?v.offsetHeight-v.clientHeight-T-he:0;if(de===v)Le=D==="start"?be:D==="end"?be-g:D==="nearest"?Me(S,S+g,g,T,he,S+be,S+be+x,x):be-g/2,Ze=$==="start"?ae:$==="center"?ae-M/2:$==="end"?ae-M:Me(ee,ee+M,M,ue,E,ee+ae,ee+ae+b,b),Le=Math.max(0,Le+S),Ze=Math.max(0,Ze+ee);else{Le=D==="start"?be-Je-T:D==="end"?be-Ee+he+Ue:D==="nearest"?Me(Je,Ee,He,T,he+Ue,be,be+x,x):be-(Je+He/2)+Ue/2,Ze=$==="start"?ae-G-ue:$==="center"?ae-(G+je/2)+ke/2:$==="end"?ae-we+E+ke:Me(G,we,je,ue,E+ke,ae,ae+b,b);var ge=v.scrollLeft,Re=v.scrollTop;be+=Re-(Le=Math.max(0,Math.min(Re+Le,v.scrollHeight-He+Ue))),ae+=ge-(Ze=Math.max(0,Math.min(ge+Ze,v.scrollWidth-je+ke)))}Te.push({el:v,top:Le,left:Ze})}return Te};function Ce(j){return j===Object(j)&&Object.keys(j).length!==0}function Y(j,F){F===void 0&&(F="auto");var se="scrollBehavior"in document.body.style;j.forEach(function(X){var D=X.el,$=X.top,L=X.left;D.scroll&&se?D.scroll({top:$,left:L,behavior:F}):(D.scrollTop=$,D.scrollLeft=L)})}function I(j){return j===!1?{block:"end",inline:"nearest"}:Ce(j)?j:{block:"start",inline:"nearest"}}function V(j,F){var se=!j.ownerDocument.documentElement.contains(j);if(Ce(F)&&typeof F.behavior=="function")return F.behavior(se?[]:xe(j,F));if(se)return;var X=I(F);return Y(xe(j,X),X.behavior)}var J=Ge.a=V},bT9E:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return Ae});var ie=p("VTBJ");function Ae(me,Me){var xe=Object(ie.a)({},me);return Array.isArray(Me)&&Me.forEach(function(Ce){delete xe[Ce]}),xe}},c5Ni:function(at,Ge,p){},dejd:function(at,Ge,p){},dmUQ:function(at,Ge,p){"use strict";var ie=p("Ff2n"),Ae=p("rePB"),me=p("1OyB"),Me=p("vuIU"),xe=p("Ji7U"),Ce=p("md7G"),Y=p("foSv"),I=p("q1tI"),V=p.n(I),J=p("TSYQ"),j=p.n(J),F=p("4IlW");function se(x,b){var z=Object.keys(x);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(x);b&&(A=A.filter(function(k){return Object.getOwnPropertyDescriptor(x,k).enumerable})),z.push.apply(z,A)}return z}function X(x){for(var b=1;b1?je-1:0),we=1;we1?P-1:0),le=1;le=0)return parseInt(Te.slice(Te.indexOf("e-")+2),10);var P=0;return Te.indexOf(".")>=0&&(P=Te.length-Te.indexOf(".")-1),P},k.getInputDisplayValue=function(ae){var Te=ae||k.state,P=Te.focused,v=Te.inputValue,le=Te.value,He;P?He=v:He=k.toPrecisionAsStep(le),He==null&&(He="");var je=k.formatWrapper(He);return M(k.props.decimalSeparator)&&(je=je.toString().replace(".",k.props.decimalSeparator)),je},k.recordCursorPosition=function(){try{k.cursorStart=k.input.selectionStart,k.cursorEnd=k.input.selectionEnd,k.currentValue=k.input.value,k.cursorBefore=k.input.value.substring(0,k.cursorStart),k.cursorAfter=k.input.value.substring(k.cursorEnd)}catch(ae){}},k.restoreByAfter=function(ae){if(ae===void 0)return!1;var Te=k.input.value,P=Te.lastIndexOf(ae);if(P===-1)return!1;var v=k.cursorBefore.length;return k.lastKeyCode===F.a.DELETE&&k.cursorBefore.charAt(v-1)===ae[0]?(k.fixCaret(v,v),!0):P+ae.length===Te.length?(k.fixCaret(P,P),!0):!1},k.partRestoreByAfter=function(ae){return ae===void 0?!1:Array.prototype.some.call(ae,function(Te,P){var v=ae.substring(P);return k.restoreByAfter(v)})},k.isNotCompleteNumber=function(ae){return isNaN(ae)||ae===""||ae===null||ae&&ae.toString().indexOf(".")===ae.toString().length-1},k.stop=function(){k.autoStepTimer&&clearTimeout(k.autoStepTimer)},k.down=function(ae,Te,P){k.pressingUpOrDown=!0,k.step("down",ae,Te,P)},k.up=function(ae,Te,P){k.pressingUpOrDown=!0,k.step("up",ae,Te,P)},k.saveInput=function(ae){k.input=ae};var Z=A.value;Z===void 0&&(Z=A.defaultValue),k.state={focused:A.autoFocus};var be=k.getValidValue(k.toNumber(Z));return k.state=X(X({},k.state),{},{inputValue:k.toPrecisionAsStep(be),value:be}),k}return Object(Me.a)(z,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(k){var Z=this.props,be=Z.value,ae=Z.onChange,Te=Z.max,P=Z.min,v=this.state.focused;if(k){if(!g(k.value,be)||!g(k.max,Te)||!g(k.min,P)){var le=v?be:this.getValidValue(be),He;this.pressingUpOrDown?He=le:this.inputting?He=this.rawInput:He=this.toPrecisionAsStep(le),this.setState({value:le,inputValue:He})}var je="value"in this.props?be:this.state.value;"max"in this.props&&k.max!==Te&&typeof je=="number"&&je>Te&&ae&&ae(Te),"min"in this.props&&k.min!==P&&typeof je=="number"&&je1&&arguments[1]!==void 0?arguments[1]:this.props.min,be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,ae=parseFloat(k);return isNaN(ae)?k:(aebe&&(ae=be),ae)}},{key:"setValue",value:function(k,Z){var be=this.props.precision,ae=this.isNotCompleteNumber(parseFloat(k))?null:parseFloat(k),Te=this.state.value,P=Te===void 0?null:Te,v=this.state.inputValue,le=v===void 0?null:v,He=typeof ae=="number"?ae.toFixed(be):"".concat(ae),je=ae!==P||He!=="".concat(le);return"value"in this.props?(le=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:le},Z)):this.setState({value:ae,inputValue:this.toPrecisionAsStep(k)},Z),je&&this.props.onChange(ae),ae}},{key:"getMaxPrecision",value:function(k){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=this.props,ae=be.precision,Te=be.step;if(M(ae))return ae;var P=this.getPrecision(Z),v=this.getPrecision(Te),le=this.getPrecision(k);return k?Math.max(le,P+v):P+v}},{key:"getPrecisionFactor",value:function(k){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=this.getMaxPrecision(k,Z);return Math.pow(10,be)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(k){return this.props.formatter?this.props.formatter(k):k}},{key:"toPrecisionAsStep",value:function(k){if(this.isNotCompleteNumber(k)||k==="")return k;var Z=Math.abs(this.getMaxPrecision(k));return isNaN(Z)?k.toString():Number(k).toFixed(Z)}},{key:"toNumber",value:function(k){var Z=this.props.precision,be=this.state.focused,ae=k&&k.length>16&&be;return this.isNotCompleteNumber(k)||ae?k:M(Z)?Math.round(k*Math.pow(10,Z))/Math.pow(10,Z):Number(k)}},{key:"upStep",value:function(k,Z){var be=this.props.step,ae=this.getPrecisionFactor(k,Z),Te=Math.abs(this.getMaxPrecision(k,Z)),P=((ae*k+ae*be*Z)/ae).toFixed(Te);return this.toNumber(P)}},{key:"downStep",value:function(k,Z){var be=this.props.step,ae=this.getPrecisionFactor(k,Z),Te=Math.abs(this.getMaxPrecision(k,Z)),P=((ae*k-ae*be*Z)/ae).toFixed(Te);return this.toNumber(P)}},{key:"step",value:function(k,Z){var be=this,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Te=arguments.length>3?arguments[3]:void 0;this.stop(),Z&&(Z.persist(),Z.preventDefault());var P=this.props;if(P.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var le=this["".concat(k,"Step")](v,ae),He=le>P.max||leP.max?le=P.max:le=Je),Fe=(Mt||Mt===0)&&(isNaN(Mt)||Number(Mt)<=we),N=Ne||ae||Te,H=Fe||ae||Te,K=j()("".concat(be,"-handler"),"".concat(be,"-handler-up"),Object(Ae.a)({},"".concat(be,"-handler-up-disabled"),N)),C=j()("".concat(be,"-handler"),"".concat(be,"-handler-down"),Object(Ae.a)({},"".concat(be,"-handler-down-disabled"),H)),w=P?{onTouchStart:N?L:this.up,onTouchEnd:this.stop}:{onMouseDown:N?L:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},O=P?{onTouchStart:H?L:this.down,onTouchEnd:this.stop}:{onMouseDown:H?L:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return V.a.createElement("div",{className:Ct,style:Ee,title:G,onMouseEnter:U,onMouseLeave:ue,onMouseOver:T,onMouseOut:E,onFocus:function(){return null},onBlur:function(){return null}},V.a.createElement("div",{className:"".concat(be,"-handler-wrap")},V.a.createElement("span",Object.assign({unselectable:"on"},w,{role:"button","aria-label":"Increase Value","aria-disabled":N,className:K}),le||V.a.createElement("span",{unselectable:"on",className:"".concat(be,"-handler-up-inner"),onClick:te})),V.a.createElement("span",Object.assign({unselectable:"on"},O,{role:"button","aria-label":"Decrease Value","aria-disabled":H,className:C}),He||V.a.createElement("span",{unselectable:"on",className:"".concat(be,"-handler-down-inner"),onClick:te}))),V.a.createElement("div",{className:"".concat(be,"-input-wrap")},V.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":we,"aria-valuemax":Je,"aria-valuenow":Mt,required:he,type:ke,placeholder:Ue,onPaste:Et,onClick:Le,onMouseUp:this.onMouseUp,className:"".concat(be,"-input"),tabIndex:Ze,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ut?this.onKeyDown:L,onKeyUp:Ut?this.onKeyUp:L,autoFocus:Xe,maxLength:it,readOnly:Te,disabled:ae,max:Je,min:we,step:Qe,name:De,title:G,id:ge,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(kt),pattern:Be,inputMode:Re,onInput:pt},Pe))))}}]),z}(V.a.Component);ee.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ce,min:-ce,step:1,style:{},onChange:L,onKeyDown:L,onPressEnter:L,onFocus:L,onBlur:L,parser:_,required:!1,autoComplete:"off"};var S=ee,B=Ge.a=S},"e+RI":function(at,Ge,p){at.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":function(at,Ge,p){"use strict";var ie=p("giR+"),Ae=p("fyUT"),me=p("tJVT"),Me=p("PpiC"),xe=p("OaEy"),Ce=p("2fM7"),Y=p("q1tI"),I=p.n(Y),V=p("2sxD"),J=p.n(V),j=p("51dB"),F=p.n(j),se=p("5MlY"),X=p.n(se),D=p("lnNo"),$=p.n(D),L=p("YBdh"),te=p.n(L),_=p("LvDl"),de=p.n(_),_e=p("TSYQ"),ce=p.n(_e),M=Ce.a.Option,g=function(x){var b=parseInt(x);return Object(_.isNaN)(b)?0:b},ee=function(x){var b,z,A=x.index,k=x.value,Z=k===void 0?[]:k,be=x.onChange,ae=x.type,Te=x.disabled,P=Te===void 0?!1:Te,v=x.expansion,le=v===void 0?!0:v,He=Object(Me.a)(x,["index","value","onChange","type","disabled","expansion"]),je=Object(Y.useState)(!0),Je=Object(me.a)(je,2),we=Je[0],Ee=Je[1],G=function(ue,T){var E=Object(_.cloneDeep)(Z);E.difficulties[T].num=ue,console.log(E,444),be(E)};return I.a.createElement("div",{className:J.a.ListGroup,style:{borderWidth:A?1:0}},I.a.createElement("div",{className:J.a.a},A+1),I.a.createElement("div",{"data-type":"width",className:J.a.b},Z==null?void 0:Z.name),I.a.createElement("div",{className:J.a.c},Z==null||((b=Z.difficulties)===null||b===void 0)?void 0:b.map(function(U,ue){return I.a.createElement("div",{key:ue,style:{display:we?"flex":ue?"none":"flex"},className:J.a.c1},I.a.createElement("span",{style:{color:"#777777",marginRight:5}},"\u96BE\u5EA6"),U.difficulty===1&&I.a.createElement("span",{className:J.a.radio},"\u7B80\u5355"),U.difficulty===2&&I.a.createElement("span",{className:J.a.radio},"\u9002\u4E2D"),U.difficulty===3&&I.a.createElement("span",{className:J.a.radio},"\u56F0\u96BE"),I.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"\u62BD\u9898\u6570\u91CF"),A===0&&ue===0?I.a.createElement("div",{id:"".concat(ae,"_sum")},I.a.createElement(Ae.a,{disabled:P,parser:g,onChange:function(E){return G(E,ue)},min:0,max:U==null?void 0:U.count,value:(U==null?void 0:U.num)||0,style:{width:66}}),I.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6570\u91CF")):I.a.createElement(Ae.a,{disabled:P,parser:g,onChange:function(E){return G(E,ue)},min:0,max:U==null?void 0:U.count,value:(U==null?void 0:U.num)||0,style:{width:66}}),I.a.createElement("span",{style:{marginLeft:5}},"/",U==null?void 0:U.count))})),I.a.createElement("div",{style:{display:(Z==null||((z=Z.difficulties)===null||z===void 0)?void 0:z.length)===1||!le?"none":"block"},onClick:function(){return Ee(!we)},className:J.a.d},we?"\u6536\u8D77":"\u5C55\u5F00",I.a.createElement("img",{style:{marginTop:-2,transform:we?"rotate(0deg)":"rotate(180deg)"},src:$.a,className:"ml5"})))},S=function(x){var b,z,A=x.value,k=A===void 0?[]:A,Z=x.onChange,be=x.listClassName,ae=x.disabled,Te=ae===void 0?!1:ae,P=x.expansion,v=P===void 0?!0:P,le=Object(Me.a)(x,["value","onChange","listClassName","disabled","expansion"]),He=Object(Y.useState)(!0),je=Object(me.a)(He,2),Je=je[0],we=je[1],Ee=function(E){var he,Le=E.score||0,Ze=[];E==null||((he=E.item_banks)===null||he===void 0)||he.forEach(function(Ue){var ge;Ue==null||((ge=Ue.tag_disciplines)===null||ge===void 0)||ge.forEach(function(Re){var Be;Re==null||((Be=Re.difficulties)===null||Be===void 0)||Be.forEach(function(Qe){Qe.num&&Ze.push(Qe.num)})})});var ke=Ze.reduce(function(Ue,ge){return Ue+ge},0);return ke*Le},G=[{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:"\u7F16\u7A0B\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],U=function(E,he,Le){var Ze=Object(_.cloneDeep)(k);Ze.item_banks[he].tag_disciplines[Le]=E;var ke=Ee(Ze);Ze.scoreTotal=ke,console.log(Ze,"newValue"),Z(Ze)},ue=function(E){var he=Object(_.cloneDeep)(k);he.score=E;var Le=Ee(he);he.scoreTotal=Le,Z(he)};return I.a.createElement("div",{className:ce()(J.a.list,be)},I.a.createElement("div",{className:J.a.head},I.a.createElement("div",{className:J.a.name},I.a.createElement("b",null),I.a.createElement("span",null,(b=G.find(function(T){return T.type===(k==null?void 0:k.item_type)}))===null||b===void 0?void 0:b.name)),I.a.createElement("div",{className:J.a.right},v&&I.a.createElement("div",{onClick:function(){return we(!Je)},className:"current c-light-primary mb10"},Je?"\u6536\u8D77":"\u5C55\u5F00",I.a.createElement("img",{style:{marginTop:-2,transform:Je?"rotate(0deg)":"rotate(180deg)"},src:$.a,className:"ml5"})),I.a.createElement("div",null,I.a.createElement("img",{src:F.a}),I.a.createElement("span",{className:"ml10 mr20"},"\u603B\u5206",k.scoreTotal,"\u5206"),I.a.createElement("img",{className:"mr10",src:X.a}),I.a.createElement("span",null,(k==null?void 0:k.item_type)==="COMBINATION"?"\u6BCF\u5C0F\u9898":"\u6BCF\u9898"),I.a.createElement("div",{id:"".concat(k==null?void 0:k.item_type,"_score")},I.a.createElement(Ae.a,{disabled:Te,parser:g,min:0,onChange:ue,value:k.score,style:{margin:"0 5px"}}),I.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6BCF\u9898\u5206\u6570")),I.a.createElement("span",null,"\u5206")))),I.a.createElement("div",{className:J.a.body,style:{display:Je?"block":"none"}},k==null||((z=k.item_banks)===null||z===void 0)?void 0:z.map(function(T,E){var he;return I.a.createElement(I.a.Fragment,{key:E},I.a.createElement("div",{className:J.a.top},I.a.createElement("img",{src:te.a}),I.a.createElement("span",null,"\u65B9\u5411/\u8BFE\u7A0B"),I.a.createElement("b",null),I.a.createElement("aside",null,T==null?void 0:T.disciplines,"/",T==null?void 0:T.sub_discipline)),I.a.createElement("div",{className:J.a.bottom},I.a.createElement("div",{className:J.a.l},"\u77E5\u8BC6\u70B9"),I.a.createElement("div",{className:J.a.r},T==null||((he=T.tag_disciplines)===null||he===void 0)?void 0:he.map(function(Le,Ze){return I.a.createElement(ee,{expansion:v,disabled:Te,type:k==null?void 0:k.item_type,key:"".concat(E,"-").concat(Ze),value:Le,index:Ze,onChange:function(Ue){return U(Ue,E,Ze)}})}))))})))};Ge.a=S},exQ7:function(at,Ge,p){at.exports=p.p+"static/te.6f9c0684.svg"},fAei:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return de.a});var ie=p("rePB"),Ae=p("VTBJ"),me=p("KQm4"),Me=p("1OyB"),xe=p("vuIU"),Ce=p("Ji7U"),Y=p("LK+K"),I=p("q1tI"),V=p("4IlW"),J=p("Kwbf"),j=p("TSYQ"),F=p.n(j),se=p("sboe"),X=p("OZM5"),D=p("815F"),$=p("ODXe"),L=p("Ff2n"),te=p("+nKL"),_=p("8XRh"),de=p("WaYH"),_e=function(we,Ee){var G=we.className,U=we.style,ue=we.motion,T=we.motionNodes,E=we.motionType,he=we.onMotionStart,Le=we.onMotionEnd,Ze=we.active,ke=we.treeNodeRequiredProps,Ue=Object(L.a)(we,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ge=I.useState(!0),Re=Object($.a)(ge,2),Be=Re[0],Qe=Re[1],it=I.useContext(se.a),Xe=it.prefixCls,De=I.useRef(!1),Et=function(){De.current||Le(),De.current=!0};return Object(I.useEffect)(function(){T&&E==="hide"&&Be&&Qe(!1)},[T]),Object(I.useEffect)(function(){return T&&he(),function(){T&&Et()}},[]),T?I.createElement(_.default,Object.assign({ref:Ee,visible:Be},ue,{motionAppear:E==="show",onAppearEnd:Et,onLeaveEnd:Et}),function(pt,bt){var ct=pt.className,Mt=pt.style;return I.createElement("div",{ref:bt,className:F()("".concat(Xe,"-treenode-motion"),ct),style:Mt},T.map(function(Ot){var Ct=Ot.data,Pe=Ct.key,Ut=Object(L.a)(Ct,["key"]),kt=Ot.isStart,Ne=Ot.isEnd;delete Ut.children;var Fe=Object(D.f)(Pe,ke);return I.createElement(de.a,Object.assign({},Ut,Fe,{active:Ze,data:Ot.data,key:Pe,isStart:kt,isEnd:Ne}))}))}):I.createElement(de.a,Object.assign({domRef:Ee,className:G,style:U},Ue,{active:Ze}))};_e.displayName="MotionTreeNode";var ce=I.forwardRef(_e),M=ce;function g(){var Je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ee=Je.length,G=we.length;if(Math.abs(Ee-G)!==1)return{add:!1,key:null};function U(ue,T){var E=new Map;ue.forEach(function(Le){E.set(Le,!0)});var he=T.filter(function(Le){return!E.has(Le)});return he.length===1?he[0]:null}return Ee ").concat(we);return we}var ae=function(we,Ee){var G=we.prefixCls,U=we.data,ue=we.selectable,T=we.checkable,E=we.expandedKeys,he=we.selectedKeys,Le=we.checkedKeys,Ze=we.loadedKeys,ke=we.loadingKeys,Ue=we.halfCheckedKeys,ge=we.keyEntities,Re=we.disabled,Be=we.dragging,Qe=we.dragOverNodeKey,it=we.dropPosition,Xe=we.motion,De=we.height,Et=we.itemHeight,pt=we.virtual,bt=we.focusable,ct=we.activeItem,Mt=we.focused,Ot=we.tabIndex,Ct=we.onKeyDown,Pe=we.onFocus,Ut=we.onBlur,kt=we.onActiveChange,Ne=we.onListChangeStart,Fe=we.onListChangeEnd,N=Object(L.a)(we,["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"]),H=I.useRef(null);I.useImperativeHandle(Ee,function(){return{scrollTo:function(dt){H.current.scrollTo(dt)}}});var K=I.useState(E),C=Object($.a)(K,2),w=C[0],O=C[1],R=I.useState(U),re=Object($.a)(R,2),ne=re[0],pe=re[1],nt=I.useState(U),Ke=Object($.a)(nt,2),Se=Ke[0],gt=Ke[1],jt=I.useState([]),ot=Object($.a)(jt,2),Xt=ot[0],tt=ot[1],Ht=I.useState(null),It=Object($.a)(Ht,2),Rt=It[0],Jt=It[1];function Ft(){pe(U),gt(U),tt([]),Jt(null),Fe()}I.useEffect(function(){O(E);var qe=g(w,E);if(qe.key!==null)if(qe.add){var dt=ne.findIndex(function(tn){var Lt=tn.data.key;return Lt===qe.key}),Gt=k(ee(ne,U,qe.key),pt,De,Et),Kt=ne.slice();Kt.splice(dt+1,0,A),gt(Kt),tt(Gt),Jt("show")}else{var on=U.findIndex(function(tn){var Lt=tn.data.key;return Lt===qe.key}),Vt=k(ee(U,ne,qe.key),pt,De,Et),_t=U.slice();_t.splice(on+1,0,A),gt(_t),tt(Vt),Jt("hide")}else ne!==U&&(pe(U),gt(U))},[E,U]),I.useEffect(function(){Be||Ft()},[Be]);var We=Xe?Se:U,lt={expandedKeys:E,selectedKeys:he,loadedKeys:Ze,loadingKeys:ke,checkedKeys:Le,halfCheckedKeys:Ue,dragOverNodeKey:Qe,dropPosition:it,keyEntities:ge};return I.createElement(I.Fragment,null,Mt&&ct&&I.createElement("span",{style:S,"aria-live":"assertive"},be(ct)),I.createElement("div",{role:"tree"},I.createElement("input",{style:S,disabled:bt===!1||Re,tabIndex:bt!==!1?Ot:null,onKeyDown:Ct,onFocus:Pe,onBlur:Ut,value:"",onChange:B})),I.createElement(te.a,Object.assign({},N,{data:We,itemKey:Z,height:De,fullHeight:!1,virtual:pt,itemHeight:Et,prefixCls:"".concat(G,"-list"),ref:H}),function(qe){var dt=qe.pos,Gt=qe.data,Kt=Gt.key,on=Object(L.a)(Gt,["key"]),Vt=qe.isStart,_t=qe.isEnd,tn=Object(D.e)(Kt,dt);delete on.children;var Lt=Object(D.f)(tn,lt);return I.createElement(M,Object.assign({},on,Lt,{active:ct&&Kt===ct.data.key,pos:dt,data:qe.data,isStart:Vt,isEnd:_t,motion:Xe,motionNodes:Kt===x?Xt:null,motionType:Rt,onMotionStart:Ne,onMotionEnd:Ft,treeNodeRequiredProps:lt,onMouseMove:function(){kt(null)}}))}))},Te=I.forwardRef(ae);Te.displayName="NodeList";var P=Te,v=p("NvD2"),le=function(Je){Object(Ce.a)(Ee,Je);var we=Object(Y.a)(Ee);function Ee(){var G;return Object(Me.a)(this,Ee),G=we.apply(this,arguments),G.destroyed=!1,G.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},G.listRef=I.createRef(),G.onNodeDragStart=function(U,ue){var T=G.state,E=T.expandedKeys,he=T.keyEntities,Le=G.props.onDragStart,Ze=ue.props.eventKey;G.dragNode=ue;var ke=Object(X.b)(E,Ze);G.setState({dragging:!0,dragNodesKeys:Object(X.g)(Ze,he)}),G.setExpandedKeys(ke),Le&&Le({event:U,node:Object(D.b)(ue.props)})},G.onNodeDragEnter=function(U,ue){var T=G.state,E=T.expandedKeys,he=T.keyEntities,Le=T.dragNodesKeys,Ze=G.props.onDragEnter,ke=ue.props,Ue=ke.pos,ge=ke.eventKey;if(!G.dragNode||Le.indexOf(ge)!==-1)return;var Re=Object(X.c)(U,ue);if(G.dragNode.props.eventKey===ge&&Re===0){G.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){G.setState({dragOverNodeKey:ge,dropPosition:Re}),G.delayedDragEnterLogic||(G.delayedDragEnterLogic={}),Object.keys(G.delayedDragEnterLogic).forEach(function(Be){clearTimeout(G.delayedDragEnterLogic[Be])}),G.delayedDragEnterLogic[Ue]=window.setTimeout(function(){if(!G.state.dragging)return;var Be=Object(me.a)(E),Qe=he[ge];Qe&&(Qe.children||[]).length&&(Be=Object(X.a)(E,ge)),"expandedKeys"in G.props||G.setExpandedKeys(Be),Ze&&Ze({event:U,node:Object(D.b)(ue.props),expandedKeys:Be})},400)},0)},G.onNodeDragOver=function(U,ue){var T=G.state.dragNodesKeys,E=G.props.onDragOver,he=ue.props.eventKey;if(T.indexOf(he)!==-1)return;if(G.dragNode&&he===G.state.dragOverNodeKey){var Le=Object(X.c)(U,ue);if(Le===G.state.dropPosition)return;G.setState({dropPosition:Le})}E&&E({event:U,node:Object(D.b)(ue.props)})},G.onNodeDragLeave=function(U,ue){var T=G.props.onDragLeave;G.setState({dragOverNodeKey:""}),T&&T({event:U,node:Object(D.b)(ue.props)})},G.onNodeDragEnd=function(U,ue){var T=G.props.onDragEnd;G.setState({dragOverNodeKey:""}),G.cleanDragState(),T&&T({event:U,node:Object(D.b)(ue.props)}),G.dragNode=null},G.onNodeDrop=function(U,ue){var T=G.state,E=T.dragNodesKeys,he=E===void 0?[]:E,Le=T.dropPosition,Ze=G.props.onDrop,ke=ue.props,Ue=ke.eventKey,ge=ke.pos;if(G.setState({dragOverNodeKey:""}),G.cleanDragState(),he.indexOf(Ue)!==-1){Object(J.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Re=Object(X.k)(ge),Be={event:U,node:Object(D.b)(ue.props),dragNode:G.dragNode?Object(D.b)(G.dragNode.props):null,dragNodesKeys:he.slice(),dropPosition:Le+Number(Re[Re.length-1]),dropToGap:!1};Le!==0&&(Be.dropToGap=!0),Ze&&Ze(Be),G.dragNode=null},G.cleanDragState=function(){var U=G.state.dragging;U&&G.setState({dragging:!1})},G.onNodeClick=function(U,ue){var T=G.props.onClick;T&&T(U,ue)},G.onNodeDoubleClick=function(U,ue){var T=G.props.onDoubleClick;T&&T(U,ue)},G.onNodeSelect=function(U,ue){var T=G.state.selectedKeys,E=G.state.keyEntities,he=G.props,Le=he.onSelect,Ze=he.multiple,ke=ue.selected,Ue=ue.key,ge=!ke;ge?Ze?T=Object(X.a)(T,Ue):T=[Ue]:T=Object(X.b)(T,Ue);var Re=T.map(function(Be){var Qe=E[Be];return Qe?Qe.node:null}).filter(function(Be){return Be});G.setUncontrolledState({selectedKeys:T}),Le&&Le(T,{event:"select",selected:ge,node:ue,selectedNodes:Re,nativeEvent:U.nativeEvent})},G.onNodeCheck=function(U,ue,T){var E=G.state,he=E.keyEntities,Le=E.checkedKeys,Ze=E.halfCheckedKeys,ke=G.props,Ue=ke.checkStrictly,ge=ke.onCheck,Re=ue.key,Be,Qe={event:"check",node:ue,checked:T,nativeEvent:U.nativeEvent};if(Ue){var it=T?Object(X.a)(Le,Re):Object(X.b)(Le,Re),Xe=Object(X.b)(Ze,Re);Be={checked:it,halfChecked:Xe},Qe.checkedNodes=it.map(function(Mt){return he[Mt]}).filter(function(Mt){return Mt}).map(function(Mt){return Mt.node}),G.setUncontrolledState({checkedKeys:it})}else{var De=Object(v.a)([].concat(Object(me.a)(Le),[Re]),!0,he),Et=De.checkedKeys,pt=De.halfCheckedKeys;if(!T){var bt=new Set(Et);bt.delete(Re);var ct=Object(v.a)(Array.from(bt),{checked:!1,halfCheckedKeys:pt},he);Et=ct.checkedKeys,pt=ct.halfCheckedKeys}Be=Et,Qe.checkedNodes=[],Qe.checkedNodesPositions=[],Qe.halfCheckedKeys=pt,Et.forEach(function(Mt){var Ot=he[Mt];if(!Ot)return;var Ct=Ot.node,Pe=Ot.pos;Qe.checkedNodes.push(Ct),Qe.checkedNodesPositions.push({node:Ct,pos:Pe})}),G.setUncontrolledState({checkedKeys:Et},!1,{halfCheckedKeys:pt})}ge&&ge(Be,Qe)},G.onNodeLoad=function(U){return new Promise(function(ue){G.setState(function(T){var E=T.loadedKeys,he=E===void 0?[]:E,Le=T.loadingKeys,Ze=Le===void 0?[]:Le,ke=G.props,Ue=ke.loadData,ge=ke.onLoad,Re=U.key;if(!Ue||he.indexOf(Re)!==-1||Ze.indexOf(Re)!==-1)return{};var Be=Ue(U);return Be.then(function(){var Qe=G.state,it=Qe.loadedKeys,Xe=Qe.loadingKeys,De=Object(X.a)(it,Re),Et=Object(X.b)(Xe,Re);ge&&ge(De,{event:"load",node:U}),G.setUncontrolledState({loadedKeys:De}),G.setState({loadingKeys:Et}),ue()}),{loadingKeys:Object(X.a)(Ze,Re)}})})},G.onNodeMouseEnter=function(U,ue){var T=G.props.onMouseEnter;T&&T({event:U,node:ue})},G.onNodeMouseLeave=function(U,ue){var T=G.props.onMouseLeave;T&&T({event:U,node:ue})},G.onNodeContextMenu=function(U,ue){var T=G.props.onRightClick;T&&(U.preventDefault(),T({event:U,node:ue}))},G.onFocus=function(){var U=G.props.onFocus;G.setState({focused:!0}),U&&U.apply(void 0,arguments)},G.onBlur=function(){var U=G.props.onBlur;G.setState({focused:!1}),G.onActiveChange(null),U&&U.apply(void 0,arguments)},G.getTreeNodeRequiredProps=function(){var U=G.state,ue=U.expandedKeys,T=U.selectedKeys,E=U.loadedKeys,he=U.loadingKeys,Le=U.checkedKeys,Ze=U.halfCheckedKeys,ke=U.dragOverNodeKey,Ue=U.dropPosition,ge=U.keyEntities;return{expandedKeys:ue||[],selectedKeys:T||[],loadedKeys:E||[],loadingKeys:he||[],checkedKeys:Le||[],halfCheckedKeys:Ze||[],dragOverNodeKey:ke,dropPosition:Ue,keyEntities:ge}},G.setExpandedKeys=function(U){var ue=G.state.treeData,T=Object(D.d)(ue,U);G.setUncontrolledState({expandedKeys:U,flattenNodes:T},!0)},G.onNodeExpand=function(U,ue){var T=G.state.expandedKeys,E=G.state.listChanging,he=G.props,Le=he.onExpand,Ze=he.loadData,ke=ue.key,Ue=ue.expanded;if(E)return;var ge=T.indexOf(ke),Re=!Ue;if(Object(J.a)(Ue&&ge!==-1||!Ue&&ge===-1,"Expand state not sync with index check"),Re?T=Object(X.a)(T,ke):T=Object(X.b)(T,ke),G.setExpandedKeys(T),Le&&Le(T,{node:ue,expanded:Re,nativeEvent:U.nativeEvent}),Re&&Ze){var Be=G.onNodeLoad(ue);Be&&Be.then(function(){var Qe=Object(D.d)(G.state.treeData,T);G.setUncontrolledState({flattenNodes:Qe})})}},G.onListChangeStart=function(){G.setUncontrolledState({listChanging:!0})},G.onListChangeEnd=function(){setTimeout(function(){G.setUncontrolledState({listChanging:!1})})},G.onActiveChange=function(U){var ue=G.state.activeKey,T=G.props.onActiveChange;if(ue===U)return;G.setState({activeKey:U}),U!==null&&G.scrollTo({key:U}),T&&T(U)},G.getActiveItem=function(){var U=G.state,ue=U.activeKey,T=U.flattenNodes;return ue===null?null:T.find(function(E){var he=E.data.key;return he===ue})||null},G.offsetActiveKey=function(U){var ue=G.state,T=ue.flattenNodes,E=ue.activeKey,he=T.findIndex(function(ke){var Ue=ke.data.key;return Ue===E});he===-1&&U<0&&(he=T.length),he=(he+U+T.length)%T.length;var Le=T[he];if(Le){var Ze=Le.data.key;G.onActiveChange(Ze)}else G.onActiveChange(null)},G.onKeyDown=function(U){var ue=G.state,T=ue.activeKey,E=ue.expandedKeys,he=ue.checkedKeys,Le=G.props,Ze=Le.onKeyDown,ke=Le.checkable,Ue=Le.selectable;switch(U.which){case V.a.UP:{G.offsetActiveKey(-1),U.preventDefault();break}case V.a.DOWN:{G.offsetActiveKey(1),U.preventDefault();break}}var ge=G.getActiveItem();if(ge&&ge.data){var Re=G.getTreeNodeRequiredProps(),Be=ge.data.isLeaf===!1||!!(ge.data.children||[]).length,Qe=Object(D.b)(Object(Ae.a)(Object(Ae.a)({},Object(D.f)(T,Re)),{},{data:ge.data,active:!0}));switch(U.which){case V.a.LEFT:{Be&&E.includes(T)?G.onNodeExpand({},Qe):ge.parent&&G.onActiveChange(ge.parent.data.key),U.preventDefault();break}case V.a.RIGHT:{Be&&!E.includes(T)?G.onNodeExpand({},Qe):ge.children&&ge.children.length&&G.onActiveChange(ge.children[0].data.key),U.preventDefault();break}case V.a.ENTER:case V.a.SPACE:{ke&&!Qe.disabled&&Qe.checkable!==!1&&!Qe.disableCheckbox?G.onNodeCheck({},Qe,!he.includes(T)):!ke&&Ue&&!Qe.disabled&&Qe.selectable!==!1&&G.onNodeSelect({},Qe);break}}}Ze&&Ze(U)},G.setUncontrolledState=function(U){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(G.destroyed)return;var E=!1,he=!0,Le={};Object.keys(U).forEach(function(Ze){if(Ze in G.props){he=!1;return}E=!0,Le[Ze]=U[Ze]}),E&&(!ue||he)&&G.setState(Object(Ae.a)(Object(Ae.a)({},Le),T))},G.scrollTo=function(U){G.listRef.current.scrollTo(U)},G}return Object(xe.a)(Ee,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var U,ue=this.state,T=ue.focused,E=ue.flattenNodes,he=ue.keyEntities,Le=ue.dragging,Ze=ue.activeKey,ke=this.props,Ue=ke.prefixCls,ge=ke.className,Re=ke.style,Be=ke.showLine,Qe=ke.focusable,it=ke.tabIndex,Xe=it===void 0?0:it,De=ke.selectable,Et=ke.showIcon,pt=ke.icon,bt=ke.switcherIcon,ct=ke.draggable,Mt=ke.checkable,Ot=ke.checkStrictly,Ct=ke.disabled,Pe=ke.motion,Ut=ke.loadData,kt=ke.filterTreeNode,Ne=ke.height,Fe=ke.itemHeight,N=ke.virtual,H=ke.titleRender,K=ke.onContextMenu,C=Object(X.f)(this.props);return I.createElement(se.a.Provider,{value:{prefixCls:Ue,selectable:De,showIcon:Et,icon:pt,switcherIcon:bt,draggable:ct,checkable:Mt,checkStrictly:Ot,disabled:Ct,keyEntities:he,loadData:Ut,filterTreeNode:kt,titleRender:H,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}},I.createElement("div",{className:F()(Ue,ge,(U={},Object(ie.a)(U,"".concat(Ue,"-show-line"),Be),Object(ie.a)(U,"".concat(Ue,"-focused"),T),Object(ie.a)(U,"".concat(Ue,"-active-focused"),Ze!==null),U))},I.createElement(P,Object.assign({ref:this.listRef,prefixCls:Ue,style:Re,data:E,disabled:Ct,selectable:De,checkable:!!Mt,motion:Pe,dragging:Le,height:Ne,itemHeight:Fe,virtual:N,focusable:Qe,focused:T,tabIndex:Xe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:K},this.getTreeNodeRequiredProps(),C))))}}],[{key:"getDerivedStateFromProps",value:function(U,ue){var T=ue.prevProps,E={prevProps:U};function he(pt){return!T&&pt in U||T&&T[pt]!==U[pt]}var Le;if(he("treeData")?Le=U.treeData:he("children")&&(Object(J.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Le=Object(D.c)(U.children)),Le){E.treeData=Le;var Ze=Object(D.a)(Le);E.keyEntities=Object(Ae.a)(Object(ie.a)({},x,z),Ze.keyEntities)}var ke=E.keyEntities||ue.keyEntities;if(he("expandedKeys")||T&&he("autoExpandParent"))E.expandedKeys=U.autoExpandParent||!T&&U.defaultExpandParent?Object(X.e)(U.expandedKeys,ke):U.expandedKeys;else if(!T&&U.defaultExpandAll){var Ue=Object(Ae.a)({},ke);delete Ue[x],E.expandedKeys=Object.keys(Ue).map(function(pt){return Ue[pt].key})}else!T&&U.defaultExpandedKeys&&(E.expandedKeys=U.autoExpandParent||U.defaultExpandParent?Object(X.e)(U.defaultExpandedKeys,ke):U.defaultExpandedKeys);if(E.expandedKeys||delete E.expandedKeys,Le||E.expandedKeys){var ge=Object(D.d)(Le||ue.treeData,E.expandedKeys||ue.expandedKeys);E.flattenNodes=ge}if(U.selectable&&(he("selectedKeys")?E.selectedKeys=Object(X.d)(U.selectedKeys,U):!T&&U.defaultSelectedKeys&&(E.selectedKeys=Object(X.d)(U.defaultSelectedKeys,U))),U.checkable){var Re;if(he("checkedKeys")?Re=Object(X.j)(U.checkedKeys)||{}:!T&&U.defaultCheckedKeys?Re=Object(X.j)(U.defaultCheckedKeys)||{}:Le&&(Re=Object(X.j)(U.checkedKeys)||{checkedKeys:ue.checkedKeys,halfCheckedKeys:ue.halfCheckedKeys}),Re){var Be=Re,Qe=Be.checkedKeys,it=Qe===void 0?[]:Qe,Xe=Be.halfCheckedKeys,De=Xe===void 0?[]:Xe;if(!U.checkStrictly){var Et=Object(v.a)(it,!0,ke);it=Et.checkedKeys,De=Et.halfCheckedKeys}E.checkedKeys=it,E.halfCheckedKeys=De}}return he("loadedKeys")&&(E.loadedKeys=U.loadedKeys),E}}]),Ee}(I.Component);le.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:[]},le.TreeNode=de.a;var He=le,je=Ge.b=He},k4n4:function(at,Ge,p){"use strict";var ie=p("tJVT"),Ae=p("q1tI"),me=p.n(Ae),Me=p("e+RI"),xe=p.n(Me),Ce=p("FTkQ"),Y=p.n(Ce),I=p("E/GV"),V=p.n(I),J=function(F){var se=F.type,X=se===void 0?1:se,D=F.value,$=D===void 0?[]:D,L=F.onChange,te=F.disabled,_=te===void 0?!1:te,de=F.icon,_e=Object(Ae.useState)(),ce=Object(ie.a)(_e,2),M=ce[0],g=ce[1],ee=function(B){L(B)};return X===1?me.a.createElement("div",null,$==null?void 0:$.map(function(S,B){return me.a.createElement("div",{key:B,className:_?"".concat(xe.a.btn," ").concat(xe.a.btnDisabled):xe.a.btn},me.a.createElement("span",{className:xe.a.s1},S.name),me.a.createElement("img",{src:Y.a,className:xe.a.s2,onClick:function(){return ee(S.id)}}))})):me.a.createElement("div",null,$==null?void 0:$.map(function(S,B){return me.a.createElement("div",{key:B,className:xe.a.btn2},me.a.createElement("span",{className:xe.a.s1},me.a.createElement("img",{src:de||V.a}),S.name),me.a.createElement("img",{src:Y.a,className:xe.a.s2,onClick:function(){return ee(S.id)}}))}))};Ge.a=J},kSUc:function(at,Ge,p){},kqOp:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return J});var ie=p("0Owb"),Ae=p("fWQN"),me=p("mtLc"),Me=p("yKVA"),xe=p("879j"),Ce=p("q1tI"),Y=p.n(Ce),I=p("Ot1p"),V="\u2581",J=function(j){Object(Me.a)(se,j);var F=Object(xe.a)(se);function se(){var X;Object(Ae.a)(this,se);for(var D=arguments.length,$=new Array(D),L=0;L` "'(~:]+/,D=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,$=/^\s*\[[^\]]+?\]:.*$/,L=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 _(P,v,le){return v.f=v.inline=le,le(P,v)}function de(P,v,le){return v.f=v.block=le,le(P,v)}function _e(P){return!P||!/\S/.test(P.string)}function ce(P){if(P.linkTitle=!1,P.linkHref=!1,P.linkText=!1,P.em=!1,P.strong=!1,P.strikethrough=!1,P.quote=0,P.indentedCode=!1,P.f==g){var v=xe;if(!v){var le=ie.innerMode(Me,P.htmlState);v=le.mode.name=="xml"&&le.state.tagStart===null&&!le.state.context&&le.state.tokenize.isInText}v&&(P.f=x,P.block=M,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function M(P,v){var le=P.column()===v.indentation,He=_e(v.prevLine.stream),je=v.indentedCode,Je=v.prevLine.hr,we=v.list!==!1,Ee=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var G=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,we)){for(v.list=null;G=4&&(je||v.prevLine.fencedCodeEnd||v.prevLine.header||He))return P.skipToEnd(),v.indentedCode=!0,Y.code;if(P.eatSpace())return null;if(le&&v.indentation<=Ee&&(T=P.match(F))&&T[1].length<=6)return v.quote=0,v.header=T[1].length,v.thisLine.header=!0,me.highlightFormatting&&(v.formatting="header"),v.f=v.inline,S(v);if(v.indentation<=Ee&&P.eat(">"))return v.quote=le?1:v.quote+1,me.highlightFormatting&&(v.formatting="quote"),P.eatSpace(),S(v);if(!ue&&!v.setext&&le&&v.indentation<=Ee&&(T=P.match(J))){var E=T[1]?"ol":"ul";return v.indentation=G+P.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,me.taskLists&&P.match(j,!1)&&(v.taskList=!0),v.f=v.inline,me.highlightFormatting&&(v.formatting=["list","list-"+E]),S(v)}else{if(le&&v.indentation<=Ee&&(T=P.match(D,!0)))return v.quote=0,v.fencedEndRE=new RegExp(T[1]+"+ *$"),v.localMode=me.fencedCodeBlockHighlighting&&Ce(T[2]||me.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=ie.startState(v.localMode)),v.f=v.block=ee,me.highlightFormatting&&(v.formatting="code-block"),v.code=-1,S(v);if(v.setext||(!U||!we)&&!v.quote&&v.list===!1&&!v.code&&!ue&&!$.test(P.string)&&(T=P.lookAhead(1))&&(T=T.match(se)))return v.setext?(v.header=v.setext,v.setext=0,P.skipToEnd(),me.highlightFormatting&&(v.formatting="header")):(v.header=T[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,S(v);if(ue)return P.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,Y.hr;if(P.peek()==="[")return _(P,v,Z)}return _(P,v,v.inline)}function g(P,v){var le=Me.token(P,v.htmlState);if(!xe){var He=ie.innerMode(Me,v.htmlState);(He.mode.name=="xml"&&He.state.tagStart===null&&!He.state.context&&He.state.tokenize.isInText||v.md_inside&&P.current().indexOf(">")>-1)&&(v.f=x,v.block=M,v.htmlState=null)}return le}function ee(P,v){var le=v.listStack[v.listStack.length-1]||0,He=v.indentation=P.quote?v.push(Y.formatting+"-"+P.formatting[le]+"-"+P.quote):v.push("error"))}if(P.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(P.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(P.linkHref?v.push(Y.linkHref,"url"):(P.strong&&v.push(Y.strong),P.em&&v.push(Y.em),P.strikethrough&&v.push(Y.strikethrough),P.emoji&&v.push(Y.emoji),P.linkText&&v.push(Y.linkText),P.code&&v.push(Y.code),P.image&&v.push(Y.image),P.imageAltText&&v.push(Y.imageAltText,"link"),P.imageMarker&&v.push(Y.imageMarker)),P.header&&v.push(Y.header,Y.header+"-"+P.header),P.quote&&(v.push(Y.quote),!me.maxBlockquoteDepth||me.maxBlockquoteDepth>=P.quote?v.push(Y.quote+"-"+P.quote):v.push(Y.quote+"-"+me.maxBlockquoteDepth)),P.list!==!1){var He=(P.listStack.length-1)%3;He?He===1?v.push(Y.list2):v.push(Y.list3):v.push(Y.list1)}return P.trailingSpaceNewLine?v.push("trailing-space-new-line"):P.trailingSpace&&v.push("trailing-space-"+(P.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function B(P,v){return P.match(X,!0)?S(v):void 0}function x(P,v){var le=v.text(P,v);if(typeof le!="undefined")return le;if(v.list)return v.list=null,S(v);if(v.taskList){var He=P.match(j,!0)[1]===" ";return He?v.taskOpen=!0:v.taskClosed=!0,me.highlightFormatting&&(v.formatting="task"),v.taskList=!1,S(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&P.match(/^#+$/,!0))return me.highlightFormatting&&(v.formatting="header"),S(v);var je=P.next();if(v.linkTitle){v.linkTitle=!1;var Je=je;je==="("&&(Je=")"),Je=(Je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var we="^\\s*(?:[^"+Je+"\\\\]+|\\\\\\\\|\\\\.)"+Je;if(P.match(new RegExp(we),!0))return Y.linkHref}if(je==="`"){var Ee=v.formatting;me.highlightFormatting&&(v.formatting="code"),P.eatWhile("`");var G=P.current().length;if(v.code==0&&(!v.quote||G==1))return v.code=G,S(v);if(G==v.code){var U=S(v);return v.code=0,U}else return v.formatting=Ee,S(v)}else if(v.code)return S(v);if(je==="\\"&&(P.next(),me.highlightFormatting)){var ue=S(v),T=Y.formatting+"-escape";return ue?ue+" "+T:T}if(je==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,me.highlightFormatting&&(v.formatting="image"),S(v);if(je==="["&&v.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,me.highlightFormatting&&(v.formatting="image"),S(v);if(je==="]"&&v.imageAltText){me.highlightFormatting&&(v.formatting="image");var ue=S(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=z,ue}if(je==="["&&!v.image)return v.linkText&&P.match(/^.*?\]/)||(v.linkText=!0,me.highlightFormatting&&(v.formatting="link")),S(v);if(je==="]"&&v.linkText){me.highlightFormatting&&(v.formatting="link");var ue=S(v);return v.linkText=!1,v.inline=v.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?z:x,ue}if(je==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=b,me.highlightFormatting&&(v.formatting="link");var ue=S(v);return ue?ue+=" ":ue="",ue+Y.linkInline}if(je==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=b,me.highlightFormatting&&(v.formatting="link");var ue=S(v);return ue?ue+=" ":ue="",ue+Y.linkEmail}if(me.xml&&je==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var E=P.string.indexOf(">",P.pos);if(E!=-1){var he=P.string.substring(P.start,E);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(he)&&(v.md_inside=!0)}return P.backUp(1),v.htmlState=ie.startState(Me),de(P,v,g)}if(me.xml&&je==="<"&&P.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(je==="*"||je==="_"){for(var Le=1,Ze=P.pos==1?" ":P.string.charAt(P.pos-2);Le<3&&P.eat(je);)Le++;var ke=P.peek()||" ",Ue=!/\s/.test(ke)&&(!L.test(ke)||/\s/.test(Ze)||L.test(Ze)),ge=!/\s/.test(Ze)&&(!L.test(Ze)||/\s/.test(ke)||L.test(ke)),Re=null,Be=null;if(Le%2&&(!v.em&&Ue&&(je==="*"||!ge||L.test(Ze))?Re=!0:v.em==je&&ge&&(je==="*"||!Ue||L.test(ke))&&(Re=!1)),Le>1&&(!v.strong&&Ue&&(je==="*"||!ge||L.test(Ze))?Be=!0:v.strong==je&&ge&&(je==="*"||!Ue||L.test(ke))&&(Be=!1)),Be!=null||Re!=null){me.highlightFormatting&&(v.formatting=Re==null?"strong":Be==null?"em":"strong em"),Re===!0&&(v.em=je),Be===!0&&(v.strong=je);var U=S(v);return Re===!1&&(v.em=!1),Be===!1&&(v.strong=!1),U}}else if(je===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return S(v);P.backUp(1)}if(me.strikethrough){if(je==="~"&&P.eatWhile(je)){if(v.strikethrough){me.highlightFormatting&&(v.formatting="strikethrough");var U=S(v);return v.strikethrough=!1,U}else if(P.match(/^[^\s]/,!1))return v.strikethrough=!0,me.highlightFormatting&&(v.formatting="strikethrough"),S(v)}else if(je===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return S(v);P.backUp(2)}}if(me.emoji&&je===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,me.highlightFormatting&&(v.formatting="emoji");var Qe=S(v);return v.emoji=!1,Qe}return je===" "&&(P.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),S(v)}function b(P,v){var le=P.next();if(le===">"){v.f=v.inline=x,me.highlightFormatting&&(v.formatting="link");var He=S(v);return He?He+=" ":He="",He+Y.linkInline}return P.match(/^[^>]+/,!0),Y.linkInline}function z(P,v){if(P.eatSpace())return null;var le=P.next();return le==="("||le==="["?(v.f=v.inline=k(le==="("?")":"]"),me.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,S(v)):"error"}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function k(P){return function(v,le){var He=v.next();if(He===P){le.f=le.inline=x,me.highlightFormatting&&(le.formatting="link-string");var je=S(le);return le.linkHref=!1,je}return v.match(A[P]),le.linkHref=!0,S(le)}}function Z(P,v){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=be,P.next(),me.highlightFormatting&&(v.formatting="link"),v.linkText=!0,S(v)):_(P,v,x)}function be(P,v){if(P.match(/^\]:/,!0)){v.f=v.inline=ae,me.highlightFormatting&&(v.formatting="link");var le=S(v);return v.linkText=!1,le}return P.match(/^([^\]\\]|\\.)+/,!0),Y.linkText}function ae(P,v){return P.eatSpace()?null:(P.match(/^[^\s]+/,!0),P.peek()===void 0?v.linkTitle=!0:P.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=x,Y.linkHref+" url")}var Te={startState:function(){return{f:M,prevLine:{stream:null},thisLine:{stream:null},block:M,htmlState:null,indentation:0,inline:x,text:B,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(P){return{f:P.f,prevLine:P.prevLine,thisLine:P.thisLine,block:P.block,htmlState:P.htmlState&&ie.copyState(Me,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?ie.copyState(P.localMode,P.localState):null,inline:P.inline,text:P.text,formatting:!1,linkText:P.linkText,linkTitle:P.linkTitle,linkHref:P.linkHref,code:P.code,em:P.em,strong:P.strong,strikethrough:P.strikethrough,emoji:P.emoji,header:P.header,setext:P.setext,hr:P.hr,taskList:P.taskList,list:P.list,listStack:P.listStack.slice(0),quote:P.quote,indentedCode:P.indentedCode,trailingSpace:P.trailingSpace,trailingSpaceNewLine:P.trailingSpaceNewLine,md_inside:P.md_inside,fencedEndRE:P.fencedEndRE}},token:function(P,v){if(v.formatting=!1,P!=v.thisLine.stream){if(v.header=0,v.hr=!1,P.match(/^\s*$/,!0))return ce(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:P},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=g)){var le=P.match(/^\s*/,!0)[0].replace(/\t/g,te).length;if(v.indentation=le,v.indentationDiff=null,le>0)return null}}return v.f(P,v)},innerMode:function(P){return P.block==g?{state:P.htmlState,mode:Me}:P.localState?{state:P.localState,mode:P.localMode}:{state:P,mode:Te}},indent:function(P,v,le){return P.block==g&&Me.indent?Me.indent(P.htmlState,v,le):P.localState&&P.localMode.indent?P.localMode.indent(P.localState,v,le):ie.Pass},blankLine:ce,getType:S,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Te},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},lnNo:function(at,Ge,p){at.exports=p.p+"static/up.69f3b3fd.svg"},m3fD:function(at,Ge,p){at.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"}},osHv:function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";var Ae=ie.Pos;function me(L,te){return L.line-te.line||L.ch-te.ch}var Me="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",xe=Me+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ce=new RegExp("<(/?)(["+Me+"]["+xe+"]*)","g");function Y(L,te,_,de){this.line=te,this.ch=_,this.cm=L,this.text=L.getLine(te),this.min=de?Math.max(de.from,L.firstLine()):L.firstLine(),this.max=de?Math.min(de.to-1,L.lastLine()):L.lastLine()}function I(L,te){var _=L.cm.getTokenTypeAt(Ae(L.line,te));return _&&/\btag\b/.test(_)}function V(L){return L.line>=L.max?void 0:(L.ch=0,L.text=L.cm.getLine(++L.line),!0)}function J(L){return L.line<=L.min?void 0:(L.text=L.cm.getLine(--L.line),L.ch=L.text.length,!0)}function j(L){for(;;){var te=L.text.indexOf(">",L.ch);if(te==-1){if(V(L))continue;return}if(!I(L,te+1)){L.ch=te+1;continue}var _=L.text.lastIndexOf("/",te),de=_>-1&&!/\S/.test(L.text.slice(_+1,te));return L.ch=te+1,de?"selfClose":"regular"}}function F(L){for(;;){var te=L.ch?L.text.lastIndexOf("<",L.ch-1):-1;if(te==-1){if(J(L))continue;return}if(!I(L,te+1)){L.ch=te;continue}Ce.lastIndex=te,L.ch=te;var _=Ce.exec(L.text);if(_&&_.index==te)return _}}function se(L){for(;;){Ce.lastIndex=L.ch;var te=Ce.exec(L.text);if(!te){if(V(L))continue;return}if(!I(L,te.index+1)){L.ch=te.index+1;continue}return L.ch=te.index+te[0].length,te}}function X(L){for(;;){var te=L.ch?L.text.lastIndexOf(">",L.ch-1):-1;if(te==-1){if(J(L))continue;return}if(!I(L,te+1)){L.ch=te;continue}var _=L.text.lastIndexOf("/",te),de=_>-1&&!/\S/.test(L.text.slice(_+1,te));return L.ch=te+1,de?"selfClose":"regular"}}function D(L,te){for(var _=[];;){var de=se(L),_e,ce=L.line,M=L.ch-(de?de[0].length:0);if(!de||!(_e=j(L)))return;if(_e=="selfClose")continue;if(de[1]){for(var g=_.length-1;g>=0;--g)if(_[g]==de[2]){_.length=g;break}if(g<0&&(!te||te==de[2]))return{tag:de[2],from:Ae(ce,M),to:Ae(L.line,L.ch)}}else _.push(de[2])}}function $(L,te){for(var _=[];;){var de=X(L);if(!de)return;if(de=="selfClose"){F(L);continue}var _e=L.line,ce=L.ch,M=F(L);if(!M)return;if(M[1])_.push(M[2]);else{for(var g=_.length-1;g>=0;--g)if(_[g]==M[2]){_.length=g;break}if(g<0&&(!te||te==M[2]))return{tag:M[2],from:Ae(L.line,L.ch),to:Ae(_e,ce)}}}}ie.registerHelper("fold","xml",function(L,te){for(var _=new Y(L,te.line,0);;){var de=se(_);if(!de||_.line!=te.line)return;var _e=j(_);if(!_e)return;if(!de[1]&&_e!="selfClose"){var ce=Ae(_.line,_.ch),M=D(_,de[2]);return M&&me(M.from,ce)>0?{from:ce,to:M.from}:null}}}),ie.findMatchingTag=function(L,te,_){var de=new Y(L,te.line,te.ch,_);if(de.text.indexOf(">")==-1&&de.text.indexOf("<")==-1)return;var _e=j(de),ce=_e&&Ae(de.line,de.ch),M=_e&&F(de);if(!_e||!M||me(de,te)>0)return;var g={from:Ae(de.line,de.ch),to:ce,tag:M[2]};return _e=="selfClose"?{open:g,close:null,at:"open"}:M[1]?{open:$(de,M[2]),close:g,at:"close"}:(de=new Y(L,ce.line,ce.ch,_),{open:g,close:D(de,M[2]),at:"open"})},ie.findEnclosingTag=function(L,te,_,de){for(var _e=new Y(L,te.line,te.ch,_);;){var ce=$(_e,de);if(!ce)break;var M=new Y(L,te.line,te.ch,_),g=D(M,ce.tag);if(g)return{open:ce,close:g}}},ie.scanForClosingTag=function(L,te,_,de){var _e=new Y(L,te.line,te.ch,de?{from:0,to:de}:null);return D(_e,_)}})},p5ED:function(at,Ge,p){"use strict";var ie=p("+L6B"),Ae=p("2/Rp"),me=p("5Dmo"),Me=p("3S7+"),xe=p("k1fw"),Ce=p("9og8"),Y=p("tJVT"),I=p("WmNS"),V=p.n(I),J=p("q1tI"),j=p.n(J),F=p("vHTk"),se=p.n(F),X=p("yEEn"),D=p("ZW9T"),$=p("1vsH"),L=p("V0Rq"),te=p("m3rI"),_=function(_e){var ce=_e.name,M=_e.data,g=_e.theme,ee=_e.type,S=_e.filename,B=_e.monacoEditor,x=_e.className,b=_e.style,z=_e.close,A=_e.onClose,k=_e.hasMask,Z=_e.otherData,be=Z===void 0?{}:Z,ae=Object(J.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Te=Object(Y.a)(ae,2),P=Te[0],v=Te[1],le=Object(J.useState)(""),He=Object(Y.a)(le,2),je=He[0],Je=He[1],we=Object(J.useState)(),Ee=Object(Y.a)(we,2),G=Ee[0],U=Ee[1],ue=window.ENV==="build"?"/react/build/office.html":"/office.html",T,E=1024*1024,he=10*E,Le=Object(J.useRef)();ee==="office"&&(T=Object($.R)(M).filesize,T>he&&(ee="other")),S&&(B.filename=S),Object(J.useEffect)(function(){var ge,Re,Be=(ge=document.cookie)===null||ge===void 0||((Re=ge.replace(/\s/g,""))===null||Re===void 0)?void 0:Re.split(";");Be==null||Be.map(function(Qe){var it=Qe.split("=");it[0]==="_educoder_session"&&Je(it[1])})},[]),Object(J.useEffect)(function(){ee==="office"&&Ze()},[ee]);var Ze=function(){var ge=Object(Ce.a)(V.a.mark(function Re(){var Be,Qe,it;return V.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return console.log("data:",M),Be=M,M.startsWith("http")||(Be=location.origin+Be),Qe=new URL(Be).pathname.split("/").pop(),De.next=6,Object(L.U)({attachment_id:Qe});case 6:it=De.sent,U(it);case 8:case"end":return De.stop()}},Re)}));return function(){return ge.apply(this,arguments)}}(),ke=function(){if(M.startsWith("http")||M.startsWith("/api")||M.startsWith("blob:")){Ue();return}Object($.x)(S||"educoder",M,S||"educoder")},Ue=function(){Object($.v)(S||"educoder",decodeURIComponent(M))};return j.a.createElement("div",{style:Object(xe.a)({},b||{}),className:"".concat(k&&se.a.bgBlack," ").concat(ee?se.a.wrp:"hide")},z&&j.a.createElement("div",{className:se.a.close,ref:Le},j.a.createElement(Me.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Le.current}},j.a.createElement("span",{onClick:Ue},j.a.createElement("i",{className:"icon-quxiaozhiding"}))),j.a.createElement(Me.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Le.current}},j.a.createElement("span",{className:"",onClick:function(){A(),U(null)}},j.a.createElement("i",{className:"icon-guanbi1"})))),j.a.createElement("div",{className:"".concat(se.a[x]," ").concat(x," ").concat(se.a.monaco," ").concat(ee==="txt"?"show":"hide")},ee==="txt"&&j.a.createElement(D.b,B)),ee==="audio"&&j.a.createElement("audio",{src:"".concat((M==null?void 0:M.indexOf("http://"))>-1||(M==null?void 0:M.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(M),autoPlay:!0}),ee==="video"&&j.a.createElement(j.a.Fragment,null,(M==null?void 0:M.indexOf("/api"))>-1?j.a.createElement("video",{controls:!0,src:"".concat(M),autoPlay:!0}):j.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(M),autoPlay:!0})),ee==="office"&&G&&j.a.createElement("iframe",{src:"".concat(ue,"?key=").concat(G.key,"&url=").concat(te.a.API_SERVER+G.url,"&callbackUrl=").concat(te.a.API_SERVER+G.callbackUrl,"&fileType=").concat(G.fileType,"&title=").concat(G.title,"&model=view")}),(ee==="xlsx"||ee==="doc"||ee==="pptx"||ee==="docx")&&j.a.createElement("iframe",{src:"".concat(ue,"?key=").concat(be.key,"&url=").concat(te.a.API_SERVER+be.url,"&callbackUrl=").concat(te.a.API_SERVER+be.callbackUrl,"&fileType=").concat(be.fileType,"&title=").concat(be.title,"&model=").concat(be.model)}),ee==="html"&&j.a.createElement("iframe",{src:M+"&disposition=inline"}),ee==="pdf"&&j.a.createElement("embed",{className:se.a.embed,src:M,type:"application/pdf"}),ee==="image"&&j.a.createElement("img",{src:"".concat((M==null?void 0:M.indexOf("http://"))>-1||(M==null?void 0:M.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(M)}),ee==="other"&&j.a.createElement("div",null,j.a.createElement(Ae.a,{type:"primary",size:"large",onClick:ke},j.a.createElement(X.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),ee==="download"&&j.a.createElement(Ae.a,{type:"primary",size:"large",onClick:ke},j.a.createElement(X.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Ge.a=_},"p77/":function(at,Ge,p){},"rAM+":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return Ae});var ie=p("Qw5x");function Ae(me,Me){var xe;if(typeof Symbol=="undefined"||me[Symbol.iterator]==null){if(Array.isArray(me)||(xe=Object(ie.a)(me))||Me&&me&&typeof me.length=="number"){xe&&(me=xe);var Ce=0,Y=function(){};return{s:Y,n:function(){return Ce>=me.length?{done:!0}:{done:!1,value:me[Ce++]}},e:function(F){throw F},f:Y}}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 I=!0,V=!1,J;return{s:function(){xe=me[Symbol.iterator]()},n:function(){var F=xe.next();return I=F.done,F},e:function(F){V=!0,J=F},f:function(){try{!I&&xe.return!=null&&xe.return()}finally{if(V)throw J}}}}},rUJ1:function(at,Ge){const p=/[&<>"']/,ie=/[&<>"']/g,Ae=/[<>"']|&(?!#?\w+;)/,me=/[<>"']|&(?!#?\w+;)/g,Me={"&":"&","<":"<",">":">",'"':""","'":"'"},xe=ee=>Me[ee];function Ce(ee,S){if(S){if(p.test(ee))return ee.replace(ie,xe)}else if(Ae.test(ee))return ee.replace(me,xe);return ee}const Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(ee){return ee.replace(Y,(S,B)=>(B=B.toLowerCase(),B==="colon"?":":B.charAt(0)==="#"?B.charAt(1)==="x"?String.fromCharCode(parseInt(B.substring(2),16)):String.fromCharCode(+B.substring(1)):""))}const V=/(^|[^\[])\^/g;function J(ee,S){ee=ee.source||ee,S=S||"";const B={replace:(x,b)=>(b=b.source||b,b=b.replace(V,"$1"),ee=ee.replace(x,b),B),getRegex:()=>new RegExp(ee,S)};return B}const j=/[^\w:]/g,F=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function se(ee,S,B){if(ee){let x;try{x=decodeURIComponent(I(B)).replace(j,"").toLowerCase()}catch(b){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}S&&!F.test(B)&&(B=te(S,B));try{B=encodeURI(B).replace(/%25/g,"%")}catch(x){return null}return B}const X={},D=/^[^:]+:\/*[^/]*$/,$=/^([^:]+:)[\s\S]*$/,L=/^([^:]+:\/*[^/]*)[\s\S]*$/;function te(ee,S){X[" "+ee]||(D.test(ee)?X[" "+ee]=ee+"/":X[" "+ee]=ce(ee,"/",!0)),ee=X[" "+ee];const B=ee.indexOf(":")===-1;return S.substring(0,2)==="//"?B?S:ee.replace($,"$1")+S:S.charAt(0)==="/"?B?S:ee.replace(L,"$1")+S:ee+S}const _={exec:function(){}};function de(ee){let S=1,B,x;for(;S{let Z=!1,be=A;for(;--be>=0&&k[be]==="\\";)Z=!Z;return Z?"|":" |"}),x=B.split(/ \|/);let b=0;if(x.length>S)x.splice(S);else for(;x.length20?(X.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:nt,analysis:jt,standard_answers:ut,is_ordered:dt}):(X.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Lt=function(){Ke(""),ot(""),It([]),Gt(!1)},un=function(ut,mn,En){var On=Ht.slice();if(mn&&On.splice(ut,mn),En)for(var Bn=0;Bn1&&g.a.createElement("span",null,g.a.createElement(je.a,{checked:dt,onChange:function(ut){return Gt(ut.target.checked)},className:"".concat(E.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),g.a.createElement("span",{className:"".concat(E.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:E.a.titleWrap},g.a.createElement("span",{className:E.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:jt,onChange:function(ut){return ot(ut)}}))},Ze=Object(A.a)(function(Fe){var N=Fe.loading,H=Fe.globalSetting;return{globalSetting:H,loading:N.effects}},null,null,{forwardRef:!0})(Object(M.forwardRef)(Le)),ke=p("7Kak"),Ue=p("9yH6"),ge=["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"],Re=function(N,H){var K=N.globalSetting,C=N.loading,w=N.editData,O=N.dispatch,R=N.onRef,re=R===void 0?function(){}:R,ne=N.isEdit,pe=Object(we.a)(N,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),nt=Object(M.useState)(),Ke=Object(de.a)(nt,2),Se=Ke[0],gt=Ke[1],jt=Object(M.useState)(""),ot=Object(de.a)(jt,2),Xt=ot[0],tt=ot[1],Ht=Object(M.useState)(""),It=Object(de.a)(Ht,2),Rt=It[0],Jt=It[1];Object(M.useEffect)(function(){if(!w||!ne)return;tt(w==null?void 0:w.name),Jt(w==null?void 0:w.analysis);var lt=w==null?void 0:w.choices.find(function(qe){return qe.is_answer});gt(lt.choice_text==="\u6B63\u786E"?"0":"1")},[w]),Object(M.useImperativeHandle)(H,function(){return{onSave:Ft,Clear:We}});var Ft=function(){if(!Xt)return X.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!Se)return X.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var qe=[{choice_text:"\u6B63\u786E",is_answer:Se==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Se==="1"?1:0}];return{name:Xt,choices:qe,analysis:Rt}},We=function(){tt(""),Jt(""),gt("")};return g.a.createElement("section",{className:E.a.wrap},g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xt,onChange:function(qe){return tt(qe)}}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:E.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),g.a.createElement(Ue.a.Group,{buttonStyle:"solid",value:Se,onChange:function(qe){return gt(qe.target.value)}},g.a.createElement(Ue.a.Button,{value:"0",className:"".concat(E.a.radio," mr40")},"\u6B63\u786E"),g.a.createElement(Ue.a.Button,{value:"1",className:E.a.radio},"\u9519\u8BEF")),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Rt,onChange:function(qe){return Jt(qe)}}))},Be=Object(A.a)(function(Fe){var N=Fe.loading,H=Fe.globalSetting;return{globalSetting:H,loading:N.effects}},null,null,{forwardRef:!0})(Object(M.forwardRef)(Re)),Qe=["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"],it=function(N,H){var K=N.editData,C=N.globalSetting,w=N.loading,O=N.dispatch,R=N.onRef,re=R===void 0?function(){}:R,ne=N.isEdit,pe=Object(we.a)(N,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),nt=Object(M.useState)([]),Ke=Object(de.a)(nt,2),Se=Ke[0],gt=Ke[1],jt=Object(M.useState)(),ot=Object(de.a)(jt,2),Xt=ot[0],tt=ot[1],Ht=Object(M.useState)([]),It=Object(de.a)(Ht,2),Rt=It[0],Jt=It[1],Ft=Object(M.useState)(""),We=Object(de.a)(Ft,2),lt=We[0],qe=We[1],dt=Object(M.useState)(""),Gt=Object(de.a)(dt,2),Kt=Gt[0],on=Gt[1];Object(M.useEffect)(function(){gt(["","","",""])},[]),Object(M.useEffect)(function(){if(!K||!ne)return;qe(K==null?void 0:K.name),on(K==null?void 0:K.analysis),gt(K==null?void 0:K.choices.map(function(Lt){return Lt.choice_text}));var tn=[];K==null||K.choices.map(function(Lt,un){Lt.is_answer&&tn.push(un)}),Jt(tn)},[K]),Object(M.useImperativeHandle)(H,function(){return{onSave:Vt,Clear:_t}});var Vt=function(){if(!lt)return X.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Lt=Se.findIndex(function(zt){return!zt});if(Lt>-1)return X.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Qe[Lt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!Rt.length)return X.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(Rt.length<2)return X.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var un=Se.map(function(zt,dn){return{choice_text:zt,is_answer:Rt.includes(dn)?1:0}});return{name:lt,choices:un,analysis:Kt}},_t=function(){gt(["","","",""]),qe(""),on(""),Jt("")};return g.a.createElement("section",{className:E.a.wrap},g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:lt,onChange:function(Lt){return qe(Lt)}}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:E.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Se.map(function(tn,Lt){return g.a.createElement("div",{className:E.a.choiceWrap,key:Lt},g.a.createElement(Me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(E.a.answer," ").concat(Rt.includes(Lt)?E.a.activeAnswer:""),onClick:function(){Rt.includes(Lt)?Jt(Rt.filter(function(zt){return zt!==Lt})):Jt([].concat(Object(Je.a)(Rt),[Lt]))}},Qe[Lt])),g.a.createElement("div",{className:E.a.editorWrap},Xt===Lt?g.a.createElement(Ee.a,{id:"single-question-option-".concat(Lt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tn,onChange:function(zt){Se[Lt]=zt,gt(Se)}}):g.a.createElement("div",{className:E.a.htmlWrap,onClick:function(){return tt(Lt)}},g.a.createElement(b.a,{value:tn}))),Lt>1&&g.a.createElement(Me.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(E.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){gt(Se.filter(function(zt,dn){return dn!==Lt})),Rt.includes(Lt)?Jt(Rt.filter(function(zt){return zt!==Lt})):Jt([].concat(Object(Je.a)(Rt),[Lt]))}})),Lt<7&&Lt===Se.length-1&&g.a.createElement(Me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(E.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return gt([].concat(Object(Je.a)(Se),[""]))}})))}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Kt,onChange:function(Lt){return on(Lt)}}))},Xe=Object(A.a)(function(Fe){var N=Fe.loading,H=Fe.globalSetting;return{globalSetting:H,loading:N.effects}},null,null,{forwardRef:!0})(Object(M.forwardRef)(it)),De=["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"],Et=function(N,H){var K=N.editData,C=N.globalSetting,w=N.loading,O=N.dispatch,R=N.onRef,re=R===void 0?function(){}:R,ne=N.isEdit,pe=Object(we.a)(N,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),nt=Object(M.useState)([]),Ke=Object(de.a)(nt,2),Se=Ke[0],gt=Ke[1],jt=Object(M.useState)(),ot=Object(de.a)(jt,2),Xt=ot[0],tt=ot[1],Ht=Object(M.useState)(),It=Object(de.a)(Ht,2),Rt=It[0],Jt=It[1],Ft=Object(M.useState)(""),We=Object(de.a)(Ft,2),lt=We[0],qe=We[1],dt=Object(M.useState)(""),Gt=Object(de.a)(dt,2),Kt=Gt[0],on=Gt[1];Object(M.useEffect)(function(){gt(["","","",""])},[]),Object(M.useEffect)(function(){if(!K||!ne)return;qe(K==null?void 0:K.name),on(K==null?void 0:K.analysis),gt(K==null?void 0:K.choices.map(function(tn){return tn.choice_text})),Jt(K==null?void 0:K.choices.findIndex(function(tn){return tn.is_answer}))},[K]),Object(M.useImperativeHandle)(H,function(){return{onSave:Vt,Clear:_t}});var Vt=function(){if(!lt)return X.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Lt=Se.findIndex(function(zt){return!zt});if(Lt>-1)return X.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(De[Lt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",Rt),!(typeof Rt=="number"))return X.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 un=Se.map(function(zt,dn){return{choice_text:zt,is_answer:Rt===dn?1:0}});return{name:lt,choices:un,analysis:Kt}},_t=function(){gt(["","","",""]),qe(""),on(""),Jt("")};return g.a.createElement("section",{className:E.a.wrap},g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:lt,onChange:function(Lt){return qe(Lt)}}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:E.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Se.map(function(tn,Lt){return g.a.createElement("div",{className:E.a.choiceWrap,key:Lt},g.a.createElement(Me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(E.a.answer," ").concat(Rt===Lt?E.a.activeAnswer:""),onClick:function(){return Jt(Lt)}},De[Lt])),g.a.createElement("div",{className:E.a.editorWrap},Xt===Lt?g.a.createElement(Ee.a,{id:"single-question-option-".concat(Lt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tn,onChange:function(zt){Se[Lt]=zt,gt(Se)}}):g.a.createElement("div",{className:E.a.htmlWrap,onClick:function(){return tt(Lt)}},g.a.createElement(b.a,{value:tn}))),Lt>1&&g.a.createElement(Me.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(E.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){gt(Se.filter(function(zt,dn){return dn!==Lt})),Lt===Rt&&Jt(null)}})),Lt<7&&Lt===Se.length-1&&g.a.createElement(Me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(E.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return gt([].concat(Object(Je.a)(Se),[""]))}})))}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Kt,onChange:function(Lt){return on(Lt)}}))},pt=Object(A.a)(function(Fe){var N=Fe.loading,H=Fe.globalSetting;return{globalSetting:H,loading:N.effects}},null,null,{forwardRef:!0})(Object(M.forwardRef)(Et)),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"],ct=function(N,H){var K=N.editData,C=N.globalSetting,w=N.loading,O=N.dispatch,R=N.onRef,re=R===void 0?function(){}:R,ne=N.isEdit,pe=Object(we.a)(N,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),nt=Object(M.useState)(""),Ke=Object(de.a)(nt,2),Se=Ke[0],gt=Ke[1],jt=Object(M.useState)(""),ot=Object(de.a)(jt,2),Xt=ot[0],tt=ot[1],Ht=Object(M.useState)(""),It=Object(de.a)(Ht,2),Rt=It[0],Jt=It[1];Object(M.useEffect)(function(){var lt;if(!K||!ne)return;gt(K==null?void 0:K.name),tt(K==null?void 0:K.analysis),Jt(K==null||((lt=K.answer_texts)===null||lt===void 0)?void 0:lt[0])},[K]),Object(M.useImperativeHandle)(H,function(){return{onSave:Ft,Clear:We}});var Ft=function(){return Se?Rt?{name:Se,answer_texts:[Rt],analysis:Xt}:(X.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(X.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},We=function(){gt(""),tt(""),Jt("")};return g.a.createElement("section",{className:E.a.wrap},g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Se,onChange:function(qe){return gt(qe)}}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Rt,onChange:function(qe){return Jt(qe)}}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Xt,onChange:function(qe){return tt(qe)}}))},Mt=Object(A.a)(function(Fe){var N=Fe.loading,H=Fe.globalSetting;return{globalSetting:H,loading:N.effects}},null,null,{forwardRef:!0})(Object(M.forwardRef)(ct)),Ot=p("k1fw"),Ct=["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(N,H){var K=N.globalSetting,C=N.loading,w=N.dispatch,O=N.editData,R=N.onRef,re=R===void 0?function(){}:R,ne=N.isEdit,pe=Object(we.a)(N,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),nt=Object(M.useState)(""),Ke=Object(de.a)(nt,2),Se=Ke[0],gt=Ke[1],jt=Object(M.useState)([]),ot=Object(de.a)(jt,2),Xt=ot[0],tt=ot[1];console.log(Xt),Object(M.useEffect)(function(){var Ft;if(!O||!ne)return;gt(O==null?void 0:O.name);var We=O==null||((Ft=O.sub_item_banks)===null||Ft===void 0)?void 0:Ft.map(function(lt){var qe,dt,Gt;return Object(Ot.a)(Object(Ot.a)({},lt),{},{id:lt.id,open:!1,qusList:lt==null||((qe=lt.choices)===null||qe===void 0)?void 0:qe.map(function(Kt){return Kt.choice_text}),activeQusEditor:null,qusAnswer:(dt=[lt==null||((Gt=lt.choices)===null||Gt===void 0)?void 0:Gt.findIndex(function(Kt){return Kt.is_answer})])===null||dt===void 0?void 0:dt.filter(function(Kt){return Kt!==-1})})});tt(We)},[O]),Object(M.useImperativeHandle)(H,function(){return{onSave:Ht,Clear:It}});var Ht=function(){if(!Se)return X.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Xt.length===0)return X.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var We=0;We-1)return X.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(We+1,"\u5C0F\u9898").concat(Ct[dt],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(qe!=null&&qe.qusAnswer.length))return X.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(We+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Gt=Xt.map(function(Kt){return{id:Kt.id>1?Kt.id:null,name:Kt.name,item_type:Kt.item_type,analysis:Kt.analysis,choices:Kt.qusList.map(function(on,Vt){return{choice_text:on,is_answer:Kt.qusAnswer[0]===Vt?1:0}})}});return{name:Se,sub_item_banks:Gt}},It=function(){gt(""),tt([])},Rt=function(){var We={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};tt(Xt.concat(We))},Jt=function(We,lt,qe){var dt=Object(P.cloneDeep)(Xt);if(We==="open"&&(dt[lt].open=!dt[lt].open),We==="delete"&&dt.splice(lt,1),We==="value"&&(dt[lt].name=qe),We==="answer"&&(dt[lt].qusAnswer=[qe]),We==="edit"&&(dt[lt].activeQusEditor=qe),We==="details"&&(dt[lt].qusList[dt[lt].activeQusEditor]=qe),We==="addQus"&&(dt[lt].qusList=dt[lt].qusList.concat("")),We==="deleteQus"){var Gt;dt[lt].qusList=dt[lt].qusList.filter(function(Kt,on){return on!==qe}),dt[lt].qusAnswer=(Gt=dt[lt].qusAnswer)===null||Gt===void 0?void 0:Gt.filter(function(Kt){return Kt!==qe})}We==="analysis"&&(dt[lt].analysis=qe),tt(dt)};return g.a.createElement("section",{className:E.a.wrap},g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(Ee.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Se,onChange:function(We){return gt(We)}}),Xt==null?void 0:Xt.map(function(Ft,We){var lt;return g.a.createElement("div",{className:E.a.fold,key:Ft.id},g.a.createElement("div",{onClick:function(){return Jt("open",We)},className:E.a.head},g.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Ft.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),g.a.createElement("span",null,"\u7B2C",We+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),g.a.createElement("b",{style:{visibility:"hidden"},onClick:function(dt){dt.stopPropagation(),Jt("delete",We)},className:"iconfont icon-shanchu8"})),g.a.createElement("div",{className:"mb10",style:{display:Ft.open?"block":"none"}},g.a.createElement(Ee.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ft==null?void 0:Ft.name,onChange:function(dt){return Jt("value",We,dt)}}),g.a.createElement("p",{className:E.a.titleWrap},g.a.createElement("span",{className:E.a.required},"*"),g.a.createElement("span",{className:E.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:E.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ft==null||((lt=Ft.qusList)===null||lt===void 0)?void 0:lt.map(function(qe,dt){var Gt,Kt;return g.a.createElement("div",{className:E.a.choiceWrap,key:dt},g.a.createElement(Me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(E.a.answer," ").concat(Ft!=null&&(Gt=Ft.qusAnswer)!==null&&Gt!==void 0&&Gt.includes(dt)?E.a.activeAnswer:""),onClick:function(){return Jt("answer",We,dt)}},Ct[dt])),g.a.createElement("div",{className:E.a.editorWrap},(Ft==null?void 0:Ft.activeQusEditor)===dt?g.a.createElement(Ee.a,{id:"single-question-option-".concat(dt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:qe,onChange:function(Vt){return Jt("details",We,Vt)}}):g.a.createElement("div",{className:E.a.htmlWrap,onClick:function(){return Jt("edit",We,dt)}},g.a.createElement(b.a,{value:qe}))),dt>1&&g.a.createElement(Me.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(E.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Jt("deleteQus",We,dt)}})),dt<7&&dt===(Ft==null||((Kt=Ft.qusList)===null||Kt===void 0)?void 0:Kt.length)-1&&g.a.createElement(Me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(E.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Jt("addQus",We)}})))}),g.a.createElement("p",{className:"mb10 mt10"},g.a.createElement("span",{className:E.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Ee.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ft.analysis,onChange:function(dt){return Jt("analysis",We,dt)}})))}))},Ut=Object(A.a)(function(Fe){var N=Fe.loading,H=Fe.globalSetting;return{globalSetting:H,loading:N.effects}},null,null,{forwardRef:!0})(Object(M.forwardRef)(Pe)),kt=function(N){var H,K,C,w,O,R,re,ne,pe=N.data,nt=N.submit,Ke=N.goBack,Se=N.loading,gt=N.onTypeScore,jt=N.editPreview,ot=jt===void 0?!1:jt,Xt=N.onSkipExamination,tt=N.selectValue,Ht=N.onExchange,It=Object(M.useRef)(),Rt=Object(M.useRef)(Object(P.debounce)(function(){return un()},100,{leading:!0,trailing:!0})),Jt=Object(M.useState)(null),Ft=Object(de.a)(Jt,2),We=Ft[0],lt=Ft[1],qe=Object(M.useState)(!1),dt=Object(de.a)(qe,2),Gt=dt[0],Kt=dt[1],on=Object(z.i)();Object(M.useEffect)(function(){return window.addEventListener("scroll",Rt==null?void 0:Rt.current),function(){window.removeEventListener("scroll",Rt==null?void 0:Rt.current)}},[]),Object(M.useEffect)(function(){Kt(!0)},[]),Object(M.useEffect)(function(){var ve,oe,Ve,Pt,Tt=(ve=document.getElementById("examName"))===null||ve===void 0||((oe=ve.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||oe===void 0||((Ve=oe[0])===null||Ve===void 0||((Pt=Ve.childNodes)===null||Pt===void 0)))?void 0:Pt[2];Tt&&(Tt.nodeValue="\u4EFD")},[pe]);var Vt=function(oe){var Ve=parseInt(oe);return isNaN(Ve)?"":Ve};function _t(){var ve=0,oe=0,Ve=0;return document.body&&(oe=document.body.scrollTop),document.documentElement&&(Ve=document.documentElement.scrollTop),ve=oe-Ve>0?oe:Ve,ve}function tn(){var ve=0,oe=0,Ve=0;return document.body&&(oe=document.body.scrollHeight),document.documentElement&&(Ve=document.documentElement.scrollHeight),ve=oe-Ve>0?oe:Ve,ve}function Lt(){var ve=0;return document.compatMode=="CSS1Compat"?ve=document.documentElement.clientHeight:ve=document.body.clientHeight,ve}var un=function(){var oe=document.getElementById("preview_btns"),Ve=document.getElementById("preview_btns_else");_t()+Lt()>=tn()-68?(oe.style.visibility="hidden",Ve.style.visibility="visible"):(oe.style.visibility="visible",Ve.style.visibility="hidden")},zt=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],dn=function(oe){var Ve,Pt=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("aside",{className:S.a.single},oe==null||((Ve=oe.choices)===null||Ve===void 0)?void 0:Ve.map(function(Tt,St){return Tt.is_answer&&Pt.push(mn[St]),g.a.createElement("ul",{key:St},g.a.createElement("li",null,mn[St],"\u3001"),g.a.createElement("li",null,g.a.createElement(b.a,{value:Tt.choice_text})))})),g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Pt.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",zt[oe.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:oe.analysis?oe.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(oe==null?void 0:oe.discipline_name,"/").concat(oe==null?void 0:oe.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),oe==null?void 0:oe.tag_discipline_name))))},In=function(oe){var Ve,Pt=oe==null||((Ve=oe.standard_answer)===null||Ve===void 0)?void 0:Ve.map(function(Tt){var St;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Tt.position,"\uFF09\uFF1A").concat(Tt==null||((St=Tt.answer_text)===null||St===void 0)?void 0:St.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",Pt),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:oe.analysis?oe.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(oe==null?void 0:oe.discipline_name,"/").concat(oe==null?void 0:oe.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),oe==null?void 0:oe.tag_discipline_name))))},nn=function(oe){var Ve;return g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",oe==null||((Ve=oe.answer_texts)===null||Ve===void 0)?void 0:Ve[0]),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:oe.analysis?oe.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(oe==null?void 0:oe.discipline_name,"/").concat(oe==null?void 0:oe.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),oe==null?void 0:oe.tag_discipline_name)))},$e=function(oe){var Ve;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:oe==null||((Ve=oe.program_attr)===null||Ve===void 0)?void 0:Ve.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(oe==null?void 0:oe.discipline_name,"/").concat(oe==null?void 0:oe.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),oe==null?void 0:oe.tag_discipline_name)))},ut=function(oe,Ve){var Pt;return g.a.createElement("div",null,oe==null||((Pt=oe.sub_item_banks)===null||Pt===void 0)?void 0:Pt.map(function(Tt,St){var At,cn=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},Ve+1+"."+(St+1),"\uFF08\u5355\u9009\u9898\uFF09",Tt.name),g.a.createElement("aside",{className:S.a.single},Tt==null||((At=Tt.choices)===null||At===void 0)?void 0:At.map(function(Nn,wn){return Nn.is_answer&&cn.push(mn[wn]),g.a.createElement("ul",{key:wn},g.a.createElement("li",null,mn[wn],"\u3001"),g.a.createElement("li",null,g.a.createElement(b.a,{value:Nn.choice_text})))})),g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",cn.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",zt[Tt.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(b.a,{value:Tt.analysis?Tt.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(oe==null?void 0:oe.discipline_name,"/").concat(oe==null?void 0:oe.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),oe==null?void 0:oe.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"],En=function(oe){console.log("---",oe);var Ve=[];oe.questions.map(function(Tt){return Tt==null?void 0:Tt.sub_item_banks.map(function(St){Ve.push(St)})});var Pt=0;oe.type==="COMBINATION"?Pt=oe.questions_score/Ve.length:Pt=oe.questions_score/oe.questions_count,_.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,oe==null?void 0:oe.name,(oe==null?void 0:oe.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),g.a.createElement(L.a,{min:1,parser:Vt,defaultValue:Pt,onChange:function(St){Pt=St}}),g.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Tt=Object(D.a)(ce.a.mark(function At(){var cn,Nn;return ce.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:if(Pt){yn.next=3;break}return X.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),yn.abrupt("return",Promise.reject());case 3:oe.type==="COMBINATION"?(cn={type:oe==null?void 0:oe.type,score:Pt,scoreTotal:Pt*(Ve==null?void 0:Ve.length)},gt(cn)):(Nn={type:oe==null?void 0:oe.type,score:Pt,scoreTotal:Pt*oe.questions_count},gt(Nn));case 4:case"end":return yn.stop()}},At)}));function St(){return Tt.apply(this,arguments)}return St}()})},On=function(){var oe="";_.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:le.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(F.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:oe,onChange:function(Pt){oe=Pt.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Ve=Object(D.a)(ce.a.mark(function Tt(){var St,At,cn,Nn,wn;return ce.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if(oe){An.next=3;break}return X.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),An.abrupt("return",Promise.reject());case 3:return At=[],cn=[],Nn=[],pe==null||((St=pe.questionList)===null||St===void 0)||St.forEach(function(Dn){var ti;(ti=Dn.questions)===null||ti===void 0||ti.forEach(function(wi){At.push(wi.id),cn.push(Dn.questions_score/Dn.questions_count),Dn.type==="COMBINATION"&&Nn.push({id:wi.id,sub_item_bank_ids:wi.sub_item_banks.map(function(Xn){return Xn.id})})})}),console.log("-----",Nn),wn={item_bank_ids:At,item_bank_scores:cn,name:oe,combination_item_banks:Nn},An.next=11,nt(wn);case 11:case"end":return An.stop()}},Tt)}));function Pt(){return Ve.apply(this,arguments)}return Pt}()})},Bn=function(oe,Ve,Pt,Tt){var St,At=(St=Tt.questions)===null||St===void 0?void 0:St.map(function(Nn){return Nn.id}),cn=_.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 Nn=Object(D.a)(ce.a.mark(function yn(){return ce.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return cn.update({cancelButtonProps:{disabled:!0}}),Dn.next=3,Ht({single_question_id:oe,seleted_item_bank_ids:At},{type:Ve,index:Pt});case 3:cn.update({cancelButtonProps:{disabled:!1}}),X.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return Dn.stop()}},yn)}));function wn(){return Nn.apply(this,arguments)}return wn}()})},c=function(oe){var Ve,Pt=(Ve=oe.questions)===null||Ve===void 0?void 0:Ve.map(function(At){return At.id}),Tt=oe.name,St=_.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(Tt,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var At=Object(D.a)(ce.a.mark(function Nn(){return ce.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return St.update({cancelButtonProps:{disabled:!0}}),yn.next=3,Ht({seleted_item_bank_ids:Pt},{type:oe.type});case 3:St.update({cancelButtonProps:{disabled:!1}}),X.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(Tt,"\u8BD5\u9898"));case 5:case"end":return yn.stop()}},Nn)}));function cn(){return At.apply(this,arguments)}return cn}()})},o=function(){var oe=_.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 Ve=Object(D.a)(ce.a.mark(function Tt(){return ce.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return oe.update({cancelButtonProps:{disabled:!0}}),At.next=3,Ht();case 3:oe.update({cancelButtonProps:{disabled:!1}}),X.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return At.stop()}},Tt)}));function Pt(){return Ve.apply(this,arguments)}return Pt}()})},r=function(oe){console.log(oe,"key"),Xt(oe-1)},u=function(){return g.a.createElement(g.a.Fragment,null,g.a.createElement(I.a,{color:"#55575D",overlayClassName:S.a.popover,visible:Gt,getPopupContainer:function(Ve){return Ve==null?void 0:Ve.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(J.a,{onMouseEnter:function(){return Kt(!0)},onMouseLeave:function(){return Kt(!1)},onClick:function(){On()}},"\u4FDD\u5B58")),g.a.createElement(J.a,{onClick:function(){document.body.scrollIntoView(),Ke()}},"\u8FD4\u56DE"),g.a.createElement(J.a,{loading:Se,onClick:function(){return nt()},type:"primary"},"\u63D0\u4EA4"))},h=function(){var oe;return g.a.createElement(g.a.Fragment,null,g.a.createElement(J.a,{onClick:Ke},"\u8FD4\u56DE"),tt>0&&g.a.createElement(J.a,{onClick:function(){return r(tt)},type:"primary"},"\u4E0A\u4E00\u4EFD"),tt<(pe==null||((oe=pe.exam)===null||oe===void 0)?void 0:oe.total_num)-1&&g.a.createElement(J.a,{onClick:function(){return r(tt+2)}},"\u4E0B\u4E00\u4EFD"))},d=function(oe,Ve){if(console.log(oe,222),Ve==="SINGLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(pt,{ref:It,editData:oe,isEdit:!0}),g.a.createElement(Ce.a,null));if(Ve==="MULTIPLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Xe,{ref:It,editData:oe,isEdit:!0}),g.a.createElement(Ce.a,null));if(Ve==="JUDGMENT")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Be,{ref:It,editData:oe,isEdit:!0}),g.a.createElement(Ce.a,null));if(Ve==="COMPLETION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ze,{ref:It,editData:oe,isEdit:!0}),g.a.createElement(Ce.a,null));if(Ve==="SUBJECTIVE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Mt,{ref:It,editData:oe,isEdit:!0}),g.a.createElement(Ce.a,null));if(Ve==="COMBINATION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ut,{ref:It,editData:oe,isEdit:!0}),g.a.createElement(Ce.a,null));if(Ve==="PROGRAM"){var Pt;A.d.push("/problems/".concat(oe==null||((Pt=oe.program_attr)===null||Pt===void 0)?void 0:Pt.identifier,"/edit?type=exercises&express_id=").concat(on.categoryId,"&question_id=").concat(oe==null?void 0:oe.id,"&score=").concat(oe==null?void 0:oe.score,"&callback_url=").concat(location.pathname,"&select=").concat(tt,"&exercise=true"))}},q=function(){var ve=Object(D.a)(ce.a.mark(function oe(Ve,Pt){var Tt,St,At,cn,Nn,wn,yn,An,Dn,ti;return ce.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,(Tt=It.current)===null||Tt===void 0?void 0:Tt.onSave();case 2:if(St=Xn.sent,St){Xn.next=5;break}return Xn.abrupt("return");case 5:return At={question_score:Pt.score,analysis:St.analysis},console.log(St,"editorData"),(Ve==="SINGLE"||Ve==="MULTIPLE"||Ve==="JUDGMENT")&&(Nn=[],wn=[],At.question_type=Ve==="JUDGMENT"?2:1,At.question_title=St==null?void 0:St.name,St==null||((cn=St.choices)===null||cn===void 0)||cn.forEach(function($n,$i){Nn.push($n.choice_text),$n!=null&&$n.is_answer&&wn.push($i+1)}),At.question_choices=Nn,At.standard_answers=wn),Ve==="COMPLETION"&&(At.is_ordered=St.is_ordered,At.question_title=St==null?void 0:St.name,At.question_type=3,An=[],St==null||((yn=St.standard_answers)===null||yn===void 0)||yn.forEach(function($n,$i){An.push({choice_id:$n.position,answer_text:$n.answer_text})}),At.standard_answers=An),Ve==="SUBJECTIVE"&&(At.question_title=St==null?void 0:St.name,At.question_type=3,At.standard_answers=St==null?void 0:St.answer_texts),Ve==="COMBINATION"&&(At.question_title=St==null?void 0:St.name,At.question_type=7,At.sub_questions=St==null||((Dn=St.sub_item_banks)===null||Dn===void 0)?void 0:Dn.map(function($n,$i){return{id:$n.id,question_title:$n.name,question_type:1,question_choices:$n.choices.map(function(Ei){return Ei.choice_text}),standard_answers:[$n.choices.findIndex(function(Ei){return Ei.is_answer})+1],analysis:$n.analysis}}),delete At.analysis),Xn.next=13,Object(k.a)("/api/exercise_questions/".concat(Pt.id,".json"),{method:"put",body:At});case 13:ti=Xn.sent,(ti==null?void 0:ti.status)===0&&(X.b.success("\u7F16\u8F91\u6210\u529F"),r(tt+1)),lt(null);case 16:case"end":return Xn.stop()}},oe)}));return function(Ve,Pt){return ve.apply(this,arguments)}}(),Ye=function(){for(var oe=[],Ve=0;Ve<(pe==null||((Pt=pe.exam)===null||Pt===void 0)?void 0:Pt.total_num);Ve++){var Pt;oe.push({})}return oe};console.log(Ye(),"data");var st=pe==null||((H=pe.questionList)===null||H===void 0)?void 0:H.reduce(function(ve,oe){return ve+oe.questions_score},0),Nt=ot&&(pe==null||((K=pe.exam)===null||K===void 0)?void 0:K.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(oe){var Ve=document.getElementById("id_left_preview");Ve.style.overflowY="auto"},onMouseLeave:function(oe){var Ve=document.getElementById("id_left_preview");Ve.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:be.a}),g.a.createElement("span",null,"\u9898\u6570(\u9053)"),g.a.createElement("aside",null,pe==null?void 0:pe.all_questions_count)),g.a.createElement("div",{className:"mr30 ml30"},g.a.createElement("img",{src:Te.a}),g.a.createElement("span",null,"\u603B\u5206(\u5206)"),g.a.createElement("aside",null,st)),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,pe==null||((C=pe.exam)===null||C===void 0)?void 0:C.time))),pe==null||((w=pe.questionList)===null||w===void 0)?void 0:w.map(function(ve,oe){var Ve;return g.a.createElement("div",{className:S.a.list,key:oe},g.a.createElement("div",{className:S.a.name},g.a.createElement("b",null),g.a.createElement("span",null,ve.name)),g.a.createElement("aside",null,g.a.createElement("div",null,"\u5171",g.a.createElement("span",{className:S.a.b},ve.questions_count),"\u9898 ",g.a.createElement("span",{className:S.a.l},"|"),"\u5171",g.a.createElement("span",{className:S.a.r},ve.questions_score),"\u5206"),g.a.createElement("div",{className:S.a.answerSheet},ve==null||((Ve=ve.questions)===null||Ve===void 0)?void 0:Ve.map(function(Pt,Tt){return g.a.createElement("div",{onClick:function(){var At="Anchor_".concat(Pt.id),cn=document.getElementById(At);cn&&setTimeout(function(){return cn.scrollIntoView({block:"center",behavior:"smooth"})})},key:Pt.id,className:S.a.tag},Tt+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(Me.a,{title:pe==null||((O=pe.exam)===null||O===void 0)?void 0:O.name,getPopupContainer:function(oe){return oe.parentNode}},g.a.createElement("span",{className:S.a.t},pe==null||((R=pe.exam)===null||R===void 0)?void 0:R.name))),ot?g.a.createElement(Ae.a,{showTotal:function(oe){return g.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",g.a.createElement("span",{className:"c-light-primary"},oe),"\u4EFD\u8BD5\u5377")},total:pe==null||((re=pe.exam)===null||re===void 0)?void 0:re.total_num,pageSize:1,current:tt+1,showSizeChanger:!1,onChange:r,showQuickJumper:!0,hideOnSinglePage:!1}):g.a.createElement(J.a,{onClick:o,type:"primary"},"\u968F\u673A\u66F4\u6362")),g.a.createElement("div",{className:S.a.topWarp},pe==null||((ne=pe.questionList)===null||ne===void 0)?void 0:ne.map(function(ve,oe){var Ve,Pt;return g.a.createElement(g.a.Fragment,{key:oe},g.a.createElement("div",{className:S.a.head,style:oe===0?{border:0,marginTop:-16}:{}},g.a.createElement("div",{className:S.a.name},g.a.createElement("b",null),g.a.createElement("span",null,ve.name)),g.a.createElement("div",{className:S.a.so},"\u5171",g.a.createElement("span",{className:S.a.b},ve.questions_count," "),"\u9898 ",ve.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(ve==null||((Ve=ve.questions)===null||Ve===void 0)?void 0:Ve.map(function(Tt){var St;return Tt==null||((St=Tt.sub_item_banks)===null||St===void 0)?void 0:St.length}).reduce(function(Tt,St){return Tt+St}),"\u5C0F\u9898\uFF09"),g.a.createElement("span",{className:S.a.l},"|"),"\u5171",g.a.createElement("span",{className:S.a.r},ve.questions_score),"\u5206"),!ot&&g.a.createElement("div",{className:S.a.btn},g.a.createElement(J.a,{onClick:function(){En(ve)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),g.a.createElement(J.a,{onClick:function(){return c(ve)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),ve==null||((Pt=ve.questions)===null||Pt===void 0)?void 0:Pt.map(function(Tt,St){return We===Tt.id?g.a.createElement("div",{id:"Anchor_".concat(Tt.id),className:S.a.content,style:{padding:0,marginTop:10},key:Tt.id},g.a.createElement("div",{style:{float:"right",marginTop:-6}},g.a.createElement(J.a,{onClick:function(){return lt(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),g.a.createElement(J.a,{onClick:function(){return q(ve==null?void 0:ve.type,Tt)},type:"primary"},"\u4FDD\u5B58")),d(Tt,ve.type)):g.a.createElement("div",{id:"Anchor_".concat(Tt.id),className:S.a.content,key:Tt.id},g.a.createElement("div",{className:S.a.titleWrap},g.a.createElement(b.a,{style:{paddingRight:10},className:S.a.titleHtml,value:St+1+"\u3001"+"".concat((Tt==null?void 0:Tt.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+Tt.name}),ot&&g.a.createElement(J.a,{disabled:Nt,onClick:function(){if(We){X.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}lt(Tt.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),g.a.createElement(J.a,{disabled:Nt,onClick:function(){return Bn(Tt.id,ve.type,St,ve)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(ve.type==="SINGLE"||ve.type==="JUDGMENT"||ve.type==="MULTIPLE")&&dn(Tt),ve.type==="COMPLETION"&&In(Tt),ve.type==="SUBJECTIVE"&&nn(Tt),ve.type==="PROGRAM"&&$e(Tt),ve.type==="COMBINATION"&&ut(Tt,St),g.a.createElement("div",null))}))})),g.a.createElement("div",{className:S.a.btnsElse,id:"preview_btns_else"},ot?h():u()),g.a.createElement("div",{className:S.a.btnsWrap,id:"preview_btns"},g.a.createElement("div",{className:S.a.btns},ot?h():u()))))},Ne=Ge.a=kt},sboe:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return me});var ie=p("q1tI"),Ae=p.n(ie),me=ie.createContext(null)},tmPe:function(at,Ge,p){at.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(at,Ge,p){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);