You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
345 lines
726 KiB
345 lines
726 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[177,7,8,17],{"+NIl":function(Je,Ie,f){(function(z){z(f("VrN/"))})(function(z){"use strict";z.defineMode("stex",function(ve,re){"use strict";function xe(K,L){K.cmdState.push(L)}function me(K){return K.cmdState.length>0?K.cmdState[K.cmdState.length-1]:null}function ae(K){var L=K.cmdState.pop();L&&L.closeBracket()}function j(K){for(var L=K.cmdState,M=L.length-1;M>=0;M--){var W=L[M];if(W.name=="DEFAULT")continue;return W}return{styleIdentifier:function(){return null}}}function x(K,L,M){return function(){this.name=K,this.bracketNo=0,this.style=L,this.styles=M,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=x("importmodule","tag",["string","builtin"]),k.documentclass=x("documentclass","tag",["","atom"]),k.usepackage=x("usepackage","tag",["atom"]),k.begin=x("begin","tag",["atom"]),k.end=x("end","tag",["atom"]),k.label=x("label","tag",["atom"]),k.ref=x("ref","tag",["atom"]),k.eqref=x("eqref","tag",["atom"]),k.cite=x("cite","tag",["atom"]),k.bibitem=x("bibitem","tag",["atom"]),k.Bibitem=x("Bibitem","tag",["atom"]),k.RBibitem=x("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(K,L){K.f=L}function N(K,L){var M;if(K.match(/^\\[a-zA-Z@]+/)){var W=K.current().slice(1);return M=k.hasOwnProperty(W)?k[W]:k.DEFAULT,M=new M,xe(L,M),P(L,ee),M.style}if(K.match(/^\\[$&%#{}_]/))return"tag";if(K.match(/^\\[,;!\/\\]/))return"tag";if(K.match("\\["))return P(L,function(_,we){return T(_,we,"\\]")}),"keyword";if(K.match("\\("))return P(L,function(_,we){return T(_,we,"\\)")}),"keyword";if(K.match("$$"))return P(L,function(_,we){return T(_,we,"$$")}),"keyword";if(K.match("$"))return P(L,function(_,we){return T(_,we,"$")}),"keyword";var Y=K.next();if(Y=="%")return K.skipToEnd(),"comment";if(Y=="}"||Y=="]"){if(M=me(L),M)M.closeBracket(Y),P(L,ee);else return"error";return"bracket"}else return Y=="{"||Y=="["?(M=k.DEFAULT,M=new M,xe(L,M),"bracket"):/\d/.test(Y)?(K.eatWhile(/[\w.%]/),"atom"):(K.eatWhile(/[\w\-_]/),M=j(L),M.name=="begin"&&(M.argument=K.current()),M.styleIdentifier())}function T(K,L,M){if(K.eatSpace())return null;if(M&&K.match(M))return P(L,N),"keyword";if(K.match(/^\\[a-zA-Z@]+/))return"tag";if(K.match(/^[a-zA-Z]+/))return"variable-2";if(K.match(/^\\[$&%#{}_]/))return"tag";if(K.match(/^\\[,;!\/]/))return"tag";if(K.match(/^[\^_&]/))return"tag";if(K.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(K.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var W=K.next();return W=="{"||W=="}"||W=="["||W=="]"||W=="("||W==")"?"bracket":W=="%"?(K.skipToEnd(),"comment"):"error"}function ee(K,L){var M=K.peek(),W;return M=="{"||M=="["?(W=me(L),W.openBracket(M),K.eat(M),P(L,N),"bracket"):/[ \t\r]/.test(M)?(K.eat(M),null):(P(L,N),ae(L),N(K,L))}return{startState:function(){var K=re.inMathMode?function(L,M){return T(L,M)}:N;return{cmdState:[],f:K}},copyState:function(K){return{cmdState:K.cmdState.slice(),f:K.f}},token:function(K,L){return L.f(K,L)},blankLine:function(K){K.f=N,K.cmdState.length=0},lineComment:"%"}}),z.defineMIME("text/x-stex","stex"),z.defineMIME("text/x-latex","stex")})},"+RXH":function(Je,Ie,f){Je.exports=f.p+"static/shu.46896d7d.svg"},"+yhJ":function(Je,Ie,f){Je.exports=f.p+"static/xixi.e1179cb8.svg"},"0eGx":function(Je,Ie,f){Je.exports=f.p+"static/zhong.e01397e1.svg"},"19Vz":function(Je,Ie,f){(function(z){z(f("VrN/"))})(function(z){z.defineOption("placeholder","",function(x,k,P){var N=P&&P!=z.Init;if(k&&!N)x.on("blur",me),x.on("change",ae),x.on("swapDoc",ae),z.on(x.getInputField(),"compositionupdate",x.state.placeholderCompose=function(){xe(x)}),ae(x);else if(!k&&N){x.off("blur",me),x.off("change",ae),x.off("swapDoc",ae),z.off(x.getInputField(),"compositionupdate",x.state.placeholderCompose),ve(x);var T=x.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}k&&!x.hasFocus()&&me(x)});function ve(x){x.state.placeholder&&(x.state.placeholder.parentNode.removeChild(x.state.placeholder),x.state.placeholder=null)}function re(x){ve(x);var k=x.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=x.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var P=x.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),k.appendChild(P),x.display.lineSpace.insertBefore(k,x.display.lineSpace.firstChild)}function xe(x){setTimeout(function(){var k=!1,P=x.getInputField();P.nodeName=="TEXTAREA"?k=!P.value:x.lineCount()==1&&(k=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),k?re(x):ve(x)},20)}function me(x){j(x)&&re(x)}function ae(x){var k=x.getWrapperElement(),P=j(x);k.className=k.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?re(x):ve(x)}function j(x){return x.lineCount()===1&&x.getLine(0)===""}})},"1eCo":function(Je,Ie,f){(function(z){z(f("VrN/"))})(function(z){"use strict";var ve={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},re={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};z.defineMode("xml",function(xe,me){var ae=xe.indentUnit,j={},x=me.htmlMode?ve:re;for(var k in x)j[k]=x[k];for(var k in me)j[k]=me[k];var P,N;function T(C,J){function H(ie){return J.tokenize=ie,ie(C,J)}var E=C.next();if(E=="<")return C.eat("!")?C.eat("[")?C.match("CDATA[")?H(L("atom","]]>")):null:C.match("--")?H(L("comment","-->")):C.match("DOCTYPE",!0,!0)?(C.eatWhile(/[\w\._\-]/),H(M(1))):null:C.eat("?")?(C.eatWhile(/[\w\._\-]/),J.tokenize=L("meta","?>"),"meta"):(P=C.eat("/")?"closeTag":"openTag",J.tokenize=ee,"tag bracket");if(E=="&"){var R;return C.eat("#")?C.eat("x")?R=C.eatWhile(/[a-fA-F\d]/)&&C.eat(";"):R=C.eatWhile(/[\d]/)&&C.eat(";"):R=C.eatWhile(/[\w\.\-:]/)&&C.eat(";"),R?"atom":"error"}else return C.eatWhile(/[^&<]/),null}T.isInText=!0;function ee(C,J){var H=C.next();if(H==">"||H=="/"&&C.eat(">"))return J.tokenize=T,P=H==">"?"endTag":"selfcloseTag","tag bracket";if(H=="=")return P="equals",null;if(H=="<"){J.tokenize=T,J.state=we,J.tagName=J.tagStart=null;var E=J.tokenize(C,J);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(H)?(J.tokenize=K(H),J.stringStartCol=C.column(),J.tokenize(C,J)):(C.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function K(C){var J=function(H,E){for(;!H.eol();)if(H.next()==C){E.tokenize=ee;break}return"string"};return J.isInAttribute=!0,J}function L(C,J){return function(H,E){for(;!H.eol();){if(H.match(J)){E.tokenize=T;break}H.next()}return C}}function M(C){return function(J,H){for(var E;(E=J.next())!=null;){if(E=="<")return H.tokenize=M(C+1),H.tokenize(J,H);if(E==">")if(C==1){H.tokenize=T;break}else return H.tokenize=M(C-1),H.tokenize(J,H)}return"meta"}}function W(C,J,H){this.prev=C.context,this.tagName=J,this.indent=C.indented,this.startOfLine=H,(j.doNotIndent.hasOwnProperty(J)||C.context&&C.context.noIndent)&&(this.noIndent=!0)}function Y(C){C.context&&(C.context=C.context.prev)}function _(C,J){for(var H;;){if(!C.context)return;if(H=C.context.tagName,!j.contextGrabbers.hasOwnProperty(H)||!j.contextGrabbers[H].hasOwnProperty(J))return;Y(C)}}function we(C,J,H){return C=="openTag"?(H.tagStart=J.column(),ke):C=="closeTag"?se:we}function ke(C,J,H){return C=="word"?(H.tagName=J.current(),N="tag",$):j.allowMissingTagName&&C=="endTag"?(N="tag bracket",$(C,J,H)):(N="error",ke)}function se(C,J,H){if(C=="word"){var E=J.current();return H.context&&H.context.tagName!=E&&j.implicitlyClosed.hasOwnProperty(H.context.tagName)&&Y(H),H.context&&H.context.tagName==E||j.matchClosing===!1?(N="tag",le):(N="tag error",fe)}else return j.allowMissingTagName&&C=="endTag"?(N="tag bracket",le(C,J,H)):(N="error",fe)}function le(C,J,H){return C!="endTag"?(N="error",le):(Y(H),we)}function fe(C,J,H){return N="error",le(C,J,H)}function $(C,J,H){if(C=="word")return N="attribute",h;if(C=="endTag"||C=="selfcloseTag"){var E=H.tagName,R=H.tagStart;return H.tagName=H.tagStart=null,C=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(E)?_(H,E):(_(H,E),H.context=new W(H,E,R==H.indented)),we}return N="error",$}function h(C,J,H){return C=="equals"?X:(j.allowMissing||(N="error"),$(C,J,H))}function X(C,J,H){return C=="string"?y:C=="word"&&j.allowUnquoted?(N="string",$):(N="error",$(C,J,H))}function y(C,J,H){return C=="string"?y:$(C,J,H)}return{startState:function(C){var J={tokenize:T,state:we,indented:C||0,tagName:null,tagStart:null,context:null};return C!=null&&(J.baseIndent=C),J},token:function(C,J){if(!J.tagName&&C.sol()&&(J.indented=C.indentation()),C.eatSpace())return null;P=null;var H=J.tokenize(C,J);return(H||P)&&H!="comment"&&(N=null,J.state=J.state(P||H,C,J),N&&(H=N=="error"?H+" error":N)),H},indent:function(C,J,H){var E=C.context;if(C.tokenize.isInAttribute)return C.tagStart==C.indented?C.stringStartCol+1:C.indented+ae;if(E&&E.noIndent)return z.Pass;if(C.tokenize!=ee&&C.tokenize!=T)return H?H.match(/^(\s*)/)[0].length:0;if(C.tagName)return j.multilineTagIndentPastTag!==!1?C.tagStart+C.tagName.length+2:C.tagStart+ae*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(J))return 0;var R=J&&/^<(\/)?([\w_:\.-]*)/.exec(J);if(R&&R[1])for(;E;)if(E.tagName==R[2]){E=E.prev;break}else if(j.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(R)for(;E;){var ie=j.contextGrabbers[E.tagName];if(ie&&ie.hasOwnProperty(R[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+ae:C.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(C){C.state==X&&(C.state=$)},xmlCurrentTag:function(C){return C.tagName?{name:C.tagName,close:C.type=="closeTag"}:null},xmlCurrentContext:function(C){for(var J=[],H=C.context;H;H=H.prev)H.tagName&&J.push(H.tagName);return J.reverse()}}}),z.defineMIME("text/xml","xml"),z.defineMIME("application/xml","xml"),z.mimeModes.hasOwnProperty("text/html")||z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2sxD":function(Je,Ie,f){Je.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(Je,Ie,f){Je.exports=f.p+"static/sc.e4548a72.svg"},"5MlY":function(Je,Ie,f){Je.exports=f.p+"static/sm.8d9933e4.svg"},"6+eU":function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return le});var z=f("wx14"),ve=f("rePB"),re=f("VTBJ"),xe=f("1OyB"),me=f("vuIU"),ae=f("Ji7U"),j=f("LK+K"),x=f("q1tI"),k=f.n(x),P=f("TSYQ"),N=f.n(P),T=function($){var h,X="".concat($.rootPrefixCls,"-item"),y=N()(X,"".concat(X,"-").concat($.page),(h={},Object(ve.a)(h,"".concat(X,"-active"),$.active),Object(ve.a)(h,$.className,!!$.className),Object(ve.a)(h,"".concat(X,"-disabled"),!$.page),h)),C=function(){$.onClick($.page)},J=function(E){$.onKeyPress(E,$.onClick,$.page)};return k.a.createElement("li",{title:$.showTitle?$.page:null,className:y,onClick:C,onKeyPress:J,tabIndex:"0"},$.itemRender($.page,"page",k.a.createElement("a",{rel:"nofollow"},$.page)))},ee=T,K={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},L=function(fe){Object(ae.a)(h,fe);var $=Object(j.a)(h);function h(){var X;Object(xe.a)(this,h);for(var y=arguments.length,C=new Array(y),J=0;J<y;J++)C[J]=arguments[J];return X=$.call.apply($,[this].concat(C)),X.state={goInputText:""},X.buildOptionText=function(H){return"".concat(H," ").concat(X.props.locale.items_per_page)},X.changeSize=function(H){X.props.changeSize(Number(H))},X.handleChange=function(H){X.setState({goInputText:H.target.value})},X.handleBlur=function(H){var E=X.props,R=E.goButton,ie=E.quickGo,F=E.rootPrefixCls,be=X.state.goInputText;if(R||be==="")return;if(H.relatedTarget&&(H.relatedTarget.className.indexOf("".concat(F,"-prev"))>=0||H.relatedTarget.className.indexOf("".concat(F,"-next"))>=0))return;X.setState({goInputText:""}),ie(X.getValidValue())},X.go=function(H){var E=X.state.goInputText;if(E==="")return;(H.keyCode===K.ENTER||H.type==="click")&&(X.setState({goInputText:""}),X.props.quickGo(X.getValidValue()))},X}return Object(me.a)(h,[{key:"getValidValue",value:function(){var y=this.state,C=y.goInputText,J=y.current;return!C||isNaN(C)?J:Number(C)}},{key:"getPageSizeOptions",value:function(){var y=this.props,C=y.pageSize,J=y.pageSizeOptions;return J.some(function(H){return H.toString()===C.toString()})?J:J.concat([C.toString()]).sort(function(H,E){var R=isNaN(Number(H))?0:Number(H),ie=isNaN(Number(E))?0:Number(E);return R-ie})}},{key:"render",value:function(){var y=this,C=this.props,J=C.pageSize,H=C.locale,E=C.rootPrefixCls,R=C.changeSize,ie=C.quickGo,F=C.goButton,be=C.selectComponentClass,O=C.buildOptionText,m=C.selectPrefixCls,oe=C.disabled,Be=this.state.goInputText,Ae="".concat(E,"-options"),Xe=be,Oe=null,Te=null,V=null;if(!R&&!ie)return null;var B=this.getPageSizeOptions();if(R&&Xe){var ue=B.map(function(D,A){return k.a.createElement(Xe.Option,{key:A,value:D.toString()},(O||y.buildOptionText)(D))});Oe=k.a.createElement(Xe,{disabled:oe,prefixCls:m,showSearch:!1,className:"".concat(Ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(J||B[0]).toString(),onChange:this.changeSize,getPopupContainer:function(A){return A.parentNode}},ue)}return ie&&(F&&(V=typeof F=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:oe,className:"".concat(Ae,"-quick-jumper-button")},H.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},F)),Te=k.a.createElement("div",{className:"".concat(Ae,"-quick-jumper")},H.jump_to,k.a.createElement("input",{disabled:oe,type:"text",value:Be,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),H.page,V)),k.a.createElement("li",{className:"".concat(Ae)},Oe,Te)}}]),h}(k.a.Component);L.defaultProps={pageSizeOptions:["10","20","50","100"]};var M=L,W=f("N2Kk");function Y(){}function _(fe){return typeof fe=="number"&&isFinite(fe)&&Math.floor(fe)===fe}function we(fe,$,h){return h}function ke(fe,$,h){var X=typeof fe=="undefined"?$.pageSize:fe;return Math.floor((h.total-1)/X)+1}var se=function(fe){Object(ae.a)(h,fe);var $=Object(j.a)(h);function h(X){var y;Object(xe.a)(this,h),y=$.call(this,X),y.getJumpPrevPage=function(){return Math.max(1,y.state.current-(y.props.showLessItems?3:5))},y.getJumpNextPage=function(){return Math.min(ke(void 0,y.state,y.props),y.state.current+(y.props.showLessItems?3:5))},y.getItemIcon=function(R,ie){var F=y.props.prefixCls,be=R||k.a.createElement("button",{type:"button","aria-label":ie,className:"".concat(F,"-item-link")});return typeof R=="function"&&(be=k.a.createElement(R,Object(re.a)({},y.props))),be},y.savePaginationNode=function(R){y.paginationNode=R},y.isValid=function(R){return _(R)&&R!==y.state.current},y.shouldDisplayQuickJumper=function(){var R=y.props,ie=R.showQuickJumper,F=R.pageSize,be=R.total;return be<=F?!1:ie},y.handleKeyDown=function(R){(R.keyCode===K.ARROW_UP||R.keyCode===K.ARROW_DOWN)&&R.preventDefault()},y.handleKeyUp=function(R){var ie=y.getValidValue(R),F=y.state.currentInputValue;ie!==F&&y.setState({currentInputValue:ie}),R.keyCode===K.ENTER?y.handleChange(ie):R.keyCode===K.ARROW_UP?y.handleChange(ie-1):R.keyCode===K.ARROW_DOWN&&y.handleChange(ie+1)},y.changePageSize=function(R){var ie=y.state.current,F=ke(R,y.state,y.props);ie=ie>F?F:ie,F===0&&(ie=y.state.current),typeof R=="number"&&("pageSize"in y.props||y.setState({pageSize:R}),"current"in y.props||y.setState({current:ie,currentInputValue:ie})),y.props.onShowSizeChange(ie,R),"onChange"in y.props&&y.props.onChange&&y.props.onChange(ie,R)},y.handleChange=function(R){var ie=y.props.disabled,F=R;if(y.isValid(F)&&!ie){var be=ke(void 0,y.state,y.props);F>be?F=be:F<1&&(F=1),"current"in y.props||y.setState({current:F,currentInputValue:F});var O=y.state.pageSize;return y.props.onChange(F,O),F}return y.state.current},y.prev=function(){y.hasPrev()&&y.handleChange(y.state.current-1)},y.next=function(){y.hasNext()&&y.handleChange(y.state.current+1)},y.jumpPrev=function(){y.handleChange(y.getJumpPrevPage())},y.jumpNext=function(){y.handleChange(y.getJumpNextPage())},y.hasPrev=function(){return y.state.current>1},y.hasNext=function(){return y.state.current<ke(void 0,y.state,y.props)},y.runIfEnter=function(R,ie){if(R.key==="Enter"||R.charCode===13){for(var F=arguments.length,be=new Array(F>2?F-2:0),O=2;O<F;O++)be[O-2]=arguments[O];ie.apply(void 0,be)}},y.runIfEnterPrev=function(R){y.runIfEnter(R,y.prev)},y.runIfEnterNext=function(R){y.runIfEnter(R,y.next)},y.runIfEnterJumpPrev=function(R){y.runIfEnter(R,y.jumpPrev)},y.runIfEnterJumpNext=function(R){y.runIfEnter(R,y.jumpNext)},y.handleGoTO=function(R){(R.keyCode===K.ENTER||R.type==="click")&&y.handleChange(y.state.currentInputValue)};var C=X.onChange!==Y,J="current"in X;J&&!C&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var H=X.defaultCurrent;"current"in X&&(H=X.current);var E=X.defaultPageSize;return"pageSize"in X&&(E=X.pageSize),H=Math.min(H,ke(E,void 0,X)),y.state={current:H,currentInputValue:H,pageSize:E},y}return Object(me.a)(h,[{key:"componentDidUpdate",value:function(y,C){var J=this.props.prefixCls;if(C.current!==this.state.current&&this.paginationNode){var H=this.paginationNode.querySelector(".".concat(J,"-item-").concat(C.current));H&&document.activeElement===H&&H.blur()}}},{key:"getValidValue",value:function(y){var C=y.target.value,J=ke(void 0,this.state,this.props),H=this.state.currentInputValue,E;return C===""?E=C:isNaN(Number(C))?E=H:C>=J?E=J:E=Number(C),E}},{key:"getShowSizeChanger",value:function(){var y=this.props,C=y.showSizeChanger,J=y.total,H=y.totalBoundaryShowSizeChanger;return typeof C!="undefined"?C:J>H}},{key:"renderPrev",value:function(y){var C=this.props,J=C.prevIcon,H=C.itemRender,E=H(y,"prev",this.getItemIcon(J,"prev page")),R=!this.hasPrev();return Object(x.isValidElement)(E)?Object(x.cloneElement)(E,{disabled:R}):E}},{key:"renderNext",value:function(y){var C=this.props,J=C.nextIcon,H=C.itemRender,E=H(y,"next",this.getItemIcon(J,"next page")),R=!this.hasNext();return Object(x.isValidElement)(E)?Object(x.cloneElement)(E,{disabled:R}):E}},{key:"render",value:function(){var y=this,C=this.props,J=C.prefixCls,H=C.className,E=C.style,R=C.disabled,ie=C.hideOnSinglePage,F=C.total,be=C.locale,O=C.showQuickJumper,m=C.showLessItems,oe=C.showTitle,Be=C.showTotal,Ae=C.simple,Xe=C.itemRender,Oe=C.showPrevNextJumpers,Te=C.jumpPrevIcon,V=C.jumpNextIcon,B=C.selectComponentClass,ue=C.selectPrefixCls,D=C.pageSizeOptions,A=this.state,pe=A.current,he=A.pageSize,Ze=A.currentInputValue;if(ie===!0&&F<=he)return null;var Le=ke(void 0,this.state,this.props),He=[],Pe=null,je=null,Qe=null,nt=null,ot=null,$e=O&&O.goButton,Ke=m?1:2,At=pe-1>0?pe-1:0,mt=pe+1<Le?pe+1:Le,St=Object.keys(this.props).reduce(function(w,S){return(S.substr(0,5)==="data-"||S.substr(0,5)==="aria-"||S==="role")&&(w[S]=y.props[S]),w},{});if(Ae)return $e&&(typeof $e=="boolean"?ot=k.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},be.jump_to_confirm):ot=k.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},$e),ot=k.a.createElement("li",{title:oe?"".concat(be.jump_to).concat(pe,"/").concat(Le):null,className:"".concat(J,"-simple-pager")},ot)),k.a.createElement("ul",Object(z.a)({className:N()(J,"".concat(J,"-simple"),Object(ve.a)({},"".concat(J,"-disabled"),R),H),style:E,ref:this.savePaginationNode},St),k.a.createElement("li",{title:oe?be.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:N()("".concat(J,"-prev"),Object(ve.a)({},"".concat(J,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(At)),k.a.createElement("li",{title:oe?"".concat(pe,"/").concat(Le):null,className:"".concat(J,"-simple-pager")},k.a.createElement("input",{type:"text",value:Ze,disabled:R,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),k.a.createElement("span",{className:"".concat(J,"-slash")},"/"),Le),k.a.createElement("li",{title:oe?be.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:N()("".concat(J,"-next"),Object(ve.a)({},"".concat(J,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(mt)),ot);if(Le<=3+Ke*2){var ct={locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:oe,itemRender:Xe};Le||He.push(k.a.createElement(ee,Object(z.a)({},ct,{key:"noPager",page:Le,className:"".concat(J,"-disabled")})));for(var Ot=1;Ot<=Le;Ot+=1){var Ct=pe===Ot;He.push(k.a.createElement(ee,Object(z.a)({},ct,{key:Ot,page:Ot,active:Ct})))}}else{var yt=m?be.prev_3:be.prev_5,De=m?be.next_3:be.next_5;Oe&&(Pe=k.a.createElement("li",{title:oe?yt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:N()("".concat(J,"-jump-prev"),Object(ve.a)({},"".concat(J,"-jump-prev-custom-icon"),!!Te))},Xe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Te,"prev page"))),je=k.a.createElement("li",{title:oe?De:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:N()("".concat(J,"-jump-next"),Object(ve.a)({},"".concat(J,"-jump-next-custom-icon"),!!V))},Xe(this.getJumpNextPage(),"jump-next",this.getItemIcon(V,"next page")))),nt=k.a.createElement(ee,{locale:be,last:!0,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Le,page:Le,active:!1,showTitle:oe,itemRender:Xe}),Qe=k.a.createElement(ee,{locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:oe,itemRender:Xe});var Ut=Math.max(1,pe-Ke),kt=Math.min(pe+Ke,Le);pe-1<=Ke&&(kt=1+Ke*2),Le-pe<=Ke&&(Ut=Le-Ke*2);for(var Ue=Ut;Ue<=kt;Ue+=1){var We=pe===Ue;He.push(k.a.createElement(ee,{locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ue,page:Ue,active:We,showTitle:oe,itemRender:Xe}))}pe-1>=Ke*2&&pe!==1+2&&(He[0]=Object(x.cloneElement)(He[0],{className:"".concat(J,"-item-after-jump-prev")}),He.unshift(Pe)),Le-pe>=Ke*2&&pe!==Le-2&&(He[He.length-1]=Object(x.cloneElement)(He[He.length-1],{className:"".concat(J,"-item-before-jump-next")}),He.push(je)),Ut!==1&&He.unshift(Qe),kt!==Le&&He.push(nt)}var G=null;Be&&(G=k.a.createElement("li",{className:"".concat(J,"-total-text")},Be(F,[F===0?0:(pe-1)*he+1,pe*he>F?F:pe*he])));var q=!this.hasPrev()||!Le,Q=!this.hasNext()||!Le;return k.a.createElement("ul",Object(z.a)({className:N()(J,H,Object(ve.a)({},"".concat(J,"-disabled"),R)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},St),G,k.a.createElement("li",{title:oe?be.prev_page:null,onClick:this.prev,tabIndex:q?null:0,onKeyPress:this.runIfEnterPrev,className:N()("".concat(J,"-prev"),Object(ve.a)({},"".concat(J,"-disabled"),q)),"aria-disabled":q},this.renderPrev(At)),He,k.a.createElement("li",{title:oe?be.next_page:null,onClick:this.next,tabIndex:Q?null:0,onKeyPress:this.runIfEnterNext,className:N()("".concat(J,"-next"),Object(ve.a)({},"".concat(J,"-disabled"),Q)),"aria-disabled":Q},this.renderNext(mt)),k.a.createElement(M,{disabled:R,locale:be,rootPrefixCls:J,selectComponentClass:B,selectPrefixCls:ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:pe,pageSize:he,pageSizeOptions:D,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:$e}))}}],[{key:"getDerivedStateFromProps",value:function(y,C){var J={};if("current"in y&&(J.current=y.current,y.current!==C.current&&(J.currentInputValue=J.current)),"pageSize"in y&&y.pageSize!==C.pageSize){var H=C.current,E=ke(y.pageSize,C,y);H=H>E?E:H,"current"in y||(J.current=H,J.currentInputValue=H),J.pageSize=y.pageSize}return J}}]),h}(k.a.Component);se.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:Y,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:Y,locale:W.a,style:{},itemRender:we,totalBoundaryShowSizeChanger:50};var le=se},"6K3P":function(Je,Ie,f){Je.exports=f.p+"static/jinshi.4887ef37.svg"},"7Cbv":function(Je,Ie,f){"use strict";var z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ve=new Uint8Array(16);function re(){if(!z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(ve)}var xe=/^(?:[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 me(ee){return typeof ee=="string"&&xe.test(ee)}for(var ae=me,j=[],x=0;x<256;++x)j.push((x+256).toString(16).substr(1));function k(ee){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=(j[ee[K+0]]+j[ee[K+1]]+j[ee[K+2]]+j[ee[K+3]]+"-"+j[ee[K+4]]+j[ee[K+5]]+"-"+j[ee[K+6]]+j[ee[K+7]]+"-"+j[ee[K+8]]+j[ee[K+9]]+"-"+j[ee[K+10]]+j[ee[K+11]]+j[ee[K+12]]+j[ee[K+13]]+j[ee[K+14]]+j[ee[K+15]]).toLowerCase();if(!ae(L))throw TypeError("Stringified UUID is invalid");return L}var P=k;function N(ee,K,L){ee=ee||{};var M=ee.random||(ee.rng||re)();if(M[6]=M[6]&15|64,M[8]=M[8]&63|128,K){L=L||0;for(var W=0;W<16;++W)K[L+W]=M[W];return K}return P(M)}var T=Ie.a=N},"7ahc":function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return ke});var z=f("k1fw"),ve=f("0Owb"),re=f("+L6B"),xe=f("2/Rp"),me=f("y8nQ"),ae=f("Vl3Y"),j=f("tJVT"),x=f("OaEy"),k=f("2fM7"),P=f("q1tI"),N=f.n(P),T=f("VrN/"),ee=f.n(T),K=f("p77/"),L=f.n(K),M=f("c5Ni"),W=f.n(M),Y=k.a.Option,_={labelCol:{span:4},wrapperCol:{span:20}},we={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ie.b=function(se){var le=se.callback,fe=se.onCancel,$=Object(P.useState)("python"),h=Object(j.a)($,2),X=h[0],y=h[1];function C(H){y(we[H][1])}function J(H){le(H)}return N.a.createElement(ae.a,Object(ve.a)({},_,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:J}),N.a.createElement(ae.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},N.a.createElement(k.a,{onChange:C},Object.keys(we).map(function(H){return N.a.createElement(Y,{key:H,value:H},we[H][0])}))),N.a.createElement(ae.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},N.a.createElement(ke,{mode:X})),N.a.createElement("div",{className:"flex-container flex-end"},N.a.createElement(xe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),N.a.createElement(xe.a,{type:"ghost",onClick:fe},"\u53D6\u6D88")))};function ke(se){var le=se.value,fe=se.onChange,$=se.mode,h=se.options,X=h===void 0?{}:h,y=Object(P.useRef)(),C=Object(P.useState)(),J=Object(j.a)(C,2),H=J[0],E=J[1];return Object(P.useEffect)(function(){if(H){function R(ie){var F=ie.getValue();fe&&fe(F)}return H.on("change",R),function(){H.off("change",R)}}},[H,fe]),Object(P.useEffect)(function(){H&&H.setOption("mode",$)},[H,$]),Object(P.useEffect)(function(){H&&((le!==H.getValue()||le==="")&&setTimeout(function(){H.setValue(le||" ")},300))},[H,le]),Object(P.useEffect)(function(){if(y.current&&!H){var R=ee.a.fromTextArea(y.current,Object(z.a)({mode:$,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},X));E(R)}},[y.current,H]),N.a.createElement("div",{className:"my-codemirror-container"},N.a.createElement("textarea",{ref:y}))}},"7ixt":function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return re});var z={adjustX:1,adjustY:1},ve=[0,0],re={left:{points:["cr","cl"],overflow:z,offset:[-4,0],targetOffset:ve},right:{points:["cl","cr"],overflow:z,offset:[4,0],targetOffset:ve},top:{points:["bc","tc"],overflow:z,offset:[0,-4],targetOffset:ve},bottom:{points:["tc","bc"],overflow:z,offset:[0,4],targetOffset:ve},topLeft:{points:["bl","tl"],overflow:z,offset:[0,-4],targetOffset:ve},leftTop:{points:["tr","tl"],overflow:z,offset:[-4,0],targetOffset:ve},topRight:{points:["br","tr"],overflow:z,offset:[0,-4],targetOffset:ve},rightTop:{points:["tl","tr"],overflow:z,offset:[4,0],targetOffset:ve},bottomRight:{points:["tr","br"],overflow:z,offset:[0,4],targetOffset:ve},rightBottom:{points:["bl","br"],overflow:z,offset:[4,0],targetOffset:ve},bottomLeft:{points:["tl","bl"],overflow:z,offset:[0,4],targetOffset:ve},leftBottom:{points:["br","bl"],overflow:z,offset:[-4,0],targetOffset:ve}},xe=re},"7qnI":function(Je,Ie,f){"use strict";var z=f("5Dmo"),ve=f("3S7+"),re=f("fWQN"),xe=f("mtLc"),me=f("yKVA"),ae=f("879j"),j=f("5NDa"),x=f("5rEg"),k=f("q1tI"),P=f.n(k),N=f("O2Wb"),T=f.n(N),ee=x.a.TextArea,K=function(L){Object(me.a)(W,L);var M=Object(ae.a)(W);function W(){return Object(re.a)(this,W),M.apply(this,arguments)}return Object(xe.a)(W,[{key:"render",value:function(){var _=this,we=this.props,ke=we.index,se=we.onAnswerChange,le=we.addChildAnswer,fe=we.exerciseIsPublish,$=we.answers,h=we.activeOptionErrorIndex,X=we.flex,y=X===void 0?"0 0 1000px":X;return P.a.createElement("div",{className:T.a.flex},P.a.createElement("div",{className:"".concat(T.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",ke+1,"):"),P.a.createElement("div",{className:"".concat(T.a.flex," ").concat(T.a.flex1),style:{flexDirection:"column"}},$.map(function(C,J){var H="".concat(ke,"-").concat(J);return P.a.createElement("div",{className:"".concat(T.a.flex," ").concat(T.a.flex1),key:J},P.a.createElement("div",{className:T.a.flex1,style:{flex:y}},P.a.createElement("div",null,P.a.createElement(ee,{className:H===h?T.a.error:"",spellCheck:!1,rows:4,value:C||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(J==0?"":"(\u53EF\u9009)"),onChange:function(R){return se(ke,J,R.target.value)},style:{minHeight:95}}))),!fe&&P.a.createElement(P.a.Fragment,null,J!=0&&P.a.createElement(ve.a,{title:"\u5220\u9664"},P.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _.props.deleteChildAnswer(ke,J)},style:{float:"right"}})),J===0&&P.a.createElement(ve.a,{title:"\u5220\u9664"},P.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _.props.deleteChildAnswermain(ke,J)},style:{float:"right"}})),P.a.createElement(ve.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},P.a.createElement("i",{className:"".concat(T.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return le(ke)},style:{float:"right",visibility:J==$.length-1?"":"hidden"}}))))})))}}]),W}(k.Component);Ie.a=K},"815F":function(Je,Ie,f){"use strict";f.d(Ie,"e",function(){return j}),f.d(Ie,"c",function(){return k}),f.d(Ie,"d",function(){return P}),f.d(Ie,"a",function(){return T}),f.d(Ie,"f",function(){return ee}),f.d(Ie,"b",function(){return K});var z=f("KQm4"),ve=f("VTBJ"),re=f("Ff2n"),xe=f("Zm9Q"),me=f("Kwbf"),ae=f("OZM5");function j(L,M){return L!=null?L:M}function x(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=new Map;function W(Y){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(Y||[]).forEach(function(we){var ke=we.key,se=we.children;Object(me.a)(ke!=null,"Tree node must have a certain key: [".concat(_).concat(ke,"]"));var le=String(ke);Object(me.a)(!M.has(le)||ke===null||ke===void 0,"Same 'key' exist in the Tree: ".concat(le)),M.set(le,!0),W(se,"".concat(_).concat(le," > "))})}W(L)}function k(L){function M(W){var Y=Object(xe.a)(W);return Y.map(function(_){if(!Object(ae.i)(_))return Object(me.a)(!_,"Tree/TreeNode can only accept TreeNode as children."),null;var we=_.key,ke=_.props,se=ke.children,le=Object(re.a)(ke,["children"]),fe=Object(ve.a)({key:we},le),$=M(se);return $.length&&(fe.children=$),fe}).filter(function(_){return _})}return M(L)}function P(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],W=new Set(M===!0?[]:M),Y=[];function _(we){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return we.map(function(se,le){var fe=Object(ae.h)(ke?ke.pos:"0",le),$=j(se.key,fe),h=Object(ve.a)(Object(ve.a)({},se),{},{parent:ke,pos:fe,children:null,data:se,isStart:[].concat(Object(z.a)(ke?ke.isStart:[]),[le===0]),isEnd:[].concat(Object(z.a)(ke?ke.isEnd:[]),[le===we.length-1])});return Y.push(h),M===!0||W.has($)?h.children=_(se.children||[],h):h.children=[],h})}return _(L),Y}function N(L,M,W){var Y;W?typeof W=="string"?Y=function(ke){return ke[W]}:typeof W=="function"&&(Y=function(ke){return W(ke)}):Y=function(ke,se){return j(ke.key,se)};function _(we,ke,se){var le=we?we.children:L,fe=we?Object(ae.h)(se.pos,ke):"0";if(we){var $=Y(we,fe),h={node:we,index:ke,pos:fe,key:$,parentPos:se.node?se.pos:null,level:se.level+1};M(h)}le&&le.forEach(function(X,y){_(X,y,{node:we,pos:fe,level:se?se.level+1:-1})})}_(null)}function T(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=M.initWrapper,Y=M.processEntity,_=M.onProcessFinished,we=arguments.length>2?arguments[2]:void 0,ke={},se={},le={posEntities:ke,keyEntities:se};return W&&(le=W(le)||le),N(L,function(fe){var $=fe.node,h=fe.index,X=fe.pos,y=fe.key,C=fe.parentPos,J=fe.level,H={node:$,index:h,key:y,pos:X,level:J},E=j(y,X);ke[X]=H,se[E]=H,H.parent=ke[C],H.parent&&(H.parent.children=H.parent.children||[],H.parent.children.push(H)),Y&&Y(H,le)},we),_&&_(le),le}function ee(L,M){var W=M.expandedKeys,Y=M.selectedKeys,_=M.loadedKeys,we=M.loadingKeys,ke=M.checkedKeys,se=M.halfCheckedKeys,le=M.dragOverNodeKey,fe=M.dropPosition,$=M.keyEntities,h=$[L],X={eventKey:L,expanded:W.indexOf(L)!==-1,selected:Y.indexOf(L)!==-1,loaded:_.indexOf(L)!==-1,loading:we.indexOf(L)!==-1,checked:ke.indexOf(L)!==-1,halfChecked:se.indexOf(L)!==-1,pos:String(h?h.pos:""),dragOver:le===L&&fe===0,dragOverGapTop:le===L&&fe===-1,dragOverGapBottom:le===L&&fe===1};return X}function K(L){var M=L.data,W=L.expanded,Y=L.selected,_=L.checked,we=L.loaded,ke=L.loading,se=L.halfChecked,le=L.dragOver,fe=L.dragOverGapTop,$=L.dragOverGapBottom,h=L.pos,X=L.active,y=Object(ve.a)(Object(ve.a)({},M),{},{expanded:W,selected:Y,checked:_,loaded:we,loading:ke,halfChecked:se,dragOver:le,dragOverGapTop:fe,dragOverGapBottom:$,pos:h,active:X});return"props"in y||Object.defineProperty(y,"props",{get:function(){return Object(me.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),L}}),y}},"8EBN":function(Je,Ie,f){(function(z){z(f("VrN/"))})(function(z){"use strict";z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ve=0;ve<z.modeInfo.length;ve++){var re=z.modeInfo[ve];re.mimes&&(re.mime=re.mimes[0])}z.findModeByMIME=function(xe){xe=xe.toLowerCase();for(var me=0;me<z.modeInfo.length;me++){var ae=z.modeInfo[me];if(ae.mime==xe)return ae;if(ae.mimes){for(var j=0;j<ae.mimes.length;j++)if(ae.mimes[j]==xe)return ae}}if(/\+xml$/.test(xe))return z.findModeByMIME("application/xml");if(/\+json$/.test(xe))return z.findModeByMIME("application/json")},z.findModeByExtension=function(xe){xe=xe.toLowerCase();for(var me=0;me<z.modeInfo.length;me++){var ae=z.modeInfo[me];if(ae.ext){for(var j=0;j<ae.ext.length;j++)if(ae.ext[j]==xe)return ae}}},z.findModeByFileName=function(xe){for(var me=0;me<z.modeInfo.length;me++){var ae=z.modeInfo[me];if(ae.file&&ae.file.test(xe))return ae}var j=xe.lastIndexOf("."),x=j>-1&&xe.substring(j+1,xe.length);if(x)return z.findModeByExtension(x)},z.findModeByName=function(xe){xe=xe.toLowerCase();for(var me=0;me<z.modeInfo.length;me++){var ae=z.modeInfo[me];if(ae.name.toLowerCase()==xe)return ae;if(ae.alias){for(var j=0;j<ae.alias.length;j++)if(ae.alias[j].toLowerCase()==xe)return ae}}}})},"8hTe":function(Je,Ie,f){Je.exports={button:"button___1wy9m"}},"9Bee":function(Je,Ie,f){"use strict";var z=f("DYRE"),ve=f("zeV3"),re=f("+L6B"),xe=f("2/Rp"),me=f("k1fw"),ae=f("9og8"),j=f("tJVT"),x=f("WmNS"),k=f.n(x),P=f("q1tI"),N=f.n(P),T=f("vg9a"),ee=f("DlQD"),K=f.n(ee),L=f("rUJ1");function M(d,r){var o=d.match(/^(\s+)(?:```)/);if(o===null)return r;var u=o[1];return r.split(`
|
|
`).map(function(v){var c=v.match(/^\s+/);if(c===null)return v;var ne=Object(j.a)(c,1),Ye=ne[0];return Ye.length>=u.length?v.slice(u.length):v}).join(`
|
|
`)}var W=[],Y=["<ul>"],_=new K.a.Renderer,we=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function ke(){W.length=0,Y=["<ul>"]}var se={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function le(d,r,o,u){if(r>=d.length||d[r].level<=o)return r;var v=d[r];u.push("<li><a href='#"+v.anchor+"'>"+v.text+"</a>"),r++;var c=[];return r=le(d,r,v.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(ne){u.push(ne)}),u.push("</ul>")),u.push("</li>"),r=le(d,r,o,u),r}function fe(){return le(W,0,0,Y),Y.push("</ul>"),Y.join("")}var $={heading:function(r){var o=we.exec(r);if(o)return{type:"heading",raw:o[0],depth:o[1].length,text:o[2]}},fences:function(r){var o=this.rules.block.fences.exec(r);if(o){var u=o[0],v=M(u,o[3]||""),c=o[2]?o[2].trim():o[2];if(["latex","katex","math"].indexOf(c)>=0){var ne=y(),Ye=v;v=ne,C[ne]={type:"block",expression:Ye}}return{type:"code",raw:u,lang:c,text:v}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,X=0,y=function(){return"__special_katext_id_".concat(X++,"__")},C={};function J(){return C}function H(){X=0,C={}}function E(d){return d=d.replace(h,function(r,o){var u=y();return C[u]={type:"inline",expression:o},u}),d}var R=_.listitem;_.listitem=function(d){return R(E(d))};var ie=_.paragraph;_.paragraph=function(d){return ie(E(d))};var F=_.tablecell;_.tablecell=function(d,r){return F(E(d),r)},_.code=function(d,r,o){var u=(r||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(d,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(r,'">').concat(o?d:Object(L.escape)(d,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(o?d:Object(L.escape)(d,!0))+"</code></pre>"},_.heading=function(d,r,o){var u=this.options.headerPrefix+o.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return W.push({anchor:u,level:r,text:d}),"<h"+r+' id="'+u+'">'+d+"</h"+r+">"},K.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),K.a.use({tokenizer:$,renderer:_});var be=K.a,O=f("SJMd"),m=f("ulZh"),oe=f.n(m),Be=f("m3rI"),Ae=f("Oy/b"),Xe=f("p5ED"),Oe=f("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 Te=function(d,r){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(o[v]=u[v])})(d,r)};function V(d,r){function o(){this.constructor=d}Te(d,r),d.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}function B(d,r,o,u){return new(o||(o=Promise))(function(v,c){function ne(Dt){try{_e(u.next(Dt))}catch(Ee){c(Ee)}}function Ye(Dt){try{_e(u.throw(Dt))}catch(Ee){c(Ee)}}function _e(Dt){var Ee;Dt.done?v(Dt.value):(Ee=Dt.value,Ee instanceof o?Ee:new o(function(ce){ce(Ee)})).then(ne,Ye)}_e((u=u.apply(d,r||[])).next())})}function ue(d,r){var o,u,v,c,ne={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return c={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ye(_e){return function(Dt){return function(Ee){if(o)throw new TypeError("Generator is already executing.");for(;ne;)try{if(o=1,u&&(v=2&Ee[0]?u.return:Ee[0]?u.throw||((v=u.return)&&v.call(u),0):u.next)&&!(v=v.call(u,Ee[1])).done)return v;switch(u=0,v&&(Ee=[2&Ee[0],v.value]),Ee[0]){case 0:case 1:v=Ee;break;case 4:return ne.label++,{value:Ee[1],done:!1};case 5:ne.label++,u=Ee[1],Ee=[0];continue;case 7:Ee=ne.ops.pop(),ne.trys.pop();continue;default:if(!(v=ne.trys,(v=v.length>0&&v[v.length-1])||Ee[0]!==6&&Ee[0]!==2)){ne=0;continue}if(Ee[0]===3&&(!v||Ee[1]>v[0]&&Ee[1]<v[3])){ne.label=Ee[1];break}if(Ee[0]===6&&ne.label<v[1]){ne.label=v[1],v=Ee;break}if(v&&ne.label<v[2]){ne.label=v[2],ne.ops.push(Ee);break}v[2]&&ne.ops.pop(),ne.trys.pop();continue}Ee=r.call(d,ne)}catch(ce){Ee=[6,ce],u=0}finally{o=v=0}if(5&Ee[0])throw Ee[1];return{value:Ee[0]?Ee[1]:void 0,done:!0}}([_e,Dt])}}}function D(){for(var d=0,r=0,o=arguments.length;r<o;r++)d+=arguments[r].length;var u=Array(d),v=0;for(r=0;r<o;r++)for(var c=arguments[r],ne=0,Ye=c.length;ne<Ye;ne++,v++)u[v]=c[ne];return u}var A=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(r,o){for(var u=0,v=o;u<v.length;u++){var c=v[u],ne=c[0],Ye=c[1];r.setAttribute(ne,Ye)}},d.createRect=function(r,o,u){var v=document.createElementNS("http://www.w3.org/2000/svg","rect");return v.setAttribute("width",r.toString()),v.setAttribute("height",o.toString()),u&&d.setAttributes(v,u),v},d.createLine=function(r,o,u,v,c){var ne=document.createElementNS("http://www.w3.org/2000/svg","line");return ne.setAttribute("x1",r.toString()),ne.setAttribute("y1",o.toString()),ne.setAttribute("x2",u.toString()),ne.setAttribute("y2",v.toString()),c&&d.setAttributes(ne,c),ne},d.createPolygon=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",r),o&&d.setAttributes(u,o),u},d.createCircle=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(r/2).toString()),u.setAttribute("cy",(r/2).toString()),u.setAttribute("r",r.toString()),o&&d.setAttributes(u,o),u},d.createEllipse=function(r,o,u){var v=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return v.setAttribute("cx",(r/2).toString()),v.setAttribute("cy",(o/2).toString()),v.setAttribute("rx",(r/2).toString()),v.setAttribute("ry",(o/2).toString()),u&&d.setAttributes(v,u),v},d.createGroup=function(r){var o=document.createElementNS("http://www.w3.org/2000/svg","g");return r&&d.setAttributes(o,r),o},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(r,o,u,v,c,ne,Ye){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(_e,[["id",r],["orient",o],["markerWidth",u.toString()],["markerHeight",v.toString()],["refX",c.toString()],["refY",ne.toString()]]),_e.appendChild(Ye),_e},d.createText=function(r){var o=document.createElementNS("http://www.w3.org/2000/svg","text");return o.setAttribute("x","0"),o.setAttribute("y","0"),r&&d.setAttributes(o,r),o},d.createTSpan=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=r,o&&d.setAttributes(u,o),u},d.createImage=function(r){var o=document.createElementNS("http://www.w3.org/2000/svg","image");return r&&d.setAttributes(o,r),o},d.createPoint=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=r,u.y=o,u},d.createPath=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",r),o&&d.setAttributes(u,o),u},d}(),pe=function(){function d(){}return d.addKey=function(r){d.key=r},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),he=function(){function d(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return d.prototype.rasterize=function(r,o,u){var v=this;return new Promise(function(c){var ne=u!==void 0?u:document.createElement("canvas");r===null&&(v.markersOnly=!0,v.naturalSize=!1);var Ye=document.createElementNS("http://www.w3.org/2000/svg","svg");Ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ye.setAttribute("width",o.width.baseVal.valueAsString),Ye.setAttribute("height",o.height.baseVal.valueAsString),Ye.setAttribute("viewBox","0 0 "+o.viewBox.baseVal.width.toString()+" "+o.viewBox.baseVal.height.toString()),Ye.innerHTML=o.innerHTML,v.naturalSize===!0?(Ye.width.baseVal.value=r.naturalWidth,Ye.height.baseVal.value=r.naturalHeight):v.width!==void 0&&v.height!==void 0&&(Ye.width.baseVal.value=v.width,Ye.height.baseVal.value=v.height),ne.width=Ye.width.baseVal.value,ne.height=Ye.height.baseVal.value;var _e=Ye.outerHTML,Dt=ne.getContext("2d");v.markersOnly!==!0&&Dt.drawImage(r,0,0,ne.width,ne.height);var Ee=window.URL,ce=new Image(ne.width,ne.height);ce.setAttribute("crossOrigin","anonymous");var ze=new Blob([_e],{type:"image/svg+xml"}),Rt=Ee.createObjectURL(ze);ce.onload=function(){Dt.drawImage(ce,0,0),Ee.revokeObjectURL(Rt);var Pt=ne.toDataURL(v.imageType,v.imageQuality);c(Pt)},ce.src=Rt})},d}(),Ze=function(){},Le=function(){function d(r){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+r+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),d.prototype.addClass=function(r){return this.styleSheet===void 0&&this.addStyleSheet(),r.name=""+this.classNamePrefix+r.localName,this.classes.push(r),this.styleSheet.sheet.insertRule("."+r.name+" {"+r.style+"}",this.styleSheet.sheet.cssRules.length),r},d.prototype.addRule=function(r){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(r),this.styleSheet.sheet.insertRule(r.selector+" {"+r.style+"}",this.styleSheet.sheet.cssRules.length)},d.prototype.addStyleSheet=function(){var r;this.styleSheet=document.createElement("style"),((r=this.styleSheetRoot)!==null&&r!==void 0?r:document.head).appendChild(this.styleSheet),this.addRule(new He("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Pe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Pe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},d.prototype.removeStyleSheet=function(){var r;this.styleSheet&&(((r=this.styleSheetRoot)!==null&&r!==void 0?r:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),He=function(d,r){this.selector=d,this.style=r},Pe=function(d,r){this.localName=d,this.style=r},je=function(){function d(r,o,u,v,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=r,this.displayMode=o,this.markerItems=u,this.uiStyleSettings=v,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return d.prototype.show=function(r){var o=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=r,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(c){var ne=document.createElement("div");ne.className=""+o.toolbarButtonStyleClass.name,ne.setAttribute("data-type-name",c.typeName),ne.innerHTML=c.icon,ne.addEventListener("click",function(){o.markerToolbarButtonClicked(ne,c)}),o.buttons.push(ne),o.markerButtons.push(ne)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var v=document.createElement("div");v.className=this.toolbarBlockStyleClass.name,v.style.whiteSpace="nowrap",v.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(v),this.addActionButton(v,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(v,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},d.prototype.addButtonClickListener=function(r){this.buttonClickListeners.push(r)},d.prototype.removeButtonClickListener=function(r){this.buttonClickListeners.indexOf(r)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(r),1)},d.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},d.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var r=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var o=0;o<this.markerButtons.length;o++)o<r||o===r&&this.markerButtons.length-1===r?this.markerButtonBlock.appendChild(this.markerButtons[o]):(o===r&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[o]))}},d.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},d.prototype.resetButtonStyles=function(){var r=this;this.buttons.forEach(function(o){o.className=o.className.replace(r.uiStyleSettings.toolbarButtonStyleColorsClassName?r.uiStyleSettings.toolbarButtonStyleColorsClassName:r.toolbarButtonStyleColorsClass.name,"").trim(),o.className=o.className.replace(r.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?r.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:r.toolbarActiveButtonStyleColorsClass.name,"").trim(),o.className+=" "+(r.uiStyleSettings.toolbarButtonStyleColorsClassName?r.uiStyleSettings.toolbarButtonStyleColorsClassName:r.toolbarButtonStyleColorsClass.name)})},d.prototype.addActionButton=function(r,o,u){var v=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=o,c.setAttribute("data-action",u),c.addEventListener("click",function(){v.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}r.appendChild(c),this.buttons.push(c)},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Pe("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Pe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Pe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Pe("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Pe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var r=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Pe("toolbar_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.toolbarButtonStyleColorsClass=this.styles.addClass(new Pe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},d.prototype.markerToolbarButtonClicked=function(r,o){this.setActiveButton(r),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",o)}),this.markerButtonOverflowBlock.style.display="none"},d.prototype.actionToolbarButtonClicked=function(r,o){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",o)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},d.prototype.setActiveButton=function(r){this.resetButtonStyles(),r.className=r.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),r.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},d.prototype.setActiveMarkerButton=function(r){var o=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===r});o&&this.setActiveButton(o)},d.prototype.setCurrentMarker=function(r){var o=this;this.currentMarker=r,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){o.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},d}(),Qe=function(){function d(r,o,u,v){this.panels=[],this.panelButtons=[],this.markerjsContainer=r,this.displayMode=o,this.uiStyleSettings=u,this.styles=v,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return d.prototype.addStyles=function(){var r;this.toolboxStyleClass=this.styles.addClass(new Pe("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Pe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Pe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Pe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Pe("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Pe("toolbox-panel-row_colors",`
|
|
background-color: `+((r=this.uiStyleSettings.toolboxBackgroundColor)!==null&&r!==void 0?r:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Pe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},d.prototype.show=function(r){var o;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=r,this.uiContainer.className=this.toolboxStyleClass.name+" "+((o=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&o!==void 0?o:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},d.prototype.setPanelButtons=function(r){var o,u,v=this;this.panels=r,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((o=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&o!==void 0?o:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var ne;c.uiStyleSettings=v.uiStyleSettings;var Ye=document.createElement("div");Ye.className=v.toolboxButtonStyleClass.name+" "+((ne=v.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ne!==void 0?ne:v.toolboxButtonStyleColorsClass.name),Ye.innerHTML=c.icon,Ye.title=c.title,Ye.addEventListener("click",function(){v.panelButtonClick(c)}),v.panelButtons.push(Ye),v.buttonRow.appendChild(Ye)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},d.prototype.panelButtonClick=function(r){var o=this,u=-1;if(r!==this.activePanel){u=this.panels.indexOf(r),this.panelRow.innerHTML="";var v=r.getUi();v.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(v),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=r}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){o.displayMode==="inline"?o.panelRow.style.display="none":o.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,ne){var Ye,_e;c.className=o.toolboxButtonStyleClass.name+" "+(ne===u?""+((Ye=o.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:o.toolboxActiveButtonStyleColorsClass.name):""+((_e=o.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:o.toolboxButtonStyleColorsClass.name))})},d}(),nt=function(d,r){this.title=d,this.icon=r},ot=function(d){function r(o,u,v,c){var ne=d.call(this,o,c||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ne.colors=[],ne.addTransparent=!1,ne.colorBoxes=[],ne.colors=u,ne.currentColor=v,ne.setCurrentColor=ne.setCurrentColor.bind(ne),ne.getColorBox=ne.getColorBox.bind(ne),ne}return V(r,d),r.prototype.getUi=function(){var o=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(v){var c=o.getColorBox(v);u.appendChild(c),o.colorBoxes.push(c)}),u},r.prototype.getColorBox=function(o){var u=this,v=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-v,ne=document.createElement("div");ne.style.display="inline-block",ne.style.boxSizing="content-box",ne.style.width=c-2+"px",ne.style.height=c-2+"px",ne.style.padding="1px",ne.style.marginRight="2px",ne.style.marginBottom="2px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.borderRadius=(c+2)/2+"px",ne.style.borderColor=o===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){u.setCurrentColor(o,ne)});var Ye=document.createElement("div");return Ye.style.display="inline-block",Ye.style.width=c-2+"px",Ye.style.height=c-2+"px",Ye.style.backgroundColor=o,Ye.style.borderRadius=c/2+"px",o==="transparent"&&(Ye.style.fill=this.uiStyleSettings.toolboxAccentColor,Ye.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),ne.appendChild(Ye),ne},r.prototype.setCurrentColor=function(o,u){var v=this;this.currentColor=o,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(o)},r}(nt),$e=function(){function d(r,o,u){this._state="new",this._isSelected=!1,this._container=r,this._overlayContainer=o,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(d.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(r){return!1},Object.defineProperty(d.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),d.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},d.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},d.prototype.pointerDown=function(r,o){},d.prototype.dblClick=function(r,o){},d.prototype.manipulate=function(r){},d.prototype.pointerUp=function(r){this.stateChanged()},d.prototype.dispose=function(){},d.prototype.addMarkerVisualToContainer=function(r){this.container.childNodes.length>0?this.container.insertBefore(r,this.container.childNodes[0]):this.container.appendChild(r)},d.prototype.getState=function(){return{typeName:d.typeName,state:this.state,notes:this.notes}},d.prototype.restoreState=function(r){this._state=r.state,this.notes=r.notes},d.prototype.scale=function(r,o){},d.prototype.colorChanged=function(r){this.onColorChanged&&this.onColorChanged(r),this.stateChanged()},d.prototype.fillColorChanged=function(r){this.onFillColorChanged&&this.onFillColorChanged(r),this.stateChanged()},d.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var r=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),r.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(r)&&this.onStateChanged(this)}},d.typeName="MarkerBase",d}(),Ke=function(){function d(){this.findGripByVisual=this.findGripByVisual.bind(this)}return d.prototype.findGripByVisual=function(r){return this.topLeft.ownsTarget(r)?this.topLeft:this.topCenter.ownsTarget(r)?this.topCenter:this.topRight.ownsTarget(r)?this.topRight:this.centerLeft.ownsTarget(r)?this.centerLeft:this.centerRight.ownsTarget(r)?this.centerRight:this.bottomLeft.ownsTarget(r)?this.bottomLeft:this.bottomCenter.ownsTarget(r)?this.bottomCenter:this.bottomRight.ownsTarget(r)?this.bottomRight:void 0},d}(),At=function(){function d(){this.GRIP_SIZE=10,this.visual=A.createGroup(),this.visual.appendChild(A.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(A.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(r){return r===this.visual||r===this.visual.childNodes[0]||r===this.visual.childNodes[1]},d}(),mt=function(){function d(){}return d.toITransformMatrix=function(r){return{a:r.a,b:r.b,c:r.c,d:r.d,e:r.e,f:r.f}},d.toSVGMatrix=function(r,o){return r.a=o.a,r.b=o.b,r.c=o.c,r.d=o.d,r.e=o.e,r.f=o.f,r},d}(),St=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(A.createTransform()),c.setupControlBox(),c}return V(r,d),Object.defineProperty(r.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"visual",{get:function(){return this._visual},set:function(o){this._visual=o;var u=A.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),r.prototype.ownsTarget=function(o){return!!d.prototype.ownsTarget.call(this,o)||!!(this.controlGrips.findGripByVisual(o)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(o))},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.state==="new"&&(this.left=o.x,this.top=o.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var v=this.unrotatePoint(o);if(this.manipulationStartX=v.x,this.manipulationStartY=v.y,this.offsetX=v.x-this.left,this.offsetY=v.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ne=this.container.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ne,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},r.prototype.pointerUp=function(o){var u=this.state;d.prototype.pointerUp.call(this,o),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(o),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},r.prototype.moveVisual=function(o){this.visual.style.transform="translate("+o.x+"px, "+o.y+"px)"},r.prototype.manipulate=function(o){var u=this.unrotatePoint(o);this.state==="creating"?this.resize(o):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(o)},r.prototype.resize=function(o){var u=this.manipulationStartLeft,v=this.manipulationStartWidth,c=this.manipulationStartTop,ne=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+o.x-this.manipulationStartX,v=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:v=this.manipulationStartWidth+o.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+o.y-this.manipulationStartY,ne=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ne=this.manipulationStartHeight+o.y-this.manipulationStartY}v>=0?(this.left=u,this.width=v):(this.left=u+v,this.width=-v),ne>=0?(this.top=c,this.height=ne):(this.top=c+ne,this.height=-ne),this.setSize()},r.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},r.prototype.rotate=function(o){if(Math.abs(o.x-this.centerX)>.1){var u=Math.sign(o.x-this.centerX);this.rotationAngle=180*Math.atan((o.y-this.centerY)/(o.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},r.prototype.applyRotation=function(){var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0)},r.prototype.rotatePoint=function(o){if(this.rotationAngle===0)return o;var u=this.container.getCTM(),v=A.createPoint(o.x,o.y);return{x:(v=v.matrixTransform(u)).x,y:v.y}},r.prototype.unrotatePoint=function(o){if(this.rotationAngle===0)return o;var u=this.container.getCTM();u=u.inverse();var v=A.createPoint(o.x,o.y);return{x:(v=v.matrixTransform(u)).x,y:v.y}},r.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},r.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},r.prototype.setupControlBox=function(){this.controlBox=A.createGroup();var o=A.createTransform();o.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(o),this.container.appendChild(this.controlBox),this.controlRect=A.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=A.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 Ke,this.addControlGrips(),this.controlBox.style.display="none"},r.prototype.adjustControlBox=function(){var o=this.controlBox.transform.baseVal.getItem(0);o.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(o,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()},r.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()},r.prototype.createGrip=function(){var o=new At;return o.visual.transform.baseVal.appendItem(A.createTransform()),this.controlBox.appendChild(o.visual),o},r.prototype.positionGrips=function(){var o=this.controlGrips.topLeft.GRIP_SIZE,u=-o/2,v=u,c=(this.width+this.CB_DISTANCE)/2-o/2,ne=(this.height+this.CB_DISTANCE)/2-o/2,Ye=this.height+this.CB_DISTANCE-o/2,_e=this.width+this.CB_DISTANCE-o/2;this.positionGrip(this.controlGrips.topLeft.visual,u,v),this.positionGrip(this.controlGrips.topCenter.visual,c,v),this.positionGrip(this.controlGrips.topRight.visual,_e,v),this.positionGrip(this.controlGrips.centerLeft.visual,u,ne),this.positionGrip(this.controlGrips.centerRight.visual,_e,ne),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ye),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ye),this.positionGrip(this.controlGrips.bottomRight.visual,_e,Ye),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,v-3*this.CB_DISTANCE)},r.prototype.positionGrip=function(o,u,v){var c=o.transform.baseVal.getItem(0);c.setTranslate(u,v),o.transform.baseVal.replaceItem(c,0)},r.prototype.hideControlBox=function(){this.controlBox.style.display="none"},r.prototype.showControlBox=function(){this.controlBox.style.display=""},r.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:mt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:mt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},d.prototype.getState.call(this))},r.prototype.restoreState=function(o){d.prototype.restoreState.call(this,o);var u=o;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(mt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(mt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u);var v=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:v.x*o,y:v.y*u});this.left=c.x,this.top=c.y,this.width=this.width*o,this.height=this.height*u,this.adjustControlBox()},r}($e),ct=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return V(r,d),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.visual)},r.prototype.createVisual=function(){this.visual=A.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)},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.state==="new"&&(this.createVisual(),this.moveVisual(o),this._state="creating")},r.prototype.manipulate=function(o){d.prototype.manipulate.call(this,o)},r.prototype.resize=function(o){d.prototype.resize.call(this,o),this.setSize()},r.prototype.setSize=function(){d.prototype.setSize.call(this),A.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},r.prototype.pointerUp=function(o){d.prototype.pointerUp.call(this,o),this.setSize()},r.prototype.setStrokeColor=function(o){this.strokeColor=o,this.visual&&A.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(o),this.stateChanged()},r.prototype.setFillColor=function(o){this.fillColor=o,this.visual&&A.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},r.prototype.setStrokeWidth=function(o){this.strokeWidth=o,this.visual&&A.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},r.prototype.setStrokeDasharray=function(o){this.strokeDasharray=o,this.visual&&A.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},r.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},d.prototype.getState.call(this))},r.prototype.restoreState=function(o){var u=o;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),d.prototype.restoreState.call(this,o),this.setSize()},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u),this.setSize()},r.title="Rectangle marker",r}(St),Ot=function(d){function r(o,u,v,c){var ne=d.call(this,o,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ne.widths=[],ne.widthBoxes=[],ne.widths=u,ne.currentWidth=v,ne.setCurrentWidth=ne.setCurrentWidth.bind(ne),ne}return V(r,d),r.prototype.getUi=function(){var o=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(v){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=v===o.currentWidth?o.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){o.setCurrentWidth(v,c)}),u.appendChild(c);var ne=document.createElement("div");ne.innerText=v.toString(),ne.style.marginRight="5px",c.appendChild(ne);var Ye=document.createElement("div");Ye.style.minHeight="20px",Ye.style.flexGrow="2",Ye.style.display="flex",Ye.style.alignItems="center";var _e=document.createElement("hr");_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop=v+"px solid "+o.uiStyleSettings.toolboxColor,_e.style.flexGrow="2",Ye.appendChild(_e),c.appendChild(Ye),o.widthBoxes.push(c)}),u},r.prototype.setCurrentWidth=function(o,u){var v=this;this.currentWidth=o,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},r}(nt),Ct=function(d){function r(o,u,v,c){var ne=d.call(this,o,c||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ne.styles=[],ne.styleBoxes=[],ne.styles=u,ne.currentStyle=v,ne.setCurrentStyle=ne.setCurrentStyle.bind(ne),ne}return V(r,d),r.prototype.getUi=function(){var o=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(v){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/o.styles.length-5+"%",c.style.borderColor=v===o.currentStyle?o.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){o.setCurrentStyle(v,c)}),u.appendChild(c);var ne=document.createElement("div");ne.style.minHeight="20px",ne.style.flexGrow="2",ne.style.overflow="hidden";var Ye=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+o.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(v!==""?'stroke-dasharray="'+v+'"':"")+` />
|
|
</svg>`;ne.innerHTML=Ye,c.appendChild(ne),o.styleBoxes.push(c)}),u},r.prototype.setCurrentStyle=function(o,u){var v=this;this.currentStyle=o,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},r}(nt),yt=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.strokePanel=new ot("Line color",v.defaultColorSet,v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ot("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ct("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return V(r,d),Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=d.prototype.getState.call(this);return o.typeName=r.typeName,o},r.typeName="FrameMarker",r.title="Frame marker",r.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',r}(ct),De=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(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return V(r,d),r.prototype.ownsTarget=function(o){return!!d.prototype.ownsTarget.call(this,o)||!(!this.grip1.ownsTarget(o)&&!this.grip2.ownsTarget(o))},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.manipulationStartX=o.x,this.manipulationStartY=o.y,this.state==="new"&&(this.x1=o.x,this.y1=o.y,this.x2=o.x,this.y2=o.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")},r.prototype.pointerUp=function(o){var u=this.state;d.prototype.pointerUp.call(this,o),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(o),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},r.prototype.adjustVisual=function(){},r.prototype.manipulate=function(o){this.state==="creating"?this.resize(o):this.state==="move"?(this.x1=this.manipulationStartX1+o.x-this.manipulationStartX,this.y1=this.manipulationStartY1+o.y-this.manipulationStartY,this.x2=this.manipulationStartX2+o.x-this.manipulationStartX,this.y2=this.manipulationStartY2+o.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(o)},r.prototype.resize=function(o){switch(this.activeGrip){case this.grip1:this.x1=o.x,this.y1=o.y;break;case this.grip2:case void 0:this.x2=o.x,this.y2=o.y}this.adjustVisual(),this.adjustControlBox()},r.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},r.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},r.prototype.setupControlBox=function(){this.controlBox=A.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},r.prototype.adjustControlBox=function(){this.positionGrips()},r.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},r.prototype.createGrip=function(){var o=new At;return o.visual.transform.baseVal.appendItem(A.createTransform()),this.controlBox.appendChild(o.visual),o},r.prototype.positionGrips=function(){var o=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-o/2,this.y1-o/2),this.positionGrip(this.grip2.visual,this.x2-o/2,this.y2-o/2)},r.prototype.positionGrip=function(o,u,v){var c=o.transform.baseVal.getItem(0);c.setTranslate(u,v),o.transform.baseVal.replaceItem(c,0)},r.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},d.prototype.getState.call(this))},r.prototype.restoreState=function(o){d.prototype.restoreState.call(this,o);var u=o;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u),this.x1=this.x1*o,this.y1=this.y1*u,this.x2=this.x2*o,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},r}($e),kt=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.strokePanel=new ot("Line color",v.defaultColorSet,v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ot("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ct("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return V(r,d),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.visual&&o!==this.selectorLine&&o!==this.visibleLine)},r.prototype.createVisual=function(){this.visual=A.createGroup(),this.selectorLine=A.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=A.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)},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},r.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()),A.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),A.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),A.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},r.prototype.setStrokeColor=function(o){this.strokeColor=o,this.adjustVisual(),this.colorChanged(o)},r.prototype.setStrokeWidth=function(o){this.strokeWidth=o,this.adjustVisual()},r.prototype.setStrokeDasharray=function(o){this.strokeDasharray=o,this.adjustVisual(),this.stateChanged()},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){d.prototype.restoreState.call(this,o);var u=o;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},r.typeName="LineMarker",r.title="Line marker",r.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',r}(Ut),Ue=function(d){function r(o,u,v,c){var ne=d.call(this,o,c||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ne.fonts=[],ne.fontBoxes=[],ne.fonts=u,ne.currentFont=v,ne.setCurrentFont=ne.setCurrentFont.bind(ne),ne}return V(r,d),r.prototype.getUi=function(){var o=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(v){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/o.fonts.length-5+"%",c.style.borderColor=v===o.currentFont?o.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){o.setCurrentFont(v,c)}),u.appendChild(c);var ne=document.createElement("div");ne.style.display="flex",ne.style.minHeight="20px",ne.style.flexGrow="2",ne.style.fontFamily=v,ne.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",ne.appendChild(Ye),c.appendChild(ne),o.fontBoxes.push(c)}),u},r.prototype.setCurrentFont=function(o,u){var v=this;this.currentFont=o,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},r}(nt),We=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=v.defaultColor,c.fontFamily=v.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new ot("Color",v.defaultColorSet,v.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new Ue("Font",v.defaultFontFamilies,v.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return V(r,d),r.prototype.ownsTarget=function(o){if(d.prototype.ownsTarget.call(this,o)||o===this.visual||o===this.textElement||o===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(v){v===o&&(u=!0)}),u},r.prototype.createVisual=function(){this.visual=A.createGroup(),this.bgRectangle=A.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=A.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(A.createTransform()),this.textElement.transform.baseVal.appendItem(A.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.isMoved=!1,this.pointerDownPoint=o,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(o),this._state="creating")},r.prototype.renderText=function(){var o=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){o.textElement.appendChild(A.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},r.prototype.getTextScale=function(){var o=this.textElement.getBBox(),u=1;if(o.width>0&&o.height>0){var v=(1*this.width-this.width*this.padding*2/100)/o.width,c=(1*this.height-this.height*this.padding*2/100)/o.height;u=Math.min(v,c)}return u},r.prototype.getTextPosition=function(o){var u=this.textElement.getBBox(),v=0,c=0;return u.width>0&&u.height>0&&(v=(this.width-u.width*o)/2,c=this.height/2-u.height*o/2),{x:v,y:c}},r.prototype.sizeText=function(){var o=this.textElement.getBBox(),u=this.getTextScale(),v=this.getTextPosition(u);v.y-=o.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+v.x+"px, "+v.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(v.x,v.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},r.prototype.manipulate=function(o){d.prototype.manipulate.call(this,o),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(o.x-this.pointerDownPoint.x)>5||Math.abs(o.y-this.pointerDownPoint.y)>5)},r.prototype.resize=function(o){d.prototype.resize.call(this,o),this.isMoved=!0,this.setSize(),this.sizeText()},r.prototype.setSize=function(){d.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(A.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),A.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},r.prototype.pointerUp=function(o){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),d.prototype.pointerUp.call(this,o),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},r.prototype.showTextEditor=function(){var o=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(o.textEditor.style.fontSize);o.textEditor.clientWidth>=Number.parseInt(o.textEditor.style.maxWidth)&&u>.9;)u-=.1,o.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 v=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(v)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){o.textEditDivClicked(o.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},r.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var o=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),v=this.textElement.getBBox(),c={x:v.width*o,y:v.height*o};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*o,12)+"px",this.textElement.style.display="none"}},r.prototype.textEditDivClicked=function(o){this.text=o.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},r.prototype.select=function(){d.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},r.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),d.prototype.deselect.call(this)},r.prototype.dblClick=function(o,u){d.prototype.dblClick.call(this,o,u),this.showTextEditor()},r.prototype.setColor=function(o){this.textElement&&A.setAttributes(this.textElement,[["fill",o]]),this.color=o,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(o)},r.prototype.setFont=function(o){this.textElement&&A.setAttributes(this.textElement,[["font-family",o]]),this.fontFamily=o,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},r.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},r.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){var u=o;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),d.prototype.restoreState.call(this,o),this.setSize()},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u),this.setSize(),this.sizeText(),this.positionTextEditor()},r.typeName="TextMarker",r.title="Text marker",r.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',r}(St),G=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=v.defaultColor,c.lineWidth=v.defaultStrokeWidth,c.pixelRatio=v.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new ot("Color",v.defaultColorSet,v.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Ot("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return V(r,d),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.visual&&o!==this.drawingImage)},r.prototype.createVisual=function(){this.visual=A.createGroup(),this.drawingImage=A.createImage(),this.visual.appendChild(this.drawingImage);var o=A.createTransform();this.visual.transform.baseVal.appendItem(o),this.addMarkerVisualToContainer(this.visual)},r.prototype.pointerDown=function(o,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(o.x,o.y),this.drawing=!0):d.prototype.pointerDown.call(this,o,u)},r.prototype.manipulate=function(o){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(o.x,o.y),this.canvasContext.stroke()):d.prototype.manipulate.call(this,o)},r.prototype.resize=function(o){d.prototype.resize.call(this,o),A.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),A.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},r.prototype.pointerUp=function(o){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):d.prototype.pointerUp.call(this,o)},r.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)},r.prototype.select=function(){this.state==="creating"&&this.finishCreation(),d.prototype.select.call(this)},r.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),d.prototype.deselect.call(this)},r.prototype.finishCreation=function(){for(var o=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],v=u[0],c=u[1],ne=u[2],Ye=u[3],_e=!1,Dt=0;Dt<this.canvasElement.height;Dt++)for(var Ee=0;Ee<this.canvasElement.width;Ee++)o.data[Dt*this.canvasElement.width*4+4*Ee+3]>0&&(_e=!0,Dt<c&&(c=Dt),Ee<v&&(v=Ee),Dt>Ye&&(Ye=Dt),Ee>ne&&(ne=Ee));if(_e){this.left=v/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(ne-v)/this.pixelRatio,this.height=(Ye-c)/this.pixelRatio;var ce=document.createElement("canvas");ce.width=ne-v,ce.height=Ye-c,ce.getContext("2d").putImageData(this.canvasContext.getImageData(v,c,ne-v,Ye-c),0,0),this.drawingImgUrl=ce.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},r.prototype.setDrawingImage=function(){A.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),A.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},r.prototype.setColor=function(o){this.color=o,this.colorChanged(o)},r.prototype.setLineWidth=function(o){this.lineWidth=o},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=Object.assign({drawingImgUrl:this.drawingImgUrl},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){this.createVisual(),d.prototype.restoreState.call(this,o),this.drawingImgUrl=o.drawingImgUrl,this.setDrawingImage()},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u),this.setDrawingImage()},r.typeName="FreehandMarker",r.title="Freehand marker",r.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',r}(St),q=function(d){function r(o,u,v){var c=d.call(this,o,v||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return V(r,d),r.prototype.getUi=function(){var o=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var v=function(Ye){var _e="both";switch(Ye){case 0:_e="both";break;case 1:_e="start";break;case 2:_e="end";break;case 3:_e="none"}var Dt=document.createElement("div");if(Dt.style.display="flex",Dt.style.flexGrow="2",Dt.style.alignItems="center",Dt.style.justifyContent="space-between",Dt.style.padding="5px",Dt.style.borderWidth="2px",Dt.style.borderStyle="solid",Dt.style.borderColor=_e===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",Dt.addEventListener("click",function(){o.setCurrentType(_e,Dt)}),u.appendChild(Dt),_e==="both"||_e==="start"){var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.alignItems="center",Ee.style.minHeight="20px",Ee.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ee.style.marginLeft="5px",Dt.appendChild(Ee)}var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.minHeight="20px",ce.style.flexGrow="2";var ze=document.createElement("hr");if(ze.style.minWidth="20px",ze.style.border="0px",ze.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),ze.style.flexGrow="2",ce.appendChild(ze),Dt.appendChild(ce),_e==="both"||_e==="end"){var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Rt.style.marginRight="5px",Dt.appendChild(Rt)}c.typeBoxes.push(Dt)},c=this,ne=0;ne<4;ne++)v(ne);return u},r.prototype.setCurrentType=function(o,u){var v=this;this.currentType=o,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings!==void 0?v.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},r}(nt),Q=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new q("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return V(r,d),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.arrow1&&o!==this.arrow2)},r.prototype.getArrowPoints=function(o,u){var v=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return o-v/2+","+(u+c/2)+" "+o+","+(u-c/2)+" "+(o+v/2)+","+(u+c/2)},r.prototype.createTips=function(){this.arrow1=A.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(A.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=A.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(A.createTransform()),this.visual.appendChild(this.arrow2)},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.state==="creating"&&this.createTips()},r.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",A.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),A.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var o=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(o,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var v=this.arrow2.transform.baseVal.getItem(0);v.setRotate(o+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(v,0)}},r.prototype.setArrowType=function(o){this.arrowType=o,this.adjustVisual(),this.stateChanged()},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=Object.assign({arrowType:this.arrowType},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){d.prototype.restoreState.call(this,o);var u=o;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},r.typeName="ArrowMarker",r.title="Arrow marker",r.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',r}(kt),w=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.fillColor=v.defaultFillColor,c.strokeWidth=0,c.fillPanel=new ot("Color",v.defaultColorSet,v.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return V(r,d),Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=d.prototype.getState.call(this);return o.typeName=r.typeName,o},r.typeName="CoverMarker",r.title="Cover marker",r.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',r}(ct),S=function(d){function r(o,u,v,c){var ne=d.call(this,o,c||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ne.opacities=[],ne.opacityBoxes=[],ne.opacities=u,ne.currentOpacity=v,ne.setCurrentOpacity=ne.setCurrentOpacity.bind(ne),ne}return V(r,d),r.prototype.getUi=function(){var o=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(v){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=v===o.currentOpacity?o.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){o.setCurrentOpacity(v,c)}),u.appendChild(c);var ne=document.createElement("div");ne.innerText=100*v+"%",c.appendChild(ne),o.opacityBoxes.push(c)}),u},r.prototype.setCurrentOpacity=function(o,u){var v=this;this.currentOpacity=o,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},r}(nt),U=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=v.defaultHighlightColor,c.strokeWidth=0,c.opacity=v.defaultHighlightOpacity,c.fillPanel=new ot("Color",v.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new S("Opacity",v.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return V(r,d),r.prototype.setOpacity=function(o){this.opacity=o,this.visual&&A.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=d.prototype.getState.call(this);return o.typeName=r.typeName,o},r.typeName="HighlightMarker",r.title="Highlight marker",r.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',r}(w),I='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',de=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=v.defaultStrokeColor,c.bgColor=v.defaultFillColor,c.fontFamily=v.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new ot("Text color",v.defaultColorSet,c.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new ot("Fill color",v.defaultColorSet,c.bgColor,I),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new Ue("Font",v.defaultFontFamilies,v.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new At,c.tipGrip.visual.transform.baseVal.appendItem(A.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return V(r,d),r.prototype.ownsTarget=function(o){return d.prototype.ownsTarget.call(this,o)||this.tipGrip.ownsTarget(o)||this.tip===o},r.prototype.createTip=function(){A.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=A.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},r.prototype.pointerDown=function(o,u){this.state==="new"&&d.prototype.pointerDown.call(this,o,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):d.prototype.pointerDown.call(this,o,u)},r.prototype.pointerUp=function(o){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,d.prototype.pointerUp.call(this,o);else{var u=this.state==="creating";d.prototype.pointerUp.call(this,o),this.setTipPoints(u),this.positionTip()}},r.prototype.manipulate=function(o){if(this.tipMoving){var u=this.unrotatePoint(o);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else d.prototype.manipulate.call(this,o)},r.prototype.setBgColor=function(o){this.bgRectangle&&this.tip&&(A.setAttributes(this.bgRectangle,[["fill",o]]),A.setAttributes(this.tip,[["fill",o]])),this.bgColor=o,this.fillColorChanged(o)},r.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},r.prototype.setTipPoints=function(o){o===void 0&&(o=!1);var u=Math.min(this.height/2,15),v=this.height/5;o&&(this.tipPosition={x:u+v/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+v,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+v}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-v,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+v}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-v,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-v},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+v,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-v})},r.prototype.resize=function(o){d.prototype.resize.call(this,o),this.positionTip()},r.prototype.positionTip=function(){A.setAttributes(this.tip,[["points",this.getTipPoints()]]);var o=this.tipGrip.visual.transform.baseVal.getItem(0);o.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(o,0)},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),r.prototype.select=function(){this.positionTip(),d.prototype.select.call(this)},r.prototype.getState=function(){var o=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){var u=o;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,d.prototype.restoreState.call(this,o),this.createTip(),this.setTipPoints()},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u),this.tipPosition={x:this.tipPosition.x*o,y:this.tipPosition.y*u},this.positionTip()},r.typeName="CalloutMarker",r.title="Callout marker",r.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',r}(We),Ce=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.fillColor=v.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new ot("Line color",D(v.defaultColorSet,["transparent"]),v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new ot("Fill color",D(v.defaultColorSet,["transparent"]),c.fillColor,I),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Ot("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ct("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new S("Opacity",v.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return V(r,d),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.visual)},r.prototype.createVisual=function(){this.visual=A.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.state==="new"&&(this.createVisual(),this.moveVisual(o),this._state="creating")},r.prototype.manipulate=function(o){d.prototype.manipulate.call(this,o)},r.prototype.resize=function(o){d.prototype.resize.call(this,o),this.setSize()},r.prototype.setSize=function(){d.prototype.setSize.call(this),A.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},r.prototype.pointerUp=function(o){d.prototype.pointerUp.call(this,o),this.setSize()},r.prototype.setStrokeColor=function(o){this.strokeColor=o,this.visual&&A.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(o),this.stateChanged()},r.prototype.setFillColor=function(o){this.fillColor=o,this.visual&&A.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(o),this.stateChanged()},r.prototype.setStrokeWidth=function(o){this.strokeWidth=o,this.visual&&A.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},r.prototype.setStrokeDasharray=function(o){this.strokeDasharray=o,this.visual&&A.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},r.prototype.setOpacity=function(o){this.opacity=o,this.visual&&A.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){var u=o;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),d.prototype.restoreState.call(this,o),this.setSize()},r.prototype.scale=function(o,u){d.prototype.scale.call(this,o,u),this.setSize()},r.typeName="EllipseMarker",r.title="Ellipse marker",r.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',r}(St),Re=function(d){function r(o,u,v){return d.call(this,o,u,v)||this}return V(r,d),Object.defineProperty(r.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.tip1&&o!==this.tip2)},r.prototype.createTips=function(){this.tip1=A.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(A.createTransform()),this.visual.appendChild(this.tip1),this.tip2=A.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(A.createTransform()),this.visual.appendChild(this.tip2)},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.state==="creating"&&this.createTips()},r.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(A.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),A.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var o=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(o,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var v=this.tip2.transform.baseVal.getItem(0);v.setRotate(o+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(v,0)}},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=d.prototype.getState.call(this);return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){d.prototype.restoreState.call(this,o),this.createTips(),this.adjustVisual()},r.typeName="MeasurementMarker",r.title="Measurement marker",r.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',r}(kt),bt=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.strokePanel.colors=v.defaultColorSet,c.fillColor="transparent",c}return V(r,d),Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=d.prototype.getState.call(this);return o.typeName=r.typeName,o},r.typeName="EllipseFrameMarker",r.title="Ellipse frame marker",r.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',r}(Ce),rt=function(){function d(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),d.prototype.addUndoStep=function(r){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(r)||(this.undoStack.push(r),JSON.stringify(this.lastRedoStep)!==JSON.stringify(r)&&this.redoStack.splice(0,this.redoStack.length))},d.prototype.replaceLastUndoStep=function(r){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=r)},d.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},d.prototype.undo=function(){if(this.undoStack.length>1){var r=this.undoStack.pop();return r!==void 0&&this.redoStack.push(r),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},d.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},d}(),ge=function(d){function r(o,u,v){var c=d.call(this,o,u,v)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.strokePanel=new ot("Line color",v.defaultColorSet,v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ot("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ct("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return V(r,d),r.prototype.ownsTarget=function(o){return!(!d.prototype.ownsTarget.call(this,o)&&o!==this.visual&&o!==this.selectorCurve&&o!==this.visibleCurve&&!this.curveGrip.ownsTarget(o))},r.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},r.prototype.createVisual=function(){this.visual=A.createGroup(),this.selectorCurve=A.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=A.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)},r.prototype.pointerDown=function(o,u){d.prototype.pointerDown.call(this,o,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=o.x,this.curveY=o.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},r.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),A.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),A.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),A.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},r.prototype.setupControlBox=function(){d.prototype.setupControlBox.call(this),this.curveControlLine1=A.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=A.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)},r.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,d.prototype.addControlGrips.call(this)},r.prototype.positionGrips=function(){d.prototype.positionGrips.call(this);var o=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-o/2,this.curveY-o/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()))},r.prototype.manipulate=function(o){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+o.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+o.y-this.manipulationStartY),d.prototype.manipulate.call(this,o)},r.prototype.resize=function(o){this.activeGrip===this.curveGrip&&(this.curveX=o.x,this.curveY=o.y),d.prototype.resize.call(this,o),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},r.prototype.setStrokeColor=function(o){this.strokeColor=o,this.adjustVisual(),this.colorChanged(o)},r.prototype.setStrokeWidth=function(o){this.strokeWidth=o,this.adjustVisual()},r.prototype.setStrokeDasharray=function(o){this.strokeDasharray=o,this.adjustVisual()},r.prototype.scale=function(o,u){this.curveX=this.curveX*o,this.curveY=this.curveY*u,d.prototype.scale.call(this,o,u)},Object.defineProperty(r.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),r.prototype.getState=function(){var o=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},d.prototype.getState.call(this));return o.typeName=r.typeName,o},r.prototype.restoreState=function(o){d.prototype.restoreState.call(this,o);var u=o;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},r.typeName="CurveMarker",r.title="Curve marker",r.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',r}(Ut),ut=function(){function d(r,o){o===void 0&&(o=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=r,this.cancelable=o}return Object.defineProperty(d.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),d.prototype.preventDefault=function(){this._defaultPrevented=!0},d}(),_t=function(d){function r(o,u,v){var c=d.call(this,o,!1)||this;return c.dataUrl=u,c.state=v,c}return V(r,d),r}(ut),et=function(d){function r(o,u,v){v===void 0&&(v=!1);var c=d.call(this,o,v)||this;return c.marker=u,c}return V(r,d),r}(ut),Bt=function(){function d(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return d.prototype.addEventListener=function(r,o){this[r].push(o)},d.prototype.removeEventListener=function(r,o){var u=this[r].indexOf(o);u>-1&&this[r].splice(u,1)},d}(),qe=function(){function d(r){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new De,this._isOpen=!1,this.undoRedoManager=new rt,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 Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=d.instanceCounter++,this.styles=new Le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=r,this.targetRoot=document.body,this.width=r.clientWidth,this.height=r.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(d.prototype,"ALL_MARKER_TYPES",{get:function(){return[yt,G,Q,We,bt,Ce,U,de,Re,w,kt,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[yt,G,Q,We,Ce,U,de]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"BASIC_MARKER_TYPES",{get:function(){return[yt,G,Q,We,U]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(r){var o=this;this._availableMarkerTypes.splice(0),r.forEach(function(u){if(typeof u=="string"){var v=o.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});v!==void 0&&o._availableMarkerTypes.push(v)}else o._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(r){this._zoomLevel=r,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},d.prototype.show=function(){var r=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(o){return o(new ut(r))})},d.prototype.render=function(){return B(this,void 0,void 0,function(){var r;return ue(this,function(o){switch(o.label){case 0:return this.setCurrentMarker(),(r=new he).naturalSize=this.renderAtNaturalSize,r.imageType=this.renderImageType,r.imageQuality=this.renderImageQuality,r.markersOnly=this.renderMarkersOnly,r.width=this.renderWidth,r.height=this.renderHeight,[4,r.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return o.sent(),[4,r.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,o.sent()]}})})},d.prototype.close=function(r){var o=this;if(r===void 0&&(r=!1),this.isOpen){var u=!1;r||this.eventListeners.beforeclose.forEach(function(v){var c=new ut(o,!0);v(c),c.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(v){return v(new ut(o))}),this.detachEvents(),this._isOpen=!1)}},d.prototype.addMarkersToToolbar=function(){for(var r,o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];(r=this._availableMarkerTypes).push.apply(r,o)},d.prototype.addRenderEventListener=function(r){this.addEventListener("render",function(o){r(o.dataUrl,o.state)})},d.prototype.removeRenderEventListener=function(r){},d.prototype.addCloseEventListener=function(r){this.addEventListener("close",function(){r()})},d.prototype.removeCloseEventListener=function(r){},d.prototype.setupResizeObserver=function(){var r=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){r.resize(r.target.clientWidth,r.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return r.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},d.prototype.onPopupTargetResize=function(){var r=1*this.target.clientWidth/this.target.clientHeight,o=this.editorCanvas.clientWidth/r>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*r:this.editorCanvas.clientWidth,u=o<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/r;this.resize(o,u)},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.prototype.resize=function(r,o){this._isResizing=!0;var u=r/this.imageWidth,v=o/this.imageHeight;this.imageWidth=Math.round(r),this.imageHeight=Math.round(o),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,v),this._isResizing=!1},d.prototype.scaleMarkers=function(r,o){var u,v=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(r,o):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==v._currentMarker&&c.scale(r,o)}),u!==void 0&&this.setCurrentMarker(u)},d.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},d.prototype.setTopLeft=function(){var r=this.editingTarget.getBoundingClientRect(),o=this.editorCanvas.getBoundingClientRect();this.left=r.left-o.left,this.top=r.top-o.top},d.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},d.prototype.addDefs=function(){for(var r,o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];this.defs=A.createDefs(),this.addDefsToImage(),(r=this.defs).append.apply(r,o)},d.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},d.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},d.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},d.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},d.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},d.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},d.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},d.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var r=document.createElement("a");r.href="https://markerjs.com/",r.target="_blank",r.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',r.title="Powered by marker.js",r.style.display="grid",r.style.alignItems="center",r.style.justifyItems="center",r.style.padding="3px",r.style.width="20px",r.style.height="20px",this.logoUI.appendChild(r),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},d.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},d.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var r=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=r+"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 je(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Qe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},d.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.removeMarker=function(r){this.markerImage.removeChild(r.container),this.markers.indexOf(r)>-1&&this.markers.splice(this.markers.indexOf(r),1),r.dispose()},d.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},d.prototype.toolbarButtonClicked=function(r,o){if(r==="marker"&&o!==void 0)this.createNewMarker(o);else if(r==="action")switch(o){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},d.prototype.deleteSelectedMarker=function(){var r=this;if(this._currentMarker!==void 0){var o=!1;if(this.eventListeners.markerbeforedelete.forEach(function(v){var c=new et(r,r._currentMarker,!0);v(c),c.defaultPrevented&&(o=!0)}),!o){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(v){return v(new et(r,u))})}}},d.prototype.clear=function(){var r=this,o=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ne){var Ye=new et(r,void 0,!0);ne(Ye),Ye.defaultPrevented&&(o=!0)}),!o)){this.setCurrentMarker();for(var u=function(ne){var Ye=v.markers[ne];v.setCurrentMarker(v.markers[ne]),v._currentMarker.dispose(),v.markerImage.removeChild(v._currentMarker.container),v.markers.splice(v.markers.indexOf(v._currentMarker),1),v.eventListeners.markerdelete.forEach(function(_e){return _e(new et(r,Ye))})},v=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(d.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),d.prototype.showNotesEditor=function(){var r;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=(r=this._currentMarker.notes)!==null&&r!==void 0?r:"",this.overlayContainer.appendChild(this.notesArea))},d.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},d.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},d.prototype.addUndoStep=function(){var r=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var o=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===o.width&&u.height===o.height){var v=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(o),v<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new ut(r))})}else this.undoRedoManager.replaceLastUndoStep(o),this.eventListeners.statechange.forEach(function(c){return c(new ut(r))})}},d.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},d.prototype.undoStep=function(){var r=this,o=this.undoRedoManager.undo();o!==void 0&&(this.restoreState(o),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new ut(r))}))},d.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},d.prototype.redoStep=function(){var r=this,o=this.undoRedoManager.redo();o!==void 0&&(this.restoreState(o),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new ut(r))}))},d.prototype.stepZoom=function(){var r=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=r<this.zoomSteps.length-1?this.zoomSteps[r+1]:this.zoomSteps[0]},d.prototype.panTo=function(r){this.contentDiv.scrollBy({left:this.prevPanPoint.x-r.x,top:this.prevPanPoint.y-r.y}),this.prevPanPoint=r},d.prototype.startRenderAndClose=function(){return B(this,void 0,void 0,function(){var r,o,u=this;return ue(this,function(v){switch(v.label){case 0:return[4,this.render()];case 1:return r=v.sent(),o=this.getState(),this.eventListeners.render.forEach(function(c){return c(new _t(u,r,o))}),this.close(!0),[2]}})})},d.prototype.getState=function(r){r===!0&&this.setCurrentMarker();var o={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return o.markers.push(u.getState())}),o},d.prototype.restoreState=function(r){var o=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);r.markers.forEach(function(u){var v=o._availableMarkerTypes.find(function(ne){return ne.typeName===u.typeName});if(v!==void 0){var c=o.addNewMarker(v);c.restoreState(u),o.markers.push(c)}}),r.width&&r.height&&(r.width!==this.imageWidth||r.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/r.width,this.imageHeight/r.height),this.eventListeners.restorestate.forEach(function(u){return u(new ut(o))})},d.prototype.addNewMarker=function(r){var o=A.createGroup();return this.markerImage.appendChild(o),new r(o,this.overlayContainer,this.settings)},d.prototype.createNewMarker=function(r){var o,u=this;(o=typeof r=="string"?this._availableMarkerTypes.find(function(v){return v.typeName===r}):r)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(o),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(o.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(v){return v(new et(u,u._currentMarker))}))},d.prototype.markerCreated=function(r){var o=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(r),this.setCurrentMarker(r),r instanceof G&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(G):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new et(o,o._currentMarker))})},d.prototype.colorChanged=function(r){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=r,this.settings.defaultStrokeColor=r)},d.prototype.fillColorChanged=function(r){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=r)},d.prototype.markerStateChanged=function(r){var o=this;this.eventListeners.markerchange.forEach(function(u){return u(new et(o,r))})},d.prototype.setCurrentMarker=function(r){var o=this;this._currentMarker!==r&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new et(o,o._currentMarker))})),this._currentMarker=r,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new et(o,o._currentMarker))}))},d.prototype.onPointerDown=function(r){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||r.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var o=this.markers.find(function(u){return u.ownsTarget(r.target)});o!==void 0?(this.setCurrentMarker(o),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(r.clientX,r.clientY),r.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:r.clientX,y:r.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(r.clientX,r.clientY))},d.prototype.onDblClick=function(r){if(this._isFocused||this.focus(),this.mode==="select"){var o=this.markers.find(function(u){return u.ownsTarget(r.target)});o!==void 0&&o!==this._currentMarker&&this.setCurrentMarker(o),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(r.clientX,r.clientY),r.target):this.setCurrentMarker()}},d.prototype.onPointerMove=function(r){this.touchPoints!==1&&r.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||r.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(r.clientX,r.clientY)):this.zoomLevel>1&&this.panTo({x:r.clientX,y:r.clientY}))},d.prototype.onPointerUp=function(r){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(r.clientX,r.clientY)),this.isDragging=!1,this.addUndoStep()},d.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},d.prototype.onKeyUp=function(r){this._currentMarker===void 0||this.notesArea!==void 0||r.key!=="Delete"&&r.key!=="Backspace"||this.deleteSelectedMarker()},d.prototype.clientToLocalCoordinates=function(r,o){var u=this.markerImage.getBoundingClientRect();return{x:(r-u.left)/this.zoomLevel,y:(o-u.top)/this.zoomLevel}},d.prototype.onWindowResize=function(){this.positionUI()},d.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var r=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=r+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},d.prototype.addLicenseKey=function(r){pe.addKey(r)},d.prototype.addEventListener=function(r,o){this.eventListeners.addEventListener(r,o)},d.prototype.removeEventListener=function(r,o){this.eventListeners.removeEventListener(r,o)},d.prototype.renderState=function(r){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(r),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(d.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),d.prototype.focus=function(){var r=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(o){return o(new ut(r))}))},d.prototype.blur=function(){var r=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(o){return o(new ut(r))}))},d.instanceCounter=0,d}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var zt=function(d,r){return(zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(o[v]=u[v])})(d,r)};function It(d,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=d}zt(d,r),d.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}function vt(d,r,o,u){return new(o||(o=Promise))(function(v,c){function ne(Dt){try{_e(u.next(Dt))}catch(Ee){c(Ee)}}function Ye(Dt){try{_e(u.throw(Dt))}catch(Ee){c(Ee)}}function _e(Dt){var Ee;Dt.done?v(Dt.value):(Ee=Dt.value,Ee instanceof o?Ee:new o(function(ce){ce(Ee)})).then(ne,Ye)}_e((u=u.apply(d,r||[])).next())})}function Xt(d,r){var o,u,v,c,ne={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return c={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ye(_e){return function(Dt){return function(Ee){if(o)throw new TypeError("Generator is already executing.");for(;ne;)try{if(o=1,u&&(v=2&Ee[0]?u.return:Ee[0]?u.throw||((v=u.return)&&v.call(u),0):u.next)&&!(v=v.call(u,Ee[1])).done)return v;switch(u=0,v&&(Ee=[2&Ee[0],v.value]),Ee[0]){case 0:case 1:v=Ee;break;case 4:return ne.label++,{value:Ee[1],done:!1};case 5:ne.label++,u=Ee[1],Ee=[0];continue;case 7:Ee=ne.ops.pop(),ne.trys.pop();continue;default:if(!(v=ne.trys,(v=v.length>0&&v[v.length-1])||Ee[0]!==6&&Ee[0]!==2)){ne=0;continue}if(Ee[0]===3&&(!v||Ee[1]>v[0]&&Ee[1]<v[3])){ne.label=Ee[1];break}if(Ee[0]===6&&ne.label<v[1]){ne.label=v[1],v=Ee;break}if(v&&ne.label<v[2]){ne.label=v[2],ne.ops.push(Ee);break}v[2]&&ne.ops.pop(),ne.trys.pop();continue}Ee=r.call(d,ne)}catch(ce){Ee=[6,ce],u=0}finally{o=v=0}if(5&Ee[0])throw Ee[1];return{value:Ee[0]?Ee[1]:void 0,done:!0}}([_e,Dt])}}}var Lt=function(){function d(){}return d.addKey=function(r){d.key=r},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),Fe=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(r,o){for(var u=0,v=o;u<v.length;u++){var c=v[u],ne=c[0],Ye=c[1];r.setAttribute(ne,Ye)}},d.createRect=function(r,o,u){var v=document.createElementNS("http://www.w3.org/2000/svg","rect");return v.setAttribute("width",r.toString()),v.setAttribute("height",o.toString()),u&&d.setAttributes(v,u),v},d.createLine=function(r,o,u,v,c){var ne=document.createElementNS("http://www.w3.org/2000/svg","line");return ne.setAttribute("x1",r.toString()),ne.setAttribute("y1",o.toString()),ne.setAttribute("x2",u.toString()),ne.setAttribute("y2",v.toString()),c&&d.setAttributes(ne,c),ne},d.createPolygon=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",r),o&&d.setAttributes(u,o),u},d.createCircle=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(r/2).toString()),u.setAttribute("cy",(r/2).toString()),u.setAttribute("r",r.toString()),o&&d.setAttributes(u,o),u},d.createEllipse=function(r,o,u){var v=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return v.setAttribute("cx",(r/2).toString()),v.setAttribute("cy",(o/2).toString()),v.setAttribute("rx",(r/2).toString()),v.setAttribute("ry",(o/2).toString()),u&&d.setAttributes(v,u),v},d.createGroup=function(r){var o=document.createElementNS("http://www.w3.org/2000/svg","g");return r&&d.setAttributes(o,r),o},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(r,o,u,v,c,ne,Ye){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(_e,[["id",r],["orient",o],["markerWidth",u.toString()],["markerHeight",v.toString()],["refX",c.toString()],["refY",ne.toString()]]),_e.appendChild(Ye),_e},d.createText=function(r){var o=document.createElementNS("http://www.w3.org/2000/svg","text");return o.setAttribute("x","0"),o.setAttribute("y","0"),r&&d.setAttributes(o,r),o},d.createTSpan=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=r,o&&d.setAttributes(u,o),u},d.createImage=function(r){var o=document.createElementNS("http://www.w3.org/2000/svg","image");return r&&d.setAttributes(o,r),o},d.createPoint=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=r,u.y=o,u},d.createPath=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",r),o&&d.setAttributes(u,o),u},d.createElement=function(r,o){var u=document.createElementNS("http://www.w3.org/2000/svg",r);return o&&d.setAttributes(u,o),u},d.getHollowRectanglePath=function(r,o,u,v,c,ne,Ye,_e){return"M"+r+","+o+"V"+(o+v)+"H"+(r+u)+"V"+o+"H"+c+"V"+ne+"H"+(c+Ye)+"V"+(ne+_e)+"H"+c+"V"+o+"Z"},d}(),st=function(){function d(r){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+r+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),d.prototype.addClass=function(r){return this.styleSheet===void 0&&this.addStyleSheet(),r.name=""+this.classNamePrefix+r.localName,this.classes.push(r),this.styleSheet.sheet.insertRule("."+r.name+" {"+r.style+"}",this.styleSheet.sheet.cssRules.length),r},d.prototype.addRule=function(r){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(r),this.styleSheet.sheet.insertRule(r.selector+" {"+r.style+"}",this.styleSheet.sheet.cssRules.length)},d.prototype.addStyleSheet=function(){var r;this.styleSheet=document.createElement("style"),((r=this.styleSheetRoot)!==null&&r!==void 0?r:document.head).appendChild(this.styleSheet),this.addRule(new tt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new dt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new dt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},d.prototype.removeStyleSheet=function(){var r;this.styleSheet&&(((r=this.styleSheetRoot)!==null&&r!==void 0?r:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),tt=function(d,r){this.selector=d,this.style=r},dt=function(d,r){this.localName=d,this.style=r},Kt=function(){function d(){this.blocks=[],this.display=""}return d.prototype.addButtonBlock=function(r){r.className=this.blockClassName,r.buttonClassName=this.buttonClassName,r.buttonColorsClassName=this.buttonColorsClassName,r.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(r)},d.prototype.addElementBlock=function(r){r.className===void 0&&(r.className=this.blockClassName),this.blocks.push(r)},d.prototype.getUI=function(){var r=document.createElement("div");return r.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,r.style.display=this.display,this.blocks.forEach(function(o){return r.appendChild(o.getUI())}),r},d}(),Gt=function(){function d(){}return d.prototype.getUI=function(){var r=document.createElement("div");if(r.className=this.className,this.minWidth!==void 0&&(r.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":r.style.justifyContent="flex-start";break;case"center":r.style.justifyContent="center";break;case"end":r.style.justifyContent="flex-end"}return r.style.whiteSpace="nowrap",r},d}(),an=function(d){function r(){var o=d!==null&&d.apply(this,arguments)||this;return o.buttons=[],o}return It(r,d),r.prototype.addButton=function(o){o.className=this.buttonClassName,o.colorsClassName=this.buttonColorsClassName,o.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(o)},r.prototype.getUI=function(){var o=d.prototype.getUI.call(this);return this.buttons.forEach(function(u){return o.appendChild(u.getUI())}),o},r}(Gt),Vt=function(){function d(r,o){this._isActive=!1,this._isHidden=!1,this._icon=r,this.title=o,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(d.prototype,"icon",{get:function(){return this._icon},set:function(r){this._icon=r,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isActive",{get:function(){return this._isActive},set:function(r){this._isActive=r,this.adjustClassName()},enumerable:!1,configurable:!0}),d.prototype.getUI=function(){var r=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return r.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},d.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},d.prototype.hide=function(){this._isHidden=!0},d}(),Et=function(d){function r(){var o=d!==null&&d.apply(this,arguments)||this;return o.elements=[],o}return It(r,d),r.prototype.addElement=function(o){this.elements.push(o)},r.prototype.getUI=function(){var o=d.prototype.getUI.call(this);return this.elements.forEach(function(u){return o.appendChild(u)}),o},r}(Gt),tn=function(){function d(r,o){this.horizontal=r,this.vertical=o}return Object.defineProperty(d.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),d.prototype.getVerticalLength=function(r){return r/this.ratio},d.prototype.getHorizontalLength=function(r){return r*this.ratio},d}(),jt=function(){function d(){}return d.getIcon=function(r,o){if(r>0&&o>0){var u=new tn(r,o),v=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ne);var Ye=Fe.createDefs();ne.appendChild(Ye);var _e=Fe.createElement("clipPath",[["id","text-bg-clip"]]);Ye.appendChild(_e);var Dt=Fe.createPath(Fe.getHollowRectanglePath((24-v)/2,(24-c)/2,v,c,(24-v)/2+2,(24-c)/2+2,v-4,c-4));ne.appendChild(Dt);var Ee=Fe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ee.appendChild(Fe.createTSpan(r+":"+o)),ne.appendChild(Ee);var ce=Ee.getBBox();Fe.setAttributes(Ee,[["x",((24-ce.width)/2).toString()],["y",((24-ce.height)/2-ce.y).toString()]]);var ze=Fe.createPath(Fe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ce.width))/2,(24-Math.ceil(ce.height))/2,Math.ceil(ce.width),Math.ceil(ce.height)));return _e.appendChild(ze),Fe.setAttributes(Dt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ne),ne.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},d}(),dn=function(d){function r(o,u,v){var c=d.call(this,o,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=v,c}return It(r,d),r.prototype.setupDropdown=function(){var o=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=o.className,u.colorsClassName=o.colorsClassName,o.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},r.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},r.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},r.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},r.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},r.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},r}(Vt),$t=function(){function d(r,o){this.GRIP_SIZE=10,this.color=r,this.fillColor=o,this.visual=Fe.createGroup(),this.visual.appendChild(Fe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Fe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(r){return r===this.visual||r===this.visual.childNodes[0]||r===this.visual.childNodes[1]},d.prototype.setCenter=function(r,o){this.visual.childNodes.forEach(function(u){return Fe.setAttributes(u,[["cx",r.toString()],["cy",o.toString()]])})},d}(),mn=function(){function d(r,o,u,v){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=r,this.canvasHeight=o,this.margin=u,this.container=v,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(d.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(r){this._aspectRatio=r,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(r){this._isGridVisible=r,this.gridContainer&&Fe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(r){this._zoomFactor=r,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),d.prototype.open=function(){var r=this;this.cropShadeElement=Fe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Fe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var o=0;o<this.numberOfGridLines;o++)this.horizontalGridLines.push(Fe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Fe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return r.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return r.gridContainer.appendChild(u)}),this.cropRectElement=Fe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},d.prototype.setCropRectangle=function(r){this.cropRect=r;var o=Object.assign({},this.cropRect);this.zoomFactor!==1&&(o.width=this.cropRect.width*this.zoomFactor,o.height=this.cropRect.height*this.zoomFactor,o.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-o.width/2,o.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-o.height/2),Fe.setAttributes(this.cropRectElement,[["x",o.x.toString()],["y",o.y.toString()],["width",o.width.toString()],["height",o.height.toString()]]);var u=o.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,ne){var Ye=o.y+u*(ne+1);Fe.setAttributes(c,[["x1",""+o.x],["y1",""+Ye],["x2",""+(o.x+o.width)],["y2",""+Ye]])});var v=o.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,ne){var Ye=o.x+v*(ne+1);Fe.setAttributes(c,[["x1",""+Ye],["y1",""+o.y],["x2",""+Ye],["y2",""+(o.y+o.height)]])}),Fe.setAttributes(this.cropShadeElement,[["d",Fe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,o.x,o.y,o.width,o.height)]]),this.topLeftGrip.setCenter(o.x,o.y),this.topRightGrip.setCenter(o.x+o.width,o.y),this.bottomLeftGrip.setCenter(o.x,o.y+o.height),this.bottomRightGrip.setCenter(o.x+o.width,o.y+o.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},d.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},d.prototype.clientToLocalCoordinates=function(r,o){var u=this.container.getBoundingClientRect();return{x:r-u.left+this.margin,y:o-u.top+this.margin}},d.prototype.onPointerDown=function(r){this.container.setPointerCapture(r.pointerId),this.previousPoint=this.clientToLocalCoordinates(r.clientX,r.clientY),this.cropRectElement===r.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(r.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(r.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(r.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(r.target)&&(this.activeGrip=this.bottomRightGrip)},d.prototype.onPointerMove=function(r){if(this.isMoving)this.move(this.clientToLocalCoordinates(r.clientX,r.clientY));else if(this.activeGrip){var o=this.clientToLocalCoordinates(r.clientX,r.clientY);this.resize(o)}r.preventDefault()},d.prototype.onPointerUp=function(r){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(r.pointerId)},d.prototype.move=function(r){var o=r.x-this.previousPoint.x,u=r.y-this.previousPoint.y;this.zoomFactor!==1&&(o=-o/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+o),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=r},d.prototype.resize=function(r){var o=Object.assign({},this.cropRect),u=r.x-this.previousPoint.x,v=r.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:o.x+u<this.margin&&(u=this.margin-o.x),o.x+=u,o.width=this.cropRect.x+this.cropRect.width-o.x;break;case this.bottomRightGrip:case this.topRightGrip:o.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-o.width),o.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(o.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),o.height=this.aspectRatio.getVerticalLength(o.width)):(o.y+=v,o.height=this.cropRect.y+this.cropRect.height-o.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?o.height=this.aspectRatio.getVerticalLength(o.width):o.height+=v}o.width<10&&(o.x=this.cropRect.x,o.width=10),o.height<10&&(o.y=this.cropRect.y,o.height=10),this.previousPoint=r,o.x>=this.margin&&o.y>=this.margin&&o.x-this.margin+o.width<=this.canvasWidth&&o.y-this.margin+o.height<=this.canvasHeight&&(this.cropRect=o,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},d.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var r=this.cropRect.x+this.cropRect.width/2,o=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),v=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<v/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=v,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=r-this.cropRect.width/2,this.cropRect.y=o-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},d.prototype.getRescaledRect=function(r,o,u,v,c,ne){var Ye=u/r,_e=v/o;return{x:(c.x-ne)*Ye+ne,y:(c.y-ne)*_e+ne,width:c.width*Ye,height:c.height*_e}},d.prototype.scaleCanvas=function(r,o){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,r,o,this.cropRect,this.margin);this.canvasWidth=r,this.canvasHeight=o,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},d}(),On=function(){function d(r){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=r,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(d.prototype,"angle",{get:function(){return this._angle},set:function(r){this._angle=r,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),d.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},d.prototype.onPointerDown=function(r){this.controlContainer.setPointerCapture(r.pointerId),this.isDragging=!0,this.previousPoint={x:r.clientX,y:r.clientY}},d.prototype.onPointerMove=function(r){this.isDragging&&(this.onAngleChange&&this.onAngleChange((r.clientX-this.previousPoint.x)/5),this.previousPoint.x=r.clientX)},d.prototype.onPointerUp=function(r){this.isDragging&&this.onAngleChange&&this.onAngleChange((r.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(r.pointerId)},d.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var r=this.angleLabelText.getBBox();Fe.setAttributes(this.angleLabelElement,[["x",((this.width-r.width)/2).toString()],["y",(this.height/2).toString()]])}},d.prototype.positionScaleShape=function(){if(this.scaleShape){var r=this.scaleShape.transform.baseVal.getItem(0);r.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(r,0)}},d.prototype.getVisual=function(){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("width",this.width+"px"),r.setAttribute("height",this.height+"px"),r.setAttribute("viewBox","0 0 "+this.width+" "+this.height),r.style.flexShrink="0",document.body.appendChild(r);for(var o="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var v=u%5==0?this.height/3:this.height/6;o+="h4v"+-v+"h1v"+v}o+="v1H0Z",this.scaleShape=Fe.createPath(o);var c=Fe.createTransform();this.scaleShape.transform.baseVal.appendItem(c),r.appendChild(this.scaleShape),this.angleLabelElement=Fe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Fe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ne=Fe.createTSpan("");return ne.innerHTML="°",this.angleLabelElement.appendChild(ne),r.appendChild(this.angleLabelElement),document.body.removeChild(r),r},d}(),nn=function(){function d(){this.naturalSize=!1,this.imageType="image/png"}return d.prototype.rasterize=function(r,o,u,v,c,ne,Ye){var _e=this;return new Promise(function(Dt){var Ee=document.createElement("canvas");Ee.width=r.width.baseVal.value-2*v,Ee.height=r.height.baseVal.value-2*v;var ce=1,ze=1;_e.naturalSize===!0?(ce=o.naturalWidth/(r.width.baseVal.value-2*v)/ne,ze=o.naturalHeight/(r.height.baseVal.value-2*v)/Ye,Ee.width=o.naturalWidth/ne,Ee.height=o.naturalHeight/Ye):_e.width!==void 0&&_e.height!==void 0&&(ce=_e.width/u.width,ze=_e.height/u.height,Ee.width*=ce,Ee.height*=ze);var Rt=Ee.getContext("2d");Rt.translate(Ee.width/2,Ee.height/2),Rt.rotate(c*Math.PI/180),Rt.scale(ne,Ye),Rt.translate(-Ee.width/2,-Ee.height/2),Rt.drawImage(o,0,0,Ee.width,Ee.height);var Pt=document.createElement("canvas");Pt.width=u.width*ce,Pt.height=u.height*ze,Pt.getContext("2d").putImageData(Rt.getImageData((u.x-v)*ce,(u.y-v)*ze,u.width*ce,u.height*ze),0,0),Dt(Pt.toDataURL(_e.imageType,_e.imageQuality))})},d}(),Ve=function(){function d(r){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=d.instanceCounter++,this.styles=new st(this.instanceNo),this.target=r,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(r){this._zoomToCropEnabled=r,r?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(r){this._isGridVisible=r,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"gridLines",{get:function(){return this._gridLines},set:function(r){this._gridLines=r,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(r){this._rotationAngle=r,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"aspectRatio",{get:function(){var r;return(r=this._aspectRatio)!==null&&r!==void 0?r:this.aspectRatios[0]},set:function(r){this._aspectRatio=r},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},d.prototype.show=function(){this.showUI(),this.open()},d.prototype.close=function(r){r===void 0&&(r=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),r||this.closeEventListeners.forEach(function(o){return o()}),this._isOpen=!1)},d.prototype.addRenderEventListener=function(r){this.renderEventListeners.push(r)},d.prototype.removeRenderEventListener=function(r){this.renderEventListeners.indexOf(r)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(r),1)},d.prototype.addCloseEventListener=function(r){this.closeEventListeners.push(r)},d.prototype.removeCloseEventListener=function(r){this.closeEventListeners.indexOf(r)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(r),1)},d.prototype.setupResizeObserver=function(){var r=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){r.resize(r.target.clientWidth,r.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},d.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var r=1*this.target.clientWidth/this.target.clientHeight,o=this.contentDiv.clientWidth/r>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*r:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=o+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/r;this.resize(o,u)}},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Fe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},d.prototype.resize=function(r,o){this.imageWidth=Math.round(r),this.imageHeight=Math.round(o),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},d.prototype.setEditingTarget=function(){var r=document.createElement("canvas");r.width=this.target.naturalWidth,r.height=this.target.naturalHeight,r.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var o=r.toDataURL();Fe.setAttributes(this.editingTarget,[["href",o]]),this.setEditingTargetSize()},d.prototype.setTopLeft=function(){var r=this.target.getBoundingClientRect(),o=this.editorCanvas.getBoundingClientRect();this.left=r.left-o.left-this.CANVAS_MARGIN,this.top=r.top-o.top-this.CANVAS_MARGIN},d.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Fe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Fe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Fe.createGroup(),this.editingTargetRotationScaleContainer=Fe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var r=Fe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(r);var o=Fe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(o),this.editingTargetContainer=Fe.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},d.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},d.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Fe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new mn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},d.prototype.zoomToCrop=function(){if(this.cropRect){var r=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,o=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=r+"px "+o+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-r+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-o+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},d.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},d.prototype.cropRectChanged=function(r){this.cropRect=r,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},d.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},d.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var r=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,o=this.target.offsetTop>r+this.CANVAS_MARGIN?this.target.offsetTop-(r+this.CANVAS_MARGIN):0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},d.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},d.prototype.addTopToolbar=function(){var r=this;this.topToolbar=new Kt,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 o=new an;o.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(o);var u=[];this.aspectRatios.forEach(function(ze){var Rt=new Vt(jt.getIcon(ze.horizontal,ze.vertical),ze.horizontal===0&&ze.vertical===0?"FREE":ze.horizontal+":"+ze.vertical);Rt.onClick=function(){return r.ratioButtonClicked(ze)},u.push(Rt)}),this.aspectRatioButton=new dn(jt.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,o.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var v=new Vt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");v.isActive=this.isGridVisible,v.onClick=function(){r.isGridVisible=!r.isGridVisible,v.isActive=r.isGridVisible},o.addButton(v);var c=new Vt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){r.zoomToCropEnabled=!r.zoomToCropEnabled,c.isActive=r.zoomToCropEnabled},o.addButton(c),!Lt.isLicensed){var ne=new Et;this.topToolbar.addElementBlock(ne);var Ye=document.createElement("div");Ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var _e=document.createElement("a");_e.style.color="currentColor",_e.href="https://markerjs.com/products/cropro",_e.target="_blank",_e.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Ye.appendChild(_e),ne.addElement(Ye)}var Dt=new an;Dt.minWidth=3*this.toolbarHeight+"px",Dt.contentAlign="end",this.topToolbar.addButtonBlock(Dt);var Ee=new Vt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ee.onClick=this.startRenderAndClose,Dt.addButton(Ee),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ee.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ce=new Vt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");ce.onClick=this.close,Dt.addButton(ce),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ce.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},d.prototype.addBottomToolbar=function(){var r=this;this.bottomToolbar=new Kt,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 o=new an;o.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(o);var u=new Vt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,o.addButton(u);var v=new Vt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");v.onClick=this.rotateRightButtonClicked,o.addButton(v);var c=new Et;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new On("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(Dt){r.rotateBy(Dt),r.straightener.angle=r.rotationAngle},c.addElement(this.straightener.getUI());var ne=new an;ne.minWidth=2*this.toolbarHeight+"px",ne.contentAlign="end",this.bottomToolbar.addButtonBlock(ne);var Ye=new Vt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Ye.onClick=this.flipHorizontallyButtonClicked,ne.addButton(Ye);var _e=new Vt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");_e.onClick=this.flipVerticallyButtonClicked,ne.addButton(_e)},d.prototype.ratioButtonClicked=function(r){this.aspectRatio=r,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},d.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=jt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},d.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new tn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},d.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},d.prototype.restoreState=function(r){if(r){var o=this.cropLayer.getRescaledRect(r.width,r.height,this.imageWidth,this.imageHeight,r.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(o),this.cropRectChanged(o),this.flippedHorizontally=r.flippedHorizontally,this.flippedVertically=r.flippedVertically,this.applyFlip(),this.rotationAngle=r.rotationAngle,this.applyRotation()}},d.prototype.clientToLocalCoordinates=function(r,o){var u=this.cropImage.getBoundingClientRect();return{x:r-u.left,y:o-u.top}},d.prototype.onWindowResize=function(){this.positionUI()},d.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var r=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=r+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},d.prototype.rotateLeftButtonClicked=function(){var r=this.rotationAngle-90;this.rotationAngle%90!=0&&(r+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(r)},d.prototype.rotateRightButtonClicked=function(){var r=this.rotationAngle+90;this.rotationAngle%90!=0&&(r-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(r)},d.prototype.rotateTo=function(r){r=(r=r>180?r-360:r)<=-180?r+360:r,this.rotationAngle=r,this.applyRotation()},d.prototype.rotateBy=function(r){this.rotateTo((this.rotationAngle+r)%360)},d.prototype.applyRotation=function(){var r=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var o=this.editingTargetRotationContainer.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(o,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=r},d.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},d.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},d.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},d.prototype.startRenderAndClose=function(){return vt(this,void 0,void 0,function(){var r,o;return Xt(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return r=u.sent(),o=this.getState(),this.renderEventListeners.forEach(function(v){return v(r,o)}),this.close(!0),[2]}})})},d.prototype.render=function(){return vt(this,void 0,void 0,function(){var r;return Xt(this,function(o){switch(o.label){case 0:return(r=new nn).naturalSize=this.renderAtNaturalSize,r.imageType=this.renderImageType,r.imageQuality=this.renderImageQuality,r.width=this.renderWidth,r.height=this.renderHeight,this.unzoomFromCrop(),Fe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,r.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 o.sent(),[4,r.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,o.sent()]}})})},d.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 r=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new dt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*r)+`px;
|
|
height: `+(this.toolbarHeight-2*r)+`px;
|
|
padding: `+r+`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 tt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new tt("."+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*r)+`px;
|
|
padding: `+r+`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;
|
|
`))},d.instanceCounter=0,d}(),lt=f("8hTe"),gn=f.n(lt),yn=/<pre[^>]*>/g;function An(d){var r=document.createElement("div");return r.innerHTML=d,r.childNodes.length===0?"":r.childNodes[0].nodeValue}var Kn=Ie.a=function(d){var r=d.value,o=r===void 0?"":r,u=d.edit,v=u===void 0?!1:u,c=d.className,ne=d.showTextOnly,Ye=d.showLines,_e=d.replaces,Dt=d.zoomImg,Ee=d.hasMask,ce=d.style,ze=ce===void 0?{}:ce,Rt=d.stylesPrev,Pt=Rt===void 0?{}:Rt,Tt=String(o),Wt=Object(P.useRef)(),bn=Object(P.useRef)(),Fn=Object(P.useState)(""),En=Object(j.a)(Fn,2),Zt=En[0],In=En[1],li=Object(P.useState)("office"),Wn=Object(j.a)(li,2),gi=Wn[0],Bn=Wn[1],Gn=function(){var hn=new Ve(bn.current);hn.displayMode="popup",hn.addRenderEventListener(function(){var ui=Object(ae.a)(k.a.mark(function Cn(ci){var Nn;return k.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Wt.current.style.display="none",Zn.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ci}});case 3:Nn=Zn.sent,Nn!=null&&Nn.id&&_e(bn.current.getAttribute("src").replace(Be.a.API_SERVER,""),"/api/attachments/".concat(Nn==null?void 0:Nn.id,"?type=").concat(Nn.content_type));case 5:case"end":return Zn.stop()}},Cn)}));return function(Cn){return ui.apply(this,arguments)}}()),hn.show()},Xi=function(){var hn=new qe(bn.current);hn.settings.displayMode="popup",hn.addEventListener("render",function(){var ui=Object(ae.a)(k.a.mark(function Cn(ci){var Nn;return k.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:if(Wt.current.style.display="none",!bn.current){Zn.next=6;break}return Zn.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ci.dataUrl}});case 4:Nn=Zn.sent,Nn!=null&&Nn.id&&_e(bn.current.getAttribute("src").replace(Be.a.API_SERVER,""),"/api/attachments/".concat(Nn==null?void 0:Nn.id,"?type=").concat(Nn.content_type));case 6:case"end":return Zn.stop()}},Cn)}));return function(Cn){return ui.apply(this,arguments)}}()),hn.show(),window.markerArea=hn},ii=Object(P.useMemo)(function(){try{var on=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,hn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ui=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tt=Tt.replace(on,"("+Be.a.API_SERVER+"/api/attachments/").replace(hn,'"'+Be.a.API_SERVER+"/api/attachments/").replace(ui,'"'+Be.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,`
|
|
`),Tt=Tt.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(ia){}var Cn=be(Tt),ci=J();if(Tt.match(/\[TOC\]/)&&(Cn=Cn.replace("<p>[TOC]</p>",fe()),ke()),Cn=Cn.replace(/(__special_katext_id_\d+__)/g,function(ia,Zn){var $n=ci[Zn],Yi=$n.type,xi=$n.expression;return Object(Ae.renderToString)(An(xi)||"",{displayMode:Yi==="block",throwOnError:!1,output:"html"})}),Cn=Cn.replace(/▁/g,"\u2581\u2581\u2581"),H(),ne){var Nn=document.createElement("div");return Nn.innerHTML=Cn,Nn.innerText}return setTimeout(function(){return la()},500),Cn},[Tt]),Pi=Object(P.useRef)();se.WebkitLineClamp=Ye,Ye&&(ze=Object(me.a)(Object(me.a)({},ze),se));function $i(on){var hn=on.target;if(hn.tagName.toUpperCase()==="IMG"){if(Dt){var ui=hn.getAttribute("src");In(ui),Bn("image")}}else if(hn.tagName.toUpperCase()==="A"){var Cn=hn.getAttribute("href");if(Cn.indexOf("office")>-1)on.preventDefault(),In(Cn),Bn("office");else if(Cn.indexOf("application/pdf")>-1)on.preventDefault(),In(Cn),Bn("pdf");else if(Cn.indexOf("type=text")>-1)on.preventDefault(),In(Cn),Bn("html");else if(Cn.startsWith("#")){on.preventDefault();var ci=document.getElementById(Cn.replace("#",""));ci&&ci.scrollIntoView(!0)}}}var la=function(){var hn,ui=(hn=Pi.current)===null||hn===void 0?void 0:hn.querySelectorAll("video");ui==null||ui.forEach(function(Cn){if(Cn.oncontextmenu=function(){return!1},Cn.src.indexOf(".m3u8")>-1&&!Cn.canPlayType("application/vnd.apple.mpegurl")){if(oe.a.isSupported()){var ci=new oe.a;ci.loadSource(Cn.src),ci.attachMedia(Cn)}}})};Object(P.useEffect)(function(){if(Pi.current&&ii&&(ii.match(yn)&&window.PR.prettyPrint()),Pi.current)return Pi.current.addEventListener("click",$i),function(){Pi.current.removeEventListener("click",$i),H(),ke()}},[ii,Pi.current,$i]);var na=function(hn){if(!v)return;hn.target.nodeName==="IMG"?(Wt.current.style.display="flex",Wt.current.style.width=hn.target.clientWidth+"px",Wt.current.style.height=hn.target.clientHeight+"px",Wt.current.style.top=hn.target.offsetTop+"px",Wt.current.style.left=hn.target.offsetLeft+"px",bn.current.src=hn.target.getAttribute("src")):Wt.current.style.display="none"};return N.a.createElement("div",{style:{position:"relative"}},N.a.createElement("div",{ref:Pi,style:Object(me.a)({},ze),className:"".concat(c||""," markdown-body ").concat(gn.a.mdBody),onMouseOver:na,dangerouslySetInnerHTML:{__html:ii}}),N.a.createElement("div",{ref:Wt,className:gn.a.button},N.a.createElement(ve.a,null,N.a.createElement(xe.a,{onClick:function(){return Gn()}},"\u88C1\u526A"),N.a.createElement(xe.a,{onClick:function(){return Xi()}},"\u7F16\u8F91"))),N.a.createElement("img",{ref:bn,src:"https://ali-cdn.educoder.net/images/avatars/PortalImage/170?t=1659681136",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),N.a.createElement(Xe.a,{close:!0,data:Zt,hasMask:Ee,type:Zt!=null&&Zt.length?gi:"",style:Object(me.a)({},Pt),onClose:function(){return In("")}}))}},"9VGf":function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return re});var z=f("q1tI"),ve=f.n(z);function re(xe,me){var ae=Object(z.useRef)();Object(z.useEffect)(function(){ae.current=xe}),Object(z.useEffect)(function(){function j(){ae.current()}if(me!==null){var x=setInterval(j,me);return function(){return clearInterval(x)}}},[me])}},"A+k2":function(Je,Ie,f){Je.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(Je,Ie,f){(function(z){z(f("VrN/"),f("osHv"))})(function(z){z.defineOption("autoCloseTags",!1,function(k,P,N){if(N!=z.Init&&N&&k.removeKeyMap("autoCloseTags"),!P)return;var T={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(T["'/'"]=function(ee){return ae(ee)}),(typeof P!="object"||P.whenOpening!==!1)&&(T["'>'"]=function(ee){return xe(ee)}),k.addKeyMap(T)});var ve=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],re=["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 xe(k){if(k.getOption("disableInput"))return z.Pass;for(var P=k.listSelections(),N=[],T=k.getOption("autoCloseTags"),ee=0;ee<P.length;ee++){if(!P[ee].empty())return z.Pass;var K=P[ee].head,L=k.getTokenAt(K),M=z.innerMode(k.getMode(),L.state),W=M.state,Y=M.mode.xmlCurrentTag&&M.mode.xmlCurrentTag(W),_=Y&&Y.name;if(!_)return z.Pass;var we=M.mode.configuration=="html",ke=typeof T=="object"&&T.dontCloseTags||we&&ve,se=typeof T=="object"&&T.indentTags||we&&re;L.end>K.ch&&(_=_.slice(0,_.length-L.end+K.ch));var le=_.toLowerCase();if(!_||L.type=="string"&&(L.end!=K.ch||!/[\"\']/.test(L.string.charAt(L.string.length-1))||L.string.length==1)||L.type=="tag"&&Y.close||L.string.indexOf("/")==K.ch-L.start-1||ke&&j(ke,le)>-1||x(k,M.mode.xmlCurrentContext&&M.mode.xmlCurrentContext(W)||[],_,K,!0))return z.Pass;var fe=typeof T=="object"&&T.emptyTags;if(fe&&j(fe,_)>-1){N[ee]={text:"/>",newPos:z.Pos(K.line,K.ch+2)};continue}var $=se&&j(se,le)>-1;N[ee]={indent:$,text:">"+($?`
|
|
|
|
`:"")+"</"+_+">",newPos:$?z.Pos(K.line+1,0):z.Pos(K.line,K.ch+1)}}for(var h=typeof T=="object"&&T.dontIndentOnAutoClose,ee=P.length-1;ee>=0;ee--){var X=N[ee];k.replaceRange(X.text,P[ee].head,P[ee].anchor,"+insert");var y=k.listSelections().slice(0);y[ee]={head:X.newPos,anchor:X.newPos},k.setSelections(y),!h&&X.indent&&(k.indentLine(X.newPos.line,null,!0),k.indentLine(X.newPos.line+1,null,!0))}}function me(k,P){for(var N=k.listSelections(),T=[],ee=P?"/":"</",K=k.getOption("autoCloseTags"),L=typeof K=="object"&&K.dontIndentOnSlash,M=0;M<N.length;M++){if(!N[M].empty())return z.Pass;var W=N[M].head,Y=k.getTokenAt(W),_=z.innerMode(k.getMode(),Y.state),we=_.state;if(P&&(Y.type=="string"||Y.string.charAt(0)!="<"||Y.start!=W.ch-1))return z.Pass;var ke,se=_.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(se&&_.mode.name=="javascript")ke=ee+"script";else if(se&&_.mode.name=="css")ke=ee+"style";else{var le=_.mode.xmlCurrentContext&&_.mode.xmlCurrentContext(we);if(!le||le.length&&x(k,le,le[le.length-1],W))return z.Pass;ke=ee+le[le.length-1]}k.getLine(W.line).charAt(Y.end)!=">"&&(ke+=">"),T[M]=ke}if(k.replaceSelections(T),N=k.listSelections(),!L)for(var M=0;M<N.length;M++)(M==N.length-1||N[M].head.line<N[M+1].head.line)&&k.indentLine(N[M].head.line)}function ae(k){return k.getOption("disableInput")?z.Pass:me(k,!0)}z.commands.closeTag=function(k){return me(k)};function j(k,P){if(k.indexOf)return k.indexOf(P);for(var N=0,T=k.length;N<T;++N)if(k[N]==P)return N;return-1}function x(k,P,N,T,ee){if(!z.scanForClosingTag)return!1;var K=Math.min(k.lastLine()+1,T.line+500),L=z.scanForClosingTag(k,T,null,K);if(!L||L.tag!=N)return!1;for(var M=ee?1:0,W=P.length-1;W>=0&&P[W]==N;W--)++M;T=L.to;for(var W=1;W<M;W++){var Y=z.scanForClosingTag(k,T,null,K);if(!Y||Y.tag!=N)return!1;T=Y.to}return!0}})},BjJ7:function(Je,Ie,f){"use strict";f.d(Ie,"d",function(){return ve}),f.d(Ie,"c",function(){return re}),f.d(Ie,"e",function(){return xe}),f.d(Ie,"b",function(){return me}),f.d(Ie,"a",function(){return j});var z=f("m3rI");function ve(x){var k=!0;if(x.length>0){for(var P=0;P<x.length;P++)if(x[P].compile_success==0||!x[P].compile_success){k=!1;break}}else k=!1;return k}function re(x){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],N=0;N<x.length;N++){var T=x[N],ee=k?"".concat(k,"/").concat(T.name):"".concat(T.name);P.push({title:T.name,isLeaf:!(T.type==="tree"),key:ee})}return P}function xe(x,k,P){for(var N=0;N<x.length;N++){var T=x[N];if(T.key===k){T.children=P;break}T.children&&xe(T.children,k,P)}return x}function me(x,k,P){var N;return function(){var T=this,ee=arguments,K=function(){N=null,P||x.apply(T,ee)},L=P&&!N;clearTimeout(N),N=setTimeout(K,k),L&&x.apply(T,ee)}}var ae=!0,j=z.a.API_SERVER},"C+DQ":function(Je,Ie,f){},D1Df:function(Je,Ie,f){"use strict";function z(E){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(ie){return typeof ie}:z=function(ie){return ie&&typeof Symbol=="function"&&ie.constructor===Symbol&&ie!==Symbol.prototype?"symbol":typeof ie},z(E)}function ve(){return ve=Object.assign||function(E){for(var R=1;R<arguments.length;R++){var ie=arguments[R];for(var F in ie)Object.prototype.hasOwnProperty.call(ie,F)&&(E[F]=ie[F])}return E},ve.apply(this,arguments)}function re(E,R){var ie=Object.keys(E);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(E);R&&(F=F.filter(function(be){return Object.getOwnPropertyDescriptor(E,be).enumerable})),ie.push.apply(ie,F)}return ie}function xe(E){for(var R=1;R<arguments.length;R++){var ie=arguments[R]!=null?arguments[R]:{};R%2?re(ie,!0).forEach(function(F){L(E,F,ie[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(ie)):re(ie).forEach(function(F){Object.defineProperty(E,F,Object.getOwnPropertyDescriptor(ie,F))})}return E}function me(E,R){if(E==null)return{};var ie=ae(E,R),F,be;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(E);for(be=0;be<O.length;be++){if(F=O[be],R.indexOf(F)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(E,F))continue;ie[F]=E[F]}}return ie}function ae(E,R){if(E==null)return{};var ie={},F=Object.keys(E),be,O;for(O=0;O<F.length;O++){if(be=F[O],R.indexOf(be)>=0)continue;ie[be]=E[be]}return ie}function j(E,R){if(!(E instanceof R))throw new TypeError("Cannot call a class as a function")}function x(E,R){for(var ie=0;ie<R.length;ie++){var F=R[ie];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(E,F.key,F)}}function k(E,R,ie){return R&&x(E.prototype,R),ie&&x(E,ie),E}function P(E,R){return R&&(z(R)==="object"||typeof R=="function")?R:T(E)}function N(E){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(ie){return ie.__proto__||Object.getPrototypeOf(ie)},N(E)}function T(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function ee(E,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(R&&R.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),R&&K(E,R)}function K(E,R){return K=Object.setPrototypeOf||function(F,be){return F.__proto__=be,F},K(E,R)}function L(E,R,ie){return R in E?Object.defineProperty(E,R,{value:ie,enumerable:!0,configurable:!0,writable:!0}):E[R]=ie,E}var M=f("q1tI"),W=f("17x9"),Y=f("H38U"),_=f("aRTE");function we(E){for(var R="",ie=0;ie<E.length;ie++){var F=E.charCodeAt(ie);F<128?R+=String.fromCharCode(F):F<2048?(R+=String.fromCharCode(192|F>>6),R+=String.fromCharCode(128|F&63)):F<55296||F>=57344?(R+=String.fromCharCode(224|F>>12),R+=String.fromCharCode(128|F>>6&63),R+=String.fromCharCode(128|F&63)):(ie++,F=65536+((F&1023)<<10|E.charCodeAt(ie)&1023),R+=String.fromCharCode(240|F>>18),R+=String.fromCharCode(128|F>>12&63),R+=String.fromCharCode(128|F>>6&63),R+=String.fromCharCode(128|F&63))}return R}var ke={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},se={},le=4,fe=.1;function $(E){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ie=[];return E.forEach(function(F,be){var O=null;F.forEach(function(m,oe){if(!m&&O!==null){ie.push("M".concat(O+R," ").concat(be+R,"h").concat(oe-O,"v1H").concat(O+R,"z")),O=null;return}if(oe===F.length-1){if(!m)return;O===null?ie.push("M".concat(oe+R,",").concat(be+R," h1v1H").concat(oe+R,"z")):ie.push("M".concat(O+R,",").concat(be+R," h").concat(oe+1-O,"v1H").concat(O+R,"z"));return}m&&O===null&&(O=oe)})}),ie.join("")}function h(E,R){return E.slice().map(function(ie,F){return F<R.y||F>=R.y+R.h?ie:ie.map(function(be,O){return O<R.x||O>=R.x+R.w?be:!1})})}function X(E,R){var ie=E.imageSettings,F=E.size,be=E.includeMargin;if(ie==null)return null;var O=be?le:0,m=R.length+O*2,oe=Math.floor(F*fe),Be=m/F,Ae=(ie.width||oe)*Be,Xe=(ie.height||oe)*Be,Oe=ie.x==null?R.length/2-Ae/2:ie.x*Be,Te=ie.y==null?R.length/2-Xe/2:ie.y*Be,V=null;if(ie.excavate){var B=Math.floor(Oe),ue=Math.floor(Te),D=Math.ceil(Ae+Oe-B),A=Math.ceil(Xe+Te-ue);V={x:B,y:ue,w:D,h:A}}return{x:Oe,y:Te,h:Xe,w:Ae,excavation:V}}var y=function(){try{new Path2D().addPath(new Path2D)}catch(E){return!1}return!0}(),C=function(E){ee(R,E);function R(){var ie,F;j(this,R);for(var be=arguments.length,O=new Array(be),m=0;m<be;m++)O[m]=arguments[m];return F=P(this,(ie=N(R)).call.apply(ie,[this].concat(O))),L(T(F),"_canvas",void 0),L(T(F),"_image",void 0),L(T(F),"state",{imgLoaded:!1}),L(T(F),"handleImageLoad",function(){F.setState({imgLoaded:!0})}),F}return k(R,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var F=this.props,be=F.value,O=F.size,m=F.level,oe=F.bgColor,Be=F.fgColor,Ae=F.includeMargin,Xe=F.imageSettings,Oe=new Y(-1,_[m]);if(Oe.addData(we(be)),Oe.make(),this._canvas!=null){var Te=this._canvas,V=Te.getContext("2d");if(!V)return;var B=Oe.modules;if(B===null)return;var ue=Ae?le:0,D=B.length+ue*2,A=X(this.props,B);Xe!=null&&A!=null&&(A.excavation!=null&&(B=h(B,A.excavation)));var pe=window.devicePixelRatio||1;Te.height=Te.width=O*pe;var he=O/D*pe;V.scale(he,he),V.fillStyle=oe,V.fillRect(0,0,D,D),V.fillStyle=Be,y?V.fill(new Path2D($(B,ue))):B.forEach(function(Ze,Le){Ze.forEach(function(He,Pe){He&&V.fillRect(Pe+ue,Le+ue,1,1)})}),this.state.imgLoaded&&this._image&&A!=null&&V.drawImage(this._image,A.x+ue,A.y+ue,A.w,A.h)}}},{key:"render",value:function(){var F=this,be=this.props,O=be.value,m=be.size,oe=be.level,Be=be.bgColor,Ae=be.fgColor,Xe=be.style,Oe=be.includeMargin,Te=be.imageSettings,V=me(be,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),B=xe({height:m,width:m},Xe),ue=null,D=Te&&Te.src;return Te!=null&&D!=null&&(ue=M.createElement("img",{src:D,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(pe){return F._image=pe}})),M.createElement(M.Fragment,null,M.createElement("canvas",ve({style:B,height:m,width:m,ref:function(pe){return F._canvas=pe}},V)),ue)}}]),R}(M.PureComponent);L(C,"defaultProps",ke);var J=function(E){ee(R,E);function R(){return j(this,R),P(this,N(R).apply(this,arguments))}return k(R,[{key:"render",value:function(){var F=this.props,be=F.value,O=F.size,m=F.level,oe=F.bgColor,Be=F.fgColor,Ae=F.includeMargin,Xe=F.imageSettings,Oe=me(F,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),Te=new Y(-1,_[m]);Te.addData(we(be)),Te.make();var V=Te.modules;if(V===null)return null;var B=Ae?le:0,ue=V.length+B*2,D=X(this.props,V),A=null;Xe!=null&&D!=null&&(D.excavation!=null&&(V=h(V,D.excavation)),A=M.createElement("image",{xlinkHref:Xe.src,height:D.h,width:D.w,x:D.x+B,y:D.y+B,preserveAspectRatio:"none"}));var pe=$(V,B);return M.createElement("svg",ve({shapeRendering:"crispEdges",height:O,width:O,viewBox:"0 0 ".concat(ue," ").concat(ue)},Oe),M.createElement("path",{fill:oe,d:"M0,0 h".concat(ue,"v").concat(ue,"H0z")}),M.createElement("path",{fill:Be,d:pe}),A)}}]),R}(M.PureComponent);L(J,"defaultProps",ke);var H=function(R){var ie=R.renderAs,F=me(R,["renderAs"]),be=ie==="svg"?J:C;return M.createElement(be,F)};H.defaultProps=xe({renderAs:"canvas"},ke),Je.exports=H},DlQD:function(Je,Ie,f){(function(z,ve){Je.exports=ve()})(this,function(){"use strict";function z(G,q){for(var Q=0;Q<q.length;Q++){var w=q[Q];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(G,w.key,w)}}function ve(G,q,Q){return q&&z(G.prototype,q),Q&&z(G,Q),G}function re(G,q){if(!G)return;if(typeof G=="string")return xe(G,q);var Q=Object.prototype.toString.call(G).slice(8,-1);if(Q==="Object"&&G.constructor&&(Q=G.constructor.name),Q==="Map"||Q==="Set")return Array.from(G);if(Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q))return xe(G,q)}function xe(G,q){(q==null||q>G.length)&&(q=G.length);for(var Q=0,w=new Array(q);Q<q;Q++)w[Q]=G[Q];return w}function me(G,q){var Q;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(Q=re(G))||q&&G&&typeof G.length=="number"){Q&&(G=Q);var w=0;return function(){return w>=G.length?{done:!0}:{done:!1,value:G[w++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Q=G[Symbol.iterator](),Q.next.bind(Q)}function ae(G,q){return q={exports:{}},G(q,q.exports),q.exports}var j=ae(function(G){function q(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Q(w){G.exports.defaults=w}G.exports={defaults:q(),getDefaults:q,changeDefaults:Q}}),x=j.defaults,k=j.getDefaults,P=j.changeDefaults,N=/[&<>"']/,T=/[&<>"']/g,ee=/[<>"']|&(?!#?\w+;)/,K=/[<>"']|&(?!#?\w+;)/g,L={"&":"&","<":"<",">":">",'"':""","'":"'"},M=function(q){return L[q]};function W(G,q){if(q){if(N.test(G))return G.replace(T,M)}else if(ee.test(G))return G.replace(K,M);return G}var Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _(G){return G.replace(Y,function(q,Q){return Q=Q.toLowerCase(),Q==="colon"?":":Q.charAt(0)==="#"?Q.charAt(1)==="x"?String.fromCharCode(parseInt(Q.substring(2),16)):String.fromCharCode(+Q.substring(1)):""})}var we=/(^|[^\[])\^/g;function ke(G,q){G=G.source||G,q=q||"";var Q={replace:function(S,U){return U=U.source||U,U=U.replace(we,"$1"),G=G.replace(S,U),Q},getRegex:function(){return new RegExp(G,q)}};return Q}var se=/[^\w:]/g,le=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function fe(G,q,Q){if(G){var w;try{w=decodeURIComponent(_(Q)).replace(se,"").toLowerCase()}catch(S){return null}if(w.indexOf("javascript:")===0||w.indexOf("vbscript:")===0||w.indexOf("data:")===0)return null}q&&!le.test(Q)&&(Q=C(q,Q));try{Q=encodeURI(Q).replace(/%25/g,"%")}catch(S){return null}return Q}var $={},h=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C(G,q){$[" "+G]||(h.test(G)?$[" "+G]=G+"/":$[" "+G]=R(G,"/",!0)),G=$[" "+G];var Q=G.indexOf(":")===-1;return q.substring(0,2)==="//"?Q?q:G.replace(X,"$1")+q:q.charAt(0)==="/"?Q?q:G.replace(y,"$1")+q:G+q}var J={exec:function(){}};function H(G){for(var q=1,Q,w;q<arguments.length;q++){Q=arguments[q];for(w in Q)Object.prototype.hasOwnProperty.call(Q,w)&&(G[w]=Q[w])}return G}function E(G,q){var Q=G.replace(/\|/g,function(U,I,de){for(var Ce=!1,Re=I;--Re>=0&&de[Re]==="\\";)Ce=!Ce;return Ce?"|":" |"}),w=Q.split(/ \|/),S=0;if(w.length>q)w.splice(q);else for(;w.length<q;)w.push("");for(;S<w.length;S++)w[S]=w[S].trim().replace(/\\\|/g,"|");return w}function R(G,q,Q){var w=G.length;if(w===0)return"";for(var S=0;S<w;){var U=G.charAt(w-S-1);if(U===q&&!Q)S++;else if(U!==q&&Q)S++;else break}return G.substr(0,w-S)}function ie(G,q){if(G.indexOf(q[1])===-1)return-1;for(var Q=G.length,w=0,S=0;S<Q;S++)if(G[S]==="\\")S++;else if(G[S]===q[0])w++;else if(G[S]===q[1]&&(w--,w<0))return S;return-1}function F(G){G&&G.sanitize&&!G.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var be={escape:W,unescape:_,edit:ke,cleanUrl:fe,resolveUrl:C,noopTest:J,merge:H,splitCells:E,rtrim:R,findClosingBracket:ie,checkSanitizeDeprecation:F},O=j.defaults,m=be.rtrim,oe=be.splitCells,Be=be.escape,Ae=be.findClosingBracket;function Xe(G,q,Q){var w=q.href,S=q.title?Be(q.title):null,U=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:Q,href:w,title:S,text:U}:{type:"image",raw:Q,href:w,title:S,text:Be(U)}}function Oe(G,q){var Q=G.match(/^(\s+)(?:```)/);if(Q===null)return q;var w=Q[1];return q.split(`
|
|
`).map(function(S){var U=S.match(/^\s+/);if(U===null)return S;var I=U[0];return I.length>=w.length?S.slice(w.length):S}).join(`
|
|
`)}var Te=function(){function G(Q){this.options=Q||O}var q=G.prototype;return q.space=function(w){var S=this.rules.block.newline.exec(w);if(S)return S[0].length>1?{type:"space",raw:S[0]}:{raw:`
|
|
`}},q.code=function(w,S){var U=this.rules.block.code.exec(w);if(U){var I=S[S.length-1];if(I&&I.type==="paragraph")return{raw:U[0],text:U[0].trimRight()};var de=U[0].replace(/^ {4}/gm,"");return{type:"code",raw:U[0],codeBlockStyle:"indented",text:this.options.pedantic?de:m(de,`
|
|
`)}}},q.fences=function(w){var S=this.rules.block.fences.exec(w);if(S){var U=S[0],I=Oe(U,S[3]||"");return{type:"code",raw:U,lang:S[2]?S[2].trim():S[2],text:I}}},q.heading=function(w){var S=this.rules.block.heading.exec(w);if(S)return{type:"heading",raw:S[0],depth:S[1].length,text:S[2]}},q.nptable=function(w){var S=this.rules.block.nptable.exec(w);if(S){var U={type:"table",header:oe(S[1].replace(/^ *| *\| *$/g,"")),align:S[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:S[3]?S[3].replace(/\n$/,"").split(`
|
|
`):[],raw:S[0]};if(U.header.length===U.align.length){var I=U.align.length,de;for(de=0;de<I;de++)/^ *-+: *$/.test(U.align[de])?U.align[de]="right":/^ *:-+: *$/.test(U.align[de])?U.align[de]="center":/^ *:-+ *$/.test(U.align[de])?U.align[de]="left":U.align[de]=null;for(I=U.cells.length,de=0;de<I;de++)U.cells[de]=oe(U.cells[de],U.header.length);return U}}},q.hr=function(w){var S=this.rules.block.hr.exec(w);if(S)return{type:"hr",raw:S[0]}},q.blockquote=function(w){var S=this.rules.block.blockquote.exec(w);if(S){var U=S[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:S[0],text:U}}},q.list=function(w){var S=this.rules.block.list.exec(w);if(S){for(var U=S[0],I=S[2],de=I.length>1,Ce=I[I.length-1]===")",Re={type:"list",raw:U,ordered:de,start:de?+I.slice(0,-1):"",loose:!1,items:[]},bt=S[0].match(this.rules.block.item),rt=!1,ge,ut,_t,et,Bt,qe,zt,It=bt.length,vt=0;vt<It;vt++)ge=bt[vt],U=ge,ut=ge.length,ge=ge.replace(/^ *([*+-]|\d+[.)]) */,""),~ge.indexOf(`
|
|
`)&&(ut-=ge.length,ge=this.options.pedantic?ge.replace(/^ {1,4}/gm,""):ge.replace(new RegExp("^ {1,"+ut+"}","gm"),"")),vt!==It-1&&(_t=this.rules.block.bullet.exec(bt[vt+1])[0],(de?_t.length===1||!Ce&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==I)&&(et=bt.slice(vt+1).join(`
|
|
`),Re.raw=Re.raw.substring(0,Re.raw.length-et.length),vt=It-1)),Bt=rt||/\n\n(?!\s*$)/.test(ge),vt!==It-1&&(rt=ge.charAt(ge.length-1)===`
|
|
`,Bt||(Bt=rt)),Bt&&(Re.loose=!0),qe=/^\[[ xX]\] /.test(ge),zt=void 0,qe&&(zt=ge[1]!==" ",ge=ge.replace(/^\[[ xX]\] +/,"")),Re.items.push({type:"list_item",raw:U,task:qe,checked:zt,loose:Bt,text:ge});return Re}},q.html=function(w){var S=this.rules.block.html.exec(w);if(S)return{type:this.options.sanitize?"paragraph":"html",raw:S[0],pre:!this.options.sanitizer&&(S[1]==="pre"||S[1]==="script"||S[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):Be(S[0]):S[0]}},q.def=function(w){var S=this.rules.block.def.exec(w);if(S){S[3]&&(S[3]=S[3].substring(1,S[3].length-1));var U=S[1].toLowerCase().replace(/\s+/g," ");return{tag:U,raw:S[0],href:S[2],title:S[3]}}},q.table=function(w){var S=this.rules.block.table.exec(w);if(S){var U={type:"table",header:oe(S[1].replace(/^ *| *\| *$/g,"")),align:S[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:S[3]?S[3].replace(/\n$/,"").split(`
|
|
`):[]};if(U.header.length===U.align.length){U.raw=S[0];var I=U.align.length,de;for(de=0;de<I;de++)/^ *-+: *$/.test(U.align[de])?U.align[de]="right":/^ *:-+: *$/.test(U.align[de])?U.align[de]="center":/^ *:-+ *$/.test(U.align[de])?U.align[de]="left":U.align[de]=null;for(I=U.cells.length,de=0;de<I;de++)U.cells[de]=oe(U.cells[de].replace(/^ *\| *| *\| *$/g,""),U.header.length);return U}}},q.lheading=function(w){var S=this.rules.block.lheading.exec(w);if(S)return{type:"heading",raw:S[0],depth:S[2].charAt(0)==="="?1:2,text:S[1]}},q.paragraph=function(w){var S=this.rules.block.paragraph.exec(w);if(S)return{type:"paragraph",raw:S[0],text:S[1].charAt(S[1].length-1)===`
|
|
`?S[1].slice(0,-1):S[1]}},q.text=function(w,S){var U=this.rules.block.text.exec(w);if(U){var I=S[S.length-1];return I&&I.type==="text"?{raw:U[0],text:U[0]}:{type:"text",raw:U[0],text:U[0]}}},q.escape=function(w){var S=this.rules.inline.escape.exec(w);if(S)return{type:"escape",raw:S[0],text:Be(S[1])}},q.tag=function(w,S,U){var I=this.rules.inline.tag.exec(w);if(I)return!S&&/^<a /i.test(I[0])?S=!0:S&&/^<\/a>/i.test(I[0])&&(S=!1),!U&&/^<(pre|code|kbd|script)(\s|>)/i.test(I[0])?U=!0:U&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(I[0])&&(U=!1),{type:this.options.sanitize?"text":"html",raw:I[0],inLink:S,inRawBlock:U,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):Be(I[0]):I[0]}},q.link=function(w){var S=this.rules.inline.link.exec(w);if(S){var U=Ae(S[2],"()");if(U>-1){var I=S[0].indexOf("!")===0?5:4,de=I+S[1].length+U;S[2]=S[2].substring(0,U),S[0]=S[0].substring(0,de).trim(),S[3]=""}var Ce=S[2],Re="";if(this.options.pedantic){var bt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);bt?(Ce=bt[1],Re=bt[3]):Re=""}else Re=S[3]?S[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var rt=Xe(S,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Re&&Re.replace(this.rules.inline._escapes,"$1")},S[0]);return rt}},q.reflink=function(w,S){var U;if((U=this.rules.inline.reflink.exec(w))||(U=this.rules.inline.nolink.exec(w))){var I=(U[2]||U[1]).replace(/\s+/g," ");if(I=S[I.toLowerCase()],!I||!I.href){var de=U[0].charAt(0);return{type:"text",raw:de,text:de}}var Ce=Xe(U,I,U[0]);return Ce}},q.strong=function(w,S,U){U===void 0&&(U="");var I=this.rules.inline.strong.start.exec(w);if(I&&(!I[1]||I[1]&&(U===""||this.rules.inline.punctuation.exec(U)))){S=S.slice(-1*w.length);var de=I[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;de.lastIndex=0;for(var Ce;(I=de.exec(S))!=null;)if(Ce=this.rules.inline.strong.middle.exec(S.slice(0,I.index+3)),Ce)return{type:"strong",raw:w.slice(0,Ce[0].length),text:w.slice(2,Ce[0].length-2)}}},q.em=function(w,S,U){U===void 0&&(U="");var I=this.rules.inline.em.start.exec(w);if(I&&(!I[1]||I[1]&&(U===""||this.rules.inline.punctuation.exec(U)))){S=S.slice(-1*w.length);var de=I[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;de.lastIndex=0;for(var Ce;(I=de.exec(S))!=null;)if(Ce=this.rules.inline.em.middle.exec(S.slice(0,I.index+2)),Ce)return{type:"em",raw:w.slice(0,Ce[0].length),text:w.slice(1,Ce[0].length-1)}}},q.codespan=function(w){var S=this.rules.inline.code.exec(w);if(S){var U=S[2].replace(/\n/g," "),I=/[^ ]/.test(U),de=U.startsWith(" ")&&U.endsWith(" ");return I&&de&&(U=U.substring(1,U.length-1)),U=Be(U,!0),{type:"codespan",raw:S[0],text:U}}},q.br=function(w){var S=this.rules.inline.br.exec(w);if(S)return{type:"br",raw:S[0]}},q.del=function(w){var S=this.rules.inline.del.exec(w);if(S)return{type:"del",raw:S[0],text:S[1]}},q.autolink=function(w,S){var U=this.rules.inline.autolink.exec(w);if(U){var I,de;return U[2]==="@"?(I=Be(this.options.mangle?S(U[1]):U[1]),de="mailto:"+I):(I=Be(U[1]),de=I),{type:"link",raw:U[0],text:I,href:de,tokens:[{type:"text",raw:I,text:I}]}}},q.url=function(w,S){var U;if(U=this.rules.inline.url.exec(w)){var I,de;if(U[2]==="@")I=Be(this.options.mangle?S(U[0]):U[0]),de="mailto:"+I;else{var Ce;do Ce=U[0],U[0]=this.rules.inline._backpedal.exec(U[0])[0];while(Ce!==U[0]);I=Be(U[0]),U[1]==="www."?de="http://"+I:de=I}return{type:"link",raw:U[0],text:I,href:de,tokens:[{type:"text",raw:I,text:I}]}}},q.inlineText=function(w,S,U){var I=this.rules.inline.text.exec(w);if(I){var de;return S?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):Be(I[0]):I[0]:de=Be(this.options.smartypants?U(I[0]):I[0]),{type:"text",raw:I[0],text:de}}},G}(),V=be.noopTest,B=be.edit,ue=be.merge,D={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:V,table:V,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};D._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,D._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,D.def=B(D.def).replace("label",D._label).replace("title",D._title).getRegex(),D.bullet=/(?:[*+-]|\d{1,9}[.)])/,D.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,D.item=B(D.item,"gm").replace(/bull/g,D.bullet).getRegex(),D.list=B(D.list).replace(/bull/g,D.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+D.def.source+")").getRegex(),D._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",D._comment=/<!--(?!-?>)[\s\S]*?-->/,D.html=B(D.html,"i").replace("comment",D._comment).replace("tag",D._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),D.paragraph=B(D._paragraph).replace("hr",D.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",D._tag).getRegex(),D.blockquote=B(D.blockquote).replace("paragraph",D.paragraph).getRegex(),D.normal=ue({},D),D.gfm=ue({},D.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*|$)"}),D.gfm.nptable=B(D.gfm.nptable).replace("hr",D.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",D._tag).getRegex(),D.gfm.table=B(D.gfm.table).replace("hr",D.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",D._tag).getRegex(),D.pedantic=ue({},D.normal,{html:B(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",D._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:V,paragraph:B(D.normal._paragraph).replace("hr",D.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",D.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var A={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:V,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:V,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};A._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",A.punctuation=B(A.punctuation).replace(/punctuation/g,A._punctuation).getRegex(),A._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",A._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",A.em.start=B(A.em.start).replace(/punctuation/g,A._punctuation).getRegex(),A.em.middle=B(A.em.middle).replace(/punctuation/g,A._punctuation).replace(/overlapSkip/g,A._overlapSkip).getRegex(),A.em.endAst=B(A.em.endAst,"g").replace(/punctuation/g,A._punctuation).getRegex(),A.em.endUnd=B(A.em.endUnd,"g").replace(/punctuation/g,A._punctuation).getRegex(),A.strong.start=B(A.strong.start).replace(/punctuation/g,A._punctuation).getRegex(),A.strong.middle=B(A.strong.middle).replace(/punctuation/g,A._punctuation).replace(/blockSkip/g,A._blockSkip).getRegex(),A.strong.endAst=B(A.strong.endAst,"g").replace(/punctuation/g,A._punctuation).getRegex(),A.strong.endUnd=B(A.strong.endUnd,"g").replace(/punctuation/g,A._punctuation).getRegex(),A.blockSkip=B(A._blockSkip,"g").getRegex(),A.overlapSkip=B(A._overlapSkip,"g").getRegex(),A._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,A._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,A._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])?)+(?![-_])/,A.autolink=B(A.autolink).replace("scheme",A._scheme).replace("email",A._email).getRegex(),A._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,A.tag=B(A.tag).replace("comment",D._comment).replace("attribute",A._attribute).getRegex(),A._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,A._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,A._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,A.link=B(A.link).replace("label",A._label).replace("href",A._href).replace("title",A._title).getRegex(),A.reflink=B(A.reflink).replace("label",A._label).getRegex(),A.reflinkSearch=B(A.reflinkSearch,"g").replace("reflink",A.reflink).replace("nolink",A.nolink).getRegex(),A.normal=ue({},A),A.pedantic=ue({},A.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:B(/^!?\[(label)\]\((.*?)\)/).replace("label",A._label).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",A._label).getRegex()}),A.gfm=ue({},A.normal,{escape:B(A.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),A.gfm.url=B(A.gfm.url,"i").replace("email",A.gfm._extended_email).getRegex(),A.breaks=ue({},A.gfm,{br:B(A.br).replace("{2,}","*").getRegex(),text:B(A.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var pe={block:D,inline:A},he=j.defaults,Ze=pe.block,Le=pe.inline;function He(G){return G.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Pe(G){var q="",Q,w,S=G.length;for(Q=0;Q<S;Q++)w=G.charCodeAt(Q),Math.random()>.5&&(w="x"+w.toString(16)),q+="&#"+w+";";return q}var je=function(){function G(Q){this.tokens=[],this.tokens.links=Object.create(null),this.options=Q||he,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var w={block:Ze.normal,inline:Le.normal};this.options.pedantic?(w.block=Ze.pedantic,w.inline=Le.pedantic):this.options.gfm&&(w.block=Ze.gfm,this.options.breaks?w.inline=Le.breaks:w.inline=Le.gfm),this.tokenizer.rules=w}G.lex=function(w,S){var U=new G(S);return U.lex(w)};var q=G.prototype;return q.lex=function(w){return w=w.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(w,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(w,S,U){S===void 0&&(S=[]),U===void 0&&(U=!0),w=w.replace(/^ +$/gm,"");for(var I,de,Ce,Re;w;){if(I=this.tokenizer.space(w)){w=w.substring(I.raw.length),I.type&&S.push(I);continue}if(I=this.tokenizer.code(w,S)){w=w.substring(I.raw.length),I.type?S.push(I):(Re=S[S.length-1],Re.raw+=`
|
|
`+I.raw,Re.text+=`
|
|
`+I.text);continue}if(I=this.tokenizer.fences(w)){w=w.substring(I.raw.length),S.push(I);continue}if(I=this.tokenizer.heading(w)){w=w.substring(I.raw.length),S.push(I);continue}if(I=this.tokenizer.nptable(w)){w=w.substring(I.raw.length),S.push(I);continue}if(I=this.tokenizer.hr(w)){w=w.substring(I.raw.length),S.push(I);continue}if(I=this.tokenizer.blockquote(w)){w=w.substring(I.raw.length),I.tokens=this.blockTokens(I.text,[],U),S.push(I);continue}if(I=this.tokenizer.list(w)){for(w=w.substring(I.raw.length),Ce=I.items.length,de=0;de<Ce;de++)I.items[de].tokens=this.blockTokens(I.items[de].text,[],!1);S.push(I);continue}if(I=this.tokenizer.html(w)){w=w.substring(I.raw.length),S.push(I);continue}if(U&&(I=this.tokenizer.def(w))){w=w.substring(I.raw.length),this.tokens.links[I.tag]||(this.tokens.links[I.tag]={href:I.href,title:I.title});continue}if(I=this.tokenizer.table(w)){w=w.substring(I.raw.length),S.push(I);continue}if(I=this.tokenizer.lheading(w)){w=w.substring(I.raw.length),S.push(I);continue}if(U&&(I=this.tokenizer.paragraph(w))){w=w.substring(I.raw.length),S.push(I);continue}if(I=this.tokenizer.text(w,S)){w=w.substring(I.raw.length),I.type?S.push(I):(Re=S[S.length-1],Re.raw+=`
|
|
`+I.raw,Re.text+=`
|
|
`+I.text);continue}if(w){var bt="Infinite loop on byte: "+w.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return S},q.inline=function(w){var S,U,I,de,Ce,Re,bt=w.length;for(S=0;S<bt;S++){Re=w[S];switch(Re.type){case"paragraph":case"text":case"heading":{Re.tokens=[],this.inlineTokens(Re.text,Re.tokens);break}case"table":{for(Re.tokens={header:[],cells:[]},de=Re.header.length,U=0;U<de;U++)Re.tokens.header[U]=[],this.inlineTokens(Re.header[U],Re.tokens.header[U]);for(de=Re.cells.length,U=0;U<de;U++)for(Ce=Re.cells[U],Re.tokens.cells[U]=[],I=0;I<Ce.length;I++)Re.tokens.cells[U][I]=[],this.inlineTokens(Ce[I],Re.tokens.cells[U][I]);break}case"blockquote":{this.inline(Re.tokens);break}case"list":{for(de=Re.items.length,U=0;U<de;U++)this.inline(Re.items[U].tokens);break}}}return w},q.inlineTokens=function(w,S,U,I,de){S===void 0&&(S=[]),U===void 0&&(U=!1),I===void 0&&(I=!1),de===void 0&&(de="");var Ce,Re=w,bt;if(this.tokens.links){var rt=Object.keys(this.tokens.links);if(rt.length>0)for(;(bt=this.tokenizer.rules.inline.reflinkSearch.exec(Re))!=null;)rt.includes(bt[0].slice(bt[0].lastIndexOf("[")+1,-1))&&(Re=Re.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(bt=this.tokenizer.rules.inline.blockSkip.exec(Re))!=null;)Re=Re.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;w;){if(Ce=this.tokenizer.escape(w)){w=w.substring(Ce.raw.length),S.push(Ce);continue}if(Ce=this.tokenizer.tag(w,U,I)){w=w.substring(Ce.raw.length),U=Ce.inLink,I=Ce.inRawBlock,S.push(Ce);continue}if(Ce=this.tokenizer.link(w)){w=w.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,I)),S.push(Ce);continue}if(Ce=this.tokenizer.reflink(w,this.tokens.links)){w=w.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,I)),S.push(Ce);continue}if(Ce=this.tokenizer.strong(w,Re,de)){w=w.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],U,I),S.push(Ce);continue}if(Ce=this.tokenizer.em(w,Re,de)){w=w.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],U,I),S.push(Ce);continue}if(Ce=this.tokenizer.codespan(w)){w=w.substring(Ce.raw.length),S.push(Ce);continue}if(Ce=this.tokenizer.br(w)){w=w.substring(Ce.raw.length),S.push(Ce);continue}if(Ce=this.tokenizer.del(w)){w=w.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],U,I),S.push(Ce);continue}if(Ce=this.tokenizer.autolink(w,Pe)){w=w.substring(Ce.raw.length),S.push(Ce);continue}if(!U&&(Ce=this.tokenizer.url(w,Pe))){w=w.substring(Ce.raw.length),S.push(Ce);continue}if(Ce=this.tokenizer.inlineText(w,I,He)){w=w.substring(Ce.raw.length),de=Ce.raw.slice(-1),S.push(Ce);continue}if(w){var ge="Infinite loop on byte: "+w.charCodeAt(0);if(this.options.silent){console.error(ge);break}else throw new Error(ge)}}return S},ve(G,null,[{key:"rules",get:function(){return{block:Ze,inline:Le}}}]),G}(),Qe=j.defaults,nt=be.cleanUrl,ot=be.escape,$e=function(){function G(Q){this.options=Q||Qe}var q=G.prototype;return q.code=function(w,S,U){var I=(S||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(w,I);de!=null&&de!==w&&(U=!0,w=de)}return I?'<pre><code class="'+this.options.langPrefix+ot(I,!0)+'">'+(U?w:ot(w,!0))+`</code></pre>
|
|
`:"<pre><code>"+(U?w:ot(w,!0))+`</code></pre>
|
|
`},q.blockquote=function(w){return`<blockquote>
|
|
`+w+`</blockquote>
|
|
`},q.html=function(w){return w},q.heading=function(w,S,U,I){return this.options.headerIds?"<h"+S+' id="'+this.options.headerPrefix+I.slug(U)+'">'+w+"</h"+S+`>
|
|
`:"<h"+S+">"+w+"</h"+S+`>
|
|
`},q.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},q.list=function(w,S,U){var I=S?"ol":"ul",de=S&&U!==1?' start="'+U+'"':"";return"<"+I+de+`>
|
|
`+w+"</"+I+`>
|
|
`},q.listitem=function(w){return"<li>"+w+`</li>
|
|
`},q.checkbox=function(w){return"<input "+(w?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},q.paragraph=function(w){return"<p>"+w+`</p>
|
|
`},q.table=function(w,S){return S&&(S="<tbody>"+S+"</tbody>"),`<table>
|
|
<thead>
|
|
`+w+`</thead>
|
|
`+S+`</table>
|
|
`},q.tablerow=function(w){return`<tr>
|
|
`+w+`</tr>
|
|
`},q.tablecell=function(w,S){var U=S.header?"th":"td",I=S.align?"<"+U+' align="'+S.align+'">':"<"+U+">";return I+w+"</"+U+`>
|
|
`},q.strong=function(w){return"<strong>"+w+"</strong>"},q.em=function(w){return"<em>"+w+"</em>"},q.codespan=function(w){return"<code>"+w+"</code>"},q.br=function(){return this.options.xhtml?"<br/>":"<br>"},q.del=function(w){return"<del>"+w+"</del>"},q.link=function(w,S,U){if(w=nt(this.options.sanitize,this.options.baseUrl,w),w===null)return U;var I='<a href="'+ot(w)+'"';return S&&(I+=' title="'+S+'"'),I+=">"+U+"</a>",I},q.image=function(w,S,U){if(w=nt(this.options.sanitize,this.options.baseUrl,w),w===null)return U;var I='<img src="'+w+'" alt="'+U+'"';return S&&(I+=' title="'+S+'"'),I+=this.options.xhtml?"/>":">",I},q.text=function(w){return w},G}(),Ke=function(){function G(){}var q=G.prototype;return q.strong=function(w){return w},q.em=function(w){return w},q.codespan=function(w){return w},q.del=function(w){return w},q.html=function(w){return w},q.text=function(w){return w},q.link=function(w,S,U){return""+U},q.image=function(w,S,U){return""+U},q.br=function(){return""},G}(),At=function(){function G(){this.seen={}}var q=G.prototype;return q.slug=function(w){var S=w.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(S)){var U=S;do this.seen[U]++,S=U+"-"+this.seen[U];while(this.seen.hasOwnProperty(S))}return this.seen[S]=0,S},G}(),mt=j.defaults,St=be.unescape,ct=function(){function G(Q){this.options=Q||mt,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new At}G.parse=function(w,S){var U=new G(S);return U.parse(w)};var q=G.prototype;return q.parse=function(w,S){S===void 0&&(S=!0);var U="",I,de,Ce,Re,bt,rt,ge,ut,_t,et,Bt,qe,zt,It,vt,Xt,Lt,Fe,st=w.length;for(I=0;I<st;I++){et=w[I];switch(et.type){case"space":continue;case"hr":{U+=this.renderer.hr();continue}case"heading":{U+=this.renderer.heading(this.parseInline(et.tokens),et.depth,St(this.parseInline(et.tokens,this.textRenderer)),this.slugger);continue}case"code":{U+=this.renderer.code(et.text,et.lang,et.escaped);continue}case"table":{for(ut="",ge="",Re=et.header.length,de=0;de<Re;de++)ge+=this.renderer.tablecell(this.parseInline(et.tokens.header[de]),{header:!0,align:et.align[de]});for(ut+=this.renderer.tablerow(ge),_t="",Re=et.cells.length,de=0;de<Re;de++){for(rt=et.tokens.cells[de],ge="",bt=rt.length,Ce=0;Ce<bt;Ce++)ge+=this.renderer.tablecell(this.parseInline(rt[Ce]),{header:!1,align:et.align[Ce]});_t+=this.renderer.tablerow(ge)}U+=this.renderer.table(ut,_t);continue}case"blockquote":{_t=this.parse(et.tokens),U+=this.renderer.blockquote(_t);continue}case"list":{for(Bt=et.ordered,qe=et.start,zt=et.loose,Re=et.items.length,_t="",de=0;de<Re;de++)vt=et.items[de],Xt=vt.checked,Lt=vt.task,It="",vt.task&&(Fe=this.renderer.checkbox(Xt),zt?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=Fe+" "+vt.tokens[0].text,vt.tokens[0].tokens&&vt.tokens[0].tokens.length>0&&vt.tokens[0].tokens[0].type==="text"&&(vt.tokens[0].tokens[0].text=Fe+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:Fe}):It+=Fe),It+=this.parse(vt.tokens,zt),_t+=this.renderer.listitem(It,Lt,Xt);U+=this.renderer.list(_t,Bt,qe);continue}case"html":{U+=this.renderer.html(et.text);continue}case"paragraph":{U+=this.renderer.paragraph(this.parseInline(et.tokens));continue}case"text":{for(_t=et.tokens?this.parseInline(et.tokens):et.text;I+1<st&&w[I+1].type==="text";)et=w[++I],_t+=`
|
|
`+(et.tokens?this.parseInline(et.tokens):et.text);U+=S?this.renderer.paragraph(_t):_t;continue}default:{var tt='Token with "'+et.type+'" type was not found.';if(this.options.silent){console.error(tt);return}else throw new Error(tt)}}}return U},q.parseInline=function(w,S){S=S||this.renderer;var U="",I,de,Ce=w.length;for(I=0;I<Ce;I++){de=w[I];switch(de.type){case"escape":{U+=S.text(de.text);break}case"html":{U+=S.html(de.text);break}case"link":{U+=S.link(de.href,de.title,this.parseInline(de.tokens,S));break}case"image":{U+=S.image(de.href,de.title,de.text);break}case"strong":{U+=S.strong(this.parseInline(de.tokens,S));break}case"em":{U+=S.em(this.parseInline(de.tokens,S));break}case"codespan":{U+=S.codespan(de.text);break}case"br":{U+=S.br();break}case"del":{U+=S.del(this.parseInline(de.tokens,S));break}case"text":{U+=S.text(de.text);break}default:{var Re='Token with "'+de.type+'" type was not found.';if(this.options.silent){console.error(Re);return}else throw new Error(Re)}}}return U},G}(),Ot=be.merge,Ct=be.checkSanitizeDeprecation,yt=be.escape,De=j.getDefaults,Ut=j.changeDefaults,kt=j.defaults;function Ue(G,q,Q){if(typeof G=="undefined"||G===null)throw new Error("marked(): input parameter is undefined or null");if(typeof G!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(G)+", string expected");if(typeof q=="function"&&(Q=q,q=null),q=Ot({},Ue.defaults,q||{}),Ct(q),Q){var w=q.highlight,S;try{S=je.lex(G,q)}catch(Ce){return Q(Ce)}var U=function(Re){var bt;if(!Re)try{bt=ct.parse(S,q)}catch(rt){Re=rt}return q.highlight=w,Re?Q(Re):Q(null,bt)};if(!w||w.length<3)return U();if(delete q.highlight,!S.length)return U();var I=0;Ue.walkTokens(S,function(Ce){Ce.type==="code"&&(I++,setTimeout(function(){w(Ce.text,Ce.lang,function(Re,bt){if(Re)return U(Re);bt!=null&&bt!==Ce.text&&(Ce.text=bt,Ce.escaped=!0),I--,I===0&&U()})},0))}),I===0&&U();return}try{var de=je.lex(G,q);return q.walkTokens&&Ue.walkTokens(de,q.walkTokens),ct.parse(de,q)}catch(Ce){if(Ce.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+yt(Ce.message+"",!0)+"</pre>";throw Ce}}Ue.options=Ue.setOptions=function(G){return Ot(Ue.defaults,G),Ut(Ue.defaults),Ue},Ue.getDefaults=De,Ue.defaults=kt,Ue.use=function(G){var q=Ot({},G);if(G.renderer&&function(){var w=Ue.defaults.renderer||new $e,S=function(de){var Ce=w[de];w[de]=function(){for(var Re=arguments.length,bt=new Array(Re),rt=0;rt<Re;rt++)bt[rt]=arguments[rt];var ge=G.renderer[de].apply(w,bt);return ge===!1&&(ge=Ce.apply(w,bt)),ge}};for(var U in G.renderer)S(U);q.renderer=w}(),G.tokenizer&&function(){var w=Ue.defaults.tokenizer||new Te,S=function(de){var Ce=w[de];w[de]=function(){for(var Re=arguments.length,bt=new Array(Re),rt=0;rt<Re;rt++)bt[rt]=arguments[rt];var ge=G.tokenizer[de].apply(w,bt);return ge===!1&&(ge=Ce.apply(w,bt)),ge}};for(var U in G.tokenizer)S(U);q.tokenizer=w}(),G.walkTokens){var Q=Ue.defaults.walkTokens;q.walkTokens=function(w){G.walkTokens(w),Q&&Q(w)}}Ue.setOptions(q)},Ue.walkTokens=function(G,q){for(var Q=me(G),w;!(w=Q()).done;){var S=w.value;q(S);switch(S.type){case"table":{for(var U=me(S.tokens.header),I;!(I=U()).done;){var de=I.value;Ue.walkTokens(de,q)}for(var Ce=me(S.tokens.cells),Re;!(Re=Ce()).done;)for(var bt=Re.value,rt=me(bt),ge;!(ge=rt()).done;){var ut=ge.value;Ue.walkTokens(ut,q)}break}case"list":{Ue.walkTokens(S.items,q);break}default:S.tokens&&Ue.walkTokens(S.tokens,q)}}},Ue.Parser=ct,Ue.parser=ct.parse,Ue.Renderer=$e,Ue.TextRenderer=Ke,Ue.Lexer=je,Ue.lexer=je.lex,Ue.Tokenizer=Te,Ue.Slugger=At,Ue.parse=Ue;var We=Ue;return We})},"Dvv+":function(Je,Ie,f){"use strict";f.r(Ie);var z=f("cWXX"),ve=f("/ezw"),re=f("+L6B"),xe=f("2/Rp"),me=f("7Kak"),ae=f("9yH6"),j=f("giR+"),x=f("fyUT"),k=f("9og8"),P=f("k1fw"),N=f("y8nQ"),T=f("Vl3Y"),ee=f("tJVT"),K=f("5NDa"),L=f("5rEg"),M=f("WmNS"),W=f.n(M),Y=f("q1tI"),_=f.n(Y),we=f("Ty5D"),ke=f("9kvl"),se=f("m3fD"),le=f.n(se),fe=f("A+k2"),$=f.n(fe),h=function(de){var Ce=de.value,Re=Ce===void 0?[]:Ce,bt=de.onChange,rt=de.className,ge=rt===void 0?"":rt;return _.a.createElement("div",{className:"".concat($.a.tabs," ").concat(ge," ")},_.a.createElement("div",{onClick:function(){return bt(0)},className:Re===0?$.a.active:""},_.a.createElement("div",null,"1"),_.a.createElement("div",null,"\u5F55\u5165\u4FE1\u606F")," "),_.a.createElement("div",{onClick:function(){return bt(1)},className:Re===1?$.a.active:""},_.a.createElement("div",null,"2"),_.a.createElement("div",null,"\u914D\u7F6E\u7EC4\u5377")))},X=h,y=f("2qtc"),C=f("kLXV"),J=f("sRBo"),H=f("kaz8"),E=f("5Dmo"),R=f("3S7+"),ie=f("miYZ"),F=f("tsqr"),be=f("oBTY"),O=f("IlMy"),m=f.n(O),oe=f("WCUW"),Be=f("QSKd"),Ae=f.n(Be),Xe=f("Hfvn"),Oe=f.n(Xe),Te=f("HPRh"),V=f.n(Te),B=f("+RXH"),ue=f.n(B),D=f("+yhJ"),A=f.n(D),pe=f("RZ/O"),he=f.n(pe),Ze=f("exQ7"),Le=f.n(Ze),He=f("HG2Q"),Pe=f.n(He),je=f("k4n4"),Qe=f("eS0+"),nt=f("PpiC"),ot=f("K5AI"),$e=f.n(ot),Ke=f("LvDl"),At=H.a.Group,mt=function(de){var Ce=de.value,Re=Ce===void 0?[]:Ce,bt=de.onChange,rt=de.options,ge=de.search,ut=Object(nt.a)(de,["value","onChange","options","search"]),_t=_.a.useState(!1),et=Object(ee.a)(_t,2),Bt=et[0],qe=et[1];Object(Y.useEffect)(function(){var Lt,Fe=rt==null||((Lt=rt.tag_disciplines)===null||Lt===void 0)?void 0:Lt.map(function(tt){return tt.id}),st=Re==null?void 0:Re.filter(function(tt){return Fe.includes(tt)});qe(st.length===(Fe==null?void 0:Fe.length))},[Re]);var zt=function(Fe){var st,tt,dt=rt==null||((st=rt.tag_disciplines)===null||st===void 0)?void 0:st.map(function(Vt){return Vt.id}),Kt=Re==null?void 0:Re.filter(function(Vt){return dt.includes(Vt)}),Gt=Object(Ke.uniq)([].concat(Object(be.a)(Re),Object(be.a)(Fe)));if(Kt.length>Fe.length){var an=Object(Ke.xor)(Kt,Fe);console.log(an,"newLevel"),Gt=Gt.filter(function(Vt){return!an.includes(Vt)})}bt(Gt),qe(Fe.length===(rt==null||((tt=rt.tag_disciplines)===null||tt===void 0)?void 0:tt.length))},It=function(Fe){var st,tt=rt==null||((st=rt.tag_disciplines)===null||st===void 0)?void 0:st.map(function(dt){return dt.id});bt(Fe.target.checked?Object(Ke.uniq)([].concat(Object(be.a)(Re),Object(be.a)(tt))):Re==null?void 0:Re.filter(function(dt){return!tt.includes(dt)})),qe(Fe.target.checked)};console.log(rt,"options");var vt=function(){var Fe,st,tt=(rt==null?void 0:rt.tag_disciplines)||[];if(ge){var dt;tt=(dt=tt)===null||dt===void 0?void 0:dt.filter(function(Kt){var Gt;return Kt==null||((Gt=Kt.name)===null||Gt===void 0)?void 0:Gt.includes(ge)})}return tt=(Fe=tt)===null||Fe===void 0?void 0:Fe.map(function(Kt){return Object(P.a)(Object(P.a)({},Kt),{},{label:"".concat(Kt.name,"(".concat(Kt==null?void 0:Kt.item_count,")")),value:Kt.id})}),tt=(st=tt)===null||st===void 0?void 0:st.filter(function(Kt){return Kt.item_count!==0}),tt},Xt=function(){var Fe=!1;if(!ge)Fe=!0;else{var st;(st=rt.tag_disciplines)===null||st===void 0||st.forEach(function(tt){if(!Fe){var dt;Fe=((dt=tt.name)===null||dt===void 0?void 0:dt.includes(ge))&&tt.item_count!==0}})}return Fe};return(rt==null?void 0:rt.item_count)===0||!Xt()?_.a.createElement(_.a.Fragment,null):_.a.createElement("div",{className:$e.a.cInput},_.a.createElement("div",{className:$e.a.cl},_.a.createElement(H.a,{checked:Bt,onChange:It},_.a.createElement("span",{className:$e.a.box},_.a.createElement("span",{className:"font14 c-light-primary"},_.a.createElement("span",{title:rt==null?void 0:rt.name,className:$e.a.box1}," ",rt==null?void 0:rt.name),_.a.createElement("span",null," ","(".concat(rt==null?void 0:rt.item_count,")"))),_.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),_.a.createElement("div",{className:$e.a.cr},_.a.createElement(At,{options:vt(),value:Re,onChange:zt})))},St=mt,ct=f("ErOA"),Ot=f("ozfa"),Ct=f("MJZm"),yt=f("0Owb"),De=f("tmPe"),Ut=f.n(De),kt=function(de){var Ce=de.value,Re=de.onChange,bt=de.defaultValue,rt=de.treeData,ge=rt===void 0?[]:rt,ut=Object(nt.a)(de,["value","onChange","defaultValue","treeData"]);return _.a.createElement("div",{className:Ut.a.customTree},_.a.createElement(Ct.a,Object(yt.a)({multiple:!0,showIcon:!0,selectedKeys:Ce,defaultExpandedKeys:bt,treeData:ge,onSelect:Re},ut)))},Ue=kt,We=f("sbIO"),G=L.a.Search,q=function(de){var Ce,Re=de.formValue,bt=de.setFatherTabs,rt=de.tabs,ge=de.editData,ut=de.dispatch,_t=Object(we.i)().id,et=Object(Y.useState)(["mine"]),Bt=Object(ee.a)(et,2),qe=Bt[0],zt=Bt[1],It=Object(Y.useState)(!0),vt=Object(ee.a)(It,2),Xt=vt[0],Lt=vt[1],Fe=Object(Y.useState)(!1),st=Object(ee.a)(Fe,2),tt=st[0],dt=st[1],Kt=Object(Y.useState)(!1),Gt=Object(ee.a)(Kt,2),an=Gt[0],Vt=Gt[1],Et=Object(Y.useState)(0),tn=Object(ee.a)(Et,2),jt=tn[0],dn=tn[1],$t=Object(Y.useState)(""),mn=Object(ee.a)($t,2),On=mn[0],nn=mn[1],Ve=Object(Y.useState)(!1),lt=Object(ee.a)(Ve,2),gn=lt[0],yn=lt[1],An=Object(Y.useState)(!1),Kn=Object(ee.a)(An,2),d=Kn[0],r=Kn[1],o=Object(Y.useState)({}),u=Object(ee.a)(o,2),v=u[0],c=u[1],ne=Object(Y.useState)([]),Ye=Object(ee.a)(ne,2),_e=Ye[0],Dt=Ye[1],Ee=Object(Y.useState)([]),ce=Object(ee.a)(Ee,2),ze=ce[0],Rt=ce[1],Pt=Object(Y.useState)([]),Tt=Object(ee.a)(Pt,2),Wt=Tt[0],bn=Tt[1],Fn=Object(Y.useState)([]),En=Object(ee.a)(Fn,2),Zt=En[0],In=En[1],li=Object(Y.useState)(null),Wn=Object(ee.a)(li,2),gi=Wn[0],Bn=Wn[1],Gn=Object(Y.useRef)([]),Xi=Object(Y.useState)(!1),ii=Object(ee.a)(Xi,2),Pi=ii[0],$i=ii[1],la=Object(Y.useState)([]),na=Object(ee.a)(la,2),on=na[0],hn=na[1],ui=Object(Y.useState)([0]),Cn=Object(ee.a)(ui,2),ci=Cn[0],Nn=Cn[1],ia=Object(Y.useState)([]),Zn=Object(ee.a)(ia,2),$n=Zn[0],Yi=Zn[1],xi=Object(Y.useRef)([]),aa=Object(Y.useState)(!1),Ra=Object(ee.a)(aa,2),zi=Ra[0],ra=Ra[1],Ti=Object(Y.useState)([]),ua=Object(ee.a)(Ti,2),Rn=ua[0],Bi=ua[1],nr=Object(Y.useState)([]),Ia=Object(ee.a)(nr,2),ca=Ia[0],Pr=Ia[1],oa=Object(Y.useRef)([]),Ba=Object(Y.useState)([]),Ht=Object(ee.a)(Ba,2),en=Ht[0],Jt=Ht[1],cn=Object(Y.useState)(!1),vn=Object(ee.a)(cn,2),kn=vn[0],fn=vn[1],Hn=Object(Y.useRef)([]),ai=Object(Y.useState)(0),sn=Object(ee.a)(ai,2),da=sn[0],xn=sn[1],qn=$n==null?void 0:$n.filter(function(ht){return on==null?void 0:on.includes(ht.id)}),Mn=ca==null?void 0:ca.filter(function(ht){return Rn==null?void 0:Rn.includes(ht.id)});Object(Y.useEffect)(function(){Ta()},[]),Object(Y.useEffect)(function(){return rt===1&&(ut({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),ut({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){ut({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),ut({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[rt]),Object(Y.useEffect)(function(){_t?ge&&qr():(ir(qe),Fa(),Lt(!1))},[ge]),Object(Y.useEffect)(function(){On&&Fi()},[On]);var Fi=function(){var at=null;ze==null||ze.forEach(function(Ne){var Me;(Me=Ne.sub_disciplines)===null||Me===void 0||Me.forEach(function(pt){var gt;(gt=pt.tag_disciplines)===null||gt===void 0||gt.forEach(function(Mt){var Qt,rn=((Qt=Mt.name)===null||Qt===void 0?void 0:Qt.includes(On))&&Mt.item_count!==0;rn&&!at&&(at=Ne.id)})})}),at&&Bn(at)},Pa=function(at){function Ne(Me){var pt=Me.children,gt=Array.isArray(pt)&&pt.length>0,Mt=Me==null?void 0:Me.group_id;return Hn.current.push({name:Me==null?void 0:Me.name,id:Mt,count:Me==null?void 0:Me.count}),{title:_.a.createElement("div",{title:Me==null?void 0:Me.name,className:m.a.name},Me==null?void 0:Me.name,"\uFF08".concat(Me==null?void 0:Me.count,"\uFF09")),value:Mt,name:Me==null?void 0:Me.name,key:Mt,count:Me==null?void 0:Me.count,id:Mt,icon:_.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:gt?pt==null?void 0:pt.map(function(Qt){return Ne(Qt)}):[]}}return at==null?void 0:at.map(function(Me){return Ne(Me)})},Ta=function(){var ht=Object(k.a)(W.a.mark(function at(){var Ne,Me;return W.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(oe.z)({});case 2:Ne=gt.sent,Hn.current=[{id:0,name:"\u6839\u76EE\u5F55",count:Ne==null?void 0:Ne.root_count}],Ne!=null&&Ne.data&&(Me=[{title:_.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:m.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((Ne==null?void 0:Ne.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:Ne==null?void 0:Ne.root_count,name:"\u6839\u76EE\u5F55",icon:_.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Pa(Ne.data||[])}],Yi(Hn.current),Jt(Me));case 5:case"end":return gt.stop()}},at)}));return function(){return ht.apply(this,arguments)}}(),qr=function(){var ht=Object(k.a)(W.a.mark(function at(){var Ne,Me,pt,gt,Mt,Qt,rn,Pn,_n,Ln,wn,ei,Yn,Jn,vi,Dn,di,hi;return W.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return Ln=ge==null||((Ne=ge.tag_disciplines)===null||Ne===void 0)?void 0:Ne.map(function(pn){return pn.tag_discipline_id}),wn=ge==null||((Me=ge.groups)===null||Me===void 0)?void 0:Me.map(function(pn){return pn.id}),ei={source:ge==null||((pt=ge.examination_bank)===null||pt===void 0)?void 0:pt.source,group_ids:wn,tag_discipline_ids:Ln,teach_group_ids:ge==null?void 0:ge.teach_group_ids},ln.next=5,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ei});case 5:if(Yn=ln.sent,!((Yn==null?void 0:Yn.status)===-1)){ln.next=8;break}return ln.abrupt("return");case 8:Jn=Yn==null?void 0:Yn.filter(function(pn){var Vn;return!!(pn!=null&&(Vn=pn.item_banks)!==null&&Vn!==void 0&&Vn.length)}),Jn=Jn.map(function(pn){return Object(P.a)(Object(P.a)({},pn),{},{scoreTotal:0,score:0,questionTotal:0})}),Jn=(gt=Jn)===null||gt===void 0?void 0:gt.map(function(pn,Vn){var Si,fi,Mi;return Object(P.a)(Object(P.a)({},pn),{},{score:(ge==null||((Si=ge.score_settings)===null||Si===void 0||((fi=Si.find(function(pi){return pi.item_type===(pn==null?void 0:pn.item_type)}))===null||fi===void 0))?void 0:fi.score)||0,item_banks:pn==null||((Mi=pn.item_banks)===null||Mi===void 0)?void 0:Mi.map(function(pi){var Sn;return Object(P.a)(Object(P.a)({},pi),{},{tag_disciplines:pi==null||((Sn=pi.tag_disciplines)===null||Sn===void 0)?void 0:Sn.map(function(jn){var ri;return Object(P.a)(Object(P.a)({},jn),{},{difficulties:jn==null||((ri=jn.difficulties)===null||ri===void 0)?void 0:ri.map(function(Ki){var Li=ge==null?void 0:ge.contents.find(function(Zi){return Zi.item_type===pn.item_type&&Zi.sub_discipline_id===pi.sub_discipline_id&&Zi.tag_discipline_id===jn.tag_discipline_id&&Zi.difficulty===Ki.difficulty});return Li?Object(P.a)(Object(P.a)({},Ki),{},{num:Li==null?void 0:Li.quanlity}):Object(P.a)({},Ki)})})})})})})}),vi=Oa(Jn),Dn=vi.panel,di=vi.score_num_item,Jn=(Mt=Jn)===null||Mt===void 0?void 0:Mt.map(function(pn,Vn){var Si,fi=(Dn==null||((Si=Dn[Vn])===null||Si===void 0)?void 0:Si.reduce(function(Mi,pi){return Mi+pi},0))||0;return Object(P.a)(Object(P.a)({},pn),{},{scoreTotal:fi*(di[Vn]||0),questionTotal:fi})}),hi=[],ge==null||((Qt=ge.sort_by_item_type)===null||Qt===void 0)||Qt.forEach(function(pn){var Vn=Jn.find(function(Si){var fi,Mi=(fi=ha.find(function(pi){return pi.type===(Si==null?void 0:Si.item_type)}))===null||fi===void 0?void 0:fi.name;return Mi===pn});hi.push(Vn)}),hi=Object(Ke.compact)(hi),ir(ge==null||((rn=ge.examination_bank)===null||rn===void 0)?void 0:rn.source),Fa(),zt(ge==null||((Pn=ge.examination_bank)===null||Pn===void 0)?void 0:Pn.source),In(Ln),Gn.current=Ln,hn(wn),Bi((ge==null?void 0:ge.teach_group_ids)||[]),xn(ge==null||((_n=ge.groups)===null||_n===void 0)?void 0:_n.map(function(pn){return pn.count}).reduce(function(pn,Vn){return pn+Vn},0)),xi.current=wn,Nn(wn!=null&&wn.length?wn:[0]),Dt(Object(Ke.cloneDeep)(hi)),Lt(!1);case 29:case"end":return ln.stop()}},at)}));return function(){return ht.apply(this,arguments)}}(),Tr=function(){var ht=Object(k.a)(W.a.mark(function at(){var Ne;return W.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:Ne={source:qe,group_ids:on,tag_discipline_ids:Zt,teach_group_ids:Rn,item_bank_quotes:jt},qi(Ne),Gn.current=Zt,yn(!1);case 4:case"end":return pt.stop()}},at)}));return function(){return ht.apply(this,arguments)}}(),ir=function(){var ht=Object(k.a)(W.a.mark(function at(Ne){var Me,pt,gt,Mt,Qt,rn;return W.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,Object(ct.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:Ne}});case 2:gt=_n.sent,Mt=[],gt==null||((Me=gt.disciplines)===null||Me===void 0)||Me.forEach(function(Ln){var wn;Ln==null||((wn=Ln.sub_disciplines)===null||wn===void 0)||wn.forEach(function(ei){Mt=Mt.concat((ei==null?void 0:ei.tag_disciplines)||[])})}),Qt=null,rn=gt==null||((pt=gt.disciplines)===null||pt===void 0)?void 0:pt.map(function(Ln){var wn,ei=Ln==null||((wn=Ln.sub_disciplines)===null||wn===void 0)?void 0:wn.reduce(function(Yn,Jn){return Yn+Jn.item_count},0);return!Qt&&ei!==0&&(Qt=Ln.id),Object(P.a)(Object(P.a)({},Ln),{},{item_count:ei})}),console.log(rn,48767874),Rt(rn),bn(Mt),Bn(Qt);case 11:case"end":return _n.stop()}},at)}));return function(Ne){return ht.apply(this,arguments)}}(),Fa=function(){var ht=Object(k.a)(W.a.mark(function at(){var Ne;return W.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(ct.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:Ne=pt.sent,Pr((Ne==null?void 0:Ne.groups)||[]);case 4:case"end":return pt.stop()}},at)}));return function(){return ht.apply(this,arguments)}}(),qi=function(){var ht=Object(k.a)(W.a.mark(function at(Ne){var Me,pt;return W.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Lt(!0),Mt.next=3,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:Ne});case 3:Me=Mt.sent,pt=Me==null?void 0:Me.filter(function(Qt){var rn;return!!(Qt!=null&&(rn=Qt.item_banks)!==null&&rn!==void 0&&rn.length)}),pt=pt.map(function(Qt){return Object(P.a)(Object(P.a)({},Qt),{},{scoreTotal:0,score:0,questionTotal:0})}),Dt(pt),Lt(!1);case 8:case"end":return Mt.stop()}},at)}));return function(Ne){return ht.apply(this,arguments)}}(),eo=function(){In(Gn.current),yn(!1),nn("")},to=function(at){In(at)},Or=function(){for(var at=Wt==null?void 0:Wt.filter(function(Pn){return Zt==null?void 0:Zt.includes(Pn.id)}),Ne=Object(be.a)(at),Me=0,pt=[],gt=0;gt<Ne.length;gt++){for(var Mt="",Qt=0;Qt<pt.length;Qt++)if(pt[Qt][0].parent_name==Ne[gt].parent_name){Me=1,Mt=Qt;break}if(Me==1)pt[Mt].push(Ne[gt]),Me=0;else if(Me==0){var rn=new Array;rn.push(Ne[gt]),pt.push(rn)}}return pt},Ar=function(at,Ne){var Me,pt,gt=Object(Ke.cloneDeep)(_e);gt[Ne]=at;var Mt=Oa([gt[Ne]]),Qt=Mt==null||((Me=Mt.panel)===null||Me===void 0||((pt=Me[0])===null||pt===void 0))?void 0:pt.reduce(function(Pn,_n){return Pn+_n},0);gt[Ne].questionTotal=Qt,Dt(gt);var rn=document.getElementsByClassName("customError");rn==null||rn.forEach(function(Pn){var _n;Pn==null||((_n=Pn.classList)===null||_n===void 0)||_n.remove("customError")})},Oa=function(at){var Ne={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return at==null||at.forEach(function(Me,pt){var gt,Mt,Qt;Ne.panel.push([]),Ne.score_num_item.push(Me==null?void 0:Me.score),Ne.score_total.push(Me==null?void 0:Me.scoreTotal),(gt=Ne.error_tips)===null||gt===void 0||gt.push({name:(Mt=ha.find(function(rn){return rn.type===(Me==null?void 0:Me.item_type)}))===null||Mt===void 0?void 0:Mt.name,score:(Me==null?void 0:Me.score)||0,scoreTotal:Me==null?void 0:Me.scoreTotal,item_type:Me==null?void 0:Me.item_type}),Me==null||((Qt=Me.item_banks)===null||Qt===void 0)||Qt.forEach(function(rn){var Pn;rn==null||((Pn=rn.tag_disciplines)===null||Pn===void 0)||Pn.forEach(function(_n){var Ln;_n==null||((Ln=_n.difficulties)===null||Ln===void 0)||Ln.forEach(function(wn){wn.num&&(Ne.panel[pt].push(wn.num),Ne.contents.push({difficulty:wn.difficulty,item_type:Me.item_type,items_count:wn.num,sub_discipline_id:rn.sub_discipline_id,tag_discipline_id:_n.tag_discipline_id}))})})})}),Ne},ya=function(){var ht=Object(k.a)(W.a.mark(function at(Ne){var Me,pt,gt,Mt,Qt,rn,Pn,_n,Ln,wn,ei,Yn,Jn,vi,Dn,di,hi;return W.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if(!(!on.length&&!Zt.length&&!Rn.length)){ln.next=3;break}return F.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),ln.abrupt("return");case 3:Me=[],pt=[],gt=Oa(_e),Mt=0;case 7:if(!(Mt<gt.error_tips.length)){ln.next=23;break}if(Pn=gt==null||((Qt=gt.panel)===null||Qt===void 0||((rn=Qt[Mt])===null||rn===void 0))?void 0:rn.reduce(function(pn,Vn){return pn+Vn},0),!(gt.error_tips[Mt].score===0&&Pn!==0)){ln.next=14;break}return Ln=document.getElementById("".concat((_n=gt.error_tips[Mt])===null||_n===void 0?void 0:_n.item_type,"_score")),Ln.classList.add("customError"),Ln.scrollIntoView({block:"start",behavior:"smooth"}),ln.abrupt("return");case 14:if(!(gt.error_tips[Mt].score!==0&&Pn===0)){ln.next=19;break}return ei=document.getElementById("".concat((wn=gt.error_tips[Mt])===null||wn===void 0?void 0:wn.item_type,"_sum")),ei.classList.add("customError"),ei.scrollIntoView({block:"start",behavior:"smooth"}),ln.abrupt("return");case 19:gt.error_tips[Mt].score!==0&&Pn!==0&&(Me==null||Me.push({item_type:(Yn=gt.error_tips[Mt])===null||Yn===void 0?void 0:Yn.item_type,score:((Jn=gt.error_tips[Mt])===null||Jn===void 0?void 0:Jn.score)||0}),pt.push(gt.error_tips[Mt].name));case 20:Mt++,ln.next=7;break;case 23:if(!(Me.length===0)){ln.next=26;break}return F.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),ln.abrupt("return");case 26:if(dt(!0),vi=Object(P.a)({contents:gt.contents,group_ids:on,teach_group_ids:Rn,score_settings:Me,source:qe,sub_discipline_id:0,sort_by_item_type:pt,tag_discipline_ids:Zt},Re),!Ne){ln.next=36;break}return Dn=Object(P.a)(Object(P.a)({},vi),Ne),ln.next=32,Object(ct.a)("/api/examination_banks/save_question_list.json",{method:"post",body:Dn});case 32:return di=ln.sent,di.status===0&&F.b.success("\u4FDD\u5B58\u6210\u529F"),dt(!1),ln.abrupt("return");case 36:if(hi={},!ge){ln.next=43;break}return ln.next=40,Object(ct.a)("/api/examination_banks/".concat(ge==null?void 0:ge.id,"/update_random_exam.json"),{method:"post",body:vi});case 40:hi=ln.sent,ln.next=46;break;case 43:return ln.next=45,Object(ct.a)("/api/examination_banks/create_random_exam.json",{method:"post",body:vi});case 45:hi=ln.sent;case 46:hi.status===0&&(F.b.success("\u64CD\u4F5C\u6210\u529F"),ke.d.push("/paperlibrary?defaultActiveKey=0")),dt(!1);case 48:case"end":return ln.stop()}},at)}));return function(Ne){return ht.apply(this,arguments)}}(),Ji=function(){var ht=Object(k.a)(W.a.mark(function at(Ne,Me){var pt,gt,Mt,Qt,rn,Pn,_n,Ln,wn,ei,Yn,Jn,vi,Dn,di,hi,wi,ln,pn,Vn,Si,fi,Mi;return W.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:if(!(!on.length&&!Zt.length&&!Rn.length)){Sn.next=3;break}return F.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),Sn.abrupt("return");case 3:pt=[],gt=[],Mt=Oa(_e),Qt=0;case 7:if(!(Qt<Mt.error_tips.length)){Sn.next=23;break}if(_n=Mt==null||((rn=Mt.panel)===null||rn===void 0||((Pn=rn[Qt])===null||Pn===void 0))?void 0:Pn.reduce(function(jn,ri){return jn+ri},0),!(Mt.error_tips[Qt].score===0&&_n!==0)){Sn.next=14;break}return wn=document.getElementById("".concat((Ln=Mt.error_tips[Qt])===null||Ln===void 0?void 0:Ln.item_type,"_score")),wn.classList.add("customError"),wn.scrollIntoView({block:"start",behavior:"smooth"}),Sn.abrupt("return");case 14:if(!(Mt.error_tips[Qt].score!==0&&_n===0)){Sn.next=19;break}return Yn=document.getElementById("".concat((ei=Mt.error_tips[Qt])===null||ei===void 0?void 0:ei.item_type,"_sum")),Yn.classList.add("customError"),Yn.scrollIntoView({block:"start",behavior:"smooth"}),Sn.abrupt("return");case 19:Mt.error_tips[Qt].score!==0&&_n!==0&&(pt==null||pt.push({item_type:(Jn=Mt.error_tips[Qt])===null||Jn===void 0?void 0:Jn.item_type,score:((vi=Mt.error_tips[Qt])===null||vi===void 0?void 0:vi.score)||0}),gt.push(Mt.error_tips[Qt].name));case 20:Qt++,Sn.next=7;break;case 23:if(!(pt.length===0)){Sn.next=26;break}return F.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),Sn.abrupt("return");case 26:if(Vt(!0),Dn=Object(P.a)({contents:Mt.contents,group_ids:on,teach_group_ids:Rn,score_settings:pt,sort_by_item_type:gt,tag_discipline_ids:Zt,source:qe,sub_discipline_id:0},Re),!(Ne!==void 0&&!(Ne!=null&&Ne.single_question_id))){Sn.next=36;break}return Dn.seleted_item_bank_ids=Ne==null?void 0:Ne.seleted_item_bank_ids,Sn.next=32,Object(ct.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:Dn});case 32:return di=Sn.sent,di!=null&&di.questions&&(wi=Object(Ke.cloneDeep)(v),wi.questionList=wi==null||((hi=wi.questionList)===null||hi===void 0)?void 0:hi.map(function(jn){if(jn.type===Me.type){var ri;return Object(P.a)(Object(P.a)({},jn),{},{questions:(di==null||((ri=di.questions)===null||ri===void 0)?void 0:ri.questions)||[]})}return jn}),c(wi)),Vt(!1),Sn.abrupt("return");case 36:if(!(Ne!=null&&Ne!==void 0&&Ne.single_question_id)){Sn.next=45;break}return Dn.seleted_item_bank_ids=Ne==null?void 0:Ne.seleted_item_bank_ids,Dn.single_question_id=Ne==null?void 0:Ne.single_question_id,Sn.next=41,Object(ct.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:Dn});case 41:return ln=Sn.sent,ln&&(Vn=Object(Ke.cloneDeep)(v),Vn.questionList=Vn==null||((pn=Vn.questionList)===null||pn===void 0)?void 0:pn.map(function(jn){if(jn.type===Me.type){var ri,Ki,Li=Object(Ke.cloneDeep)(jn==null?void 0:jn.questions);return Li.splice(Me.index,1,ln==null||((ri=ln.questions)===null||ri===void 0||((Ki=ri.questions)===null||Ki===void 0))?void 0:Ki[0]),console.log(jn==null?void 0:jn.questions,Li,Me.index,"new_questions"),Object(P.a)(Object(P.a)({},jn),{},{questions:Li})}return jn}),c(Vn)),Vt(!1),Sn.abrupt("return");case 45:return Sn.next=47,Object(ct.a)("/api/examination_banks/preview_random_questions.json",{method:"post",body:Dn});case 47:Si=Sn.sent,Si.exam&&(fi=no(Si),Mi=[],gt==null||gt.forEach(function(jn){var ri,Ki=fi==null||((ri=fi.questionList)===null||ri===void 0)?void 0:ri.find(function(Li){var Zi,pa=(Zi=ha.find(function(ma){return ma.type===(Li==null?void 0:Li.type)}))===null||Zi===void 0?void 0:Zi.name;return pa===jn});Mi.push(Ki)}),Mi=Object(Ke.compact)(Mi),fi.questionList=Mi,c(Object(P.a)({},fi)),console.log(JSON.stringify(fi)),r(!0),document.body.scrollIntoView()),Vt(!1);case 50:case"end":return Sn.stop()}},at)}));return function(Ne,Me){return ht.apply(this,arguments)}}(),ha=[{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:"PHOTOGRAPH",name:"\u62CD\u7167\u4E0A\u4F20\u9898"},{type:"FILEUPLOAD",name:"\u6587\u4EF6\u4E0A\u4F20\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u63A5\u9F99\u9898"}],ar=function(){var at=Oa(_e),Ne=at.panel,Me=at.score_total;return Me=Me.reduce(function(pt,gt){return pt+gt},0),Ne=Object(Ke.flatten)(Ne).reduce(function(pt,gt){return pt+gt},0),_.a.createElement("div",{className:m.a.total},_.a.createElement("div",null,_.a.createElement("img",{src:A.a}),_.a.createElement("span",null,"\u9898\u6570(\u9053)"),_.a.createElement("aside",null,Ne)),_.a.createElement("aside",null),_.a.createElement("div",null,_.a.createElement("img",{src:he.a}),_.a.createElement("span",null,"\u603B\u5206(\u5206)"),_.a.createElement("aside",null,Me)))},rr=function(at,Ne,Me){return at[Ne]=at.splice(Me,1,at[Ne])[0],at},Qi=function(at){var Ne=[],Me=Object(Ke.cloneDeep)(_e);Me.length>1&&at!==0&&(Ne=rr(Me,at,at-1)),Dt(Ne)},fa=function(at){var Ne=[],Me=Object(Ke.cloneDeep)(_e);Me.length>1&&at!==Me.length-1&&(Ne=rr(Me,at,at+1)),Dt(Ne)},Aa=function(){var ht=Object(k.a)(W.a.mark(function at(Ne){var Me,pt,gt,Mt;return W.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:if(gt=Object(be.a)(qe),qe.includes(Ne)?gt=gt.filter(function(Pn){return Pn!==Ne}):gt.push(Ne),!(gt.length===0)){rn.next=5;break}return F.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),rn.abrupt("return");case 5:(Me=gt)!==null&&Me!==void 0&&Me.includes("mine")||(hn([]),xi.current=[]),(pt=gt)!==null&&pt!==void 0&&pt.includes("teach_groups")||(Bi([]),oa.current=[]),zt(gt),ir(gt),In([]),Gn.current=[],Mt={source:gt,group_ids:xi.current,tag_discipline_ids:[],teach_group_ids:oa.current},qi(Mt);case 13:case"end":return rn.stop()}},at)}));return function(Ne){return ht.apply(this,arguments)}}(),no=function(at){var Ne={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!at)return;var Me=at||{},pt=Me.exam,gt=Me.single_questions,Mt=Me.multiple_questions,Qt=Me.judgement_questions,rn=Me.program_questions,Pn=Me.completion_questions,_n=Me.subjective_questions,Ln=Me.practical_questions,wn=Me.combination_questions,ei=Me.photograph_questions,Yn=Me.fileupload_questions,Jn=[Object(P.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},gt),Object(P.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},Mt),Object(P.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Pn),Object(P.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Qt),Object(P.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},_n),Object(P.a)({type:"PHOTOGRAPH",name:"\u62CD\u7167\u4E0A\u4F20\u9898"},ei),Object(P.a)({type:"FILEUPLOAD",name:"\u6587\u4EF6\u4E0A\u4F20\u9898"},Yn),Object(P.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},rn),Object(P.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Ln),Object(P.a)({type:"COMBINATION",name:"\u63A5\u9F99\u9898"},wn)],vi=[],Dn=0,di=0,hi=Jn.filter(function(wi){return wi.questions_count>0}).map(function(wi,ln){var pn;return(pn=wi.questions)===null||pn===void 0||pn.forEach(function(Vn){vi.push(Vn.id),Dn=Dn+Vn.score,di=di+1}),Object(P.a)(Object(P.a)({},wi),{number:Ne[ln+1]})});return{all_questions_count:di,all_score:Dn,questionList:hi,ids:vi,exam:pt}},Mr=function(at){var Ne,Me,pt=Object(Ke.cloneDeep)(v),gt=Object(Ke.cloneDeep)(_e);pt.questionList=pt==null||((Ne=pt.questionList)===null||Ne===void 0)?void 0:Ne.map(function(Mt){return Mt.type===at.type?Object(P.a)(Object(P.a)({},Mt),{},{questions_score:at.scoreTotal}):Mt}),gt=(Me=gt)===null||Me===void 0?void 0:Me.map(function(Mt){return Mt.item_type===at.type?Object(P.a)(Object(P.a)({},Mt),{},{score:at.score,scoreTotal:at.scoreTotal}):Mt}),Dt(gt),c(pt),console.log(at,v,_e)},or=ze==null||((Ce=ze.find(function(ht){return ht.id===gi}))===null||Ce===void 0)?void 0:Ce.sub_disciplines,Wa=Or();return d?_.a.createElement(We.a,{loading:tt,submit:ya,goBack:function(){return r(!1)},data:v,onTypeScore:Mr,onExchange:Ji}):_.a.createElement("section",{className:m.a.wrap,style:{display:rt?"flex":"none"}},_.a.createElement("div",{id:"id_left",className:m.a.left,onMouseEnter:function(at){var Ne=document.getElementById("id_left");Ne.style.overflowY="auto"},onMouseLeave:function(at){var Ne=document.getElementById("id_left");Ne.style.overflowY="hidden"}},_.a.createElement(ve.a,{loading:Xt,active:!0,paragraph:{rows:5}},_e.map(function(ht,at){var Ne;return _.a.createElement("div",{className:m.a.list,key:at},_.a.createElement("div",{className:m.a.name},_.a.createElement("b",null),_.a.createElement("span",null,(Ne=ha.find(function(Me){return Me.type===(ht==null?void 0:ht.item_type)}))===null||Ne===void 0?void 0:Ne.name)),_.a.createElement("aside",null,_.a.createElement("div",null,"\u5171",_.a.createElement("span",{className:m.a.b},ht.questionTotal),"\u9898",_.a.createElement("span",{className:m.a.l},"|"),"\u5171",_.a.createElement("span",{className:m.a.r},ht.scoreTotal),"\u5206"),_.a.createElement("div",null,at>0?_.a.createElement(R.a,{getPopupContainer:function(pt){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},_.a.createElement("span",{onClick:function(){return Qi(at)},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"})),at<_e.length-1?_.a.createElement(R.a,{getPopupContainer:function(pt){return document.getElementById("id_left")},title:"\u4E0B\u79FB"},_.a.createElement("span",{onClick:function(){return fa(at)},style:{transform:"rotate(90deg)"}},_.a.createElement("i",{className:"icon-jiantou1"}))):_.a.createElement("span",{style:{transform:"rotate(90deg)",cursor:"not-allowed"}},_.a.createElement("i",{className:"icon-jiantou1"})))))})),ar()),_.a.createElement("div",{className:m.a.right},_.a.createElement(X,{className:m.a.tabs,value:1,onChange:function(){return bt(0)}}),_.a.createElement("section",{className:m.a.topWarp},_.a.createElement("div",{className:m.a.title},_.a.createElement("b",null),_.a.createElement("span",null,"\u62BD\u9898\u7EC4\u5377"),_.a.createElement("div",null,"STEP2")),_.a.createElement("div",{className:m.a.source},_.a.createElement("b",null,"*"),_.a.createElement("span",null,"\u8BD5\u9898\u6765\u6E90"),_.a.createElement("aside",null,_.a.createElement("div",{onClick:function(){return Aa("mine")}},_.a.createElement(H.a,{checked:qe==null?void 0:qe.includes("mine")}),_.a.createElement("span",{style:{color:qe!=null&&qe.includes("mine")?"#007DFE":"#666666"}},"\u4EC5\u6211\u521B\u5EFA\u7684")),_.a.createElement("div",{className:"mb20",onClick:function(){return Aa("teach_groups")}},_.a.createElement(H.a,{checked:qe==null?void 0:qe.includes("teach_groups")}),_.a.createElement("span",{style:{color:qe!=null&&qe.includes("teach_groups")?"#007DFE":"#666666"}},"\u6559\u7814\u5171\u4EAB")),_.a.createElement("div",{onClick:function(){return Aa("public")}},_.a.createElement(H.a,{checked:qe==null?void 0:qe.includes("public")}),_.a.createElement("span",{style:{color:qe!=null&&qe.includes("public")?"#007DFE":"#666666"}},"\u516C\u5171\u9898\u5E93"))),_.a.createElement("aside",null,(qe==null?void 0:qe.includes("mine"))&&_.a.createElement("div",{style:{marginBottom:14},className:m.a.folder,onClick:function(){fn(!0),$i(!0),xi.current=on,xn((qn==null?void 0:qn.map(function(at){return at.count}).reduce(function(at,Ne){return at+Ne},0))||0)}},_.a.createElement("img",{src:Oe.a}),_.a.createElement("span",null,"\u9009\u62E9\u8BD5\u9898\u6587\u4EF6\u5939"),_.a.createElement(R.a,{title:"\u9009\u4E2D\u9879\u4EC5\u5305\u62EC\u8BE5\u6587\u4EF6\u5939\u4E0B\u7684\u8BD5\u9898\uFF0C\u4E0D\u5305\u62EC\u5B50\u6587\u4EF6\u5939\uFF0C\u4E14\u7CFB\u7EDF\u53D6\u60A8\u9009\u4E2D\u7684\u6587\u4EF6\u5939\u548C\u8003\u67E5\u8303\u56F4\u4E2D\u7684\u8BD5\u9898\u7684\u5E76\u96C6\u4F5C\u4E3A\u968F\u673A\u5BF9\u8C61\u3002"},_.a.createElement("img",{src:Ae.a}))),(qe==null?void 0:qe.includes("teach_groups"))&&_.a.createElement("div",{className:m.a.folder,onClick:function(){ra(!0),oa.current=Rn}},_.a.createElement("img",{src:Le.a}),_.a.createElement("span",null,"\u9009\u62E9\u6559\u7814\u56E2\u961F")))),_.a.createElement("div",{className:m.a.times},_.a.createElement("b",null,"*"),_.a.createElement("span",null,"\u9898\u76EE\u4F7F\u7528\u6B21\u6570"),_.a.createElement("div",{className:m.a.maxTimesInputWrapper},"\u4E0D\u8D85\u8FC7",_.a.createElement(x.a,{className:m.a.maxTimesInput,value:jt,onChange:function(at){if(typeof at=="number"){if(dn(at),!on.length&&!Zt.length&&!Rn.length)return;var Ne={source:qe,group_ids:on,tag_discipline_ids:Zt,teach_group_ids:Rn,item_bank_quotes:at};qi(Ne),Gn.current=Zt}},min:0,precision:0}),"\u6B21")),(qe==null?void 0:qe.includes("mine"))&&_.a.createElement("div",{className:m.a.choice},_.a.createElement("div",{className:m.a.name},_.a.createElement("b",null),_.a.createElement("span",null,"\u5DF2\u9009\u6587\u4EF6\u5939")),_.a.createElement(je.a,{type:2,value:qn,onChange:function(at){var Ne=on.filter(function(pt){return pt!==at}),Me={source:qe,group_ids:Ne,tag_discipline_ids:Zt,teach_group_ids:Rn};qi(Me),hn(Ne),xi.current=Ne}})),(qe==null?void 0:qe.includes("teach_groups"))&&_.a.createElement("div",{className:m.a.choice},_.a.createElement("div",{className:m.a.name},_.a.createElement("b",null),_.a.createElement("span",null,"\u5DF2\u9009\u6559\u7814\u56E2\u961F")),_.a.createElement(je.a,{icon:Pe.a,type:2,value:Mn,onChange:function(at){var Ne=Rn.filter(function(pt){return pt!==at}),Me={source:qe,group_ids:on,tag_discipline_ids:Zt,teach_group_ids:Ne};qi(Me),Bi(Ne),oa.current=Ne}})),_.a.createElement("div",{className:m.a.range},_.a.createElement("div",{className:m.a.name},_.a.createElement("b",null),_.a.createElement("span",null,"\u8003\u5BDF\u8303\u56F4")),_.a.createElement("div",{onClick:function(){if(gi===null){F.b.warn("\u8003\u5BDF\u8303\u56F4\u6CA1\u6709\u77E5\u8BC6\u70B9\u53EF\u4EE5\u9009\u62E9");return}Gn.current=Zt,yn(!0)},className:m.a.btn},_.a.createElement("img",{src:V.a})," \u9009\u62E9\u8303\u56F4"),_.a.createElement("div",{className:m.a.name},_.a.createElement("b",{className:m.a.num}),_.a.createElement("span",null,"\u5DF2\u9009\u77E5\u8BC6\u70B9")),_.a.createElement("div",{className:m.a.knWarp},Wa==null?void 0:Wa.map(function(ht,at){return _.a.createElement(_.a.Fragment,{key:at},_.a.createElement("div",{className:m.a.kn},_.a.createElement("span",null,at+1)," ",_.a.createElement("span",null,ht==null?void 0:ht[0].parent_name)),_.a.createElement(je.a,{type:1,value:ht==null?void 0:ht.filter(function(Ne){return!!Ne.item_count}),onChange:function(Me){var pt=Zt.filter(function(Mt){return Mt!==Me}),gt={source:qe,group_ids:on,tag_discipline_ids:pt,teach_group_ids:Rn};qi(gt),In(pt),Gn.current=pt}}))})))),_.a.createElement(ve.a,{loading:Xt,active:!0,paragraph:{rows:5}},_e.map(function(ht,at){return _.a.createElement(Qe.a,{key:at,value:ht,onChange:function(Me){return Ar(Me,at)}})}),_.a.createElement("div",{className:m.a.btns},_.a.createElement(xe.a,{onClick:function(){bt(0),document.body.scrollIntoView()}},"\u4E0A\u4E00\u6B65"),_.a.createElement(xe.a,{loading:tt,onClick:function(){return ya()}},"\u63D0\u4EA4"),_.a.createElement(xe.a,{loading:an,onClick:function(){return Ji()},type:"primary"},"\u9884\u89C8")))),_.a.createElement(C.a,{centered:!0,closable:!1,destroyOnClose:!0,className:m.a.modal,visible:gn,title:null,width:"1200px",onOk:Tr,onCancel:eo},_.a.createElement("div",{className:m.a.modalBody},_.a.createElement("div",{className:m.a.left},_.a.createElement("div",{className:m.a.title},_.a.createElement("img",{src:ue.a}),_.a.createElement("span",null,"\u7AE0\u8282\u5206\u5E03")),_.a.createElement("div",{className:m.a.l},ze==null?void 0:ze.map(function(ht){var at=null,Ne=!1;if(!On)Ne=!0;else{var Me;(Me=ht.sub_disciplines)===null||Me===void 0||Me.forEach(function(pt){var gt;(gt=pt.tag_disciplines)===null||gt===void 0||gt.forEach(function(Mt){if(!Ne){var Qt;Ne=((Qt=Mt.name)===null||Qt===void 0?void 0:Qt.includes(On))&&Mt.item_count!==0}})})}return _.a.createElement(_.a.Fragment,{key:ht.id},!!ht.item_count&&Ne&&_.a.createElement("div",{onClick:function(){return Bn(ht.id)},className:"".concat(m.a.name," ").concat(ht.id===gi?m.a.active:"")},_.a.createElement("b",null),_.a.createElement("span",null,ht.name)))}))),_.a.createElement("div",{className:m.a.right},_.a.createElement("div",{className:m.a.inputWarp},_.a.createElement(G,{onChange:function(at){return nn(at.target.value)},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9",value:On})),_.a.createElement("div",{className:m.a.l},or==null?void 0:or.map(function(ht,at){var Ne,Me=Object(P.a)(Object(P.a)({},ht),{},{tag_disciplines:ht==null||((Ne=ht.tag_disciplines)===null||Ne===void 0)?void 0:Ne.filter(function(pt){return pt.item_count!==0})});return _.a.createElement(St,{search:On,onChange:to,key:ht.id,value:Zt,options:Me})}))))),_.a.createElement(C.a,{centered:!0,title:"\u9009\u62E9\u6587\u4EF6\u5939",visible:Pi,width:718,destroyOnClose:!0,onCancel:function(){hn(xi.current),$i(!1),xn(0)},footer:_.a.createElement("div",{style:{display:"flex",alignItems:"center"}},_.a.createElement("span",{style:{flex:"1",textAlign:"left"}},"\u5DF2\u9009",on.length||0,"\u4E2A\u6587\u4EF6\u5939\uFF0C\u5171\uFF08",da||0,"\uFF09\u9053\u9898"),_.a.createElement(xe.a,{onClick:function(){hn(xi.current),xn(0),$i(!1)}},"\u53D6\u6D88"),_.a.createElement(xe.a,{type:"primary",onClick:function(){var at={source:qe,group_ids:on,tag_discipline_ids:Zt,teach_group_ids:Rn};qi(at),xi.current=on,$i(!1)}},"\u786E\u8BA4"))},_.a.createElement("aside",{className:m.a.exportModal},kn&&_.a.createElement(Ue,{treeData:en,defaultValue:ci,value:on,onChange:function(at,Ne){var Me;xn((Me=Ne.selectedNodes)===null||Me===void 0?void 0:Me.map(function(pt){return pt.count}).reduce(function(pt,gt){return pt+gt},0)),hn(at)}}))),_.a.createElement(C.a,{centered:!0,title:"\u9009\u62E9\u6559\u7814\u56E2\u961F",visible:zi,width:718,destroyOnClose:!0,onCancel:function(){Bi(oa.current),ra(!1)},onOk:function(){var at={source:qe,group_ids:on,tag_discipline_ids:Zt,teach_group_ids:Rn};qi(at),oa.current=Rn,ra(!1)}},_.a.createElement("aside",{className:m.a.teachModal},_.a.createElement("div",{className:m.a.head},_.a.createElement("div",{className:m.a.li}),_.a.createElement("div",{className:m.a.li},"\u56E2\u961F\u540D\u79F0"),_.a.createElement("div",{className:m.a.li},"\u5171\u4EAB\u9898\u76EE\u6570\u91CF")),_.a.createElement("div",{className:m.a.wraps},ca==null?void 0:ca.map(function(ht){return _.a.createElement("div",{key:ht.id,className:m.a.body},_.a.createElement("div",{className:m.a.li},_.a.createElement(H.a,{onChange:function(){var Ne=ht.id,Me=Object(be.a)(Rn);Rn.includes(Ne)?Me=Me.filter(function(pt){return pt!==Ne}):Me.push(Ne),Bi(Me)},checked:Rn==null?void 0:Rn.includes(ht.id)})),_.a.createElement("div",{title:ht.name,className:m.a.li},ht.name),_.a.createElement("div",{className:m.a.li},ht.item_bank_count))})))))},Q=q,w=L.a.TextArea,S=function(de){var Ce=de.paperlibrary,Re=de.user,bt=de.globalSetting,rt=de.dispatch,ge=Object(Y.useState)(0),ut=Object(ee.a)(ge,2),_t=ut[0],et=ut[1],Bt=T.a.useForm(),qe=Object(ee.a)(Bt,1),zt=qe[0],It=Object(Y.useState)({}),vt=Object(ee.a)(It,2),Xt=vt[0],Lt=vt[1],Fe=Object(Y.useState)(!0),st=Object(ee.a)(Fe,2),tt=st[0],dt=st[1],Kt=Object(Y.useState)(null),Gt=Object(ee.a)(Kt,2),an=Gt[0],Vt=Gt[1],Et=Object(we.i)().id;console.log(Et,"editId"),Object(Y.useEffect)(function(){return rt({type:"globalSetting/footerToggle",payload:!1}),function(){rt({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(Y.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var tn=function(On){Lt(Object(P.a)({},zt.getFieldsValue()))};Object(Y.useEffect)(function(){if(Et){jt();return}dt(!1)},[Et]);var jt=function(){var mn=Object(k.a)(W.a.mark(function On(){var nn,Ve,lt,gn,yn,An;return W.a.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,Object(ct.a)("/api/examination_banks/".concat(Et,"/edit_random_exam.json"),{method:"get",params:{}});case 2:nn=d.sent,nn!=null&&nn.examination_bank&&(An={difficulty:nn==null||((Ve=nn.examination_bank)===null||Ve===void 0)?void 0:Ve.difficulty,exam_notes:nn==null||((lt=nn.examination_bank)===null||lt===void 0)?void 0:lt.exam_notes,name:nn==null||((gn=nn.examination_bank)===null||gn===void 0)?void 0:gn.name,time:nn==null||((yn=nn.examination_bank)===null||yn===void 0)?void 0:yn.time},dt(!1),Lt(Object(P.a)({},An)),zt.setFieldsValue(Object(P.a)({},An)),Vt(Object(P.a)(Object(P.a)({},nn),{},{id:Et})));case 4:case"end":return d.stop()}},On)}));return function(){return mn.apply(this,arguments)}}(),dn=function(){var mn=Object(k.a)(W.a.mark(function On(nn){return W.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(!(nn===0)){lt.next=3;break}return et(nn),lt.abrupt("return");case 3:return lt.next=5,zt.validateFields();case 5:et(nn);case 6:case"end":return lt.stop()}},On)}));return function(nn){return mn.apply(this,arguments)}}(),$t=function(On){var nn=parseInt(On);return Object(Ke.isNaN)(nn)?"":nn};return _.a.createElement("section",{className:le.a.wrap},_.a.createElement(ve.a,{loading:tt,active:!0,paragraph:{rows:5}},_.a.createElement("div",{className:le.a.crumbs},_.a.createElement("b",null),_.a.createElement("span",{className:"current",onClick:function(){return ke.d.push("/")}},"\u9996\u9875>"),_.a.createElement("span",{className:"current",onClick:function(){return ke.d.push("/paperlibrary")}},"\u8BD5\u5377\u4E0E\u4F5C\u4E1A>"),_.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u8BD5\u5377\u4E0E\u4F5C\u4E1A")),_t===0&&_.a.createElement(X,{value:_t,onChange:dn}),_t===0&&_.a.createElement("section",{className:le.a.oneWrap},_.a.createElement("div",{className:le.a.title},_.a.createElement("b",null),_.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),_.a.createElement("div",null,"STEP1")," "),_.a.createElement(T.a,{className:le.a.formWrap,form:zt,layout:"horizontal",onValuesChange:tn},_.a.createElement(T.a.Item,{label:"\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^(?!(\s+$))/,message:"\u8F93\u5165\u6846\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C"}]},_.a.createElement(L.a,{className:le.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),_.a.createElement("div",{style:{position:"relative"}},_.a.createElement(T.a.Item,{label:"\u5B8C\u6210\u65F6\u957F\u9650\u5236:",name:"time",rules:[{required:!0,message:"\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},_.a.createElement(x.a,{min:1,parser:$t,max:9999,placeholder:"\u8BF7\u8F93\u5165\u65F6\u957F",style:{width:190}})),_.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),_.a.createElement(T.a.Item,{label:"\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},_.a.createElement(ae.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},_.a.createElement(ae.a.Button,{className:le.a.rb,value:1},"\u7B80\u5355"),_.a.createElement(ae.a.Button,{className:le.a.rb,value:2},"\u9002\u4E2D"),_.a.createElement(ae.a.Button,{className:le.a.rb,value:3},"\u56F0\u96BE"))),_.a.createElement(T.a.Item,{label:"\u987B\u77E5",name:"exam_notes"},_.a.createElement(w,{rows:4,maxLength:300}))),_.a.createElement("div",{className:le.a.btns},_.a.createElement(xe.a,{className:"mr40",onClick:function(){return ke.d.push("/paperlibrary")}},"\u8FD4\u56DE"),_.a.createElement(xe.a,{type:"primary",onClick:Object(k.a)(W.a.mark(function mn(){return W.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,zt.validateFields();case 2:et(1);case 3:case"end":return nn.stop()}},mn)}))},"\u4E0B\u4E00\u6B65"))),_.a.createElement(Q,{tabs:_t,dispatch:rt,editData:an,setFatherTabs:et,formValue:Xt})))},U=Ie.default=Object(ke.a)(function(I){var de=I.paperlibrary,Ce=I.user,Re=I.globalSetting;return{paperlibrary:de,user:Ce,globalSetting:Re}})(S)},"E/GV":function(Je,Ie,f){Je.exports=f.p+"static/swenjianjia.a86ae489.svg"},ELLl:function(Je,Ie,f){(function(z){z(f("VrN/"))})(function(z){var ve={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},re=z.Pos;z.defineOption("autoCloseBrackets",!1,function(L,M,W){W&&W!=z.Init&&(L.removeKeyMap(me),L.state.closeBrackets=null),M&&(ae(xe(M,"pairs")),L.state.closeBrackets=M,L.addKeyMap(me))});function xe(L,M){return M=="pairs"&&typeof L=="string"?L:typeof L=="object"&&L[M]!=null?L[M]:ve[M]}var me={Backspace:k,Enter:P};function ae(L){for(var M=0;M<L.length;M++){var W=L.charAt(M),Y="'"+W+"'";me[Y]||(me[Y]=j(W))}}ae(ve.pairs+"`");function j(L){return function(M){return T(M,L)}}function x(L){var M=L.state.closeBrackets;if(!M||M.override)return M;var W=L.getModeAt(L.getCursor());return W.closeBrackets||M}function k(L){var M=x(L);if(!M||L.getOption("disableInput"))return z.Pass;for(var W=xe(M,"pairs"),Y=L.listSelections(),_=0;_<Y.length;_++){if(!Y[_].empty())return z.Pass;var we=ee(L,Y[_].head);if(!we||W.indexOf(we)%2!=0)return z.Pass}for(var _=Y.length-1;_>=0;_--){var ke=Y[_].head;L.replaceRange("",re(ke.line,ke.ch-1),re(ke.line,ke.ch+1),"+delete")}}function P(L){var M=x(L),W=M&&xe(M,"explode");if(!W||L.getOption("disableInput"))return z.Pass;for(var Y=L.listSelections(),_=0;_<Y.length;_++){if(!Y[_].empty())return z.Pass;var we=ee(L,Y[_].head);if(!we||W.indexOf(we)%2!=0)return z.Pass}L.operation(function(){var ke=L.lineSeparator()||`
|
|
`;L.replaceSelection(ke+ke,null),L.execCommand("goCharLeft"),Y=L.listSelections();for(var se=0;se<Y.length;se++){var le=Y[se].head.line;L.indentLine(le,null,!0),L.indentLine(le+1,null,!0)}})}function N(L){var M=z.cmpPos(L.anchor,L.head)>0;return{anchor:new re(L.anchor.line,L.anchor.ch+(M?-1:1)),head:new re(L.head.line,L.head.ch+(M?1:-1))}}function T(L,M){var W=x(L);if(!W||L.getOption("disableInput"))return z.Pass;var Y=xe(W,"pairs"),_=Y.indexOf(M);if(_==-1)return z.Pass;for(var we=xe(W,"closeBefore"),ke=xe(W,"triples"),se=Y.charAt(_+1)==M,le=L.listSelections(),fe=_%2==0,$,h=0;h<le.length;h++){var X=le[h],y=X.head,C,J=L.getRange(y,re(y.line,y.ch+1));if(fe&&!X.empty())C="surround";else if((se||!fe)&&J==M)se&&K(L,y)?C="both":ke.indexOf(M)>=0&&L.getRange(y,re(y.line,y.ch+3))==M+M+M?C="skipThree":C="skip";else if(se&&y.ch>1&&ke.indexOf(M)>=0&&L.getRange(re(y.line,y.ch-2),y)==M+M){if(y.ch>2&&/\bstring/.test(L.getTokenTypeAt(re(y.line,y.ch-2))))return z.Pass;C="addFour"}else if(se){var H=y.ch==0?" ":L.getRange(re(y.line,y.ch-1),y);if(!z.isWordChar(J)&&H!=M&&!z.isWordChar(H))C="both";else return z.Pass}else if(fe&&(J.length===0||/\s/.test(J)||we.indexOf(J)>-1))C="both";else return z.Pass;if(!$)$=C;else if($!=C)return z.Pass}var E=_%2?Y.charAt(_-1):M,R=_%2?M:Y.charAt(_+1);L.operation(function(){if($=="skip")L.execCommand("goCharRight");else if($=="skipThree")for(var ie=0;ie<3;ie++)L.execCommand("goCharRight");else if($=="surround"){for(var F=L.getSelections(),ie=0;ie<F.length;ie++)F[ie]=E+F[ie]+R;L.replaceSelections(F,"around"),F=L.listSelections().slice();for(var ie=0;ie<F.length;ie++)F[ie]=N(F[ie]);L.setSelections(F)}else $=="both"?(L.replaceSelection(E+R,null),L.triggerElectric(E+R),L.execCommand("goCharLeft")):$=="addFour"&&(L.replaceSelection(E+E+E+E,"before"),L.execCommand("goCharRight"))})}function ee(L,M){var W=L.getRange(re(M.line,M.ch-1),re(M.line,M.ch+1));return W.length==2?W:null}function K(L,M){var W=L.getTokenAt(re(M.line,M.ch+1));return/\bstring/.test(W.type)&&W.start==M.ch&&(M.ch==0||!/\bstring/.test(L.getTokenTypeAt(M)))}})},FTkQ:function(Je,Ie){Je.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx:function(Je,Ie){Je.exports=function(z,ve,re,xe){var me=re?re.call(xe,z,ve):void 0;if(me!==void 0)return!!me;if(z===ve)return!0;if(typeof z!="object"||!z||typeof ve!="object"||!ve)return!1;var ae=Object.keys(z),j=Object.keys(ve);if(ae.length!==j.length)return!1;for(var x=Object.prototype.hasOwnProperty.bind(ve),k=0;k<ae.length;k++){var P=ae[k];if(!x(P))return!1;var N=z[P],T=ve[P];if(me=re?re.call(xe,N,T,P):void 0,me===!1||me===void 0&&N!==T)return!1}return!0}},H38U:function(Je,Ie,f){var z=f("f4xo"),ve=f("rcnY"),re=f("wU8J"),xe=f("Iq15"),me=f("dWSS");function ae(x,k){this.typeNumber=x,this.errorCorrectLevel=k,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var j=ae.prototype;j.addData=function(x){var k=new z(x);this.dataList.push(k),this.dataCache=null},j.isDark=function(x,k){if(x<0||this.moduleCount<=x||k<0||this.moduleCount<=k)throw new Error(x+","+k);return this.modules[x][k]},j.getModuleCount=function(){return this.moduleCount},j.make=function(){if(this.typeNumber<1){var x=1;for(x=1;x<40;x++){for(var k=ve.getRSBlocks(x,this.errorCorrectLevel),P=new re,N=0,T=0;T<k.length;T++)N+=k[T].dataCount;for(var T=0;T<this.dataList.length;T++){var ee=this.dataList[T];P.put(ee.mode,4),P.put(ee.getLength(),xe.getLengthInBits(ee.mode,x)),ee.write(P)}if(P.getLengthInBits()<=N*8)break}this.typeNumber=x}this.makeImpl(!1,this.getBestMaskPattern())},j.makeImpl=function(x,k){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var P=0;P<this.moduleCount;P++){this.modules[P]=new Array(this.moduleCount);for(var N=0;N<this.moduleCount;N++)this.modules[P][N]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(x,k),this.typeNumber>=7&&this.setupTypeNumber(x),this.dataCache==null&&(this.dataCache=ae.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,k)},j.setupPositionProbePattern=function(x,k){for(var P=-1;P<=7;P++){if(x+P<=-1||this.moduleCount<=x+P)continue;for(var N=-1;N<=7;N++){if(k+N<=-1||this.moduleCount<=k+N)continue;0<=P&&P<=6&&(N==0||N==6)||0<=N&&N<=6&&(P==0||P==6)||2<=P&&P<=4&&2<=N&&N<=4?this.modules[x+P][k+N]=!0:this.modules[x+P][k+N]=!1}}},j.getBestMaskPattern=function(){for(var x=0,k=0,P=0;P<8;P++){this.makeImpl(!0,P);var N=xe.getLostPoint(this);(P==0||x>N)&&(x=N,k=P)}return k},j.createMovieClip=function(x,k,P){var N=x.createEmptyMovieClip(k,P),T=1;this.make();for(var ee=0;ee<this.modules.length;ee++)for(var K=ee*T,L=0;L<this.modules[ee].length;L++){var M=L*T,W=this.modules[ee][L];W&&(N.beginFill(0,100),N.moveTo(M,K),N.lineTo(M+T,K),N.lineTo(M+T,K+T),N.lineTo(M,K+T),N.endFill())}return N},j.setupTimingPattern=function(){for(var x=8;x<this.moduleCount-8;x++){if(this.modules[x][6]!=null)continue;this.modules[x][6]=x%2==0}for(var k=8;k<this.moduleCount-8;k++){if(this.modules[6][k]!=null)continue;this.modules[6][k]=k%2==0}},j.setupPositionAdjustPattern=function(){for(var x=xe.getPatternPosition(this.typeNumber),k=0;k<x.length;k++)for(var P=0;P<x.length;P++){var N=x[k],T=x[P];if(this.modules[N][T]!=null)continue;for(var ee=-2;ee<=2;ee++)for(var K=-2;K<=2;K++)ee==-2||ee==2||K==-2||K==2||ee==0&&K==0?this.modules[N+ee][T+K]=!0:this.modules[N+ee][T+K]=!1}},j.setupTypeNumber=function(x){for(var k=xe.getBCHTypeNumber(this.typeNumber),P=0;P<18;P++){var N=!x&&(k>>P&1)==1;this.modules[Math.floor(P/3)][P%3+this.moduleCount-8-3]=N}for(var P=0;P<18;P++){var N=!x&&(k>>P&1)==1;this.modules[P%3+this.moduleCount-8-3][Math.floor(P/3)]=N}},j.setupTypeInfo=function(x,k){for(var P=this.errorCorrectLevel<<3|k,N=xe.getBCHTypeInfo(P),T=0;T<15;T++){var ee=!x&&(N>>T&1)==1;T<6?this.modules[T][8]=ee:T<8?this.modules[T+1][8]=ee:this.modules[this.moduleCount-15+T][8]=ee}for(var T=0;T<15;T++){var ee=!x&&(N>>T&1)==1;T<8?this.modules[8][this.moduleCount-T-1]=ee:T<9?this.modules[8][15-T-1+1]=ee:this.modules[8][15-T-1]=ee}this.modules[this.moduleCount-8][8]=!x},j.mapData=function(x,k){for(var P=-1,N=this.moduleCount-1,T=7,ee=0,K=this.moduleCount-1;K>0;K-=2)for(K==6&&K--;;){for(var L=0;L<2;L++)if(this.modules[N][K-L]==null){var M=!1;ee<x.length&&(M=(x[ee]>>>T&1)==1);var W=xe.getMask(k,N,K-L);W&&(M=!M),this.modules[N][K-L]=M,T--,T==-1&&(ee++,T=7)}if(N+=P,N<0||this.moduleCount<=N){N-=P,P=-P;break}}},ae.PAD0=236,ae.PAD1=17,ae.createData=function(x,k,P){for(var N=ve.getRSBlocks(x,k),T=new re,ee=0;ee<P.length;ee++){var K=P[ee];T.put(K.mode,4),T.put(K.getLength(),xe.getLengthInBits(K.mode,x)),K.write(T)}for(var L=0,ee=0;ee<N.length;ee++)L+=N[ee].dataCount;if(T.getLengthInBits()>L*8)throw new Error("code length overflow. ("+T.getLengthInBits()+">"+L*8+")");for(T.getLengthInBits()+4<=L*8&&T.put(0,4);T.getLengthInBits()%8!=0;)T.putBit(!1);for(;!(T.getLengthInBits()>=L*8);){if(T.put(ae.PAD0,8),T.getLengthInBits()>=L*8)break;T.put(ae.PAD1,8)}return ae.createBytes(T,N)},ae.createBytes=function(x,k){for(var P=0,N=0,T=0,ee=new Array(k.length),K=new Array(k.length),L=0;L<k.length;L++){var M=k[L].dataCount,W=k[L].totalCount-M;N=Math.max(N,M),T=Math.max(T,W),ee[L]=new Array(M);for(var Y=0;Y<ee[L].length;Y++)ee[L][Y]=255&x.buffer[Y+P];P+=M;var _=xe.getErrorCorrectPolynomial(W),we=new me(ee[L],_.getLength()-1),ke=we.mod(_);K[L]=new Array(_.getLength()-1);for(var Y=0;Y<K[L].length;Y++){var se=Y+ke.getLength()-K[L].length;K[L][Y]=se>=0?ke.get(se):0}}for(var le=0,Y=0;Y<k.length;Y++)le+=k[Y].totalCount;for(var fe=new Array(le),$=0,Y=0;Y<N;Y++)for(var L=0;L<k.length;L++)Y<ee[L].length&&(fe[$++]=ee[L][Y]);for(var Y=0;Y<T;Y++)for(var L=0;L<k.length;L++)Y<K[L].length&&(fe[$++]=K[L][Y]);return fe},Je.exports=ae},HG2Q:function(Je,Ie,f){Je.exports=f.p+"static/sren.1eb1974f.svg"},HPRh:function(Je,Ie,f){Je.exports=f.p+"static/median.a4540c4f.svg"},Hfvn:function(Je,Ie,f){Je.exports=f.p+"static/wenjian.3da927fc.svg"},HmJG:function(Je,Ie,f){},IlMy:function(Je,Ie,f){Je.exports={flex_box_center:"flex_box_center___1Rd7-",flex_space_between:"flex_space_between___1qdJI",flex_box_vertical_center:"flex_box_vertical_center___3PScB",flex_box_center_end:"flex_box_center_end___gmzWk",flex_box_column:"flex_box_column___qhFY7",wrap:"wrap___2CDxR",left:"left___21M_k",list:"list___ahv58",name:"name___3cBep",b:"b___1CRFh",r:"r___2F_9I",l:"l___3XCXI",total:"total___2VTdV",topWarp:"topWarp___y9feY",right:"right___U2Z5M",tabs:"tabs___3eZK5",title:"title___3iKxF",source:"source___3rkh5",folder:"folder___AxGOK",times:"times___3x9Ch",maxTimesInputWrapper:"maxTimesInputWrapper___36-0E",maxTimesInput:"maxTimesInput___2O-54",choice:"choice___1AdWh",range:"range___23nFr",btn:"btn___1QiCj",knWarp:"knWarp___3eQQ5",kn:"kn___1OLj0",btns:"btns___26z5C",modalBody:"modalBody___1b2lK",active:"active___kELz6",inputWarp:"inputWarp___1leis",modal:"modal___1Ehn0",exportModal:"exportModal___1Vsj-",teachModal:"teachModal___CwfeZ",head:"head___2_Y6a",wraps:"wraps___3-f7m",body:"body___2Jb5Z"}},Iq15:function(Je,Ie,f){var z=f("nVVt"),ve=f("dWSS"),re=f("dQei"),xe={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},me={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(ae){for(var j=ae<<10;me.getBCHDigit(j)-me.getBCHDigit(me.G15)>=0;)j^=me.G15<<me.getBCHDigit(j)-me.getBCHDigit(me.G15);return(ae<<10|j)^me.G15_MASK},getBCHTypeNumber:function(ae){for(var j=ae<<12;me.getBCHDigit(j)-me.getBCHDigit(me.G18)>=0;)j^=me.G18<<me.getBCHDigit(j)-me.getBCHDigit(me.G18);return ae<<12|j},getBCHDigit:function(ae){for(var j=0;ae!=0;)j++,ae>>>=1;return j},getPatternPosition:function(ae){return me.PATTERN_POSITION_TABLE[ae-1]},getMask:function(ae,j,x){switch(ae){case xe.PATTERN000:return(j+x)%2==0;case xe.PATTERN001:return j%2==0;case xe.PATTERN010:return x%3==0;case xe.PATTERN011:return(j+x)%3==0;case xe.PATTERN100:return(Math.floor(j/2)+Math.floor(x/3))%2==0;case xe.PATTERN101:return j*x%2+j*x%3==0;case xe.PATTERN110:return(j*x%2+j*x%3)%2==0;case xe.PATTERN111:return(j*x%3+(j+x)%2)%2==0;default:throw new Error("bad maskPattern:"+ae)}},getErrorCorrectPolynomial:function(ae){for(var j=new ve([1],0),x=0;x<ae;x++)j=j.multiply(new ve([1,re.gexp(x)],0));return j},getLengthInBits:function(ae,j){if(1<=j&&j<10)switch(ae){case z.MODE_NUMBER:return 10;case z.MODE_ALPHA_NUM:return 9;case z.MODE_8BIT_BYTE:return 8;case z.MODE_KANJI:return 8;default:throw new Error("mode:"+ae)}else if(j<27)switch(ae){case z.MODE_NUMBER:return 12;case z.MODE_ALPHA_NUM:return 11;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 10;default:throw new Error("mode:"+ae)}else if(j<41)switch(ae){case z.MODE_NUMBER:return 14;case z.MODE_ALPHA_NUM:return 13;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 12;default:throw new Error("mode:"+ae)}else throw new Error("type:"+j)},getLostPoint:function(ae){for(var j=ae.getModuleCount(),x=0,k=0;k<j;k++)for(var P=0;P<j;P++){for(var N=0,T=ae.isDark(k,P),ee=-1;ee<=1;ee++){if(k+ee<0||j<=k+ee)continue;for(var K=-1;K<=1;K++){if(P+K<0||j<=P+K)continue;if(ee==0&&K==0)continue;T==ae.isDark(k+ee,P+K)&&N++}}N>5&&(x+=3+N-5)}for(var k=0;k<j-1;k++)for(var P=0;P<j-1;P++){var L=0;ae.isDark(k,P)&&L++,ae.isDark(k+1,P)&&L++,ae.isDark(k,P+1)&&L++,ae.isDark(k+1,P+1)&&L++,(L==0||L==4)&&(x+=3)}for(var k=0;k<j;k++)for(var P=0;P<j-6;P++)ae.isDark(k,P)&&!ae.isDark(k,P+1)&&ae.isDark(k,P+2)&&ae.isDark(k,P+3)&&ae.isDark(k,P+4)&&!ae.isDark(k,P+5)&&ae.isDark(k,P+6)&&(x+=40);for(var P=0;P<j;P++)for(var k=0;k<j-6;k++)ae.isDark(k,P)&&!ae.isDark(k+1,P)&&ae.isDark(k+2,P)&&ae.isDark(k+3,P)&&ae.isDark(k+4,P)&&!ae.isDark(k+5,P)&&ae.isDark(k+6,P)&&(x+=40);for(var M=0,P=0;P<j;P++)for(var k=0;k<j;k++)ae.isDark(k,P)&&M++;var W=Math.abs(100*M/j/j-50)/5;return x+=W*10,x}};Je.exports=me},K5AI:function(Je,Ie,f){Je.exports={cInput:"cInput___2BJRi",cl:"cl___AbKoK",box:"box___3gRA9",box1:"box1___S3u_s",cr:"cr___16yEi"}},LdHM:function(Je,Ie,f){"use strict";f.d(Ie,"b",function(){return we}),f.d(Ie,"a",function(){return se});var z=f("1OyB"),ve=f("vuIU"),re=f("Ji7U"),xe=f("LK+K"),me=f("q1tI"),ae=f("rePB"),j=f("Ff2n"),x=f("ODXe"),k=f("4IlW"),P=f("bX4T"),N=f("YrtM"),T=f("TSYQ"),ee=f.n(T),K=f("+nKL"),L=f("8OUc"),M=function(oe,Be){var Ae=oe.prefixCls,Xe=oe.id,Oe=oe.flattenOptions,Te=oe.childrenAsData,V=oe.values,B=oe.searchValue,ue=oe.multiple,D=oe.defaultActiveFirstOption,A=oe.height,pe=oe.itemHeight,he=oe.notFoundContent,Ze=oe.open,Le=oe.menuItemSelectedIcon,He=oe.virtual,Pe=oe.onSelect,je=oe.onToggleOpen,Qe=oe.onActiveValue,nt=oe.onScroll,ot=oe.onMouseEnter,$e="".concat(Ae,"-item"),Ke=Object(N.a)(function(){return Oe},[Ze,Oe],function(We,G){return G[0]&&We[1]!==G[1]}),At=me.useRef(null),mt=function(G){G.preventDefault()},St=function(G){At.current&&At.current.scrollTo({index:G})},ct=function(G){for(var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Q=Ke.length,w=0;w<Q;w+=1){var S=(G+w*q+Q)%Q,U=Ke[S],I=U.group,de=U.data;if(!I&&!de.disabled)return S}return-1},Ot=me.useState(function(){return ct(0)}),Ct=Object(x.a)(Ot,2),yt=Ct[0],De=Ct[1],Ut=function(G){De(G);var q=Ke[G];if(!q){Qe(null,-1);return}Qe(q.data.value,G)};me.useEffect(function(){Ut(D!==!1?ct(0):-1)},[Ke.length,B]),me.useEffect(function(){var We=setTimeout(function(){if(!ue&&Ze&&V.size===1){var G=Array.from(V)[0],q=Ke.findIndex(function(Q){var w=Q.data;return w.value===G});Ut(q),St(q)}});return function(){return clearTimeout(We)}},[Ze]);var kt=function(G){G!==void 0&&Pe(G,{selected:!V.has(G)}),ue||je(!1)};if(me.useImperativeHandle(Be,function(){return{onKeyDown:function(G){var q=G.which;switch(q){case k.a.UP:case k.a.DOWN:{var Q=0;if(q===k.a.UP?Q=-1:q===k.a.DOWN&&(Q=1),Q!==0){var w=ct(yt+Q,Q);St(w),Ut(w)}break}case k.a.ENTER:{var S=Ke[yt];S&&!S.data.disabled?kt(S.data.value):kt(void 0),Ze&&G.preventDefault();break}case k.a.ESC:je(!1)}},onKeyUp:function(){},scrollTo:function(G){St(G)}}}),Ke.length===0)return me.createElement("div",{role:"listbox",id:"".concat(Xe,"_list"),className:"".concat($e,"-empty"),onMouseDown:mt},he);function Ue(We){var G=Ke[We];if(!G)return null;var q=G.data||{},Q=q.value,w=q.label,S=q.children,U=Object(P.a)(q,!0),I=Te?S:w;return G?me.createElement("div",Object.assign({"aria-label":typeof I=="string"?I:null},U,{key:We,role:"option",id:"".concat(Xe,"_list_").concat(We),"aria-selected":V.has(Q)}),Q):null}return me.createElement(me.Fragment,null,me.createElement("div",{role:"listbox",id:"".concat(Xe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ue(yt-1),Ue(yt),Ue(yt+1)),me.createElement(K.a,{itemKey:"key",ref:At,data:Ke,height:A,itemHeight:pe,fullHeight:!1,onMouseDown:mt,onScroll:nt,virtual:He,onMouseEnter:ot},function(We,G){var q,Q=We.group,w=We.groupOption,S=We.data,U=S.label,I=S.key;if(Q)return me.createElement("div",{className:ee()($e,"".concat($e,"-group"))},U!==void 0?U:I);var de=S.disabled,Ce=S.value,Re=S.title,bt=S.children,rt=S.style,ge=S.className,ut=Object(j.a)(S,["disabled","value","title","children","style","className"]),_t=V.has(Ce),et="".concat($e,"-option"),Bt=ee()($e,et,ge,(q={},Object(ae.a)(q,"".concat(et,"-grouped"),w),Object(ae.a)(q,"".concat(et,"-active"),yt===G&&!de),Object(ae.a)(q,"".concat(et,"-disabled"),de),Object(ae.a)(q,"".concat(et,"-selected"),_t),q)),qe=Te?bt:U,zt=!Le||typeof Le=="function"||_t;return me.createElement("div",Object.assign({},ut,{"aria-selected":_t,className:Bt,title:Re,onMouseMove:function(){if(yt===G||de)return;Ut(G)},onClick:function(){de||kt(Ce)},style:rt}),me.createElement("div",{className:"".concat(et,"-content")},qe||Ce),me.isValidElement(Le)||_t,zt&&me.createElement(L.a,{className:"".concat($e,"-option-state"),customizeIcon:Le,customizeIconProps:{isSelected:_t}},_t?"\u2713":null))}))},W=me.forwardRef(M);W.displayName="OptionList";var Y=W,_=function(){return null};_.isSelectOption=!0;var we=_,ke=function(){return null};ke.isSelectOptGroup=!0;var se=ke,le=f("VTBJ"),fe=f("Zm9Q");function $(m){var oe=m.key,Be=m.props,Ae=Be.children,Xe=Be.value,Oe=Object(j.a)(Be,["children","value"]);return Object(le.a)({key:oe,value:Xe!==void 0?Xe:oe,children:Ae},Oe)}function h(m){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(fe.a)(m).map(function(Be,Ae){if(!me.isValidElement(Be)||!Be.type)return null;var Xe=Be.type.isSelectOptGroup,Oe=Be.key,Te=Be.props,V=Te.children,B=Object(j.a)(Te,["children"]);return oe||!Xe?$(Be):Object(le.a)(Object(le.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?Ae:Oe,"__"),label:Oe},B),{},{options:h(V)})}).filter(function(Be){return Be})}var X=f("2Qr1"),y=f("qNPg"),C=f("U8pU"),J=f("Kwbf"),H=f("WKfj");function E(m){var oe=m.mode,Be=m.options,Ae=m.children,Xe=m.backfill,Oe=m.allowClear,Te=m.placeholder,V=m.getInputElement,B=m.showSearch,ue=m.onSearch,D=m.defaultOpen,A=m.autoFocus,pe=m.labelInValue,he=m.value,Ze=m.inputValue,Le=m.optionLabelProp,He=oe==="multiple"||oe==="tags",Pe=B!==void 0?B:He||oe==="combobox",je=Be||h(Ae);if(Object(J.a)(oe!=="tags"||je.every(function($e){return!$e.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),oe==="tags"||oe==="combobox"){var Qe=je.some(function($e){return $e.options?$e.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in $e?$e.value:$e.key)=="number"});Object(J.a)(!Qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(J.a)(oe!=="combobox"||!Le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(J.a)(oe==="combobox"||!Xe,"`backfill` only works with `combobox` mode."),Object(J.a)(oe==="combobox"||!V,"`getInputElement` only work with `combobox` mode."),Object(J.b)(oe!=="combobox"||!V||!Oe||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!Pe&&oe!=="combobox"&&oe!=="tags"&&Object(J.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(J.b)(!D||A,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),he!=null){var nt=Object(H.d)(he);Object(J.a)(!pe||nt.every(function($e){return Object(C.a)($e)==="object"&&("key"in $e||"value"in $e)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(J.a)(!He||Array.isArray(he),"`value` should be array when `mode` is `multiple` or `tags`")}if(Ae){var ot=null;Object(fe.a)(Ae).some(function($e){if(!me.isValidElement($e)||!$e.type)return!1;var Ke=$e.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var At=Object(fe.a)($e.props.children).every(function(mt){return!me.isValidElement(mt)||!$e.type||mt.type.isSelectOption?!0:(ot=mt.type,!1)});return!At}return ot=Ke,!0}),ot&&Object(J.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ot.displayName||ot.name||ot,"`.")),Object(J.a)(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var R=E,ie=Object(y.a)({prefixCls:"rc-select",components:{optionList:Y},convertChildrenToData:h,flattenOptions:X.d,getLabeledValue:X.e,filterOptions:X.b,isValueDisabled:X.g,findValueOption:X.c,warningProps:R,fillOptionsWithMissingValue:X.a}),F=function(m){Object(re.a)(Be,m);var oe=Object(xe.a)(Be);function Be(){var Ae;return Object(z.a)(this,Be),Ae=oe.apply(this,arguments),Ae.selectRef=me.createRef(),Ae.focus=function(){Ae.selectRef.current.focus()},Ae.blur=function(){Ae.selectRef.current.blur()},Ae}return Object(ve.a)(Be,[{key:"render",value:function(){return me.createElement(ie,Object.assign({ref:this.selectRef},this.props))}}]),Be}(me.Component);F.Option=we,F.OptGroup=se;var be=F,O=Ie.c=be},M8RZ:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return k});var z=f("fWQN"),ve=f("mtLc"),re=f("yKVA"),xe=f("879j"),me=f("q1tI"),ae=f.n(me),j=f("i8i4"),x=f.n(j),k=function(P){Object(re.a)(T,P);var N=Object(xe.a)(T);function T(ee){var K;Object(z.a)(this,T),K=N.call(this,ee);var L=window.document;return K.node=L.createElement("div"),L.body.appendChild(K.node),K}return Object(ve.a)(T,[{key:"render",value:function(){var K=this.props.children;return Object(j.createPortal)(K,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(ae.a.Component)},NvD2:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return ae});var z=f("Kwbf");function ve(j,x){var k=new Set;return j.forEach(function(P){x.has(P)||k.add(P)}),k}function re(j){var x=j||{},k=x.disabled,P=x.disableCheckbox,N=x.checkable;return!!(k||P)||N===!1}function xe(j,x,k,P){for(var N=new Set(j),T=new Set,ee=0;ee<=k;ee+=1){var K=x.get(ee)||new Set;K.forEach(function(Y){var _=Y.key,we=Y.node,ke=Y.children,se=ke===void 0?[]:ke;N.has(_)&&!P(we)&&se.filter(function(le){return!P(le.node)}).forEach(function(le){N.add(le.key)})})}for(var L=new Set,M=k;M>=0;M-=1){var W=x.get(M)||new Set;W.forEach(function(Y){var _=Y.parent,we=Y.node;if(P(we)||!Y.parent||L.has(Y.parent.key))return;if(P(Y.parent.node)){L.add(_.key);return}var ke=!0,se=!1;(_.children||[]).filter(function(le){return!P(le.node)}).forEach(function(le){var fe=le.key,$=N.has(fe);ke&&!$&&(ke=!1),!se&&($||T.has(fe))&&(se=!0)}),ke&&N.add(_.key),se&&T.add(_.key),L.add(_.key)})}return{checkedKeys:Array.from(N),halfCheckedKeys:Array.from(ve(T,N))}}function me(j,x,k,P,N){for(var T=new Set(j),ee=new Set(x),K=0;K<=P;K+=1){var L=k.get(K)||new Set;L.forEach(function(_){var we=_.key,ke=_.node,se=_.children,le=se===void 0?[]:se;!T.has(we)&&!ee.has(we)&&!N(ke)&&le.filter(function(fe){return!N(fe.node)}).forEach(function(fe){T.delete(fe.key)})})}ee=new Set;for(var M=new Set,W=P;W>=0;W-=1){var Y=k.get(W)||new Set;Y.forEach(function(_){var we=_.parent,ke=_.node;if(N(ke)||!_.parent||M.has(_.parent.key))return;if(N(_.parent.node)){M.add(we.key);return}var se=!0,le=!1;(we.children||[]).filter(function(fe){return!N(fe.node)}).forEach(function(fe){var $=fe.key,h=T.has($);se&&!h&&(se=!1),!le&&(h||ee.has($))&&(le=!0)}),se||T.delete(we.key),le&&ee.add(we.key),M.add(we.key)})}return{checkedKeys:Array.from(T),halfCheckedKeys:Array.from(ve(ee,T))}}function ae(j,x,k,P){var N=[],T;P?T=P:T=re;var ee=new Set(j.filter(function(W){var Y=!!k[W];return Y||N.push(W),Y})),K=new Map,L=0;Object.keys(k).forEach(function(W){var Y=k[W],_=Y.level,we=K.get(_);we||(we=new Set,K.set(_,we)),we.add(Y),L=Math.max(L,_)}),Object(z.a)(!N.length,"Tree missing follow keys: ".concat(N.slice(0,100).map(function(W){return"'".concat(W,"'")}).join(", ")));var M;return x===!0?M=xe(ee,K,L,T):M=me(ee,x.halfCheckedKeys,K,L,T),M}},O2Wb:function(Je,Ie,f){Je.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(Je,Ie,f){"use strict";var z=f("U8pU"),ve=f("VTBJ"),re=f("Ff2n"),xe=f("q1tI"),me=f("uciX"),ae=f("7ixt"),j=function(ee){var K=ee.overlay,L=ee.prefixCls,M=ee.id,W=ee.overlayInnerStyle;return xe.createElement("div",{className:"".concat(L,"-inner"),id:M,role:"tooltip",style:W},typeof K=="function"?K():K)},x=j,k=function(ee,K){var L=ee.overlayClassName,M=ee.trigger,W=M===void 0?["hover"]:M,Y=ee.mouseEnterDelay,_=Y===void 0?0:Y,we=ee.mouseLeaveDelay,ke=we===void 0?.1:we,se=ee.overlayStyle,le=ee.prefixCls,fe=le===void 0?"rc-tooltip":le,$=ee.children,h=ee.onVisibleChange,X=ee.afterVisibleChange,y=ee.transitionName,C=ee.animation,J=ee.placement,H=J===void 0?"right":J,E=ee.align,R=E===void 0?{}:E,ie=ee.destroyTooltipOnHide,F=ie===void 0?!1:ie,be=ee.defaultVisible,O=ee.getTooltipContainer,m=ee.overlayInnerStyle,oe=Object(re.a)(ee,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Be=Object(xe.useRef)(null);Object(xe.useImperativeHandle)(K,function(){return Be.current});var Ae=Object(ve.a)({},oe);"visible"in ee&&(Ae.popupVisible=ee.visible);var Xe=function(){var ue=ee.arrowContent,D=ue===void 0?null:ue,A=ee.overlay,pe=ee.id;return[xe.createElement("div",{className:"".concat(fe,"-arrow"),key:"arrow"},D),xe.createElement(x,{key:"content",prefixCls:fe,id:pe,overlay:A,overlayInnerStyle:m})]},Oe=!1,Te=!1;if(typeof F=="boolean")Oe=F;else if(F&&Object(z.a)(F)==="object"){var V=F.keepParent;Oe=V===!0,Te=V===!1}return xe.createElement(me.a,Object.assign({popupClassName:L,prefixCls:fe,popup:Xe,action:W,builtinPlacements:ae.a,popupPlacement:H,ref:Be,popupAlign:R,getPopupContainer:O,onPopupVisibleChange:h,afterPopupVisibleChange:X,popupTransitionName:y,popupAnimation:C,defaultPopupVisible:be,destroyPopupOnHide:Oe,autoDestroy:Te,mouseLeaveDelay:ke,popupStyle:se,mouseEnterDelay:_},Ae),$)},P=Object(xe.forwardRef)(k),N=Ie.a=P},OZM5:function(Je,Ie,f){"use strict";f.d(Ie,"b",function(){return P}),f.d(Ie,"a",function(){return N}),f.d(Ie,"k",function(){return T}),f.d(Ie,"h",function(){return ee}),f.d(Ie,"i",function(){return K}),f.d(Ie,"g",function(){return L}),f.d(Ie,"c",function(){return M}),f.d(Ie,"d",function(){return W}),f.d(Ie,"j",function(){return we}),f.d(Ie,"e",function(){return ke}),f.d(Ie,"f",function(){return se});var z=f("KQm4"),ve=f("U8pU"),re=f("Ff2n"),xe=f("q1tI"),me=f.n(xe),ae=f("Kwbf"),j=f("WaYH"),x=.25,k=2;function P(le,fe){var $=le.slice(),h=$.indexOf(fe);return h>=0&&$.splice(h,1),$}function N(le,fe){var $=le.slice();return $.indexOf(fe)===-1&&$.push(fe),$}function T(le){return le.split("-")}function ee(le,fe){return"".concat(le,"-").concat(fe)}function K(le){return le&&le.type&&le.type.isTreeNode}function L(le,fe){var $=[le],h=fe[le];function X(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];y.forEach(function(C){var J=C.key,H=C.children;$.push(J),X(H)})}return X(h.children),$}function M(le,fe){var $=le.clientY,h=fe.selectHandle.getBoundingClientRect(),X=h.top,y=h.bottom,C=h.height,J=Math.max(C*x,k);return $<=X+J?-1:$>=y-J?1:0}function W(le,fe){if(!le)return;var $=fe.multiple;return $?le.slice():le.length?[le[0]]:le}var Y=function(fe){return fe};function _(le,fe){if(!le)return[];var $=fe||{},h=$.processProps,X=h===void 0?Y:h,y=Array.isArray(le)?le:[le];return y.map(function(C){var J=C.children,H=Object(re.a)(C,["children"]),E=_(J,fe);return me.a.createElement(j.a,Object.assign({},X(H)),E)})}function we(le){if(!le)return null;var fe;if(Array.isArray(le))fe={checkedKeys:le,halfCheckedKeys:void 0};else if(Object(ve.a)(le)==="object")fe={checkedKeys:le.checked||void 0,halfCheckedKeys:le.halfChecked||void 0};else return Object(ae.a)(!1,"`checkedKeys` is not an array or an object"),null;return fe}function ke(le,fe){var $=new Set;function h(X){if($.has(X))return;var y=fe[X];if(!y)return;$.add(X);var C=y.parent,J=y.node;if(J.disabled)return;C&&h(C.key)}return(le||[]).forEach(function(X){h(X)}),Object(z.a)($)}function se(le){var fe={};return Object.keys(le).forEach(function($){($.startsWith("data-")||$.startsWith("aria-"))&&(fe[$]=le[$])}),fe}},Ot1p:function(Je,Ie,f){"use strict";var z=f("2qtc"),ve=f("kLXV"),re=f("rAM+"),xe=f("miYZ"),me=f("tsqr"),ae=f("9og8"),j=f("tJVT"),x=f("jrin"),k=f("WmNS"),P=f.n(k),N=f("q1tI"),T=f.n(N),ee=f("VrN/"),K=f.n(ee),L=f("bdgK"),M=f("p77/"),W=f("Bd2K"),Y=f("ELLl"),_=f("19Vz"),we=f("lZu9"),ke=f("+NIl"),se=f("kSUc"),le=f("9Bee"),fe=function(ge){var ut=ge.value,_t=ut===void 0?"":ut,et=ge.className,Bt=ge.showTextOnly,qe=ge.showLines,zt=ge.style,It=zt===void 0?{}:zt,vt=Object(N.useMemo)(function(){return""},[_t]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:vt}}))},$=f("Q9mQ"),h=f("diRs"),X=f("0Owb"),y=f("dejd"),C=f("C+DQ"),J=f("D1Df"),H=f.n(J),E=f("1vsH"),R=f("m3rI"),ie=[{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 F(ge){var ut=ge.onActionCallback,_t=ge.title,et=ge.icon,Bt=ge.actionName,qe=ge.className,zt=qe===void 0?"":qe,It=ge.children;function vt(){ut(Bt)}return T.a.createElement("a",{title:_t,className:zt,onClick:vt},T.a.createElement("i",{className:"md-iconfont ".concat(et)}),It)}var be=function(ge){var ut=ge.watch,_t=ge.showNullButton,et=ge.onActionCallback,Bt=ge.fullScreen,qe=ge.insertTemp,zt=ge.hidetoolBar,It=ge.uuid,vt=ge.setOpenPhones,Xt=Object(E.E)("_educoder_session_login"),Lt=Object(E.E)("_educoder_session"),Fe=[].concat(ie,[{title:"".concat(ut?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ut?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!zt&&Fe.map(function(st,tt){return T.a.createElement("li",{key:tt},st.actionName?T.a.createElement(F,Object(X.a)({},st,{onActionCallback:et})):T.a.createElement("span",{className:"v-line"}))}),_t?T.a.createElement("li",null,T.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:et},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,qe&&T.a.createElement("li",null,T.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(qe),onActionCallback:et},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",null,T.a.createElement(h.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:T.a.createElement("div",null,T.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+Xt+"&_educoder_session="+Lt+"&key="+It+"&api="+encodeURIComponent(R.a.API_SERVER)),T.a.createElement(H.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+Xt+"&_educoder_session="+Lt+"&key="+It+"&api="+encodeURIComponent(R.a.API_SERVER)}))},T.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return vt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(F,{icon:"".concat(Bt?"icon-shrink":"icon-enlarge"),title:Bt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:et})))},O=f("M8RZ"),m=f("+L6B"),oe=f("2/Rp"),Be=f("y8nQ"),Ae=f("Vl3Y"),Xe=f("5NDa"),Oe=f("5rEg"),Te={labelCol:{span:4},wrapperCol:{span:20}},V=function(ge){var ut=ge.callback,_t=ge.onCancel;function et(Bt){ut(Bt)}return T.a.createElement(Ae.a,Object(X.a)({},Te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:et}),T.a.createElement(Ae.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(Oe.a,null)),T.a.createElement(Ae.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(Oe.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(oe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(oe.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},B=f("7ahc"),ue=f("k1fw"),D=f("HmJG"),A=f("BjJ7"),pe=Ae.a.useForm,he={width:280,marginRight:10},Ze={labelCol:{span:5},wrapperCol:{span:19}},Le=function(ge){var ut=ge.callback,_t=ge.onCancel,et=pe(),Bt=Object(j.a)(et,1),qe=Bt[0],zt=Object(N.useRef)();function It(Lt){ut(Object(ue.a)(Object(ue.a)({},Lt),{},{name:zt.current}))}function vt(Lt,Fe){qe.setFieldsValue({src:"/api/attachments/".concat(Lt.id,"?type=").concat(Lt.content_type),type:Fe.type})}function Xt(Lt){var Fe=Lt.target.files[0];zt.current=Fe.name,Pe(Fe,vt)}return T.a.createElement(Ae.a,Object(X.a)({form:qe},Ze,{className:"upload-image-panel",onFinish:It}),T.a.createElement(Ae.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(Ae.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},T.a.createElement(Oe.a,{style:he})),T.a.createElement(He,{onFileChange:Xt}))),T.a.createElement(Ae.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},T.a.createElement(Oe.a,{style:{width:264}})),T.a.createElement(Ae.a.Item,{style:{textAlign:"right"}},T.a.createElement(oe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(oe.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))};function He(ge){var ut=ge.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:ut}))}function Pe(ge,ut){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var _t=new FormData;_t.append("editormd-image-file",ge),_t.append("file_param_name","editormd-image-file"),_t.append("byxhr","true");var et=new window.XMLHttpRequest;et.withCredentials=!0,et.addEventListener("load",function(Bt){ut(JSON.parse(Bt.target.responseText),ge)},!1),et.addEventListener("error",function(Bt){console.error(Bt)},!1),et.open("POST","".concat(A.a,"/api/attachments.json")),et.send(_t)}var je=f("giR+"),Qe=f("fyUT"),nt=f("7Kak"),ot=f("9yH6"),$e=ot.a.Group,Ke={margin:"0 8px"},At=function(ge){var ut=ge.callback,_t=ge.onCancel;function et(Bt){ut(Bt)}return T.a.createElement(Ae.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:et},T.a.createElement("div",{className:"flex-container"},T.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Ke},"\u884C\u6570"),T.a.createElement(Ae.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(Qe.a,null)),T.a.createElement("span",{style:Ke},"\u5217\u6570"),T.a.createElement(Ae.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(Qe.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12}},T.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(Ae.a.Item,{name:"align"},T.a.createElement($e,null,T.a.createElement(ot.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(ot.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(ot.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(ot.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(oe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(oe.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},mt=f("ErOA"),St=f("7Cbv"),ct="link",Ot="upload-image",Ct="code-block",yt="add-table",De="------------",Ut={default:De,left:":".concat(De),center:":".concat(De,":"),right:"".concat(De,":")},kt=f("9VGf"),Ue,We;function G(){}var q=0,Q=1e4,w="\u2581",S=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function U(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var I=navigator.platform.toUpperCase().indexOf("MAC")>=0,de=I?"Cmd":"Ctrl",Ce=["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"],Re=(Ue={},Object(x.a)(Ue,de+"-B","bold"),Object(x.a)(Ue,de+"-I","italic"),Ue),bt=(We={},Object(x.a)(We,ct,"\u6DFB\u52A0\u94FE\u63A5"),Object(x.a)(We,Ct,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(x.a)(We,Ot,"\u6DFB\u52A0\u6587\u4EF6"),Object(x.a)(We,yt,"\u6DFB\u52A0\u8868\u683C"),We),rt=Ie.a=function(ge){var ut=ge.defaultValue,_t=ut===void 0?"":ut,et=ge.onChange,Bt=ge.width,qe=Bt===void 0?"100%":Bt,zt=ge.height,It=zt===void 0?400:zt,vt=ge.miniToolbar,Xt=vt===void 0?!1:vt,Lt=ge.isFocus,Fe=Lt===void 0?!1:Lt,st=ge.watch,tt=ge.insertTemp,dt=ge.mode,Kt=dt===void 0?"markdown":dt,Gt=ge.id,an=Gt===void 0?"markdown-editor-id":Gt,Vt=ge.showResizeBar,Et=Vt===void 0?!1:Vt,tn=ge.noStorage,jt=tn===void 0?!1:tn,dn=ge.showNullButton,$t=dn===void 0?!1:dn,mn=ge.hidetoolBar,On=mn===void 0?!1:mn,nn=ge.fullScreen,Ve=nn===void 0?!1:nn,lt=ge.onBlur,gn=ge.onCMBeforeChange,yn=ge.onFullScreen,An=ge.className,Kn=An===void 0?"":An,d=ge.disablePaste,r=d===void 0?!1:d,o=ge.placeholder,u=o===void 0?"":o,v=ge.values,c=v===void 0?"":v,ne=Object(N.useState)(null),Ye=Object(j.a)(ne,2),_e=Ye[0],Dt=Ye[1],Ee=Object(N.useState)(_t),ce=Object(j.a)(Ee,2),ze=ce[0],Rt=ce[1],Pt=Object(N.useState)(st),Tt=Object(j.a)(Pt,2),Wt=Tt[0],bn=Tt[1],Fn=Object(N.useState)(Ve),En=Object(j.a)(Fn,2),Zt=En[0],In=En[1],li=Object(N.useState)(""),Wn=Object(j.a)(li,2),gi=Wn[0],Bn=Wn[1],Gn=Object(N.useState)(0),Xi=Object(j.a)(Gn,2),ii=Xi[0],Pi=Xi[1],$i=Object(N.useState)(It),la=Object(j.a)($i,2),na=la[0],on=la[1],hn=Object(N.useState)(!1),ui=Object(j.a)(hn,2),Cn=ui[0],ci=ui[1],Nn=Object(N.useRef)(Object(St.a)()),ia=Object(N.useRef)(!1),Zn=Object(N.useRef)(),$n=Object(N.useRef)(),Yi=Object(N.useRef)(),xi=Object(N.useRef)(),aa=Object(N.useRef)(),Ra=function(){var Ht=Object(ae.a)(P.a.mark(function en(){var Jt,cn;return P.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(mt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Nn.current}});case 2:cn=kn.sent,cn!=null&&(Jt=cn.attachments)!==null&&Jt!==void 0&&Jt.length&&(console.log("cm:",_e,$n),cn.attachments.map(function(fn){fn.content_type.indexOf("image")>-1?_e.replaceSelection(".concat(fn.content_type,")")):fn.content_type.indexOf("video")>-1?_e.replaceSelection('<video width="100%" controls src="'.concat(R.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):fn.content_type.indexOf("pdf")>-1?_e.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(fn.id,"?type=").concat(fn.content_type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):_e.replaceSelection("[".concat(fn.name,"](").concat(R.a.API_SERVER,"/api/attachments/").concat(fn.id,"?type=").concat(fn.content_type,")"))}));case 4:case"end":return kn.stop()}},en)}));return function(){return Ht.apply(this,arguments)}}();Object(N.useEffect)(function(){Rt(c),_e==null||_e.setValue(c)},[c]),Object(N.useEffect)(function(){yn==null||yn(Zt)},[Zt]),Object(N.useEffect)(function(){if($n.current){var Ht=K.a.fromTextArea($n.current,{mode:Kt,lineNumbers:!Xt,lineWrapping:!0,value:_t,autoCloseTags:!0,autoCloseBrackets:!0});Fe&&Ht.focus();function en(Jt,cn){if(r){cn.preventDefault();return}var vn=cn.clipboardData;if(vn){var kn=vn.types.toString(),fn=vn.items;if(kn==="Files"||vn.types.indexOf("Files")>-1){if(cn.preventDefault(),Kt=="stex")return;try{var Hn,ai=fn[1];((Hn=fn[0])===null||Hn===void 0?void 0:Hn.kind)==="file"&&(ai=fn[0]);var sn=ai.getAsFile(),da=sn.name.split(".").pop();Pe(sn,function(xn){if(xn.id){var qn,Mn,Fi;(sn==null||((qn=sn.type)===null||qn===void 0)?void 0:qn.indexOf("image"))>-1?Ht.replaceSelection(".concat(xn.content_type,")")):(sn==null||((Mn=sn.type)===null||Mn===void 0)?void 0:Mn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,'"></video>')):(sn==null||((Fi=sn.type)===null||Fi===void 0)?void 0:Fi.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,"?type=").concat(sn.type,'&disposition=inline" target="_blank">').concat(sn.name,"</a>")):Ce.includes(da)?Ht.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,'?type=office&disposition=inline" target="_blank">').concat(sn.name,"</a>")):Ht.replaceSelection("[".concat(sn.name,"](").concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,"?type=").concat(xn.content_type,")"))}else(xn==null?void 0:xn.status)===401&&(document.location.href="/user/login")})}catch(xn){me.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ht.on("paste",en),Ht.on("dragleave",function(Jt,cn){Yi.current.classList.remove("mouse-hover-md")}),Ht.on("dragover",function(Jt,cn){Yi.current.classList.add("mouse-hover-md")}),Ht.on("drop",function(Jt,cn){Yi.current.classList.add("mouse-hover-md");var vn;if(vn=cn.dataTransfer.files,vn.length>0){cn.preventDefault(),cn.stopPropagation();for(var kn=function(ai){var sn=vn[ai],da=sn.name.split(".").pop();Pe(sn,function(xn){if(xn.id){var qn,Mn,Fi;(sn==null||((qn=sn.type)===null||qn===void 0)?void 0:qn.indexOf("image"))>-1?Ht.replaceSelection(".concat(xn.content_type,")")):(sn==null||((Mn=sn.type)===null||Mn===void 0)?void 0:Mn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,'"></video>')):(sn==null||((Fi=sn.type)===null||Fi===void 0)?void 0:Fi.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,"?type=").concat(sn.type,'&disposition=inline" target="_blank">').concat(sn.name,"</a>")):Ce.includes(da)?Ht.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,'?type=office&disposition=inline" target="_blank">').concat(sn.name,"</a>")):Ht.replaceSelection("[".concat(sn.name,"](").concat(R.a.API_SERVER,"/api/attachments/").concat(xn.id,"?type=").concat(xn.content_type,")"))}else(xn==null?void 0:xn.status)===401&&(document.location.href="/user/login")})},fn=0;fn<vn.length;fn++)kn(fn)}}),Dt(Ht),function(){Ht.off("paste",en)}}},[]);var zi=Object(N.useCallback)(function(){if(Yi.current)try{}catch(Ht){console.log(Ht,"---- to set md editor body height")}},[na,Yi,Zt]);Object(N.useEffect)(function(){function Ht(){var Jt=new L.default(function(cn){var vn=Object(re.a)(cn),kn;try{for(vn.s();!(kn=vn.n()).done;){var fn=kn.value;(fn.target.offsetHeight>0||fn.target.offsetWidth>0)&&(zi(),_e.setSize("100%","100%"),_e.refresh())}}catch(Hn){vn.e(Hn)}finally{vn.f()}});return Jt.observe($n.current.parentElement),Jt}if(_e){var en=Ht();return function(){en.unobserve($n.current.parentElement)}}},[_e,zi]),Object(N.useEffect)(function(){if(_e){for(var Ht=[],en=function(){var fn=cn[Jt];vn=Object(j.a)(fn,2);var Hn=vn[0],ai=vn[1],sn=Object(x.a)({},Hn,function(){ra(ai)});Ht.push(sn),_e.addKeyMap(sn)},Jt=0,cn=Object.entries(Re);Jt<cn.length;Jt++){var vn;en()}return Zn.current=setInterval(function(){ia.current&&Ra()},4e3),function(){clearInterval(Zn.current);var kn=Object(re.a)(Ht),fn;try{for(kn.s();!(fn=kn.n()).done;){var Hn=fn.value;_e.removeKeyMap(Hn)}}catch(ai){kn.e(ai)}finally{kn.f()}}}},[_e]),Object(N.useEffect)(function(){Ve!==Zt&&In(Ve)},[Ve]),Object(kt.a)(function(){if(!jt&&ii>0){var Ht=new Date().getTime(),en=window.sessionStorage.getItem(an);Ht>=ii+Q&&(!en||en!==ze)&&(window.sessionStorage.setItem(an,ze),ci(!0))}},Q),Object(N.useEffect)(function(){bn(st)},[_e,st]),Object(N.useEffect)(function(){_e&&(Fe&&_e.focus())},[_e,Fe]),Object(N.useEffect)(function(){if(Wt&&_e){var Ht=_e.getScrollerElement();function en(Jt){var cn=Jt.target;if(aa.current){var vn=cn.scrollTop/cn.scrollHeight;aa.current.scrollTop=aa.current.scrollHeight*vn}}return Ht.addEventListener("scroll",en),function(){Ht.removeEventListener("scroll",en)}}},[_e,Wt]),Object(N.useEffect)(function(){if(_e&&gn){function Ht(en,Jt){gn(en,Jt)}return _e.on("beforeChange",Ht),function(){_e.off("beforeChange",Ht)}}},[_e,gn]),Object(N.useEffect)(function(){if(_e&<){function Ht(){lt(_e.getValue())}return _e.on("blur",Ht),function(){_e.off("blur",Ht)}}},[_e,lt]),Object(N.useEffect)(function(){if(_e){function Ht(en){var Jt=en.getValue();Rt(Jt),Pi(new Date().getTime()),en.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),et&&et(Jt)}return _e.on("change",Ht),function(){_e.off("change",Ht)}}},[_e,et]),Object(N.useEffect)(function(){_e&&(_t==null?(_e.setValue(""),Rt("")):_t!==_e.getValue()&&(_e.setValue(_t),Rt(_t),_e.setCursor(_e.lineCount(),0)))},[_e,_t]);var ra=Object(N.useCallback)(function(Ht){var en=_e.getCursor(),Jt=_e.getSelection(),cn=Jt.split(`
|
|
`);switch(Ht){case"bold":return _e.replaceSelection("**"+Jt+"**"),Jt===""&&_e.setCursor(en.line,en.ch+2),_e.focus();case"italic":return _e.replaceSelection("*"+Jt+"*"),Jt===""&&_e.setCursor(en.line,en.ch+1),_e.focus();case"code":return _e.replaceSelection("`"+Jt+"`"),Jt===""&&_e.setCursor(en.line,en.ch+1),_e.focus();case"inline-latex":return _e.replaceSelection("`$$"+Jt+"$$`"),Jt===""&&_e.setCursor(en.line,en.ch+3),_e.focus();case"latex":return _e.replaceSelection("```latex\n"+Jt+"\n```"),_e.setCursor(en.line+1,Jt.length+1),_e.focus();case"line-break":return _e.replaceSelection(`<br/>
|
|
`),_e.focus();case"list-ul":return Jt===""?_e.replaceSelection("- "+Jt):_e.replaceSelection(cn.map(function(vn){return vn===""?"":"- ".concat(vn)}).join(`
|
|
`)),_e.focus();case"list-ol":return Jt===""?_e.replaceSelection("1. "+Jt):_e.replaceSelection(cn.map(function(vn,kn){return vn===""?"":"".concat(kn+1,". ").concat(vn)}).join(`
|
|
`)),_e.focus();case"add-null-ch":return Jt===""&&_e.setCursor(en.line,en.ch+1),_e.replaceSelection(w),_e.focus();case"inster-template-1":return Jt===""&&_e.setCursor(en.line,en.ch),_e.replaceSelection(S),_e.focus();case"eraser":return _e.setValue(""),_e.focus();case"trigger-watch":return bn(!Wt),_e.focus();case"trigger-full-screen":return In(!Zt),_e.focus();case ct:Bn(ct);return;case Ct:Bn(Ct);return;case Ot:Bn(Ot);return;case yt:Bn(yt);return;default:throw new Error}},[_e,Wt,Zt]),Ti=Object(N.useCallback)(function(Ht){Bn("");switch(gi){case ct:var en=Ht.title,Jt=Ht.link;return _e.replaceSelection("[".concat(en,"](").concat(Jt,")")),_e.focus();case Ct:var cn=Ht.language,vn=Ht.content;return _e.replaceSelection(["```"+cn,vn,"```"].join(`
|
|
`)),_e.focus();case Ot:var kn=Ht.src,fn=Ht.alt,Hn=Ht.name;return kn.indexOf("type=image")>-1?_e.replaceSelection(".concat(kn,' "').concat(fn||"",'" )')):kn.indexOf("type=application/pdf")>-1?_e.replaceSelection('<a href="'.concat(kn,'&disposition=inline" target="_blank">').concat(Hn,"</a>")):_e.replaceSelection('<a href="'.concat(kn,'" target="_blank">').concat(Hn,"</a>")),_e.focus();case yt:for(var ai=Ht.row,sn=Ht.col,da=Ht.align,xn=`
|
|
`,qn=0;qn<ai;qn++){for(var Mn=[],Fi=[],Pa=0;Pa<sn;Pa++)qn===1&&Fi.push(Ut[da]),Mn.push(" ");qn===1&&(xn+="| ".concat(Fi.join(" | "),` |
|
|
`)),xn+="| ".concat(Mn.join(sn===1?"":" | "),` |
|
|
`)}return _e.replaceSelection(xn+`
|
|
`),_e.focus();default:throw new Error}},[_e,gi]),ua=Object(N.useMemo)(function(){switch(gi){case ct:return T.a.createElement(V,{callback:Ti,onCancel:Rn});case Ct:return T.a.createElement(B.b,{callback:Ti,onCancel:Rn});case Ot:return T.a.createElement(Le,{callback:Ti,onCancel:Rn});case yt:return T.a.createElement(At,{callback:Ti,onCancel:Rn});default:return null}},[gi]);function Rn(){Bn("")}Object(N.useEffect)(function(){if(xi.current){var Ht=xi.current,en=!1,Jt=0;function cn(fn){en=!0,Jt=fn.pageY}function vn(){en=!1}function kn(fn){if(en){var Hn=fn.pageY-Jt;Hn<0&&(Hn=0),Hn>300&&(Hn=300);var ai=It+Hn+"px";on(ai)}}return Ht.addEventListener("mousedown",cn),document.addEventListener("mousemove",kn),document.addEventListener("mouseup",vn),function(){Ht.removeEventListener("mousedown",cn),document.removeEventListener("mousemove",kn),document.removeEventListener("mouseup",vn)}}},[_e,xi]),Object(N.useEffect)(function(){on(It)},[It]);var Bi=U(qe),nr=U(na),Ia={width:Bi,height:nr},ca=Object(N.useMemo)(function(){if(ii){var Ht=new Date(ii),en=Ht.getHours(),Jt=Ht.getMinutes(),cn=Ht.getSeconds();return en=en<10?"0"+en:en,Jt=Jt<10?"0"+Jt:Jt,cn=cn<10?"0"+cn:cn,"".concat(en,":").concat(Jt,":").concat(cn)}return 0},[ii]);function Pr(){window.sessionStorage.removeItem(an),ci(!1),Pi(0)}function oa(){ci(!1),Pi(0),_e.setValue(window.sessionStorage.getItem(an))}function Ba(Ht,en){var Jt=_e.getValue();Jt=Jt.replace(Ht,en),Rt(Jt),_e==null||_e.setValue(Jt)}return T.a.createElement(N.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:Yi},T.a.createElement("div",{className:"markdown-editor-container ".concat(Kn," ").concat(Wt?"on-preview":""," ").concat(Xt?"mini":""," ").concat(Zt?"full-screen":""),style:Ia},T.a.createElement(be,{insertTemp:tt,watch:Wt,fullScreen:Zt,showNullButton:$t,onActionCallback:ra,hidetoolBar:On,uuid:Nn.current,setOpenPhones:function(){ia.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:$n,placeholder:u})),Wt?T.a.createElement("div",{ref:aa,className:"preview-container"},Kt==="stex"&&T.a.createElement(fe,{value:ze}),Kt!=="stex"&&T.a.createElement(le.a,{edit:!0,value:ze,replaces:Ba})):null))),Et?T.a.createElement("a",{ref:xi,className:"editor-resize"}):null,T.a.createElement(O.a,null,bt[gi]?T.a.createElement(ve.a,{centered:!0,title:bt[gi],visible:!0,onCancel:Rn,footer:null},ua):null))}},PGNT:function(Je,Ie,f){Je.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(Je,Ie,f){Je.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(Je,Ie,f){Je.exports=f.p+"static/wenhao.35e7ea02.svg"},"RZ/O":function(Je,Ie,f){Je.exports=f.p+"static/bi.c00a7d71.svg"},SJMd:function(Je,Ie){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var f,z,ve,re=!1,xe,me;window.PR_SHOULD_USE_CONTINUATION=!0;var ae,j;(function(){var x=window,k=["break,continue,do,else,for,if,return,while"],P=[k,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],N=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[N,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],ee=[N,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],K=[N,"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"],L="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",M=[N,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],W="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",Y=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],_=[k,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],we=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],ke=[T,K,ee,M,W,Y,_,we],se=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,le="str",fe="kwd",$="com",h="typ",X="lit",y="pun",C="pln",J="tag",H="dec",E="src",R="atn",ie="atv",F="nocode",be="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function O(Pe){for(var je=0,Qe=!1,nt=!1,ot=0,$e=Pe.length;ot<$e;++ot){var Ke=Pe[ot];if(Ke.ignoreCase)nt=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Qe=!0,nt=!1;break}}var At={b:8,t:9,n:10,v:11,f:12,r:13};function mt(yt){var De=yt.charCodeAt(0);if(De!==92)return De;var Ut=yt.charAt(1);return De=At[Ut],De||("0"<=Ut&&Ut<="7"?parseInt(yt.substring(1),8):Ut==="u"||Ut==="x"?parseInt(yt.substring(2),16):yt.charCodeAt(1))}function St(yt){if(yt<32)return(yt<16?"\\x0":"\\x")+yt.toString(16);var De=String.fromCharCode(yt);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function ct(yt){var De=yt.substring(1,yt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ut=[],kt=De[0]==="^",Ue=["["];kt&&Ue.push("^");for(var We=kt?1:0,G=De.length;We<G;++We){var q=De[We];if(/\\[bdsw]/i.test(q))Ue.push(q);else{var Q=mt(q),w;We+2<G&&De[We+1]==="-"?(w=mt(De[We+2]),We+=2):w=Q,Ut.push([Q,w]),w<65||Q>122||(w<65||Q>90||Ut.push([Math.max(65,Q)|32,Math.min(w,90)|32]),w<97||Q>122||Ut.push([Math.max(97,Q)&~32,Math.min(w,122)&~32]))}}Ut.sort(function(de,Ce){return de[0]-Ce[0]||Ce[1]-de[1]});for(var S=[],U=[],We=0;We<Ut.length;++We){var I=Ut[We];I[0]<=U[1]+1?U[1]=Math.max(U[1],I[1]):S.push(U=I)}for(var We=0;We<S.length;++We){var I=S[We];Ue.push(St(I[0])),I[1]>I[0]&&(I[1]+1>I[0]&&Ue.push("-"),Ue.push(St(I[1])))}return Ue.push("]"),Ue.join("")}function Ot(yt){for(var De=yt.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=De.length,kt=[],Ue=0,We=0;Ue<Ut;++Ue){var G=De[Ue];if(G==="(")++We;else if(G.charAt(0)==="\\"){var q=+G.substring(1);q&&(q<=We?kt[q]=-1:De[Ue]=St(q))}}for(var Ue=1;Ue<kt.length;++Ue)kt[Ue]===-1&&(kt[Ue]=++je);for(var Ue=0,We=0;Ue<Ut;++Ue){var G=De[Ue];if(G==="(")++We,kt[We]||(De[Ue]="(?:");else if(G.charAt(0)==="\\"){var q=+G.substring(1);q&&q<=We&&(De[Ue]="\\"+kt[q])}}for(var Ue=0;Ue<Ut;++Ue)De[Ue]==="^"&&De[Ue+1]!=="^"&&(De[Ue]="");if(yt.ignoreCase&&Qe)for(var Ue=0;Ue<Ut;++Ue){var G=De[Ue],Q=G.charAt(0);G.length>=2&&Q==="["?De[Ue]=ct(G):Q!=="\\"&&(De[Ue]=G.replace(/[a-zA-Z]/g,function(U){var I=U.charCodeAt(0);return"["+String.fromCharCode(I&~32,I|32)+"]"}))}return De.join("")}for(var Ct=[],ot=0,$e=Pe.length;ot<$e;++ot){var Ke=Pe[ot];if(Ke.global||Ke.multiline)throw new Error(""+Ke);Ct.push("(?:"+Ot(Ke)+")")}return new RegExp(Ct.join("|"),nt?"gi":"g")}function m(Pe,je){var Qe=/(?:^|\s)nocode(?:\s|$)/,nt=[],ot=0,$e=[],Ke=0;function At(mt){var St=mt.nodeType;if(St==1){if(Qe.test(mt.className))return;for(var ct=mt.firstChild;ct;ct=ct.nextSibling)At(ct);var Ot=mt.nodeName.toLowerCase();(Ot==="br"||Ot==="li")&&(nt[Ke]=`
|
|
`,$e[Ke<<1]=ot++,$e[Ke++<<1|1]=mt)}else if(St==3||St==4){var Ct=mt.nodeValue;Ct.length&&(je?Ct=Ct.replace(/\r\n?/g,`
|
|
`):Ct=Ct.replace(/[ \t\r\n]+/g," "),nt[Ke]=Ct,$e[Ke<<1]=ot,ot+=Ct.length,$e[Ke++<<1|1]=mt)}}return At(Pe),{sourceCode:nt.join("").replace(/\n$/,""),spans:$e}}function oe(Pe,je,Qe,nt,ot){if(!Qe)return;var $e={sourceNode:Pe,pre:1,langExtension:null,numberLines:null,sourceCode:Qe,spans:null,basePos:je,decorations:null};nt($e),ot.push.apply(ot,$e.decorations)}var Be=/\S/;function Ae(Pe){for(var je=void 0,Qe=Pe.firstChild;Qe;Qe=Qe.nextSibling){var nt=Qe.nodeType;je=nt===1?je?Pe:Qe:nt===3&&Be.test(Qe.nodeValue)?Pe:je}return je===Pe?void 0:je}function Xe(Pe,je){var Qe={},nt;(function(){for(var Ke=Pe.concat(je),At=[],mt={},St=0,ct=Ke.length;St<ct;++St){var Ot=Ke[St],Ct=Ot[3];if(Ct)for(var yt=Ct.length;--yt>=0;)Qe[Ct.charAt(yt)]=Ot;var De=Ot[1],Ut=""+De;mt.hasOwnProperty(Ut)||(At.push(De),mt[Ut]=null)}At.push(/[\0-\uffff]/),nt=O(At)})();var ot=je.length,$e=function(Ke){for(var At=Ke.sourceCode,mt=Ke.basePos,St=Ke.sourceNode,ct=[mt,C],Ot=0,Ct=At.match(nt)||[],yt={},De=0,Ut=Ct.length;De<Ut;++De){var kt=Ct[De],Ue=yt[kt],We=void 0,G;if(typeof Ue=="string")G=!1;else{var q=Qe[kt.charAt(0)];if(q)We=kt.match(q[1]),Ue=q[0];else{for(var Q=0;Q<ot;++Q)if(q=je[Q],We=kt.match(q[1]),We){Ue=q[0];break}We||(Ue=C)}G=Ue.length>=5&&Ue.substring(0,5)==="lang-",G&&!(We&&typeof We[1]=="string")&&(G=!1,Ue=E),G||(yt[kt]=Ue)}var w=Ot;if(Ot+=kt.length,!G)ct.push(mt+w,Ue);else{var S=We[1],U=kt.indexOf(S),I=U+S.length;We[2]&&(I=kt.length-We[2].length,U=I-S.length);var de=Ue.substring(5);oe(St,mt+w,kt.substring(0,U),$e,ct),oe(St,mt+w+U,S,A(de,S),ct),oe(St,mt+w+I,kt.substring(I),$e,ct)}}Ke.decorations=ct};return $e}function Oe(Pe){var je=[],Qe=[];Pe.tripleQuotedStrings?je.push([le,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Pe.multiLineStrings?je.push([le,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):je.push([le,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Pe.verbatimStrings&&Qe.push([le,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var nt=Pe.hashComments;nt&&(Pe.cStyleComments?(nt>1?je.push([$,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):je.push([$,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([le,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):je.push([$,/^#[^\r\n]*/,null,"#"])),Pe.cStyleComments&&(Qe.push([$,/^\/\/[^\r\n]*/,null]),Qe.push([$,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ot=Pe.regexLiterals;if(ot){var $e=ot>1?"":`
|
|
\r`,Ke=$e?".":"[\\S\\s]",At="/(?=[^/*"+$e+"])(?:[^/\\x5B\\x5C"+$e+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+$e+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+be+"("+At+")")])}var mt=Pe.types;mt&&Qe.push([h,mt]);var St=(""+Pe.keywords).replace(/^ | $/g,"");St.length&&Qe.push([fe,new RegExp("^(?:"+St.replace(/[\s,]+/g,"|")+")\\b"),null]),je.push([C,/^\s+/,null,` \r
|
|
\xA0`]);var ct="^.[^\\s\\w.$@'\"`/\\\\]*";return Pe.regexLiterals&&(ct+="(?!s*/)"),Qe.push([X,/^@[a-z_$][a-z_$@0-9]*/i,null],[h,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[C,/^[a-z_$][a-z_$@0-9]*/i,null],[X,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[C,/^\\[\s\S]?/,null],[y,new RegExp(ct),null]),Xe(je,Qe)}var Te=Oe({keywords:ke,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function V(Pe,je,Qe){for(var nt=/(?:^|\s)nocode(?:\s|$)/,ot=/\r\n?|\n/,$e=Pe.ownerDocument,Ke=$e.createElement("li");Pe.firstChild;)Ke.appendChild(Pe.firstChild);var At=[Ke];function mt(De){var Ut=De.nodeType;if(Ut==1&&!nt.test(De.className))if(De.nodeName==="br")St(De),De.parentNode&&De.parentNode.removeChild(De);else for(var kt=De.firstChild;kt;kt=kt.nextSibling)mt(kt);else if((Ut==3||Ut==4)&&Qe){var Ue=De.nodeValue,We=Ue.match(ot);if(We){var G=Ue.substring(0,We.index);De.nodeValue=G;var q=Ue.substring(We.index+We[0].length);if(q){var Q=De.parentNode;Q.insertBefore($e.createTextNode(q),De.nextSibling)}St(De),G||De.parentNode.removeChild(De)}}}function St(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function Ut(We,G){var q=G?We.cloneNode(!1):We,Q=We.parentNode;if(Q){var w=Ut(Q,1),S=We.nextSibling;w.appendChild(q);for(var U=S;U;U=S)S=U.nextSibling,w.appendChild(U)}return q}for(var kt=Ut(De.nextSibling,0),Ue;(Ue=kt.parentNode)&&Ue.nodeType===1;)kt=Ue;At.push(kt)}for(var ct=0;ct<At.length;++ct)mt(At[ct]);je===(je|0)&&At[0].setAttribute("value",je);var Ot=$e.createElement("ol");Ot.className="linenums";for(var Ct=Math.max(0,je-1|0)||0,ct=0,yt=At.length;ct<yt;++ct)Ke=At[ct],Ke.className="L"+(ct+Ct)%10,Ke.firstChild||Ke.appendChild($e.createTextNode("\xA0")),Ot.appendChild(Ke);Pe.appendChild(Ot)}function B(Pe){var je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);je=je&&+je[1]<=8;var Qe=/\n/g,nt=Pe.sourceCode,ot=nt.length,$e=0,Ke=Pe.spans,At=Ke.length,mt=0,St=Pe.decorations,ct=St.length,Ot=0;St[ct]=ot;var Ct,yt;for(yt=Ct=0;yt<ct;)St[yt]!==St[yt+2]?(St[Ct++]=St[yt++],St[Ct++]=St[yt++]):yt+=2;for(ct=Ct,yt=Ct=0;yt<ct;){for(var De=St[yt],Ut=St[yt+1],kt=yt+2;kt+2<=ct&&St[kt+1]===Ut;)kt+=2;St[Ct++]=De,St[Ct++]=Ut,yt=kt}ct=St.length=Ct;var Ue=Pe.sourceNode,We="";Ue&&(We=Ue.style.display,Ue.style.display="none");try{for(var G=null;mt<At;){var q=Ke[mt],Q=Ke[mt+2]||ot,w=St[Ot+2]||ot,kt=Math.min(Q,w),S=Ke[mt+1],U;if(S.nodeType!==1&&(U=nt.substring($e,kt))){je&&(U=U.replace(Qe,"\r")),S.nodeValue=U;var I=S.ownerDocument,de=I.createElement("span");de.className=St[Ot+1];var Ce=S.parentNode;Ce.replaceChild(de,S),de.appendChild(S),$e<Q&&(Ke[mt+1]=S=I.createTextNode(nt.substring(kt,Q)),Ce.insertBefore(S,de.nextSibling))}$e=kt,$e>=Q&&(mt+=2),$e>=w&&(Ot+=2)}}finally{Ue&&(Ue.style.display=We)}}var ue={};function D(Pe,je){for(var Qe=je.length;--Qe>=0;){var nt=je[Qe];ue.hasOwnProperty(nt)?x.console&&console.warn("cannot override language handler %s",nt):ue[nt]=Pe}}function A(Pe,je){return Pe&&ue.hasOwnProperty(Pe)||(Pe=/^\s*</.test(je)?"default-markup":"default-code"),ue[Pe]}D(Te,["default-code"]),D(Xe([],[[C,/^[^<?]+/],[H,/^<!\w[^>]*(?:>|$)/],[$,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[y,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),D(Xe([[C,/^[\s]+/,null,` \r
|
|
`],[ie,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[J,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[y,/^[=<>\/]+/],["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"]),D(Xe([],[[ie,/^[\s\S]+/]]),["uq.val"]),D(Oe({keywords:T,hashComments:!0,cStyleComments:!0,types:se}),["c","cc","cpp","cxx","cyc","m"]),D(Oe({keywords:"null,true,false"}),["json"]),D(Oe({keywords:K,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:se}),["cs"]),D(Oe({keywords:ee,cStyleComments:!0}),["java"]),D(Oe({keywords:we,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),D(Oe({keywords:Y,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),D(Oe({keywords:W,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),D(Oe({keywords:_,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),D(Oe({keywords:M,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),D(Oe({keywords:L,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),D(Xe([],[[le,/^[\s\S]+/]]),["regex"]);function pe(Pe){var je=Pe.langExtension;try{var Qe=m(Pe.sourceNode,Pe.pre),nt=Qe.sourceCode;Pe.sourceCode=nt,Pe.spans=Qe.spans,Pe.basePos=0,A(je,nt)(Pe),B(Pe)}catch(ot){x.console&&console.log(ot&&ot.stack||ot)}}function he(Pe,je,Qe){var nt=Qe||!1,ot=je||null,$e=document.createElement("div");$e.innerHTML="<pre>"+Pe+"</pre>",$e=$e.firstChild,nt&&V($e,nt,!0);var Ke={langExtension:ot,numberLines:nt,sourceNode:$e,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return pe(Ke),$e.innerHTML}function Ze(Pe,je){var Qe=je||document.body,nt=Qe.ownerDocument||document;function ot(q){return Qe.getElementsByTagName(q)}for(var $e=[ot("pre"),ot("code"),ot("xmp")],Ke=[],At=0;At<$e.length;++At)for(var mt=0,St=$e[At].length;mt<St;++mt)Ke.push($e[At][mt]);$e=null;var ct=Date;ct.now||(ct={now:function(){return+new Date}});var Ot=0,Ct=/\blang(?:uage)?-([\w.]+)(?!\S)/,yt=/\bprettyprint\b/,De=/\bprettyprinted\b/,Ut=/pre|xmp/i,kt=/^code$/i,Ue=/^(?:pre|code|xmp)$/i,We={};function G(){for(var q=x.PR_SHOULD_USE_CONTINUATION?ct.now()+250:Infinity;Ot<Ke.length&&ct.now()<q;Ot++){for(var Q=Ke[Ot],w=We,S=Q;S=S.previousSibling;){var U=S.nodeType,I=(U===7||U===8)&&S.nodeValue;if(I?!/^\??prettify\b/.test(I):U!==3||/\S/.test(S.nodeValue))break;if(I){w={},I.replace(/\b(\w+)=([\w:.%+-]+)/g,function(It,vt,Xt){w[vt]=Xt});break}}var de=Q.className;if((w!==We||yt.test(de))&&!De.test(de)){for(var Ce=!1,Re=Q.parentNode;Re;Re=Re.parentNode){var bt=Re.tagName;if(Ue.test(bt)&&Re.className&&yt.test(Re.className)){Ce=!0;break}}if(!Ce){Q.className+=" prettyprinted";var rt=w.lang;if(!rt){rt=de.match(Ct);var ge;!rt&&(ge=Ae(Q))&&kt.test(ge.tagName)&&(rt=ge.className.match(Ct)),rt&&(rt=rt[1])}var ut;if(Ut.test(Q.tagName))ut=1;else{var _t=Q.currentStyle,et=nt.defaultView,Bt=_t?_t.whiteSpace:et&&et.getComputedStyle?et.getComputedStyle(Q,null).getPropertyValue("white-space"):0;ut=Bt&&Bt.substring(0,3)==="pre"}var qe=w.linenums;(qe=qe==="true"||+qe)||(qe=de.match(/\blinenums\b(?::(\d+))?/),qe=qe?qe[1]&&qe[1].length?+qe[1]:!0:!1),qe&&V(Q,qe,ut);var zt={langExtension:rt,sourceNode:Q,numberLines:qe,pre:ut,sourceCode:null,basePos:null,spans:null,decorations:null};pe(zt)}}}Ot<Ke.length?x.setTimeout(G,250):typeof Pe=="function"&&Pe()}G()}var Le=x.PR={createSimpleLexer:Xe,registerLangHandler:D,sourceDecorator:Oe,PR_ATTRIB_NAME:R,PR_ATTRIB_VALUE:ie,PR_COMMENT:$,PR_DECLARATION:H,PR_KEYWORD:fe,PR_LITERAL:X,PR_NOCODE:F,PR_PLAIN:C,PR_PUNCTUATION:y,PR_SOURCE:E,PR_STRING:le,PR_TAG:J,PR_TYPE:h,prettyPrintOne:re?x.prettyPrintOne=he:ae=he,prettyPrint:j=re?x.prettyPrint=Ze:j=Ze},He=x.define;typeof He=="function"&&He.amd&&He("google-code-prettify",[],function(){return Le})})()},"VrN/":function(Je,Ie,f){(function(z,ve){Je.exports=ve()})(this,function(){"use strict";var z=navigator.userAgent,ve=navigator.platform,re=/gecko\/\d/i.test(z),xe=/MSIE \d/.test(z),me=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(z),ae=/Edge\/(\d+)/.exec(z),j=xe||me||ae,x=j&&(xe?document.documentMode||6:+(ae||me)[1]),k=!ae&&/WebKit\//.test(z),P=k&&/Qt\/\d+\.\d+/.test(z),N=!ae&&/Chrome\//.test(z),T=/Opera\//.test(z),ee=/Apple Computer/.test(navigator.vendor),K=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(z),L=/PhantomJS/.test(z),M=!ae&&/AppleWebKit/.test(z)&&/Mobile\/\w+/.test(z),W=/Android/.test(z),Y=M||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(z),_=M||/Mac/.test(ve),we=/\bCrOS\b/.test(z),ke=/win/i.test(ve),se=T&&z.match(/Version\/(\d*\.\d*)/);se&&(se=Number(se[1])),se&&se>=15&&(T=!1,k=!0);var le=_&&(P||T&&(se==null||se<12.11)),fe=re||j&&x>=9;function $(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var h=function(e,t){var i=e.className,n=$(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 X(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function y(e,t){return X(e).appendChild(t)}function C(e,t,i,n){var a=document.createElement(e);if(i&&(a.className=i),n&&(a.style.cssText=n),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)a.appendChild(t[s]);return a}function J(e,t,i,n){var a=C(e,t,i,n);return a.setAttribute("role","presentation"),a}var H;document.createRange?H=function(e,t,i,n){var a=document.createRange();return a.setEnd(n||e,i),a.setStart(e,t),a}:H=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(a){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function E(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function R(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function ie(e,t){var i=e.className;$(t).test(i)||(e.className+=(i?" ":"")+t)}function F(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!$(i[n]).test(t)&&(t+=" "+i[n]);return t}var be=function(e){e.select()};M?be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:j&&(be=function(e){try{e.select()}catch(t){}});function O(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function m(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function oe(e,t,i,n,a){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=a||0;;){var p=e.indexOf(" ",s);if(p<0||p>=t)return l+(t-s);l+=p-s,l+=i-l%i,s=p+1}}var Be=function(){this.id=null,this.f=null,this.time=0,this.handler=O(this.onTimeout,this)};Be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Be.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function Ae(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Xe=50,Oe={toString:function(){return"CodeMirror.Pass"}},Te={scroll:!1},V={origin:"*mouse"},B={origin:"+move"};function ue(e,t,i){for(var n=0,a=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||a+l>=t)return n+Math.min(l,t-a);if(a+=s-n,a+=i-a%i,n=s+1,a>=t)return n}}var D=[""];function A(e){for(;D.length<=e;)D.push(pe(D)+" ");return D[e]}function pe(e){return e[e.length-1]}function he(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Ze(e,t,i){for(var n=0,a=i(t);n<e.length&&i(e[n])<=a;)n++;e.splice(n,0,t)}function Le(){}function He(e,t){var i;return Object.create?i=Object.create(e):(Le.prototype=e,i=new Le),t&&m(t,i),i}var Pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function je(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Pe.test(e))}function Qe(e,t){return t?t.source.indexOf("\\w")>-1&&je(e)?!0:t.test(e):je(e)}function nt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ot=/[\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 $e(e){return e.charCodeAt(0)>=768&&ot.test(e)}function Ke(e,t,i){for(;(i<0?t>0:t<e.length)&&$e(e.charAt(t));)t+=i;return t}function At(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var 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 mt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var a=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),a=!0)}a||n(t,i,"ltr")}var St=null;function ct(e,t,i){var n;St=null;for(var a=0;a<e.length;++a){var s=e[a];if(s.from<t&&s.to>t)return a;s.to==t&&(s.from!=s.to&&i=="before"?n=a:St=a),s.from==t&&(s.from!=s.to&&i!="before"?n=a:St=a)}return n!=null?n:St}var Ot=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(b){return b<=247?e.charAt(b):1424<=b&&b<=1524?"R":1536<=b&&b<=1785?t.charAt(b-1536):1774<=b&&b<=2220?"r":8192<=b&&b<=8203?"w":b==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,p=/[1n]/;function g(b,Z,te){this.level=b,this.from=Z,this.to=te}return function(b,Z){var te=Z=="ltr"?"L":"R";if(b.length==0||Z=="ltr"&&!n.test(b))return!1;for(var Se=b.length,ye=[],Ge=0;Ge<Se;++Ge)ye.push(i(b.charCodeAt(Ge)));for(var it=0,ft=te;it<Se;++it){var xt=ye[it];xt=="m"?ye[it]=ft:ft=xt}for(var Nt=0,wt=te;Nt<Se;++Nt){var Ft=ye[Nt];Ft=="1"&&wt=="r"?ye[Nt]="n":s.test(Ft)&&(wt=Ft,Ft=="r"&&(ye[Nt]="R"))}for(var qt=1,Yt=ye[0];qt<Se-1;++qt){var un=ye[qt];un=="+"&&Yt=="1"&&ye[qt+1]=="1"?ye[qt]="1":un==","&&Yt==ye[qt+1]&&(Yt=="1"||Yt=="n")&&(ye[qt]=Yt),Yt=un}for(var zn=0;zn<Se;++zn){var _i=ye[zn];if(_i==",")ye[zn]="N";else if(_i=="%"){var Qn=void 0;for(Qn=zn+1;Qn<Se&&ye[Qn]=="%";++Qn);for(var Hi=zn&&ye[zn-1]=="!"||Qn<Se&&ye[Qn]=="1"?"1":"N",ji=zn;ji<Qn;++ji)ye[ji]=Hi;zn=Qn-1}}for(var oi=0,Ui=te;oi<Se;++oi){var Ci=ye[oi];Ui=="L"&&Ci=="1"?ye[oi]="L":s.test(Ci)&&(Ui=Ci)}for(var mi=0;mi<Se;++mi)if(a.test(ye[mi])){var si=void 0;for(si=mi+1;si<Se&&a.test(ye[si]);++si);for(var ti=(mi?ye[mi-1]:te)=="L",Ii=(si<Se?ye[si]:te)=="L",er=ti==Ii?ti?"L":"R":te,ka=mi;ka<si;++ka)ye[ka]=er;mi=si-1}for(var Ri=[],sa,Ei=0;Ei<Se;)if(l.test(ye[Ei])){var Po=Ei;for(++Ei;Ei<Se&&l.test(ye[Ei]);++Ei);Ri.push(new g(0,Po,Ei))}else{var va=Ei,ja=Ri.length,Ua=Z=="rtl"?1:0;for(++Ei;Ei<Se&&ye[Ei]!="L";++Ei);for(var Ai=va;Ai<Ei;)if(p.test(ye[Ai])){va<Ai&&(Ri.splice(ja,0,new g(1,va,Ai)),ja+=Ua);var tr=Ai;for(++Ai;Ai<Ei&&p.test(ye[Ai]);++Ai);Ri.splice(ja,0,new g(2,tr,Ai)),ja+=Ua,va=Ai}else++Ai;va<Ei&&Ri.splice(ja,0,new g(1,va,Ei))}return Z=="ltr"&&(Ri[0].level==1&&(sa=b.match(/^\s+/))&&(Ri[0].from=sa[0].length,Ri.unshift(new g(0,0,sa[0].length))),pe(Ri).level==1&&(sa=b.match(/\s+$/))&&(pe(Ri).to-=sa[0].length,Ri.push(new g(0,Se-sa[0].length,Se)))),Z=="rtl"?Ri.reverse():Ri}}();function Ct(e,t){var i=e.order;return i==null&&(i=e.order=Ot(e.text,t)),i}var yt=[],De=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||yt).concat(i)}};function Ut(e,t){return e._handlers&&e._handlers[t]||yt}function kt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,a=n&&n[t];if(a){var s=Ae(a,i);s>-1&&(n[t]=a.slice(0,s).concat(a.slice(s+1)))}}}function Ue(e,t){var i=Ut(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),a=0;a<i.length;++a)i[a].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ue(e,i||t.type,e,t),U(t)||t.codemirrorIgnore}function G(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Ae(i,t[n])==-1&&i.push(t[n])}function q(e,t){return Ut(e,t).length>0}function Q(e){e.prototype.on=function(t,i){De(this,t,i)},e.prototype.off=function(t,i){kt(this,t,i)}}function w(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function S(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function U(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function I(e){w(e),S(e)}function de(e){return e.target||e.srcElement}function Ce(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 Re=function(){if(j&&x<9)return!1;var e=C("div");return"draggable"in e||"dragDrop"in e}(),bt;function rt(e){if(bt==null){var t=C("span","\u200B");y(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(bt=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&x<8))}var i=bt?C("span","\u200B"):C("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ge;function ut(e){if(ge!=null)return ge;var t=y(e,document.createTextNode("A\u062EA")),i=H(t,0,1).getBoundingClientRect(),n=H(t,1,2).getBoundingClientRect();return X(e),!i||i.left==i.right?!1:ge=n.right-i.right<3}var _t=`
|
|
|
|
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/)},et=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},Bt=function(){var e=C("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),qe=null;function zt(e){if(qe!=null)return qe;var t=y(e,C("span","x")),i=t.getBoundingClientRect(),n=H(t,0,1).getBoundingClientRect();return qe=Math.abs(i.left-n.left)>1}var It={},vt={};function Xt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),It[e]=t}function Lt(e,t){vt[e]=t}function Fe(e){if(typeof e=="string"&&vt.hasOwnProperty(e))e=vt[e];else if(e&&typeof e.name=="string"&&vt.hasOwnProperty(e.name)){var t=vt[e.name];typeof t=="string"&&(t={name:t}),e=He(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function st(e,t){t=Fe(t);var i=It[t.name];if(!i)return st(e,"text/plain");var n=i(e,t);if(tt.hasOwnProperty(t.name)){var a=tt[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 tt={};function dt(e,t){var i=tt.hasOwnProperty(e)?tt[e]:tt[e]={};m(t,i)}function Kt(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 Gt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function an(e,t,i){return e.startState?e.startState(t,i):!0}var 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.pos<this.string.length)return this.string.charAt(this.pos++)},Vt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Vt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},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.lastColumnPos<this.start&&(this.lastColumnValue=oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.indentation=function(){return oe(this.string,null,this.tabSize)-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},a=this.string.substr(this.pos,e.length);if(n(a)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},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 Et(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var a=i.children[n],s=a.chunkSize();if(t<s){i=a;break}t-=s}return i.lines[t]}function tn(e,t,i){var n=[],a=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;a==i.line&&(l=l.slice(0,i.ch)),a==t.line&&(l=l.slice(t.ch)),n.push(l),++a}),n}function jt(e,t,i){var n=[];return e.iter(t,i,function(a){n.push(a.text)}),n}function dn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function $t(e){if(e.parent==null)return null;for(var t=e.parent,i=Ae(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var a=0;!(n.children[a]==t);++a)i+=n.children[a].chunkSize();return i+t.first}function mn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var a=e.children[n],s=a.height;if(t<s){e=a;continue e}t-=s,i+=a.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var p=e.lines[l],g=p.height;if(t<g)break;t-=g}return i+l}function On(e,t){return t>=e.first&&t<e.first+e.size}function nn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ve(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ve))return new Ve(e,t,i);this.line=e,this.ch=t,this.sticky=i}function lt(e,t){return e.line-t.line||e.ch-t.ch}function gn(e,t){return e.sticky==t.sticky&<(e,t)==0}function yn(e){return Ve(e.line,e.ch)}function An(e,t){return lt(e,t)<0?t:e}function Kn(e,t){return lt(e,t)<0?e:t}function d(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function r(e,t){if(t.line<e.first)return Ve(e.first,0);var i=e.first+e.size-1;return t.line>i?Ve(i,Et(e,i).text.length):o(t,Et(e,t.line).text.length)}function o(e,t){var i=e.ch;return i==null||i>t?Ve(e.line,t):i<0?Ve(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=r(e,t[n]);return i}var v=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof v?new c(e,Kt(e.mode,t.state),i,t.lookAhead):new c(e,Kt(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Kt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new v(t,this.maxLookAhead):t};function ne(e,t,i,n){var a=[e.state.modeGen],s={};Tt(e,t.text,e.doc.mode,i,function(b,Z){return a.push(b,Z)},s,n);for(var l=i.state,p=function(b){i.baseTokens=a;var Z=e.state.overlays[b],te=1,Se=0;i.state=!0,Tt(e,t.text,Z.mode,i,function(ye,Ge){for(var it=te;Se<ye;){var ft=a[te];ft>ye&&a.splice(te,1,ye,a[te+1],ft),te+=2,Se=Math.min(ye,ft)}if(!Ge)return;if(Z.opaque)a.splice(it,te-it,ye,"overlay "+Ge),te=it+2;else for(;it<te;it+=2){var xt=a[it+1];a[it+1]=(xt?xt+" ":"")+"overlay "+Ge}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)p(g);return{styles:a,classes:s.bgClass||s.textClass?s:null}}function Ye(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=_e(e,$t(t)),a=t.text.length>e.options.maxHighlightLength&&Kt(e.doc.mode,n.state),s=ne(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 _e(e,t,i){var n=e.doc,a=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=Wt(e,t,i),l=s>n.first&&Et(n,s-1).stateAfter,p=l?c.fromSaved(n,l,s):new c(n,an(n.mode),s);return n.iter(s,t,function(g){Dt(e,g.text,p);var b=p.line;g.stateAfter=b==t-1||b%5==0||b>=a.viewFrom&&b<a.viewTo?p.save():null,p.nextLine()}),i&&(n.modeFrontier=p.line),p}function Dt(e,t,i,n){var a=e.doc.mode,s=new Vt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Ee(a,i.state);!s.eol();)ce(a,s,i.state),s.start=s.pos}function Ee(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Gt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function ce(e,t,i,n){for(var a=0;a<10;a++){n&&(n[0]=Gt(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var ze=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Rt(e,t,i,n){var a=e.doc,s=a.mode,l;t=r(a,t);var p=Et(a,t.line),g=_e(e,t.line,i),b=new Vt(p.text,e.options.tabSize,g),Z;for(n&&(Z=[]);(n||b.pos<t.ch)&&!b.eol();)b.start=b.pos,l=ce(s,b,g.state),n&&Z.push(new ze(b,l,Kt(a.mode,g.state)));return n?Z:new ze(b,l,g.state)}function Pt(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Tt(e,t,i,n,a,s,l){var p=i.flattenSpans;p==null&&(p=e.options.flattenSpans);var g=0,b=null,Z=new Vt(t,e.options.tabSize,n),te,Se=e.options.addModeClass&&[null];for(t==""&&Pt(Ee(i,n.state),s);!Z.eol();){if(Z.pos>e.options.maxHighlightLength?(p=!1,l&&Dt(e,t,n,Z.pos),Z.pos=t.length,te=null):te=Pt(ce(i,Z,n.state,Se),s),Se){var ye=Se[0].name;ye&&(te="m-"+(te?ye+" "+te:ye))}if(!p||b!=te){for(;g<Z.start;)g=Math.min(Z.start,g+5e3),a(g,b);b=te}Z.start=Z.pos}for(;g<Z.pos;){var Ge=Math.min(Z.pos,g+5e3);a(Ge,b),g=Ge}}function Wt(e,t,i){for(var n,a,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),p=t;p>l;--p){if(p<=s.first)return s.first;var g=Et(s,p-1),b=g.stateAfter;if(b&&(!i||p+(b instanceof v?b.lookAhead:0)<=s.modeFrontier))return p;var Z=oe(g.text,null,e.options.tabSize);(a==null||n>Z)&&(a=p-1,n=Z)}return a}function bn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var a=Et(e,n).stateAfter;if(a&&(!(a instanceof v)||n+a.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Fn=!1,En=!1;function Zt(){Fn=!0}function In(){En=!0}function li(e,t,i){this.marker=e,this.from=t,this.to=i}function Wn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function gi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Gn(e,t,i){var n;if(e)for(var a=0;a<e.length;++a){var s=e[a],l=s.marker,p=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(p||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var g=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new li(l,s.from,g?null:s.to))}}return n}function Xi(e,t,i){var n;if(e)for(var a=0;a<e.length;++a){var s=e[a],l=s.marker,p=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(p||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new li(l,g?null:s.from-t,s.to==null?null:s.to-t))}}return n}function ii(e,t){if(t.full)return null;var i=On(e,t.from.line)&&Et(e,t.from.line).markedSpans,n=On(e,t.to.line)&&Et(e,t.to.line).markedSpans;if(!i&&!n)return null;var a=t.from.ch,s=t.to.ch,l=lt(t.from,t.to)==0,p=Gn(i,a,l),g=Xi(n,s,l),b=t.text.length==1,Z=pe(t.text).length+(b?a:0);if(p)for(var te=0;te<p.length;++te){var Se=p[te];if(Se.to==null){var ye=Wn(g,Se.marker);ye?b&&(Se.to=ye.to==null?null:ye.to+Z):Se.to=a}}if(g)for(var Ge=0;Ge<g.length;++Ge){var it=g[Ge];if(it.to!=null&&(it.to+=Z),it.from==null){var ft=Wn(p,it.marker);ft||(it.from=Z,b&&(p||(p=[])).push(it))}else it.from+=Z,b&&(p||(p=[])).push(it)}p&&(p=Pi(p)),g&&g!=p&&(g=Pi(g));var xt=[p];if(!b){var Nt=t.text.length-2,wt;if(Nt>0&&p)for(var Ft=0;Ft<p.length;++Ft)p[Ft].to==null&&(wt||(wt=[])).push(new li(p[Ft].marker,null,null));for(var qt=0;qt<Nt;++qt)xt.push(wt);xt.push(g)}return xt}function Pi(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function $i(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ye){if(ye.markedSpans)for(var Ge=0;Ge<ye.markedSpans.length;++Ge){var it=ye.markedSpans[Ge].marker;it.readOnly&&(!n||Ae(n,it)==-1)&&(n||(n=[])).push(it)}}),!n)return null;for(var a=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],p=l.find(0),g=0;g<a.length;++g){var b=a[g];if(lt(b.to,p.from)<0||lt(b.from,p.to)>0)continue;var Z=[g,1],te=lt(b.from,p.from),Se=lt(b.to,p.to);(te<0||!l.inclusiveLeft&&!te)&&Z.push({from:b.from,to:p.from}),(Se>0||!l.inclusiveRight&&!Se)&&Z.push({from:p.to,to:b.to}),a.splice.apply(a,Z),g+=Z.length-3}return a}function la(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function na(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function on(e){return e.inclusiveLeft?-1:0}function hn(e){return e.inclusiveRight?1:0}function ui(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),a=t.find(),s=lt(n.from,a.from)||on(e)-on(t);if(s)return-s;var l=lt(n.to,a.to)||hn(e)-hn(t);return l||t.id-e.id}function Cn(e,t){var i=En&&e.markedSpans,n;if(i)for(var a=void 0,s=0;s<i.length;++s)a=i[s],a.marker.collapsed&&(t?a.from:a.to)==null&&(!n||ui(n,a.marker)<0)&&(n=a.marker);return n}function ci(e){return Cn(e,!0)}function Nn(e){return Cn(e,!1)}function ia(e,t){var i=En&&e.markedSpans,n;if(i)for(var a=0;a<i.length;++a){var s=i[a];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||ui(n,s.marker)<0)&&(n=s.marker)}return n}function Zn(e,t,i,n,a){var s=Et(e,t),l=En&&s.markedSpans;if(l)for(var p=0;p<l.length;++p){var g=l[p];if(!g.marker.collapsed)continue;var b=g.marker.find(0),Z=lt(b.from,i)||on(g.marker)-on(a),te=lt(b.to,n)||hn(g.marker)-hn(a);if(Z>=0&&te<=0||Z<=0&&te>=0)continue;if(Z<=0&&(g.marker.inclusiveRight&&a.inclusiveLeft?lt(b.to,i)>=0:lt(b.to,i)>0)||Z>=0&&(g.marker.inclusiveRight&&a.inclusiveLeft?lt(b.from,n)<=0:lt(b.from,n)<0))return!0}}function $n(e){for(var t;t=ci(e);)e=t.find(-1,!0).line;return e}function Yi(e){for(var t;t=Nn(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Nn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function aa(e,t){var i=Et(e,t),n=$n(i);return i==n?t:$t(n)}function Ra(e,t){if(t>e.lastLine())return t;var i=Et(e,t),n;if(!zi(e,i))return t;for(;n=Nn(i);)i=n.find(1,!0).line;return $t(i)+1}function zi(e,t){var i=En&&t.markedSpans;if(i)for(var n=void 0,a=0;a<i.length;++a){if(n=i[a],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&ra(e,t,n))return!0}}function ra(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return ra(e,n.line,Wn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var a=void 0,s=0;s<t.markedSpans.length;++s)if(a=t.markedSpans[s],a.marker.collapsed&&!a.marker.widgetNode&&a.from==i.to&&(a.to==null||a.to!=i.from)&&(a.marker.inclusiveLeft||i.marker.inclusiveRight)&&ra(e,t,a))return!0}function Ti(e){e=$n(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var a=i.lines[n];if(a==e)break;t+=a.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var p=s.children[l];if(p==i)break;t+=p.height}return t}function ua(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=ci(n);){var a=i.find(0,!0);n=a.from.line,t+=a.from.ch-a.to.ch}for(n=e;i=Nn(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function Rn(e){var t=e.display,i=e.doc;t.maxLine=Et(i,i.first),t.maxLineLength=ua(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var a=ua(n);a>t.maxLineLength&&(t.maxLineLength=a,t.maxLine=n)})}var Bi=function(e,t,i){this.text=e,na(this,t),this.height=i?i(this):1};Bi.prototype.lineNo=function(){return $t(this)},Q(Bi);function nr(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),na(e,i);var a=n?n(e):1;a!=e.height&&dn(e,a)}function Ia(e){e.parent=null,la(e)}var ca={},Pr={};function oa(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Pr:ca;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ba(e,t){var i=J("span",null,null,k?"padding-right: .1px":null),n={pre:J("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=en,ut(e.display.measure)&&(l=Ct(s,e.doc.direction))&&(n.addToken=cn(n.addToken,l)),n.map=[];var p=t!=e.display.externalMeasured&&$t(s);kn(s,n,Ye(e,s,p)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=F(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=F(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(rt(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(k){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ue(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Ht(e){var t=C("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,i,n,a,s,l){if(!t)return;var p=e.splitSpaces?Jt(t,e.trailingSpace):t,g=e.cm.state.specialChars,b=!1,Z;if(!g.test(t))e.col+=t.length,Z=document.createTextNode(p),e.map.push(e.pos,e.pos+t.length,Z),j&&x<9&&(b=!0),e.pos+=t.length;else{Z=document.createDocumentFragment();for(var te=0;;){g.lastIndex=te;var Se=g.exec(t),ye=Se?Se.index-te:t.length-te;if(ye){var Ge=document.createTextNode(p.slice(te,te+ye));j&&x<9?Z.appendChild(C("span",[Ge])):Z.appendChild(Ge),e.map.push(e.pos,e.pos+ye,Ge),e.col+=ye,e.pos+=ye}if(!Se)break;te+=ye+1;var it=void 0;if(Se[0]==" "){var ft=e.cm.options.tabSize,xt=ft-e.col%ft;it=Z.appendChild(C("span",A(xt),"cm-tab")),it.setAttribute("role","presentation"),it.setAttribute("cm-text"," "),e.col+=xt}else Se[0]=="\r"||Se[0]==`
|
|
`?(it=Z.appendChild(C("span",Se[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",Se[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(Se[0]),it.setAttribute("cm-text",Se[0]),j&&x<9?Z.appendChild(C("span",[it])):Z.appendChild(it),e.col+=1);e.map.push(e.pos,e.pos+1,it),e.pos++}}if(e.trailingSpace=p.charCodeAt(t.length-1)==32,i||n||a||b||s||l){var Nt=i||"";n&&(Nt+=n),a&&(Nt+=a);var wt=C("span",[Z],Nt,s);if(l)for(var Ft in l)l.hasOwnProperty(Ft)&&Ft!="style"&&Ft!="class"&&wt.setAttribute(Ft,l[Ft]);return e.content.appendChild(wt)}e.content.appendChild(Z)}function Jt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",a=0;a<e.length;a++){var s=e.charAt(a);s==" "&&i&&(a==e.length-1||e.charCodeAt(a+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function cn(e,t){return function(i,n,a,s,l,p,g){a=a?a+" cm-force-border":"cm-force-border";for(var b=i.pos,Z=b+n.length;;){for(var te=void 0,Se=0;Se<t.length&&!(te=t[Se],te.to>b&&te.from<=b);Se++);if(te.to>=Z)return e(i,n,a,s,l,p,g);e(i,n.slice(0,te.to-b),a,s,null,p,g),s=null,n=n.slice(te.to-b),b=te.to}}}function vn(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 kn(e,t,i){var n=e.markedSpans,a=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,a.slice(s,s=i[l]),oa(i[l+1],t.cm.options));return}for(var p=a.length,g=0,b=1,Z="",te,Se,ye=0,Ge,it,ft,xt,Nt;;){if(ye==g){Ge=it=ft=Se="",Nt=null,xt=null,ye=Infinity;for(var wt=[],Ft=void 0,qt=0;qt<n.length;++qt){var Yt=n[qt],un=Yt.marker;if(un.type=="bookmark"&&Yt.from==g&&un.widgetNode)wt.push(un);else if(Yt.from<=g&&(Yt.to==null||Yt.to>g||un.collapsed&&Yt.to==g&&Yt.from==g)){if(Yt.to!=null&&Yt.to!=g&&ye>Yt.to&&(ye=Yt.to,it=""),un.className&&(Ge+=" "+un.className),un.css&&(Se=(Se?Se+";":"")+un.css),un.startStyle&&Yt.from==g&&(ft+=" "+un.startStyle),un.endStyle&&Yt.to==ye&&(Ft||(Ft=[])).push(un.endStyle,Yt.to),un.title&&((Nt||(Nt={})).title=un.title),un.attributes)for(var zn in un.attributes)(Nt||(Nt={}))[zn]=un.attributes[zn];un.collapsed&&(!xt||ui(xt.marker,un)<0)&&(xt=Yt)}else Yt.from>g&&ye>Yt.from&&(ye=Yt.from)}if(Ft)for(var _i=0;_i<Ft.length;_i+=2)Ft[_i+1]==ye&&(it+=" "+Ft[_i]);if(!xt||xt.from==g)for(var Qn=0;Qn<wt.length;++Qn)vn(t,0,wt[Qn]);if(xt&&(xt.from||0)==g){if(vn(t,(xt.to==null?p+1:xt.to)-g,xt.marker,xt.from==null),xt.to==null)return;xt.to==g&&(xt=!1)}}if(g>=p)break;for(var Hi=Math.min(p,ye);;){if(Z){var ji=g+Z.length;if(!xt){var oi=ji>Hi?Z.slice(0,Hi-g):Z;t.addToken(t,oi,te?te+Ge:Ge,ft,g+oi.length==ye?it:"",Se,Nt)}if(ji>=Hi){Z=Z.slice(Hi-g),g=Hi;break}g=ji,ft=""}Z=a.slice(s,s=i[b++]),te=oa(i[b++],t.cm.options)}}}function fn(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?$t(pe(this.rest))-i+1:1,this.node=this.text=null,this.hidden=zi(e,t)}function Hn(e,t,i){for(var n=[],a,s=t;s<i;s=a){var l=new fn(e.doc,Et(e.doc,s),s);a=s+l.size,n.push(l)}return n}var ai=null;function sn(e){ai?ai.ops.push(e):e.ownsGroup=ai={ops:[e],delayedCallbacks:[]}}function da(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var a=e.ops[n];if(a.cursorActivityHandlers)for(;a.cursorActivityCalled<a.cursorActivityHandlers.length;)a.cursorActivityHandlers[a.cursorActivityCalled++].call(null,a.cm)}}while(i<t.length)}function xn(e,t){var i=e.ownsGroup;if(!i)return;try{da(i)}finally{ai=null,t(i)}}var qn=null;function Mn(e,t){var i=Ut(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),a;ai?a=ai.delayedCallbacks:qn?a=qn:(a=qn=[],setTimeout(Fi,0));for(var s=function(p){a.push(function(){return i[p].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Fi(){var e=qn;qn=null;for(var t=0;t<e.length;++t)e[t]()}function Pa(e,t,i,n){for(var a=0;a<t.changes.length;a++){var s=t.changes[a];s=="text"?ir(e,t):s=="gutter"?qi(e,t,i,n):s=="class"?Fa(e,t):s=="widget"&&eo(e,t,n)}t.changes=null}function Ta(e){return e.node==e.text&&(e.node=C("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),j&&x<8&&(e.node.style.zIndex=2)),e.node}function qr(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=Ta(t);t.background=n.insertBefore(C("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Tr(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Ba(e,t)}function ir(e,t){var i=t.text.className,n=Tr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Fa(e,t)):i&&(t.text.className=i)}function Fa(e,t){qr(e,t),t.line.wrapClass?Ta(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function qi(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=Ta(t);t.gutterBackground=C("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=Ta(t),p=t.gutter=C("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(p),l.insertBefore(p,t.text),t.line.gutterClass&&(p.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=p.appendChild(C("div",nn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var g=0;g<e.display.gutterSpecs.length;++g){var b=e.display.gutterSpecs[g].className,Z=s.hasOwnProperty(b)&&s[b];Z&&p.appendChild(C("div",[Z],"CodeMirror-gutter-elt","left: "+n.gutterLeft[b]+"px; width: "+n.gutterWidth[b]+"px"))}}}function eo(e,t,i){t.alignable&&(t.alignable=null);for(var n=$("CodeMirror-linewidget"),a=t.node.firstChild,s=void 0;a;a=s)s=a.nextSibling,n.test(a.className)&&t.node.removeChild(a);Or(e,t,i)}function to(e,t,i,n){var a=Tr(e,t);return t.text=t.node=a.pre,a.bgClass&&(t.bgClass=a.bgClass),a.textClass&&(t.textClass=a.textClass),Fa(e,t),qi(e,t,i,n),Or(e,t,n),t.node}function Or(e,t,i){if(Ar(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Ar(e,t.rest[n],t,i,!1)}function Ar(e,t,i,n,a){if(!t.widgets)return;for(var s=Ta(i),l=0,p=t.widgets;l<p.length;++l){var g=p[l],b=C("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||b.setAttribute("cm-ignore-events","true"),Oa(g,b,i,n),e.display.input.setUneditable(b),a&&g.above?s.insertBefore(b,i.gutter||i.text):s.appendChild(b),Mn(g,"redraw")}}function Oa(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var a=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(a-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=a+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ya(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),y(t.display.measure,C("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Ji(e,t){for(var i=de(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function ha(e){return e.lineSpace.offsetTop}function ar(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function rr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=y(e.measure,C("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Qi(e){return Xe-e.display.nativeBarWidth}function fa(e){return e.display.scroller.clientWidth-Qi(e)-e.display.barWidth}function Aa(e){return e.display.scroller.clientHeight-Qi(e)-e.display.barHeight}function no(e,t,i){var n=e.options.lineWrapping,a=n&&fa(e);if(!t.measure.heights||n&&t.measure.width!=a){var s=t.measure.heights=[];if(n){t.measure.width=a;for(var l=t.text.firstChild.getClientRects(),p=0;p<l.length-1;p++){var g=l[p],b=l[p+1];Math.abs(g.bottom-b.bottom)>2&&s.push((g.bottom+b.top)/2-i.top)}}s.push(i.bottom-i.top)}}function Mr(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var a=0;a<e.rest.length;a++)if($t(e.rest[a])>i)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function or(e,t){t=$n(t);var i=$t(t),n=e.display.externalMeasured=new fn(e.doc,t,i);n.lineN=i;var a=n.built=Ba(e,n);return n.text=a.pre,y(e.display.lineMeasure,a.pre),n}function Wa(e,t,i,n){return Ne(e,at(e,t),i,n)}function ht(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ma(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function at(e,t){var i=$t(t),n=ht(e,i);n&&!n.text?n=null:n&&n.changes&&(Pa(e,n,i,ri(e)),e.curOp.forceUpdate=!0),n||(n=or(e,t));var a=Mr(n,t,i);return{line:t,view:n,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function Ne(e,t,i,n,a){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(no(e,t.view,t.rect),t.hasHeights=!0),l=Mt(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:a?l.rtop:l.top,bottom:a?l.rbottom:l.bottom}}var Me={left:0,right:0,top:0,bottom:0};function pt(e,t,i){for(var n,a,s,l,p,g,b=0;b<e.length;b+=3)if(p=e[b],g=e[b+1],t<p?(a=0,s=1,l="left"):t<g?(a=t-p,s=a+1):(b==e.length-3||t==g&&e[b+3]>t)&&(s=g-p,a=s-1,t>=g&&(l="right")),a!=null){if(n=e[b+2],p==g&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&a==0)for(;b&&e[b-2]==e[b-3]&&e[b-1].insertLeft;)n=e[(b-=3)+2],l="left";if(i=="right"&&a==g-p)for(;b<e.length-3&&e[b+3]==e[b+4]&&!e[b+5].insertLeft;)n=e[(b+=3)+2],l="right";break}return{node:n,start:a,end:s,collapse:l,coverStart:p,coverEnd:g}}function gt(e,t){var i=Me;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var a=e.length-1;a>=0&&!((i=e[a]).left!=i.right);a--);return i}function Mt(e,t,i,n){var a=pt(t.map,i,n),s=a.node,l=a.start,p=a.end,g=a.collapse,b;if(s.nodeType==3){for(var Z=0;Z<4;Z++){for(;l&&$e(t.line.text.charAt(a.coverStart+l));)--l;for(;a.coverStart+p<a.coverEnd&&$e(t.line.text.charAt(a.coverStart+p));)++p;if(j&&x<9&&l==0&&p==a.coverEnd-a.coverStart?b=s.parentNode.getBoundingClientRect():b=gt(H(s,l,p).getClientRects(),n),b.left||b.right||l==0)break;p=l,l=l-1,g="right"}j&&x<11&&(b=Qt(e.display.measure,b))}else{l>0&&(g=n="right");var te;e.options.lineWrapping&&(te=s.getClientRects()).length>1?b=te[n=="right"?te.length-1:0]:b=s.getBoundingClientRect()}if(j&&x<9&&!l&&(!b||!b.left&&!b.right)){var Se=s.parentNode.getClientRects()[0];Se?b={left:Se.left,right:Se.left+jn(e.display),top:Se.top,bottom:Se.bottom}:b=Me}for(var ye=b.top-t.rect.top,Ge=b.bottom-t.rect.top,it=(ye+Ge)/2,ft=t.view.measure.heights,xt=0;xt<ft.length-1&&!(it<ft[xt]);xt++);var Nt=xt?ft[xt-1]:0,wt=ft[xt],Ft={left:(g=="right"?b.right:b.left)-t.rect.left,right:(g=="left"?b.left:b.right)-t.rect.left,top:Nt,bottom:wt};return!b.left&&!b.right&&(Ft.bogus=!0),e.options.singleCursorHeightPerLine||(Ft.rtop=ye,Ft.rbottom=Ge),Ft}function Qt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!zt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function rn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Pn(e){e.display.externalMeasure=null,X(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rn(e.display.view[t])}function _n(e){Pn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ln(){return N&&W?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function wn(){return N&&W?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ei(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ya(e.widgets[i]));return t}function Yn(e,t,i,n,a){if(!a){var s=ei(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Ti(t);if(n=="local"?l+=ha(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var p=e.display.lineSpace.getBoundingClientRect();l+=p.top+(n=="window"?0:wn());var g=p.left+(n=="window"?0:Ln());i.left+=g,i.right+=g}return i.top+=l,i.bottom+=l,i}function Jn(e,t,i){if(i=="div")return t;var n=t.left,a=t.top;if(i=="page")n-=Ln(),a-=wn();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,a+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:a-l.top}}function vi(e,t,i,n,a){return n||(n=Et(e.doc,t.line)),Yn(e,n,Wa(e,n,t.ch,a),i)}function Dn(e,t,i,n,a,s){n=n||Et(e.doc,t.line),a||(a=at(e,n));function l(Ge,it){var ft=Ne(e,a,Ge,it?"right":"left",s);return it?ft.left=ft.right:ft.right=ft.left,Yn(e,n,ft,i)}var p=Ct(n,e.doc.direction),g=t.ch,b=t.sticky;if(g>=n.text.length?(g=n.text.length,b="before"):g<=0&&(g=0,b="after"),!p)return l(b=="before"?g-1:g,b=="before");function Z(Ge,it,ft){var xt=p[it],Nt=xt.level==1;return l(ft?Ge-1:Ge,Nt!=ft)}var te=ct(p,g,b),Se=St,ye=Z(g,te,b=="before");return Se!=null&&(ye.other=Z(g,Se,b!="before")),ye}function di(e,t){var i=0;t=r(e.doc,t),e.options.lineWrapping||(i=jn(e.display)*t.ch);var n=Et(e.doc,t.line),a=Ti(n)+ha(e.display);return{left:i,right:i,top:a,bottom:a+n.height}}function hi(e,t,i,n,a){var s=Ve(e,t,i);return s.xRel=a,n&&(s.outside=n),s}function wi(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return hi(n.first,0,null,-1,-1);var a=mn(n,i),s=n.first+n.size-1;if(a>s)return hi(n.first+n.size-1,Et(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=Et(n,a);;){var p=Si(e,l,a,t,i),g=ia(l,p.ch+(p.xRel>0||p.outside>0?1:0));if(!g)return p;var b=g.find(1);if(b.line==a)return b;l=Et(n,a=b.line)}}function ln(e,t,i,n){n-=ei(t);var a=t.text.length,s=At(function(l){return Ne(e,i,l-1).bottom<=n},a,0);return a=At(function(l){return Ne(e,i,l).top>n},s,a),{begin:s,end:a}}function pn(e,t,i,n){i||(i=at(e,t));var a=Yn(e,t,Ne(e,i,n),"line").top;return ln(e,t,i,a)}function Vn(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Si(e,t,i,n,a){a-=Ti(t);var s=at(e,t),l=ei(t),p=0,g=t.text.length,b=!0,Z=Ct(t,e.doc.direction);if(Z){var te=(e.options.lineWrapping?Mi:fi)(e,t,i,s,Z,n,a);b=te.level!=1,p=b?te.from:te.to-1,g=b?te.to:te.from-1}var Se=null,ye=null,Ge=At(function(qt){var Yt=Ne(e,s,qt);return Yt.top+=l,Yt.bottom+=l,Vn(Yt,n,a,!1)?(Yt.top<=a&&Yt.left<=n&&(Se=qt,ye=Yt),!0):!1},p,g),it,ft,xt=!1;if(ye){var Nt=n-ye.left<ye.right-n,wt=Nt==b;Ge=Se+(wt?0:1),ft=wt?"after":"before",it=Nt?ye.left:ye.right}else{!b&&(Ge==g||Ge==p)&&Ge++,ft=Ge==0?"after":Ge==t.text.length?"before":Ne(e,s,Ge-(b?1:0)).bottom+l<=a==b?"after":"before";var Ft=Dn(e,Ve(i,Ge,ft),"line",t,s);it=Ft.left,xt=a<Ft.top?-1:a>=Ft.bottom?1:0}return Ge=Ke(t.text,Ge,1),hi(i,Ge,ft,xt,n-it)}function fi(e,t,i,n,a,s,l){var p=At(function(te){var Se=a[te],ye=Se.level!=1;return Vn(Dn(e,Ve(i,ye?Se.to:Se.from,ye?"before":"after"),"line",t,n),s,l,!0)},0,a.length-1),g=a[p];if(p>0){var b=g.level!=1,Z=Dn(e,Ve(i,b?g.from:g.to,b?"after":"before"),"line",t,n);Vn(Z,s,l,!0)&&Z.top>l&&(g=a[p-1])}return g}function Mi(e,t,i,n,a,s,l){var p=ln(e,t,n,l),g=p.begin,b=p.end;/\s/.test(t.text.charAt(b-1))&&b--;for(var Z=null,te=null,Se=0;Se<a.length;Se++){var ye=a[Se];if(ye.from>=b||ye.to<=g)continue;var Ge=ye.level!=1,it=Ne(e,n,Ge?Math.min(b,ye.to)-1:Math.max(g,ye.from)).right,ft=it<s?s-it+1e9:it-s;(!Z||te>ft)&&(Z=ye,te=ft)}return Z||(Z=a[a.length-1]),Z.from<g&&(Z={from:g,to:Z.to,level:Z.level}),Z.to>b&&(Z={from:Z.from,to:b,level:Z.level}),Z}var pi;function Sn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pi==null){pi=C("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pi.appendChild(document.createTextNode("x")),pi.appendChild(C("br"));pi.appendChild(document.createTextNode("x"))}y(e.measure,pi);var i=pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),X(e.measure),i||1}function jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=C("span","xxxxxxxxxx"),i=C("pre",[t],"CodeMirror-line-like");y(e.measure,i);var n=t.getBoundingClientRect(),a=(n.right-n.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function ri(e){for(var t=e.display,i={},n={},a=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var p=e.display.gutterSpecs[l].className;i[p]=s.offsetLeft+s.clientLeft+a,n[p]=s.clientWidth}return{fixedPos:Ki(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Ki(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Li(e){var t=Sn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/jn(e.display)-3);return function(a){if(zi(e.doc,a))return 0;var s=0;if(a.widgets)for(var l=0;l<a.widgets.length;l++)a.widgets[l].height&&(s+=a.widgets[l].height);return i?s+(Math.ceil(a.text.length/n)||1)*t:s+t}}function Zi(e){var t=e.doc,i=Li(e);t.iter(function(n){var a=i(n);a!=n.height&&dn(n,a)})}function pa(e,t,i,n){var a=e.display;if(!i&&de(t).getAttribute("cm-not-content")=="true")return null;var s,l,p=a.lineSpace.getBoundingClientRect();try{s=t.clientX-p.left,l=t.clientY-p.top}catch(te){return null}var g=wi(e,s,l),b;if(n&&g.xRel>0&&(b=Et(e.doc,g.line).text).length==g.ch){var Z=oe(b,b.length,e.options.tabSize)-b.length;g=Ve(g.line,Math.max(0,Math.round((s-rr(e.display).left)/jn(e.display))-Z))}return g}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;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Di(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var a=e.display;if(n&&i<a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>t)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)En&&aa(e.doc,t)<a.viewTo&&_a(e);else if(i<=a.viewFrom)En&&Ra(e.doc,i+n)>a.viewFrom?_a(e):(a.viewFrom+=n,a.viewTo+=n);else if(t<=a.viewFrom&&i>=a.viewTo)_a(e);else if(t<=a.viewFrom){var s=Lr(e,i,i+n,1);s?(a.view=a.view.slice(s.index),a.viewFrom=s.lineN,a.viewTo+=n):_a(e)}else if(i>=a.viewTo){var l=Lr(e,t,t,-1);l?(a.view=a.view.slice(0,l.index),a.viewTo=l.lineN):_a(e)}else{var p=Lr(e,t,t,-1),g=Lr(e,i,i+n,1);p&&g?(a.view=a.view.slice(0,p.index).concat(Hn(e,p.lineN,g.lineN)).concat(a.view.slice(g.index)),a.viewTo+=n):_a(e)}var b=a.externalMeasured;b&&(i<b.lineN?b.lineN+=n:t<b.lineN+b.size&&(a.externalMeasured=null))}function ba(e,t,i){e.curOp.viewChanged=!0;var n=e.display,a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[ma(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Ae(l,i)==-1&&l.push(i)}function _a(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Lr(e,t,i,n){var a=ma(e,t),s,l=e.display.view;if(!En||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var p=e.display.viewFrom,g=0;g<a;g++)p+=l[g].size;if(p!=t){if(n>0){if(a==l.length-1)return null;s=p+l[a].size-t,a++}else s=p-t;t+=s,i+=s}for(;aa(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 Vs(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.viewFrom<t&&(n.view=n.view.slice(ma(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Hn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,ma(e,i)))),n.viewTo=i}function Oo(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var a=t[n];!a.hidden&&(!a.node||a.changes)&&++i}return i}function sr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ao(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},a=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var p=i.sel.ranges[l];if(p.from().line>=e.display.viewTo||p.to().line<e.display.viewFrom)continue;var g=p.empty();(g||e.options.showCursorWhenSelecting)&&Mo(e,p.head,a),g||Xs(e,p,s)}return n}function Mo(e,t,i){var n=Dn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=i.appendChild(C("div","\xA0","CodeMirror-cursor"));if(a.style.left=n.left+"px",a.style.top=n.top+"px",a.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(C("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Dr(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,a=e.doc,s=document.createDocumentFragment(),l=rr(e.display),p=l.left,g=Math.max(n.sizerWidth,fa(e)-n.sizer.offsetLeft)-l.right,b=a.direction=="ltr";function Z(wt,Ft,qt,Yt){Ft<0&&(Ft=0),Ft=Math.round(Ft),Yt=Math.round(Yt),s.appendChild(C("div",null,"CodeMirror-selected","position: absolute; left: "+wt+`px;
|
|
top: `+Ft+"px; width: "+(qt==null?g-wt:qt)+`px;
|
|
height: `+(Yt-Ft)+"px"))}function te(wt,Ft,qt){var Yt=Et(a,wt),un=Yt.text.length,zn,_i;function Qn(oi,Ui){return vi(e,Ve(wt,oi),"div",Yt,Ui)}function Hi(oi,Ui,Ci){var mi=pn(e,Yt,null,oi),si=Ui=="ltr"==(Ci=="after")?"left":"right",ti=Ci=="after"?mi.begin:mi.end-(/\s/.test(Yt.text.charAt(mi.end-1))?2:1);return Qn(ti,si)[si]}var ji=Ct(Yt,a.direction);return mt(ji,Ft||0,qt==null?un:qt,function(oi,Ui,Ci,mi){var si=Ci=="ltr",ti=Qn(oi,si?"left":"right"),Ii=Qn(Ui-1,si?"right":"left"),er=Ft==null&&oi==0,ka=qt==null&&Ui==un,Ri=mi==0,sa=!ji||mi==ji.length-1;if(Ii.top-ti.top<=3){var Ei=(b?er:ka)&&Ri,Po=(b?ka:er)&&sa,va=Ei?p:(si?ti:Ii).left,ja=Po?g:(si?Ii:ti).right;Z(va,ti.top,ja-va,ti.bottom)}else{var Ua,Ai,tr,To;si?(Ua=b&&er&&Ri?p:ti.left,Ai=b?g:Hi(oi,Ci,"before"),tr=b?p:Hi(Ui,Ci,"after"),To=b&&ka&&sa?g:Ii.right):(Ua=b?Hi(oi,Ci,"before"):p,Ai=!b&&er&&Ri?g:ti.right,tr=!b&&ka&&sa?p:Ii.left,To=b?Hi(Ui,Ci,"after"):g),Z(Ua,ti.top,Ai-Ua,ti.bottom),ti.bottom<Ii.top&&Z(p,ti.bottom,null,Ii.top),Z(tr,Ii.top,To-tr,Ii.bottom)}(!zn||Dr(ti,zn)<0)&&(zn=ti),Dr(Ii,zn)<0&&(zn=Ii),(!_i||Dr(ti,_i)<0)&&(_i=ti),Dr(Ii,_i)<0&&(_i=Ii)}),{start:zn,end:_i}}var Se=t.from(),ye=t.to();if(Se.line==ye.line)te(Se.line,Se.ch,ye.ch);else{var Ge=Et(a,Se.line),it=Et(a,ye.line),ft=$n(Ge)==$n(it),xt=te(Se.line,Se.ch,ft?Ge.text.length+1:null).end,Nt=te(ye.line,ft?0:null,ye.ch).start;ft&&(xt.top<Nt.top-2?(Z(xt.right,xt.top,null,xt.bottom),Z(p,Nt.top,Nt.left,Nt.bottom)):Z(xt.right,xt.top,Nt.left-xt.right,xt.bottom)),xt.bottom<Nt.top&&Z(p,xt.bottom,null,Nt.top)}i.appendChild(s)}function io(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ha(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Lo(e){e.state.focused||(e.display.input.focus(),ao(e))}function Do(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ha(e))},100)}function ao(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,ie(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),io(e)}function Ha(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,h(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Nr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var a=t.view[n],s=e.options.lineWrapping,l=void 0,p=0;if(a.hidden)continue;if(j&&x<8){var g=a.node.offsetTop+a.node.offsetHeight;l=g-i,i=g}else{var b=a.node.getBoundingClientRect();l=b.bottom-b.top,!s&&a.text.firstChild&&(p=a.text.firstChild.getBoundingClientRect().right-b.left-1)}var Z=a.line.height-l;if((Z>.005||Z<-.005)&&(dn(a.line,l),No(a.line),a.rest))for(var te=0;te<a.rest.length;te++)No(a.rest[te]);if(p>e.display.sizerWidth){var Se=Math.ceil(p/jn(e.display));Se>e.display.maxLineLength&&(e.display.maxLineLength=Se,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}function No(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function jr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-ha(e));var a=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=mn(t,n),l=mn(t,a);if(i&&i.ensure){var p=i.ensure.from.line,g=i.ensure.to.line;p<s?(s=p,l=mn(t,Ti(Et(t,p))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=l&&(s=mn(t,Ti(Et(t,g))-e.wrapper.clientHeight),l=g)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),a=null;if(t.top+n.top<0?a=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!L){var s=C("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-ha(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Qi(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?Ve(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ve(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,p=Dn(e,t),g=!i||i==t?p:Dn(e,i);a={left:Math.min(p.left,g.left),top:Math.min(p.top,g.top)-n,right:Math.max(p.left,g.left),bottom:Math.max(p.bottom,g.bottom)+n};var b=ro(e,a),Z=e.doc.scrollTop,te=e.doc.scrollLeft;if(b.scrollTop!=null&&(ur(e,b.scrollTop),Math.abs(e.doc.scrollTop-Z)>1&&(l=!0)),b.scrollLeft!=null&&(Ma(e,b.scrollLeft),Math.abs(e.doc.scrollLeft-te)>1&&(l=!0)),!l)break}return a}function Js(e,t){var i=ro(e,t);i.scrollTop!=null&&ur(e,i.scrollTop),i.scrollLeft!=null&&Ma(e,i.scrollLeft)}function ro(e,t){var i=e.display,n=Sn(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=Aa(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var p=e.doc.height+ar(i),g=t.top<n,b=t.bottom>p-n;if(t.top<a)l.scrollTop=g?0:t.top;else if(t.bottom>a+s){var Z=Math.min(t.top,(b?p:t.bottom)-s);Z!=a&&(l.scrollTop=Z)}var te=e.options.fixedGutter?0:i.gutters.offsetWidth,Se=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-te,ye=fa(e)-i.gutters.offsetWidth,Ge=t.right-t.left>ye;return Ge&&(t.right=t.left+ye),t.left<10?l.scrollLeft=0:t.left<Se?l.scrollLeft=Math.max(0,t.left+te-(Ge?0:10)):t.right>ye+Se-3&&(l.scrollLeft=t.right+(Ge?0:10)-ye),l}function oo(e,t){if(t==null)return;Ur(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function za(e){Ur(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function lr(e,t,i){(t!=null||i!=null)&&Ur(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qs(e,t){Ur(e),e.curOp.scrollToPos=t}function Ur(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=di(e,t.from),n=di(e,t.to);jo(e,i,n,t.margin)}}function jo(e,t,i,n){var a=ro(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});lr(e,a.scrollLeft,a.scrollTop)}function ur(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;re||lo(e,{top:t}),Uo(e,t,!0),re&&lo(e),hr(e,100)}function Uo(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 Ma(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,Ho(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function cr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+ar(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+Qi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var La=function(e,t,i){this.cm=i;var n=this.vert=C("div",[C("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=C("div",[C("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=a.tabIndex=-1,e(n),e(a),De(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),De(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,j&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};La.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}},La.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},La.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},La.prototype.zeroWidthHack=function(){var e=_&&!K?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Be,this.disableVert=new Be},La.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)},La.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var dr=function(){};dr.prototype.update=function(){return{bottom:0,right:0}},dr.prototype.setScrollLeft=function(){},dr.prototype.setScrollTop=function(){},dr.prototype.clear=function(){};function Ka(e,t){t||(t=cr(e));var i=e.display.barWidth,n=e.display.barHeight;Io(e,t);for(var a=0;a<4&&i!=e.display.barWidth||n!=e.display.barHeight;a++)i!=e.display.barWidth&&e.options.lineWrapping&&Nr(e),Io(e,cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Io(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 Bo={native:La,null:dr};function Fo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&h(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Bo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),De(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"?Ma(e,t):ur(e,t)},e),e.display.scrollbars.addClass&&ie(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=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:++Zs},sn(e.curOp)}function Na(e){var t=e.curOp;t&&xn(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var a=0;a<t.length;a++)nl(t[a]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)al(t[l])}function el(e){var t=e.cm,i=t.display;ol(t),e.updateMaxLine&&Rn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ir(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&so(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Nr(t),e.barMeasure=cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Wa(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+Qi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-fa(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ma(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==R();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ka(t,e.barMeasure),e.updatedDisplay&&co(t,e.barMeasure),e.selectionChanged&&io(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Lo(e.cm)}function al(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Wo(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Uo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ma(t,e.scrollLeft,!0,!0),e.scrollToPos){var a=Ys(t,r(n,e.scrollToPos.from),r(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,a)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var p=0;p<s.length;++p)s[p].lines.length||Ue(s[p],"hide");if(l)for(var g=0;g<l.length;++g)l[g].lines.length&&Ue(l[g],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ue(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wi(e,t){if(e.curOp)return t();Da(e);try{return t()}finally{Na(e)}}function yi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Da(e);try{return t.apply(e,arguments)}finally{Na(e)}}}function Oi(e){return function(){if(this.curOp)return e.apply(this,arguments);Da(this);try{return e.apply(this,arguments)}finally{Na(this)}}}function bi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Da(t);try{return e.apply(this,arguments)}finally{Na(t)}}}function hr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,O(rl,e))}function rl(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=_e(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,p=s.text.length>e.options.maxHighlightLength?Kt(t.mode,n.state):null,g=ne(e,s,n,!0);p&&(n.state=p),s.styles=g.styles;var b=s.styleClasses,Z=g.classes;Z?s.styleClasses=Z:b&&(s.styleClasses=null);for(var te=!l||l.length!=s.styles.length||b!=Z&&(!b||!Z||b.bgClass!=Z.bgClass||b.textClass!=Z.textClass),Se=0;!te&&Se<l.length;++Se)te=l[Se]!=s.styles[Se];te&&a.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&Dt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return hr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),a.length&&Wi(e,function(){for(var s=0;s<a.length;s++)ba(e,a[s],"text")})}var Ir=function(e,t,i){var n=e.display;this.viewport=t,this.visible=jr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=fa(e),this.force=i,this.dims=ri(e),this.events=[]};Ir.prototype.signal=function(e,t){q(e,t)&&this.events.push(arguments)},Ir.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ue.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Qi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Qi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=R();if(!t||!E(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&E(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==R())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function so(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return _a(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Oo(e)==0)return!1;zo(e)&&(_a(e),t.dims=ri(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.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(a,i.viewTo)),En&&(s=aa(e.doc,s),l=Ra(e.doc,l));var p=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,s,l),i.viewOffset=Ti(Et(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=Oo(e);if(!p&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var b=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(b),X(i.cursorDiv),X(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,p&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,hr(e,400)),i.updateLineNumbers=null,!0}function Wo(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==fa(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ar(e.display)-Aa(e),i.top)}),t.visible=jr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=jr(e.display,e.doc,i));if(!so(e,t))break;Nr(e);var a=cr(e);sr(e),Ka(e,a),co(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 lo(e,t){var i=new Ir(e,t);if(so(e,i)){Nr(e),Wo(e,i);var n=cr(e);sr(e),Ka(e,n),co(e,n),i.finish()}}function ul(e,t,i){var n=e.display,a=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function p(Ge){var it=Ge.nextSibling;return k&&_&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),it}for(var g=n.view,b=n.viewFrom,Z=0;Z<g.length;Z++){var te=g[Z];if(!te.hidden)if(!te.node||te.node.parentNode!=s){var Se=to(e,te,b,i);s.insertBefore(Se,l)}else{for(;l!=te.node;)l=p(l);var ye=a&&t!=null&&t<=b&&te.lineNumber;te.changes&&(Ae(te.changes,"gutter")>-1&&(ye=!1),Pa(e,te,b,i)),ye&&(X(te.lineNumber),te.lineNumber.appendChild(document.createTextNode(nn(e.options,b)))),l=te.node.nextSibling}b+=te.size}for(;l;)l=p(l)}function uo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function co(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+Qi(e)+"px"}function Ho(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Ki(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var p=i[l].alignable;if(p)for(var g=0;g<p.length;g++)p[g].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+a+"px")}function zo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=nn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var a=n.measure.appendChild(C("div",[C("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=a.firstChild.offsetWidth,l=a.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",uo(e.display),!0}return!1}function ho(e,t){for(var i=[],n=!1,a=0;a<e.length;a++){var s=e[a],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ko(e){var t=e.gutters,i=e.gutterSpecs;X(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var a=i[n],s=a.className,l=a.style,p=t.appendChild(C("div",null,"CodeMirror-gutter "+s));l&&(p.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=p,p.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",uo(e)}function fr(e){Ko(e.display),Di(e),Ho(e)}function cl(e,t,i,n){var a=this;this.input=i,a.scrollbarFiller=C("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=C("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=J("div",null,"CodeMirror-code"),a.selectionDiv=C("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=C("div",null,"CodeMirror-cursors"),a.measure=C("div",null,"CodeMirror-measure"),a.lineMeasure=C("div",null,"CodeMirror-measure"),a.lineSpace=J("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var s=J("div",[a.lineSpace],"CodeMirror-lines");a.mover=C("div",[s],null,"position: relative"),a.sizer=C("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=C("div",null,null,"position: absolute; height: "+Xe+"px; width: 1px;"),a.gutters=C("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=C("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=C("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),j&&x<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!k&&!(re&&Y)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=ho(n.gutters,n.lineNumbers),Ko(a),i.init(a)}var Br=0,Gi=null;j?Gi=-.53:re?Gi=15:N?Gi=-.7:ee&&(Gi=-1/3);function Go(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Go(e);return t.x*=Gi,t.y*=Gi,t}function Vo(e,t){var i=Go(t),n=i.x,a=i.y,s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&p||a&&g))return;if(a&&_&&k){e:for(var b=t.target,Z=s.view;b!=l;b=b.parentNode)for(var te=0;te<Z.length;te++)if(Z[te].node==b){e.display.currentWheelTarget=b;break e}}if(n&&!re&&!T&&Gi!=null){a&&g&&ur(e,Math.max(0,l.scrollTop+a*Gi)),Ma(e,Math.max(0,l.scrollLeft+n*Gi)),(!a||a&&g)&&w(t),s.wheelStartX=null;return}if(a&&Gi!=null){var Se=a*Gi,ye=e.doc.scrollTop,Ge=ye+s.wrapper.clientHeight;Se<0?ye=Math.max(0,ye+Se-50):Ge=Math.min(e.doc.height,Ge+Se+50),lo(e,{top:ye,bottom:Ge})}Br<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX==null)return;var it=l.scrollLeft-s.wheelStartX,ft=l.scrollTop-s.wheelStartY,xt=ft&&s.wheelDY&&ft/s.wheelDY||it&&s.wheelDX&&it/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!xt)return;Gi=(Gi*Br+xt)/(Br+1),++Br},200)):(s.wheelDX+=n,s.wheelDY+=a))}var Vi=function(e,t){this.ranges=e,this.primIndex=t};Vi.prototype.primary=function(){return this.ranges[this.primIndex]},Vi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!gn(i.anchor,n.anchor)||!gn(i.head,n.head))return!1}return!0},Vi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Tn(yn(this.ranges[t].anchor),yn(this.ranges[t].head));return new Vi(e,this.primIndex)},Vi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vi.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(lt(t,n.from())>=0&<(e,n.to())<=0)return i}return-1};var Tn=function(e,t){this.anchor=e,this.head=t};Tn.prototype.from=function(){return Kn(this.anchor,this.head)},Tn.prototype.to=function(){return An(this.anchor,this.head)},Tn.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(Se,ye){return lt(Se.from(),ye.from())}),i=Ae(t,a);for(var s=1;s<t.length;s++){var l=t[s],p=t[s-1],g=lt(p.to(),l.from());if(n&&!l.empty()?g>0:g>=0){var b=Kn(p.from(),l.from()),Z=An(p.to(),l.to()),te=p.empty()?l.from()==l.head:p.from()==p.head;s<=i&&--i,t.splice(--s,2,new Tn(te?Z:b,te?b:Z))}}return new Vi(t,i)}function Ea(e,t){return new Vi([new Tn(e,t||e)],0)}function Ca(e){return e.text?Ve(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Xo(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return Ca(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+=Ca(t).ch-t.to.ch),Ve(i,n)}function fo(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var a=e.sel.ranges[n];i.push(new Tn(Xo(a.anchor,t),Xo(a.head,t)))}return ea(e.cm,i,e.sel.primIndex)}function $o(e,t,i){return e.line==t.line?Ve(i.line,e.ch-t.ch+i.ch):Ve(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],a=Ve(e.first,0),s=a,l=0;l<t.length;l++){var p=t[l],g=$o(p.from,a,s),b=$o(Ca(p),a,s);if(a=p.to,s=b,i=="around"){var Z=e.sel.ranges[l],te=lt(Z.head,Z.anchor)<0;n[l]=new Tn(te?b:g,te?g:b)}else n[l]=new Tn(g,g)}return new Vi(n,e.sel.primIndex)}function po(e){e.doc.mode=st(e.options,e.doc.modeOption),pr(e)}function pr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,hr(e,100),e.state.modeGen++,e.curOp&&Di(e)}function Yo(e,t){return t.from.ch==0&&t.to.ch==0&&pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function mo(e,t,i,n){function a(Nt){return i?i[Nt]:null}function s(Nt,wt,Ft){nr(Nt,wt,Ft,n),Mn(Nt,"change",Nt,t)}function l(Nt,wt){for(var Ft=[],qt=Nt;qt<wt;++qt)Ft.push(new Bi(b[qt],a(qt),n));return Ft}var p=t.from,g=t.to,b=t.text,Z=Et(e,p.line),te=Et(e,g.line),Se=pe(b),ye=a(b.length-1),Ge=g.line-p.line;if(t.full)e.insert(0,l(0,b.length)),e.remove(b.length,e.size-b.length);else if(Yo(e,t)){var it=l(0,b.length-1);s(te,te.text,ye),Ge&&e.remove(p.line,Ge),it.length&&e.insert(p.line,it)}else if(Z==te)if(b.length==1)s(Z,Z.text.slice(0,p.ch)+Se+Z.text.slice(g.ch),ye);else{var ft=l(1,b.length-1);ft.push(new Bi(Se+Z.text.slice(g.ch),ye,n)),s(Z,Z.text.slice(0,p.ch)+b[0],a(0)),e.insert(p.line+1,ft)}else if(b.length==1)s(Z,Z.text.slice(0,p.ch)+b[0]+te.text.slice(g.ch),a(0)),e.remove(p.line+1,Ge);else{s(Z,Z.text.slice(0,p.ch)+b[0],a(0)),s(te,Se+te.text.slice(g.ch),ye);var xt=l(1,b.length-1);Ge>1&&e.remove(p.line+1,Ge-1),e.insert(p.line+1,xt)}Mn(e,"change",e,t)}function xa(e,t,i){function n(a,s,l){if(a.linked)for(var p=0;p<a.linked.length;++p){var g=a.linked[p];if(g.doc==s)continue;var b=l&&g.sharedHist;if(i&&!b)continue;t(g.doc,b),n(g.doc,a,b)}}n(e,null,!0)}function Jo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Zi(e),po(e),Qo(e),e.options.lineWrapping||Rn(e),e.options.mode=t.modeOption,Di(e)}function Qo(e){(e.doc.direction=="rtl"?ie:h)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){Qo(e),Di(e)})}function Fr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function go(e,t){var i={from:yn(t.from),to:Ca(t),text:tn(e,t.from,t.to)};return es(e,i,t.from.line,t.to.line+1),xa(e,function(n){return es(n,i,t.from.line,t.to.line+1)},!0),i}function Zo(e){for(;e.length;){var t=pe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Zo(e.done),pe(e.done);if(e.done.length&&!pe(e.done).ranges)return pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function qo(e,t,i,n){var a=e.history;a.undone.length=0;var s=+new Date,l,p;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=pl(a,a.lastOp==n)))p=pe(l.changes),lt(t.from,t.to)==0&<(t.from,p.to)==0?p.to=Ca(t):l.changes.push(go(e,t));else{var g=pe(a.done);for((!g||!g.ranges)&&Wr(e.sel,a.done),l={changes:[go(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,p||Ue(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 gl(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,pe(a.done),t))?a.done[a.done.length-1]=t:Wr(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=i,n&&n.clearRedo!==!1&&Zo(a.undone)}function Wr(e,t){var i=pe(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 vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],a=0;a<t.text.length;++a)n.push(vl(i[a]));return n}function ts(e,t){var i=yl(e,t),n=ii(e,t);if(!i)return n;if(!n)return i;for(var a=0;a<i.length;++a){var s=i[a],l=n[a];if(s&&l){e:for(var p=0;p<l.length;++p){for(var g=l[p],b=0;b<s.length;++b)if(s[b].marker==g.marker)continue e;s.push(g)}}else l&&(i[a]=l)}return i}function Ga(e,t,i){for(var n=[],a=0;a<e.length;++a){var s=e[a];if(s.ranges){n.push(i?Vi.prototype.deepCopy.call(s):s);continue}var l=s.changes,p=[];n.push({changes:p});for(var g=0;g<l.length;++g){var b=l[g],Z=void 0;if(p.push({from:b.from,to:b.to,text:b.text}),t)for(var te in b)(Z=te.match(/^spans_(\d+)$/))&&(Ae(t,Number(Z[1]))>-1&&(pe(p)[te]=b[te],delete b[te]))}}return n}function vo(e,t,i,n){if(n){var a=e.anchor;if(i){var s=lt(t,a)<0;s!=lt(i,a)<0?(a=t,t=i):s!=lt(t,i)<0&&(t=i)}return new Tn(a,t)}else return new Tn(i||t,t)}function Hr(e,t,i,n,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),ki(e,new Vi([vo(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<e.sel.ranges.length;s++)n[s]=vo(e.sel.ranges[s],t[s],null,a);var l=ea(e.cm,n,e.sel.primIndex);ki(e,l,i)}function yo(e,t,i,n){var a=e.sel.ranges.slice(0);a[t]=i,ki(e,ea(e.cm,a,e.sel.primIndex),n)}function is(e,t,i,n){ki(e,Ea(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(a){this.ranges=[];for(var s=0;s<a.length;s++)this.ranges[s]=new Tn(r(e,a[s].anchor),r(e,a[s].head))},origin:i&&i.origin};return Ue(e,"beforeSelectionChange",e,n),e.cm&&Ue(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ea(e.cm,n.ranges,n.ranges.length-1):t}function as(e,t,i){var n=e.history.done,a=pe(n);a&&a.ranges?(n[n.length-1]=t,zr(e,t,i)):ki(e,t,i)}function ki(e,t,i){zr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function zr(e,t,i){(q(e,"beforeSelectionChange")||e.cm&&q(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(lt(t.primary().head,e.sel.primary().head)<0?-1:1);rs(e,ss(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&za(e.cm)}function rs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,G(e.cm)),Mn(e,"cursorActivity",e)}function os(e){rs(e,ss(e,e.sel,null,!1))}function ss(e,t,i,n){for(var a,s=0;s<t.ranges.length;s++){var l=t.ranges[s],p=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],g=Kr(e,l.anchor,p&&p.anchor,i,n),b=Kr(e,l.head,p&&p.head,i,n);(a||g!=l.anchor||b!=l.head)&&(a||(a=t.ranges.slice(0,s)),a[s]=new Tn(g,b))}return a?ea(e.cm,a,t.primIndex):t}function Va(e,t,i,n,a){var s=Et(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var p=s.markedSpans[l],g=p.marker,b="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,Z="selectRight"in g?!g.selectRight:g.inclusiveRight;if((p.from==null||(b?p.from<=t.ch:p.from<t.ch))&&(p.to==null||(Z?p.to>=t.ch:p.to>t.ch))){if(a&&(Ue(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var te=g.find(n<0?1:-1),Se=void 0;if((n<0?Z:b)&&(te=ls(e,te,-n,te&&te.line==t.line?s:null)),te&&te.line==t.line&&(Se=lt(te,i))&&(n<0?Se<0:Se>0))return Va(e,te,t,n,a)}var ye=g.find(n<0?-1:1);return(n<0?b:Z)&&(ye=ls(e,ye,n,ye.line==t.line?s:null)),ye?Va(e,ye,t,n,a):null}}return t}function Kr(e,t,i,n,a){var s=n||1,l=Va(e,t,i,s,a)||!a&&Va(e,t,i,s,!0)||Va(e,t,i,-s,a)||!a&&Va(e,t,i,-s,!0);return l||(e.cantEdit=!0,Ve(e.first,0))}function ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?r(e,Ve(t.line-1)):null:i>0&&t.ch==(n||Et(e,t.line)).text.length?t.line<e.first+e.size-1?Ve(t.line+1,0):null:new Ve(t.line,t.ch+i)}function us(e){e.setSelection(Ve(e.firstLine(),0),Ve(e.lastLine()),Te)}function cs(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(a,s,l,p){a&&(n.from=r(e,a)),s&&(n.to=r(e,s)),l&&(n.text=l),p!==void 0&&(n.origin=p)}),Ue(e,"beforeChange",e,n),e.cm&&Ue(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Xa(e,t,i){if(e.cm){if(!e.cm.curOp)return yi(e.cm,Xa)(e,t,i);if(e.cm.state.suppressEdits)return}if((q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var n=Fn&&!i&&$i(e,t.from,t.to);if(n)for(var a=n.length-1;a>=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]==""&<(t.from,t.to)==0)return;var i=fo(e,t);qo(e,t,i,e.cm?e.cm.curOp.id:NaN),mr(e,t,i,ii(e,t));var n=[];xa(e,function(a,s){!s&&Ae(n,a.history)==-1&&(ms(a.history,t),n.push(a.history)),mr(a,t,null,ii(a,t))})}function Gr(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var a=e.history,s,l=e.sel,p=t=="undo"?a.done:a.undone,g=t=="undo"?a.undone:a.done,b=0;b<p.length&&!(s=p[b],i?s.ranges&&!s.equals(e.sel):!s.ranges);b++);if(b==p.length)return;for(a.lastOrigin=a.lastSelOrigin=null;;)if(s=p.pop(),s.ranges){if(Wr(s,g),i&&!s.equals(e.sel)){ki(e,s,{clearRedo:!1});return}l=s}else if(n){p.push(s);return}else break;var Z=[];Wr(l,g),g.push({changes:Z,generation:a.generation}),a.generation=s.generation||++a.maxGeneration;for(var te=q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"),Se=function(it){var ft=s.changes[it];if(ft.origin=t,te&&!cs(e,ft,!1))return p.length=0,{};Z.push(go(e,ft));var xt=it?fo(e,ft):pe(p);mr(e,ft,xt,ts(e,ft)),!it&&e.cm&&e.cm.scrollIntoView({from:ft.from,to:Ca(ft)});var Nt=[];xa(e,function(wt,Ft){!Ft&&Ae(Nt,wt.history)==-1&&(ms(wt.history,ft),Nt.push(wt.history)),mr(wt,ft,null,ts(wt,ft))})},ye=s.changes.length-1;ye>=0;--ye){var Ge=Se(ye);if(Ge)return Ge.v}}function hs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Vi(he(e.sel.ranges,function(a){return new Tn(Ve(a.anchor.line+t,a.anchor.ch),Ve(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;n<i.viewTo;n++)ba(e.cm,n,"gutter")}}function mr(e,t,i,n){if(e.cm&&!e.cm.curOp)return yi(e.cm,mr)(e,t,i,n);if(t.to.line<e.first){hs(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var a=t.text.length-1-(e.first-t.from.line);hs(e,a),t={from:Ve(e.first,0),to:Ve(t.to.line+a,t.to.ch),text:[pe(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Ve(s,Et(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tn(e,t.from,t.to),i||(i=fo(e,t)),e.cm?_l(e.cm,t,n):mo(e,t,n),zr(e,i,Te),e.cantEdit&&Kr(e,Ve(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,a=e.display,s=t.from,l=t.to,p=!1,g=s.line;e.options.lineWrapping||(g=$t($n(Et(n,s.line))),n.iter(g,l.line+1,function(ye){if(ye==a.maxLine)return p=!0,!0})),n.sel.contains(t.from,t.to)>-1&&G(e),mo(n,t,i,Li(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(ye){var Ge=ua(ye);Ge>a.maxLineLength&&(a.maxLine=ye,a.maxLineLength=Ge,a.maxLineChanged=!0,p=!1)}),p&&(e.curOp.updateMaxLine=!0)),bn(n,s.line),hr(e,400);var b=t.text.length-(l.line-s.line)-1;t.full?Di(e):s.line==l.line&&t.text.length==1&&!Yo(e.doc,t)?ba(e,s.line,"text"):Di(e,s.line,l.line+1,b);var Z=q(e,"changes"),te=q(e,"change");if(te||Z){var Se={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};te&&Mn(e,"change",e,Se),Z&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Se)}e.display.selForContextMenu=null}function $a(e,t,i,n,a){var s;n||(n=i),lt(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),Xa(e,{from:i,to:n,text:t,origin:a})}function fs(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ps(e,t,i,n){for(var a=0;a<e.length;++a){var s=e[a],l=!0;if(s.ranges){s.copied||(s=e[a]=s.deepCopy(),s.copied=!0);for(var p=0;p<s.ranges.length;p++)fs(s.ranges[p].anchor,t,i,n),fs(s.ranges[p].head,t,i,n);continue}for(var g=0;g<s.changes.length;++g){var b=s.changes[g];if(i<b.from.line)b.from=Ve(b.from.line+n,b.from.ch),b.to=Ve(b.to.line+n,b.to.ch);else if(t<=b.to.line){l=!1;break}}l||(e.splice(0,a+1),a=0)}}function ms(e,t){var i=t.from.line,n=t.to.line,a=t.text.length-(n-i)-1;ps(e.done,i,n,a),ps(e.undone,i,n,a)}function gr(e,t,i,n){var a=t,s=t;return typeof t=="number"?s=Et(e,d(e,t)):a=$t(t),a==null?null:(n(s,a)&&e.cm&&ba(e.cm,a,i),s)}function vr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}vr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var a=this.lines[i];this.height-=a.height,Ia(a),Mn(a,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function yr(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var a=e[n];t+=a.chunkSize(),i+=a.height,a.parent=this}this.size=t,this.height=i,this.parent=null}yr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],a=n.chunkSize();if(e<a){var s=Math.min(t,a-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,a==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof vr))){var p=[];this.collapse(p),this.children=[new vr(p)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var a=this.children[n],s=a.chunkSize();if(e<=s){if(a.insertInner(e,t,i),a.lines&&a.lines.length>50){for(var l=a.lines.length%25+25,p=l;p<a.lines.length;){var g=new vr(a.lines.slice(p,p+=25));a.height-=g.height,this.children.splice(++n,0,g),g.parent=this}a.lines=a.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new yr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var a=Ae(e.parent.children,e);e.parent.children.splice(a+1,0,i)}else{var n=new yr(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var a=this.children[n],s=a.chunkSize();if(e<s){var l=Math.min(t,s-e);if(a.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var br=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};br.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=$t(i);if(n==null||!t)return;for(var a=0;a<t.length;++a)t[a]==this&&t.splice(a--,1);t.length||(i.widgets=null);var s=ya(this);dn(i,Math.max(0,i.height-s)),e&&(Wi(e,function(){gs(e,i,-s),ba(e,n,"widget")}),Mn(e,"lineWidgetCleared",e,this,n))},br.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var a=ya(this)-t;if(!a)return;zi(this.doc,n)||dn(n,n.height+a),i&&Wi(i,function(){i.curOp.forceUpdate=!0,gs(i,n,a),Mn(i,"lineWidgetChanged",i,e,$t(n))})},Q(br);function gs(e,t,i){Ti(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&oo(e,i)}function El(e,t,i,n){var a=new br(e,i,n),s=e.cm;return s&&a.noHScroll&&(s.display.alignWidgets=!0),gr(e,t,"widget",function(l){var p=l.widgets||(l.widgets=[]);if(a.insertAt==null?p.push(a):p.splice(Math.min(p.length-1,Math.max(0,a.insertAt)),0,a),a.line=l,s&&!zi(e,l)){var g=Ti(l)<e.scrollTop;dn(l,l.height+ya(a)),g&&oo(s,a.height),s.curOp.forceUpdate=!0}return!0}),s&&Mn(s,"lineWidgetAdded",s,a,typeof t=="number"?t:$t(t)),a}var vs=0,wa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++vs};wa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Da(e),q(this,"clear")){var i=this.find();i&&Mn(this,"clear",i.from,i.to)}for(var n=null,a=null,s=0;s<this.lines.length;++s){var l=this.lines[s],p=Wn(l.markedSpans,this);e&&!this.collapsed?ba(e,$t(l),"text"):e&&(p.to!=null&&(a=$t(l)),p.from!=null&&(n=$t(l))),l.markedSpans=gi(l.markedSpans,p),p.from==null&&this.collapsed&&!zi(this.doc,l)&&e&&dn(l,Sn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var b=$n(this.lines[g]),Z=ua(b);Z>e.display.maxLineLength&&(e.display.maxLine=b,e.display.maxLineLength=Z,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&&os(e.doc)),e&&Mn(e,"markerCleared",e,this,n,a),t&&Na(e),this.parent&&this.parent.clear()},wa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,a=0;a<this.lines.length;++a){var s=this.lines[a],l=Wn(s.markedSpans,this);if(l.from!=null&&(i=Ve(t?s:$t(s),l.from),e==-1))return i;if(l.to!=null&&(n=Ve(t?s:$t(s),l.to),e==1))return n}return i&&{from:i,to:n}},wa.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Wi(n,function(){var a=t.line,s=$t(t.line),l=ht(n,s);if(l&&(rn(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!zi(i.doc,a)&&i.height!=null){var p=i.height;i.height=null;var g=ya(i)-p;g&&dn(a,a.height+g)}Mn(n,"markerChanged",n,e)})},wa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},wa.prototype.detachLine=function(e){if(this.lines.splice(Ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Q(wa);function Ya(e,t,i,n,a){if(n&&n.shared)return Cl(e,t,i,n,a);if(e.cm&&!e.cm.curOp)return yi(e.cm,Ya)(e,t,i,n,a);var s=new wa(e,a),l=lt(t,i);if(n&&m(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=J("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Zn(e,t.line,t,i,s)||t.line!=i.line&&Zn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");In()}s.addToHistory&&qo(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var p=t.line,g=e.cm,b;if(e.iter(p,i.line+1,function(te){g&&s.collapsed&&!g.options.lineWrapping&&$n(te)==g.display.maxLine&&(b=!0),s.collapsed&&p!=t.line&&dn(te,0),Bn(te,new li(s,p==t.line?t.ch:null,p==i.line?i.ch:null)),++p}),s.collapsed&&e.iter(t.line,i.line+1,function(te){zi(e,te)&&dn(te,0)}),s.clearOnEnter&&De(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Zt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++vs,s.atomic=!0),g){if(b&&(g.curOp.updateMaxLine=!0),s.collapsed)Di(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var Z=t.line;Z<=i.line;Z++)ba(g,Z,"text");s.atomic&&os(g.doc),Mn(g,"markerAdded",g,s)}return s}var _r=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};_r.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Mn(this,"clear")},_r.prototype.find=function(e,t){return this.primary.find(e,t)},Q(_r);function Cl(e,t,i,n,a){n=m(n),n.shared=!1;var s=[Ya(e,t,i,n,a)],l=s[0],p=n.widgetNode;return xa(e,function(g){p&&(n.widgetNode=p.cloneNode(!0)),s.push(Ya(g,r(g,t),r(g,i),n,a));for(var b=0;b<g.linked.length;++b)if(g.linked[b].isParent)return;l=pe(s)}),new _r(s,l)}function ys(e){return e.findMarks(Ve(e.first,0),e.clipPos(Ve(e.lastLine())),function(t){return t.parent})}function xl(e,t){for(var i=0;i<t.length;i++){var n=t[i],a=n.find(),s=e.clipPos(a.from),l=e.clipPos(a.to);if(lt(s,l)){var p=Ya(e,s,l,n.primary,n.primary.type);n.markers.push(p),p.parent=n}}}function wl(e){for(var t=function(n){var a=e[n],s=[a.primary.doc];xa(a.primary.doc,function(g){return s.push(g)});for(var l=0;l<a.markers.length;l++){var p=a.markers[l];Ae(s,p.doc)==-1&&(p.parent=null,a.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Ni=function(e,t,i,n,a){if(!(this instanceof Ni))return new Ni(e,t,i,n,a);i==null&&(i=0),yr.call(this,[new vr([new Bi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Ve(i,0);this.sel=Ea(s),this.history=new Fr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=a=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),mo(this,{from:s,to:s,text:e}),ki(this,Ea(s),Te)};Ni.prototype=He(yr.prototype,{constructor:Ni,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=jt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:bi(function(e){var t=Ve(this.first,0),i=this.first+this.size-1;Xa(this,{from:t,to:Ve(i,Et(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&lr(this.cm,0,0),ki(this,Ea(t),Te)}),replaceRange:function(e,t,i,n){t=r(this,t),i=i?r(this,i):t,$a(this,e,t,i,n)},getRange:function(e,t,i){var n=tn(this,r(this,e),r(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(On(this,e))return Et(this,e)},getLineNumber:function(e){return $t(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Et(this,e)),$n(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return r(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bi(function(e,t,i){is(this,r(this,typeof e=="number"?Ve(e,t||0):e),null,i)}),setSelection:bi(function(e,t,i){is(this,r(this,e),r(this,t||e),i)}),extendSelection:bi(function(e,t,i){Hr(this,r(this,e),t&&r(this,t),i)}),extendSelections:bi(function(e,t){ns(this,u(this,e),t)}),extendSelectionsBy:bi(function(e,t){var i=he(this.sel.ranges,e);ns(this,u(this,i),t)}),setSelections:bi(function(e,t,i){if(!e.length)return;for(var n=[],a=0;a<e.length;a++)n[a]=new Tn(r(this,e[a].anchor),r(this,e[a].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ki(this,ea(this.cm,n,t),i)}),addSelection:bi(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Tn(r(this,e),r(this,t||e))),ki(this,ea(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var a=tn(this,t[n].from(),t[n].to());i=i?i.concat(a):a}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var a=tn(this,i[n].from(),i[n].to());e!==!1&&(a=a.join(e||this.lineSeparator())),t[n]=a}return t},replaceSelection:function(e,t,i){for(var n=[],a=0;a<this.sel.ranges.length;a++)n[a]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:bi(function(e,t,i){for(var n=[],a=this.sel,s=0;s<a.ranges.length;s++){var l=a.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var p=t&&t!="end"&&hl(this,n,t),g=n.length-1;g>=0;g--)Xa(this,n[g]);p?as(this,p):this.cm&&za(this.cm)}),undo:bi(function(){Gr(this,"undo")}),redo:bi(function(){Gr(this,"redo")}),undoSelection:bi(function(){Gr(this,"undo",!0)}),redoSelection:bi(function(){Gr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var a=0;a<e.undone.length;a++)e.undone[a].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Fr(this.history.maxGeneration),xa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ga(this.history.done),undone:Ga(this.history.undone)}},setHistory:function(e){var t=this.history=new Fr(this.history.maxGeneration);t.done=Ga(e.done.slice(0),null,!0),t.undone=Ga(e.undone.slice(0),null,!0)},setGutterMarker:bi(function(e,t,i){return gr(this,e,"gutter",function(n){var a=n.gutterMarkers||(n.gutterMarkers={});return a[t]=i,!i&&nt(a)&&(n.gutterMarkers=null),!0})}),clearGutter:bi(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&gr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,nt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!On(this,e))return null;if(t=e,e=Et(this,e),!e)return null}else if(t=$t(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:bi(function(e,t,i){return gr(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[a])n[a]=i;else{if($(i).test(n[a]))return!1;n[a]+=" "+i}return!0})}),removeLineClass:bi(function(e,t,i){return gr(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[a];if(s)if(i==null)n[a]=null;else{var l=s.match($(i));if(!l)return!1;var p=l.index+l[0].length;n[a]=s.slice(0,l.index)+(!l.index||p==s.length?"":" ")+s.slice(p)||null}else return!1;return!0})}),addLineWidget:bi(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ya(this,r(this,e),r(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=r(this,e),Ya(this,e,e,i,"bookmark")},findMarksAt:function(e){e=r(this,e);var t=[],i=Et(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var a=i[n];(a.from==null||a.from<=e.ch)&&(a.to==null||a.to>=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,i){e=r(this,e),t=r(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 p=0;p<l.length;p++){var g=l[p];!(g.to!=null&&a==e.line&&e.ch>=g.to||g.from==null&&a!=e.line||g.from!=null&&a==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.marker)}++a}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(a){var s=a.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),r(this,Ve(i,t))},indexFromPos:function(e){e=r(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Ni(jt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Ni(jt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],xl(n,ys(this)),n},unlinkDoc:function(e){if(e instanceof Xn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(ys(this));break}if(e.history==this.history){var n=[e.id];xa(e,function(a){return n.push(a.id)},!0),e.history=new Fr(null),e.history.done=Ga(this.history.done,n),e.history.undone=Ga(this.history.undone,n)}},iterLinkedDocs:function(e){xa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_t(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:bi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Ni.prototype.eachLine=Ni.prototype.iter;var bs=0;function kl(e){var t=this;if(_s(t),We(t,e)||Ji(t.display,e))return;w(e),j&&(bs=+new Date);var i=pa(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var a=n.length,s=Array(a),l=0,p=function(){++l==a&&yi(t,function(){i=r(t.doc,i);var ye={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};Xa(t.doc,ye),as(t.doc,Ea(r(t.doc,i),r(t.doc,Ca(ye))))})()},g=function(ye,Ge){if(t.options.allowDropFileTypes&&Ae(t.options.allowDropFileTypes,ye.type)==-1){p();return}var it=new FileReader;it.onerror=function(){return p()},it.onload=function(){var ft=it.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ft)){p();return}s[Ge]=ft,p()},it.readAsText(ye)},b=0;b<n.length;b++)g(n[b],b);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Z=e.dataTransfer.getData("Text");if(Z){var te;if(t.state.draggingText&&!t.state.draggingText.copy&&(te=t.listSelections()),zr(t.doc,Ea(i,i)),te)for(var Se=0;Se<te.length;++Se)$a(t.doc,"",te[Se].anchor,te[Se].head,"drag");t.replaceSelection(Z,"around","paste"),t.display.input.focus()}}catch(ye){}}}function Rl(e,t){if(j&&(!e.state.draggingText||+new Date-bs<100)){I(t);return}if(We(e,t)||Ji(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ee){var i=C("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),T&&i.parentNode.removeChild(i)}}function Pl(e,t){var i=pa(e,t);if(!i)return;var n=document.createDocumentFragment();Mo(e,i,n),e.display.dragCursor||(e.display.dragCursor=C("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),y(e.display.dragCursor,n)}function _s(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Es(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var a=t[n].CodeMirror;a&&i.push(a)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var Cs=!1;function Tl(){if(Cs)return;Ol(),Cs=!0}function Ol(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Es(Al)},100))}),De(window,"blur",function(){return Es(Ha)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Sa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Er=0;Er<10;Er++)Sa[Er+48]=Sa[Er+96]=String(Er);for(var Vr=65;Vr<=90;Vr++)Sa[Vr]=String.fromCharCode(Vr);for(var Cr=1;Cr<=12;Cr++)Sa[Cr+111]=Sa[Cr+63235]="F"+Cr;var ga={};ga.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ga.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ga.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ga.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ga.default=_?ga.macDefault:ga.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,a,s,l=0;l<t.length-1;l++){var p=t[l];if(/^(cmd|meta|m)$/i.test(p))s=!0;else if(/^a(lt)?$/i.test(p))i=!0;else if(/^(c|ctrl|control)$/i.test(p))n=!0;else if(/^s(hift)?$/i.test(p))a=!0;else throw new Error("Unrecognized modifier name: "+p)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),a&&(e="Shift-"+e),e}function Ll(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var a=he(i.split(" "),Ml),s=0;s<a.length;s++){var l=void 0,p=void 0;s==a.length-1?(p=a.join(" "),l=n):(p=a.slice(0,s+1).join(" "),l="...");var g=t[p];if(!g)t[p]=l;else if(g!=l)throw new Error("Inconsistent bindings for "+p)}delete e[i]}for(var b in t)e[b]=t[b];return e}function Ja(e,t,i,n){t=Xr(t);var a=t.call?t.call(e,n):t[e];if(a===!1)return"nothing";if(a==="...")return"multi";if(a!=null&&i(a))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ja(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=Ja(e,t.fallthrough[s],i,n);if(l)return l}}}function xs(e){var t=typeof e=="string"?e:Sa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ws(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(le?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(le?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ss(e,t){if(T&&e.keyCode==34&&e.char)return!1;var i=Sa[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ws(i,e,t))}function Xr(e){return typeof e=="string"?ga[e]:e}function Qa(e,t){for(var i=e.doc.sel.ranges,n=[],a=0;a<i.length;a++){for(var s=t(i[a]);n.length&<(s.from,pe(n).to)<=0;){var l=n.pop();if(lt(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Wi(e,function(){for(var p=n.length-1;p>=0;p--)$a(e.doc,"",n[p].from,n[p].to,"+delete");za(e)})}function bo(e,t,i){var n=Ke(e.text,t+i,i);return n<0||n>e.text.length?null:n}function _o(e,t,i){var n=bo(e,t.ch,i);return n==null?null:new Ve(t.line,n,i<0?"after":"before")}function Eo(e,t,i,n,a){if(e){t.doc.direction=="rtl"&&(a=-a);var s=Ct(i,t.doc.direction);if(s){var l=a<0?pe(s):s[0],p=a<0==(l.level==1),g=p?"after":"before",b;if(l.level>0||t.doc.direction=="rtl"){var Z=at(t,i);b=a<0?i.text.length-1:0;var te=Ne(t,Z,b).top;b=At(function(Se){return Ne(t,Z,Se).top==te},a<0==(l.level==1)?l.from:l.to-1,b),g=="before"&&(b=bo(i,b,1))}else b=a<0?l.to:l.from;return new Ve(n,b,g)}}return new Ve(n,a<0?i.text.length:0,a<0?"before":"after")}function Dl(e,t,i,n){var a=Ct(t,e.doc.direction);if(!a)return _o(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<i.ch))return _o(t,i,n);var p=function(xt,Nt){return bo(t,xt instanceof Ve?xt.ch:xt,Nt)},g,b=function(xt){return e.options.lineWrapping?(g=g||at(e,t),pn(e,t,g,xt)):{begin:0,end:t.text.length}},Z=b(i.sticky=="before"?p(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var te=l.level==1==n<0,Se=p(i,te?1:-1);if(Se!=null&&(te?Se<=l.to&&Se<=Z.end:Se>=l.from&&Se>=Z.begin)){var ye=te?"before":"after";return new Ve(i.line,Se,ye)}}var Ge=function(xt,Nt,wt){for(var Ft=function(zn,_i){return _i?new Ve(i.line,p(zn,1),"before"):new Ve(i.line,zn,"after")};xt>=0&&xt<a.length;xt+=Nt){var qt=a[xt],Yt=Nt>0==(qt.level!=1),un=Yt?wt.begin:p(wt.end,-1);if(qt.from<=un&&un<qt.to)return Ft(un,Yt);if(un=Yt?qt.from:p(qt.to,-1),wt.begin<=un&&un<wt.end)return Ft(un,Yt)}},it=Ge(s+n,n,Z);if(it)return it;var ft=n>0?Z.end:p(Z.begin,-1);return ft!=null&&!(n>0&&ft==t.text.length)&&(it=Ge(n>0?0:a.length-1,n,b(ft)),it)?it:null}var xr={selectAll:us,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return Qa(e,function(t){if(t.empty()){var i=Et(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ve(t.head.line+1,0)}:{from:t.head,to:Ve(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Qa(e,function(t){return{from:Ve(t.from().line,0),to:r(e.doc,Ve(t.to().line+1,0))}})},delLineLeft:function(e){return Qa(e,function(t){return{from:Ve(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Qa(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Qa(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ve(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ve(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ks(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Rs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},B)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},B)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Rs(e,t.head):n},B)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,a=0;a<i.length;a++){var s=i[a].from(),l=oe(e.getLine(s.line),s.ch,n);t.push(A(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var a=t[n].head,s=Et(e.doc,a.line).text;if(s){if(a.ch==s.length&&(a=new Ve(a.line,a.ch-1)),a.ch>0)a=new Ve(a.line,a.ch+1),e.replaceRange(s.charAt(a.ch-1)+s.charAt(a.ch-2),Ve(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var l=Et(e.doc,a.line-1).text;l&&(a=new Ve(a.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ve(a.line-1,l.length-1),a,"+transpose"))}}i.push(new Tn(a,a))}e.setSelections(i)})},newlineAndIndent:function(e){return Wi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);za(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ks(e,t){var i=Et(e.doc,t),n=$n(i);return n!=i&&(t=$t(n)),Eo(!0,e,n,t,1)}function Nl(e,t){var i=Et(e.doc,t),n=Yi(i);return n!=i&&(t=$t(n)),Eo(!0,e,i,t,-1)}function Rs(e,t){var i=ks(e,t.line),n=Et(e.doc,i.line),a=Ct(n,e.doc.direction);if(!a||a[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return Ve(i.line,l?0:s,i.sticky)}return i}function $r(e,t,i){if(typeof t=="string"&&(t=xr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),a=t(e)!=Oe}finally{e.display.shift=n,e.state.suppressEdits=!1}return a}function jl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var a=Ja(t,e.state.keyMaps[n],i,e);if(a)return a}return e.options.extraKeys&&Ja(t,e.options.extraKeys,i,e)||Ja(t,e.options.keyMap,i,e)}var Ul=new Be;function wr(e,t,i,n){var a=e.state.keySeq;if(a){if(xs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==a&&(e.state.keySeq=null,e.display.input.reset())}),Ps(e,a+" "+t,i,n))return!0}return Ps(e,t,i,n)}function Ps(e,t,i,n){var a=jl(e,t,n);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&Mn(e,"keyHandled",e,t,i),(a=="handled"||a=="multi")&&(w(i),io(e)),!!a}function Ts(e,t){var i=Ss(t,!0);return i?t.shiftKey&&!e.state.keySeq?wr(e,"Shift-"+i,t,function(n){return $r(e,n,!0)})||wr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return $r(e,n)}):wr(e,i,t,function(n){return $r(e,n)}):!1}function Il(e,t,i){return wr(e,"'"+i+"'",t,function(n){return $r(e,n,!0)})}var Co=null;function Os(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=R(),We(t,e))return;j&&x<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Ts(t,e);T&&(Co=n?i:null,!n&&i==88&&!Bt&&(_?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),re&&!_&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;ie(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(h(t,"CodeMirror-crosshair"),kt(document,"keyup",i),kt(document,"mouseover",i))}De(document,"keyup",i),De(document,"mouseover",i)}function As(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function Ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ji(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||_&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(T&&i==Co){Co=null,w(e);return}if(T&&(!e.which||e.which<10)&&Ts(t,e))return;var a=String.fromCharCode(n==null?i:n);if(a=="\b")return;if(Il(t,e,a))return;t.display.input.onKeyPress(e)}var Fl=400,xo=function(e,t,i){this.time=e,this.pos=t,this.button=i};xo.prototype.compare=function(e,t,i){return this.time+Fl>e&<(t,this.pos)==0&&i==this.button};var Sr,kr;function Wl(e,t){var i=+new Date;return kr&&kr.compare(i,e,t)?(Sr=kr=null,"triple"):Sr&&Sr.compare(i,e,t)?(kr=new xo(i,e,t),Sr=null,"double"):(Sr=new xo(i,e,t),kr=null,"single")}function Ls(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Ji(i,e)){k||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(wo(t,e))return;var n=pa(t,e),a=Ce(e),s=n?Wl(n,a):"single";if(window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,a,n,s,e))return;a==1?n?Kl(t,n,s,e):de(e)==i.scroller&&w(e):a==2?(n&&Hr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):a==3&&(fe?t.display.input.onContextMenu(e):Do(t))}function Hl(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,wr(e,ws(s,a),a,function(l){if(typeof l=="string"&&(l=xr[l]),!l)return!1;var p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),p=l(e,i)!=Oe}finally{e.state.suppressEdits=!1}return p})}function zl(e,t,i){var n=e.getOption("configureMouse"),a=n?n(e,t,i):{};if(a.unit==null){var s=we?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){j?setTimeout(O(Lo,e),0):e.curOp.focus=R();var a=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Re&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(lt((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(lt(l.to(),t)>0||t.xRel<0)?Gl(e,n,t,a):Vl(e,n,t,a)}function Gl(e,t,i,n){var a=e.display,s=!1,l=yi(e,function(b){k&&(a.scroller.draggable=!1),e.state.draggingText=!1,kt(a.wrapper.ownerDocument,"mouseup",l),kt(a.wrapper.ownerDocument,"mousemove",p),kt(a.scroller,"dragstart",g),kt(a.scroller,"drop",l),s||(w(b),n.addNew||Hr(e.doc,i,null,null,n.extend),k&&!ee||j&&x==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),p=function(b){s=s||Math.abs(t.clientX-b.clientX)+Math.abs(t.clientY-b.clientY)>=10},g=function(){return s=!0};k&&(a.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),De(a.wrapper.ownerDocument,"mouseup",l),De(a.wrapper.ownerDocument,"mousemove",p),De(a.scroller,"dragstart",g),De(a.scroller,"drop",l),Do(e),setTimeout(function(){return a.input.focus()},20)}function Ds(e,t,i){if(i=="char")return new Tn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Tn(Ve(t.line,0),r(e.doc,Ve(t.line+1,0)));var n=i(e,t);return new Tn(n.from,n.to)}function Vl(e,t,i,n){var a=e.display,s=e.doc;w(t);var l,p,g=s.sel,b=g.ranges;if(n.addNew&&!n.extend?(p=s.sel.contains(i),p>-1?l=b[p]:l=new Tn(i,i)):(l=s.sel.primary(),p=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Tn(i,i)),i=pa(e,t,!0,!0),p=-1;else{var Z=Ds(e,i,n.unit);n.extend?l=vo(l,Z.anchor,Z.head,n.extend):l=Z}n.addNew?p==-1?(p=b.length,ki(s,ea(e,b.concat([l]),p),{scroll:!1,origin:"*mouse"})):b.length>1&&b[p].empty()&&n.unit=="char"&&!n.extend?(ki(s,ea(e,b.slice(0,p).concat(b.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):yo(s,p,l,V):(p=0,ki(s,new Vi([l],0),V),g=s.sel);var te=i;function Se(wt){if(lt(te,wt)==0)return;if(te=wt,n.unit=="rectangle"){for(var Ft=[],qt=e.options.tabSize,Yt=oe(Et(s,i.line).text,i.ch,qt),un=oe(Et(s,wt.line).text,wt.ch,qt),zn=Math.min(Yt,un),_i=Math.max(Yt,un),Qn=Math.min(i.line,wt.line),Hi=Math.min(e.lastLine(),Math.max(i.line,wt.line));Qn<=Hi;Qn++){var ji=Et(s,Qn).text,oi=ue(ji,zn,qt);zn==_i?Ft.push(new Tn(Ve(Qn,oi),Ve(Qn,oi))):ji.length>oi&&Ft.push(new Tn(Ve(Qn,oi),Ve(Qn,ue(ji,_i,qt))))}Ft.length||Ft.push(new Tn(i,i)),ki(s,ea(e,g.ranges.slice(0,p).concat(Ft),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(wt)}else{var Ui=l,Ci=Ds(e,wt,n.unit),mi=Ui.anchor,si;lt(Ci.anchor,mi)>0?(si=Ci.head,mi=Kn(Ui.from(),Ci.anchor)):(si=Ci.anchor,mi=An(Ui.to(),Ci.head));var ti=g.ranges.slice(0);ti[p]=Xl(e,new Tn(r(s,mi),si)),ki(s,ea(e,ti,p),V)}}var ye=a.wrapper.getBoundingClientRect(),Ge=0;function it(wt){var Ft=++Ge,qt=pa(e,wt,!0,n.unit=="rectangle");if(!qt)return;if(lt(qt,te)!=0){e.curOp.focus=R(),Se(qt);var Yt=jr(a,s);(qt.line>=Yt.to||qt.line<Yt.from)&&setTimeout(yi(e,function(){Ge==Ft&&it(wt)}),150)}else{var un=wt.clientY<ye.top?-20:wt.clientY>ye.bottom?20:0;un&&setTimeout(yi(e,function(){if(Ge!=Ft)return;a.scroller.scrollTop+=un,it(wt)}),50)}}function ft(wt){e.state.selectingText=!1,Ge=Infinity,wt&&(w(wt),a.input.focus()),kt(a.wrapper.ownerDocument,"mousemove",xt),kt(a.wrapper.ownerDocument,"mouseup",Nt),s.history.lastSelOrigin=null}var xt=yi(e,function(wt){wt.buttons===0||!Ce(wt)?ft(wt):it(wt)}),Nt=yi(e,ft);e.state.selectingText=Nt,De(a.wrapper.ownerDocument,"mousemove",xt),De(a.wrapper.ownerDocument,"mouseup",Nt)}function Xl(e,t){var i=t.anchor,n=t.head,a=Et(e.doc,i.line);if(lt(i,n)==0&&i.sticky==n.sticky)return t;var s=Ct(a);if(!s)return t;var l=ct(s,i.ch,i.sticky),p=s[l];if(p.from!=i.ch&&p.to!=i.ch)return t;var g=l+(p.from==i.ch==(p.level!=1)?0:1);if(g==0||g==s.length)return t;var b;if(n.line!=i.line)b=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Z=ct(s,n.ch,n.sticky),te=Z-l||(n.ch-i.ch)*(p.level==1?-1:1);Z==g-1||Z==g?b=te<0:b=te>0}var Se=s[g+(b?-1:0)],ye=b==(Se.level==1),Ge=ye?Se.from:Se.to,it=ye?"after":"before";return i.ch==Ge&&i.sticky==it?t:new Tn(new Ve(i.line,Ge,it),n)}function Ns(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(Se){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&w(t);var l=e.display,p=l.lineDiv.getBoundingClientRect();if(s>p.bottom||!q(e,i))return U(t);s-=p.top-l.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var b=l.gutters.childNodes[g];if(b&&b.getBoundingClientRect().right>=a){var Z=mn(e.doc,s),te=e.display.gutterSpecs[g];return Ue(e,i,e,Z,te.className,t),U(t)}}}function wo(e,t){return Ns(e,t,"gutterClick",!0)}function js(e,t){if(Ji(e.display,t)||$l(e,t))return;if(We(e,t,"contextmenu"))return;fe||e.display.input.onContextMenu(t)}function $l(e,t){return q(e,"gutterContextMenu")?Ns(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-"),_n(e)}var Za={toString:function(){return"CodeMirror.Init"}},Is={},Yr={};function Yl(e){var t=e.optionHandlers;function i(n,a,s,l){e.defaults[n]=a,s&&(t[n]=l?function(p,g,b){b!=Za&&s(p,g,b)}:s)}e.defineOption=i,e.Init=Za,i("value","",function(n,a){return n.setValue(a)},!0),i("mode",null,function(n,a){n.doc.modeOption=a,po(n)},!0),i("indentUnit",2,po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){pr(n),_n(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(g){for(var b=0;;){var Z=g.text.indexOf(a,b);if(Z==-1)break;b=Z+a.length,s.push(Ve(l,Z))}l++});for(var p=s.length-1;p>=0;p--)$a(n.doc,a,s[p],Ve(s[p].line,s[p].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!=Za&&n.refresh()}),i("specialCharPlaceholder",Ht,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",Y?"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",!ke),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Us(n),fr(n)},!0),i("keyMap","default",function(n,a,s){var l=Xr(a),p=s!=Za&&Xr(s);p&&p.detach&&p.detach(n,l),l.attach&&l.attach(n,p||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(n,a){n.display.gutterSpecs=ho(a,n.options.lineNumbers),fr(n)},!0),i("fixedGutter",!0,function(n,a){n.display.gutters.style.left=a?Ki(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Ka(n)},!0),i("scrollbarStyle","native",function(n){Fo(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=ho(n.options.gutters,a),fr(n)},!0),i("firstLineNumber",1,fr,!0),i("lineNumberFormatter",function(n){return n},fr,!0),i("showCursorWhenSelecting",!1,sr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,a){a=="nocursor"&&(Ha(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,sr,!0),i("singleCursorHeightPerLine",!0,sr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,pr,!0),i("addModeClass",!1,pr,!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,pr,!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!=Za;if(!t!=!n){var a=e.display.dragFunctions,s=t?De: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 Ql(e){e.options.lineWrapping?(ie(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(h(e.display.wrapper,"CodeMirror-wrap"),Rn(e)),Zi(e),Di(e),_n(e),setTimeout(function(){return Ka(e)},100)}function Xn(e,t){var i=this;if(!(this instanceof Xn))return new Xn(e,t);this.options=t=t?m(t):{},m(Is,t,!1);var n=t.value;typeof n=="string"?n=new Ni(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var a=new Xn.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"),Fo(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 Be,keySeq:null,specialChars:null},t.autofocus&&!Y&&s.input.focus(),j&&x<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Tl(),Da(this),this.curOp.forceUpdate=!0,Jo(this,n),t.autofocus&&!Y||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ao(i)},20):Ha(this);for(var l in Yr)Yr.hasOwnProperty(l)&&Yr[l](this,t[l],Za);zo(this),t.finishInit&&t.finishInit(this);for(var p=0;p<So.length;++p)So[p](this);Na(this),k&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Xn.defaults=Is,Xn.optionHandlers=Yr;function Zl(e){var t=e.display;De(t.scroller,"mousedown",yi(e,Ls)),j&&x<11?De(t.scroller,"dblclick",yi(e,function(g){if(We(e,g))return;var b=pa(e,g);if(!b||wo(e,g)||Ji(e.display,g))return;w(g);var Z=e.findWordAt(b);Hr(e.doc,Z.anchor,Z.head)})):De(t.scroller,"dblclick",function(g){return We(e,g)||w(g)}),De(t.scroller,"contextmenu",function(g){return js(e,g)}),De(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||js(e,g)});var i,n={end:0};function a(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(g){if(g.touches.length!=1)return!1;var b=g.touches[0];return b.radiusX<=1&&b.radiusY<=1}function l(g,b){if(b.left==null)return!0;var Z=b.left-g.left,te=b.top-g.top;return Z*Z+te*te>20*20}De(t.scroller,"touchstart",function(g){if(!We(e,g)&&!s(g)&&!wo(e,g)){t.input.ensurePolled(),clearTimeout(i);var b=+new Date;t.activeTouch={start:b,moved:!1,prev:b-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(g){var b=t.activeTouch;if(b&&!Ji(t,g)&&b.left!=null&&!b.moved&&new Date-b.start<300){var Z=e.coordsChar(t.activeTouch,"page"),te;!b.prev||l(b,b.prev)?te=new Tn(Z,Z):!b.prev.prev||l(b,b.prev.prev)?te=e.findWordAt(Z):te=new Tn(Ve(Z.line,0),r(e.doc,Ve(Z.line+1,0))),e.setSelection(te.anchor,te.head),e.focus(),w(g)}a()}),De(t.scroller,"touchcancel",a),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ur(e,t.scroller.scrollTop),Ma(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),De(t.scroller,"mousewheel",function(g){return Vo(e,g)}),De(t.scroller,"DOMMouseScroll",function(g){return Vo(e,g)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){We(e,g)||I(g)},over:function(g){We(e,g)||(Pl(e,g),I(g))},start:function(g){return Rl(e,g)},drop:yi(e,kl),leave:function(g){We(e,g)||_s(e)}};var p=t.input.getField();De(p,"keyup",function(g){return As.call(e,g)}),De(p,"keydown",yi(e,Os)),De(p,"keypress",yi(e,Ms)),De(p,"focus",function(g){return ao(e,g)}),De(p,"blur",function(g){return Ha(e,g)})}var So=[];Xn.defineInitHook=function(e){return So.push(e)};function Rr(e,t,i,n){var a=e.doc,s;i==null&&(i="add"),i=="smart"&&(a.mode.indent?s=_e(e,t).state:i="prev");var l=e.options.tabSize,p=Et(a,t),g=oe(p.text,null,l);p.stateAfter&&(p.stateAfter=null);var b=p.text.match(/^\s*/)[0],Z;if(!n&&!/\S/.test(p.text))Z=0,i="not";else if(i=="smart"&&(Z=a.mode.indent(s,p.text.slice(b.length),p.text),Z==Oe||Z>150)){if(!n)return;i="prev"}i=="prev"?t>a.first?Z=oe(Et(a,t-1).text,null,l):Z=0:i=="add"?Z=g+e.options.indentUnit:i=="subtract"?Z=g-e.options.indentUnit:typeof i=="number"&&(Z=g+i),Z=Math.max(0,Z);var te="",Se=0;if(e.options.indentWithTabs)for(var ye=Math.floor(Z/l);ye;--ye)Se+=l,te+=" ";if(Se<Z&&(te+=A(Z-Se)),te!=b)return $a(a,te,Ve(t,0),Ve(t,b.length),"+input"),p.stateAfter=null,!0;for(var Ge=0;Ge<a.sel.ranges.length;Ge++){var it=a.sel.ranges[Ge];if(it.head.line==t&&it.head.ch<b.length){var ft=Ve(t,b.length);yo(a,Ge,new Tn(ft,ft));break}}}var ta=null;function Jr(e){ta=e}function ko(e,t,i,n,a){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,p=a=="paste"||e.state.pasteIncoming>l,g=_t(t),b=null;if(p&&n.ranges.length>1)if(ta&&ta.text.join(`
|
|
`)==t){if(n.ranges.length%ta.text.length==0){b=[];for(var Z=0;Z<ta.text.length;Z++)b.push(s.splitLines(ta.text[Z]))}}else g.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(b=he(g,function(xt){return[xt]}));for(var te=e.curOp.updateInput,Se=n.ranges.length-1;Se>=0;Se--){var ye=n.ranges[Se],Ge=ye.from(),it=ye.to();ye.empty()&&(i&&i>0?Ge=Ve(Ge.line,Ge.ch-i):e.state.overwrite&&!p?it=Ve(it.line,Math.min(Et(s,it.line).text.length,it.ch+pe(g).length)):p&&ta&&ta.lineWise&&ta.text.join(`
|
|
`)==g.join(`
|
|
`)&&(Ge=it=Ve(Ge.line,0)));var ft={from:Ge,to:it,text:b?b[Se%b.length]:g,origin:a||(p?"paste":e.state.cutIncoming>l?"cut":"+input")};Xa(e.doc,ft),Mn(e,"inputRead",e,ft)}t&&!p&&Fs(e,t),za(e),e.curOp.updateInput<2&&(e.curOp.updateInput=te),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&&Wi(t,function(){return ko(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 p=0;p<s.electricChars.length;p++)if(t.indexOf(s.electricChars.charAt(p))>-1){l=Rr(e,a.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(Et(e.doc,a.head.line).text.slice(0,a.head.ch))&&(l=Rr(e,a.head.line,"smart")));l&&Mn(e,"electricInput",e,a.head.line)}}function Ws(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var a=e.doc.sel.ranges[n].head.line,s={anchor:Ve(a,0),head:Ve(a+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Hs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function zs(){var e=C("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=C("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),Hs(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,a){var s=this.options,l=s[n];if(s[n]==a&&n!="mode")return;s[n]=a,t.hasOwnProperty(n)&&yi(this,t[n])(this,a,l),Ue(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,a){this.state.keyMaps[a?"push":"unshift"](Xr(n))},removeKeyMap:function(n){for(var a=this.state.keyMaps,s=0;s<a.length;++s)if(a[s]==n||a[s].name==n)return a.splice(s,1),!0},addOverlay:Oi(function(n,a){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");Ze(this.state.overlays,{mode:s,modeSpec:n,opaque:a&&a.opaque,priority:a&&a.priority||0},function(l){return l.priority}),this.state.modeGen++,Di(this)}),removeOverlay:Oi(function(n){for(var a=this.state.overlays,s=0;s<a.length;++s){var l=a[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){a.splice(s,1),this.state.modeGen++,Di(this);return}}}),indentLine:Oi(function(n,a,s){typeof a!="string"&&typeof a!="number"&&(a==null?a=this.options.smartIndent?"smart":"prev":a=a?"add":"subtract"),On(this.doc,n)&&Rr(this,n,a,s)}),indentSelection:Oi(function(n){for(var a=this.doc.sel.ranges,s=-1,l=0;l<a.length;l++){var p=a[l];if(p.empty())p.head.line>s&&(Rr(this,p.head.line,n,!0),s=p.head.line,l==this.doc.sel.primIndex&&za(this));else{var g=p.from(),b=p.to(),Z=Math.max(s,g.line);s=Math.min(this.lastLine(),b.line-(b.ch?0:1))+1;for(var te=Z;te<s;++te)Rr(this,te,n);var Se=this.doc.sel.ranges;g.ch==0&&a.length==Se.length&&Se[l].from().ch>0&&yo(this.doc,l,new Tn(g,Se[l].to()),Te)}}}),getTokenAt:function(n,a){return Rt(this,n,a)},getLineTokens:function(n,a){return Rt(this,Ve(n),a,!0)},getTokenTypeAt:function(n){n=r(this.doc,n);var a=Ye(this,Et(this.doc,n.line)),s=0,l=(a.length-1)/2,p=n.ch,g;if(p==0)g=a[2];else for(;;){var b=s+l>>1;if((b?a[b*2-1]:0)>=p)l=b;else if(a[b*2+1]<p)s=b+1;else{g=a[b*2+2];break}}var Z=g?g.indexOf("overlay "):-1;return Z<0?g:Z==0?null:g.slice(0,Z-1)},getModeAt:function(n){var a=this.doc.mode;return a.innerMode?e.innerMode(a,this.getTokenAt(n).state).mode:a},getHelper:function(n,a){return this.getHelpers(n,a)[0]},getHelpers:function(n,a){var s=[];if(!i.hasOwnProperty(a))return s;var l=i[a],p=this.getModeAt(n);if(typeof p[a]=="string")l[p[a]]&&s.push(l[p[a]]);else if(p[a])for(var g=0;g<p[a].length;g++){var b=l[p[a][g]];b&&s.push(b)}else p.helperType&&l[p.helperType]?s.push(l[p.helperType]):l[p.name]&&s.push(l[p.name]);for(var Z=0;Z<l._global.length;Z++){var te=l._global[Z];te.pred(p,this)&&Ae(s,te.val)==-1&&s.push(te.val)}return s},getStateAfter:function(n,a){var s=this.doc;return n=d(s,n==null?s.first+s.size-1:n),_e(this,n+1,a).state},cursorCoords:function(n,a){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=r(this.doc,n):s=n?l.from():l.to(),Dn(this,s,a||"page")},charCoords:function(n,a){return vi(this,r(this.doc,n),a||"page")},coordsChar:function(n,a){return n=Jn(this,n,a||"page"),wi(this,n.left,n.top)},lineAtHeight:function(n,a){return n=Jn(this,{top:n,left:0},a||"page").top,mn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,a,s){var l=!1,p;if(typeof n=="number"){var g=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>g&&(n=g,l=!0),p=Et(this.doc,n)}else p=n;return Yn(this,p,{top:0,left:0},a||"page",s||l).top+(l?this.doc.height-Ti(p):0)},defaultTextHeight:function(){return Sn(this.display)},defaultCharWidth:function(){return jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,a,s,l,p){var g=this.display;n=Dn(this,r(this.doc,n));var b=n.bottom,Z=n.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),g.sizer.appendChild(a),l=="over")b=n.top;else if(l=="above"||l=="near"){var te=Math.max(g.wrapper.clientHeight,this.doc.height),Se=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+a.offsetHeight>te)&&n.top>a.offsetHeight?b=n.top-a.offsetHeight:n.bottom+a.offsetHeight<=te&&(b=n.bottom),Z+a.offsetWidth>Se&&(Z=Se-a.offsetWidth)}a.style.top=b+"px",a.style.left=a.style.right="",p=="right"?(Z=g.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(p=="left"?Z=0:p=="middle"&&(Z=(g.sizer.clientWidth-a.offsetWidth)/2),a.style.left=Z+"px"),s&&Js(this,{left:Z,top:b,right:Z+a.offsetWidth,bottom:b+a.offsetHeight})},triggerOnKeyDown:Oi(Os),triggerOnKeyPress:Oi(Ms),triggerOnKeyUp:As,triggerOnMouseDown:Oi(Ls),execCommand:function(n){if(xr.hasOwnProperty(n))return xr[n].call(null,this)},triggerElectric:Oi(function(n){Fs(this,n)}),findPosH:function(n,a,s,l){var p=1;a<0&&(p=-1,a=-a);for(var g=r(this.doc,n),b=0;b<a&&!(g=Ro(this.doc,g,p,s,l),g.hitSide);++b);return g},moveH:Oi(function(n,a){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Ro(s.doc,l.head,n,a,s.options.rtlMoveVisually):n<0?l.from():l.to()},B)}),deleteH:Oi(function(n,a){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):Qa(this,function(p){var g=Ro(l,p.head,n,a,!1);return n<0?{from:g,to:p.head}:{from:p.head,to:g}})}),findPosV:function(n,a,s,l){var p=1,g=l;a<0&&(p=-1,a=-a);for(var b=r(this.doc,n),Z=0;Z<a;++Z){var te=Dn(this,b,"div");if(g==null?g=te.left:te.left=g,b=Ks(this,te,p,s),b.hitSide)break}return b},moveV:Oi(function(n,a){var s=this,l=this.doc,p=[],g=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(Z){if(g)return n<0?Z.from():Z.to();var te=Dn(s,Z.head,"div");Z.goalColumn!=null&&(te.left=Z.goalColumn),p.push(te.left);var Se=Ks(s,te,n,a);return a=="page"&&Z==l.sel.primary()&&oo(s,vi(s,Se,"div").top-te.top),Se},B),p.length)for(var b=0;b<l.sel.ranges.length;b++)l.sel.ranges[b].goalColumn=p[b]}),findWordAt:function(n){var a=this.doc,s=Et(a,n.line).text,l=n.ch,p=n.ch;if(s){var g=this.getHelper(n,"wordChars");(n.sticky=="before"||p==s.length)&&l?--l:++p;for(var b=s.charAt(l),Z=Qe(b,g)?function(te){return Qe(te,g)}:/\s/.test(b)?function(te){return/\s/.test(te)}:function(te){return!/\s/.test(te)&&!Qe(te)};l>0&&Z(s.charAt(l-1));)--l;for(;p<s.length&&Z(s.charAt(p));)++p}return new Tn(Ve(n.line,l),Ve(n.line,p))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?ie(this.display.cursorDiv,"CodeMirror-overwrite"):h(this.display.cursorDiv,"CodeMirror-overwrite"),Ue(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==R()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Oi(function(n,a){lr(this,n,a)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Qi(this)-this.display.barHeight,width:n.scrollWidth-Qi(this)-this.display.barWidth,clientHeight:Aa(this),clientWidth:fa(this)}},scrollIntoView:Oi(function(n,a){n==null?(n={from:this.doc.sel.primary().head,to:null},a==null&&(a=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Ve(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=a||0,n.from.line!=null?Qs(this,n):jo(this,n.from,n.to,n.margin)}),setSize:Oi(function(n,a){var s=this,l=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};n!=null&&(this.display.wrapper.style.width=l(n)),a!=null&&(this.display.wrapper.style.height=l(a)),this.options.lineWrapping&&Pn(this);var p=this.display.viewFrom;this.doc.iter(p,this.display.viewTo,function(g){if(g.widgets){for(var b=0;b<g.widgets.length;b++)if(g.widgets[b].noHScroll){ba(s,p,"widget");break}}++p}),this.curOp.forceUpdate=!0,Ue(this,"refresh",this)}),operation:function(n){return Wi(this,n)},startOperation:function(){return Da(this)},endOperation:function(){return Na(this)},refresh:Oi(function(){var n=this.display.cachedTextHeight;Di(this),this.curOp.forceUpdate=!0,_n(this),lr(this,this.doc.scrollLeft,this.doc.scrollTop),uo(this.display),(n==null||Math.abs(n-Sn(this.display))>.5||this.options.lineWrapping)&&Zi(this),Ue(this,"refresh",this)}),swapDoc:Oi(function(n){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Jo(this,n),_n(this),this.display.input.reset(),lr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Mn(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}},Q(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 Ro(e,t,i,n,a){var s=t,l=i,p=Et(e,t.line),g=a&&e.direction=="rtl"?-i:i;function b(){var Nt=t.line+g;return Nt<e.first||Nt>=e.first+e.size?!1:(t=new Ve(Nt,t.ch,t.sticky),p=Et(e,Nt))}function Z(Nt){var wt;if(n=="codepoint"){var Ft=p.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Ft)?wt=null:wt=new Ve(t.line,Math.max(0,Math.min(p.text.length,t.ch+i*(Ft>=55296&&Ft<56320?2:1))),-i)}else a?wt=Dl(e.cm,p,t,i):wt=_o(p,t,i);if(wt==null)if(!Nt&&b())t=Eo(a,e.cm,p,t.line,g);else return!1;else t=wt;return!0}if(n=="char"||n=="codepoint")Z();else if(n=="column")Z(!0);else if(n=="word"||n=="group")for(var te=null,Se=n=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(i<0&&!Z(!Ge));Ge=!1){var it=p.text.charAt(t.ch)||`
|
|
`,ft=Qe(it,ye)?"w":Se&&it==`
|
|
`?"n":!Se||/\s/.test(it)?null:"p";if(Se&&!Ge&&!ft&&(ft="s"),te&&te!=ft){i<0&&(i=1,Z(),t.sticky="after");break}if(ft&&(te=ft),i>0&&!Z(!Ge))break}var xt=Kr(e,t,s,l,!0);return gn(s,xt)&&(xt.hitSide=!0),xt}function Ks(e,t,i,n){var a=e.doc,s=t.left,l;if(n=="page"){var p=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=Math.max(p-.5*Sn(e.display),3);l=(i>0?t.bottom:t.top)+i*g}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var b;!(b=wi(e,s,l),!b.outside);){if(i<0?l<=0:l>=a.height){b.hitSide=!0;break}l+=i*5}return b}var Un=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Un.prototype.init=function(e){var t=this,i=this,n=i.cm,a=i.div=e.lineDiv;Hs(a,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(p){for(var g=p.target;g;g=g.parentNode){if(g==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}De(a,"paste",function(p){if(!s(p)||We(n,p)||Bs(p,n))return;x<=11&&setTimeout(yi(n,function(){return t.updateFromDOM()}),20)}),De(a,"compositionstart",function(p){t.composing={data:p.data,done:!1}}),De(a,"compositionupdate",function(p){t.composing||(t.composing={data:p.data,done:!1})}),De(a,"compositionend",function(p){t.composing&&(p.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(a,"touchstart",function(){return i.forceCompositionEnd()}),De(a,"input",function(){t.composing||t.readFromDOMSoon()});function l(p){if(!s(p)||We(n,p))return;if(n.somethingSelected())Jr({lineWise:!1,text:n.getSelections()}),p.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var g=Ws(n);Jr({lineWise:!0,text:g.text}),p.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,Te),n.replaceSelection("",null,"cut")})}else return;if(p.clipboardData){p.clipboardData.clearData();var b=ta.text.join(`
|
|
`);if(p.clipboardData.setData("Text",b),p.clipboardData.getData("Text")==b){p.preventDefault();return}}var Z=zs(),te=Z.firstChild;n.display.lineSpace.insertBefore(Z,n.display.lineSpace.firstChild),te.value=ta.text.join(`
|
|
`);var Se=document.activeElement;be(te),setTimeout(function(){n.display.lineSpace.removeChild(Z),Se.focus(),Se==a&&i.showPrimarySelection()},50)}De(a,"copy",l),De(a,"cut",l)},Un.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Un.prototype.prepareSelection=function(){var e=Ao(this.cm,!1);return e.focus=document.activeElement==this.div,e},Un.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Un.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Un.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),a=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var s=Qr(t,e.anchorNode,e.anchorOffset),l=Qr(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&<(Kn(s,l),n)==0&<(An(s,l),a)==0)return;var p=t.display.view,g=n.line>=t.display.viewFrom&&Gs(t,n)||{node:p[0].measure.map[2],offset:0},b=a.line<t.display.viewTo&&Gs(t,a);if(!b){var Z=p[p.length-1].measure,te=Z.maps?Z.maps[Z.maps.length-1]:Z.map;b={node:te[te.length-1],offset:te[te.length-2]-te[te.length-3]}}if(!g||!b){e.removeAllRanges();return}var Se=e.rangeCount&&e.getRangeAt(0),ye;try{ye=H(g.node,g.offset,b.offset,b.node)}catch(Ge){}ye&&(!re&&t.state.focused?(e.collapse(g.node,g.offset),ye.collapsed||(e.removeAllRanges(),e.addRange(ye))):(e.removeAllRanges(),e.addRange(ye)),Se&&e.anchorNode==null?e.addRange(Se):re&&this.startGracePeriod()),this.rememberSelection()},Un.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Un.prototype.showMultipleSelections=function(e){y(this.cm.display.cursorDiv,e.cursors),y(this.cm.display.selectionDiv,e.selection)},Un.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Un.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Un.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Un.prototype.blur=function(){this.div.blur()},Un.prototype.getField=function(){return this.div},Un.prototype.supportsTouch=function(){return!0},Un.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Un.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Un.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(W&&N&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=Qr(t,e.anchorNode,e.anchorOffset),n=Qr(t,e.focusNode,e.focusOffset);i&&n&&Wi(t,function(){ki(t.doc,Ea(i,n),Te),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Un.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),a=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Ve(n.line-1,Et(e.doc,n.line-1).length)),a.ch==Et(e.doc,a.line).text.length&&a.line<e.lastLine()&&(a=Ve(a.line+1,0)),n.line<t.viewFrom||a.line>t.viewTo-1)return!1;var s,l,p;n.line==t.viewFrom||(s=ma(e,n.line))==0?(l=$t(t.view[0].line),p=t.view[0].node):(l=$t(t.view[s].line),p=t.view[s-1].node.nextSibling);var g=ma(e,a.line),b,Z;if(g==t.view.length-1?(b=t.viewTo-1,Z=t.lineDiv.lastChild):(b=$t(t.view[g+1].line)-1,Z=t.view[g+1].node.previousSibling),!p)return!1;for(var te=e.doc.splitLines(tu(e,p,Z,l,b)),Se=tn(e.doc,Ve(l,0),Ve(b,Et(e.doc,b).text.length));te.length>1&&Se.length>1;)if(pe(te)==pe(Se))te.pop(),Se.pop(),b--;else if(te[0]==Se[0])te.shift(),Se.shift(),l++;else break;for(var ye=0,Ge=0,it=te[0],ft=Se[0],xt=Math.min(it.length,ft.length);ye<xt&&it.charCodeAt(ye)==ft.charCodeAt(ye);)++ye;for(var Nt=pe(te),wt=pe(Se),Ft=Math.min(Nt.length-(te.length==1?ye:0),wt.length-(Se.length==1?ye:0));Ge<Ft&&Nt.charCodeAt(Nt.length-Ge-1)==wt.charCodeAt(wt.length-Ge-1);)++Ge;if(te.length==1&&Se.length==1&&l==n.line)for(;ye&&ye>n.ch&&Nt.charCodeAt(Nt.length-Ge-1)==wt.charCodeAt(wt.length-Ge-1);)ye--,Ge++;te[te.length-1]=Nt.slice(0,Nt.length-Ge).replace(/^\u200b+/,""),te[0]=te[0].slice(ye).replace(/\u200b+$/,"");var qt=Ve(l,ye),Yt=Ve(b,Se.length?pe(Se).length-Ge:0);if(te.length>1||te[0]||lt(qt,Yt))return $a(e.doc,te,qt,Yt,"+input"),!0},Un.prototype.ensurePolled=function(){this.forceCompositionEnd()},Un.prototype.reset=function(){this.forceCompositionEnd()},Un.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Un.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)},Un.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Di(e.cm)})},Un.prototype.setUneditable=function(e){e.contentEditable="false"},Un.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||yi(this.cm,ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Un.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Un.prototype.onContextMenu=function(){},Un.prototype.resetPosition=function(){},Un.prototype.needsContentAttribute=!0;function Gs(e,t){var i=ht(e,t.line);if(!i||i.hidden)return null;var n=Et(e.doc,t.line),a=Mr(i,n,t.line),s=Ct(n,e.doc.direction),l="left";if(s){var p=ct(s,t.ch);l=p%2?"right":"left"}var g=pt(a.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function qa(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,a){var s="",l=!1,p=e.doc.lineSeparator(),g=!1;function b(ye){return function(Ge){return Ge.id==ye}}function Z(){l&&(s+=p,g&&(s+=p),l=g=!1)}function te(ye){ye&&(Z(),s+=ye)}function Se(ye){if(ye.nodeType==1){var Ge=ye.getAttribute("cm-text");if(Ge){te(Ge);return}var it=ye.getAttribute("cm-marker"),ft;if(it){var xt=e.findMarks(Ve(n,0),Ve(a+1,0),b(+it));xt.length&&(ft=xt[0].find(0))&&te(tn(e.doc,ft.from,ft.to).join(p));return}if(ye.getAttribute("contenteditable")=="false")return;var Nt=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;Nt&&Z();for(var wt=0;wt<ye.childNodes.length;wt++)Se(ye.childNodes[wt]);/^(pre|p)$/i.test(ye.nodeName)&&(g=!0),Nt&&(l=!0)}else ye.nodeType==3&&te(ye.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Se(t),t==i);)t=t.nextSibling,g=!1;return s}function Qr(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return qa(e.clipPos(Ve(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var a=0;a<e.display.view.length;a++){var s=e.display.view[a];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,a=!1;if(!t||!E(n,t))return qa(Ve($t(e.line),0),!0);if(t==n&&(a=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?pe(e.rest):e.line;return qa(Ve($t(s),s.text.length),a)}var l=t.nodeType==3?t:null,p=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));p.parentNode!=n;)p=p.parentNode;var g=e.measure,b=g.maps;function Z(ft,xt,Nt){for(var wt=-1;wt<(b?b.length:0);wt++)for(var Ft=wt<0?g.map:b[wt],qt=0;qt<Ft.length;qt+=3){var Yt=Ft[qt+2];if(Yt==ft||Yt==xt){var un=$t(wt<0?e.line:e.rest[wt]),zn=Ft[qt]+Nt;return(Nt<0||Yt!=ft)&&(zn=Ft[qt+(Nt?1:0)]),Ve(un,zn)}}}var te=Z(l,p,i);if(te)return qa(te,a);for(var Se=p.nextSibling,ye=l?l.nodeValue.length-i:0;Se;Se=Se.nextSibling){if(te=Z(Se,Se.firstChild,0),te)return qa(Ve(te.line,te.ch-ye),a);ye+=Se.textContent.length}for(var Ge=p.previousSibling,it=i;Ge;Ge=Ge.previousSibling){if(te=Z(Ge,Ge.firstChild,-1),te)return qa(Ve(te.line,te.ch+it),a);it+=Ge.textContent.length}}var ni=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Be,this.hasSelection=!1,this.composing=null};ni.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var a=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),M&&(a.style.width="0px"),De(a,"input",function(){j&&x>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),De(a,"paste",function(l){if(We(n,l)||Bs(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(We(n,l))return;if(n.somethingSelected())Jr({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var p=Ws(n);Jr({lineWise:!0,text:p.text}),l.type=="cut"?n.setSelections(p.ranges,null,Te):(i.prevInput="",a.value=p.text.join(`
|
|
`),be(a))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}De(a,"cut",s),De(a,"copy",s),De(e.scroller,"paste",function(l){if(Ji(e,l)||We(n,l))return;if(!a.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var p=new Event("paste");p.clipboardData=l.clipboardData,a.dispatchEvent(p)}),De(e.lineSpace,"selectstart",function(l){Ji(e,l)||w(l)}),De(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"})}}),De(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ni.prototype.createField=function(e){this.wrapper=zs(),this.textarea=this.wrapper.firstChild},ni.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ni.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Ao(e);if(e.options.moveInputWithCursor){var a=Dn(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},ni.prototype.showSelection=function(e){var t=this.cm,i=t.display;y(i.cursorDiv,e.cursors),y(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ni.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&&be(this.textarea),j&&x>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",j&&x>=9&&(this.hasSelection=null))},ni.prototype.getField=function(){return this.textarea},ni.prototype.supportsTouch=function(){return!1},ni.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Y||R()!=this.textarea))try{this.textarea.focus()}catch(e){}},ni.prototype.blur=function(){this.textarea.blur()},ni.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ni.prototype.receivedFocus=function(){this.slowPoll()},ni.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()})},ni.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)},ni.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||et(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(j&&x>=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,p=Math.min(n.length,a.length);l<p&&n.charCodeAt(l)==a.charCodeAt(l);)++l;return Wi(t,function(){ko(t,a.slice(l),n.length-l,null,e.composing?"*compose":null),a.length>1e3||a.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ni.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ni.prototype.onKeyPress=function(){j&&x>=9&&(this.hasSelection=null),this.fastPoll()},ni.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=pa(i,e),l=n.scroller.scrollTop;if(!s||T)return;var p=i.options.resetSelectionOnContextMenu;p&&i.doc.sel.contains(s)==-1&&yi(i,ki)(i.doc,Ea(s),Te);var g=a.style.cssText,b=t.wrapper.style.cssText,Z=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Z.top-5)+"px; left: "+(e.clientX-Z.left-5)+`px;
|
|
z-index: 1000; background: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var te;k&&(te=window.scrollY),n.input.focus(),k&&window.scrollTo(null,te),n.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=ye,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Se(){if(a.selectionStart!=null){var it=i.somethingSelected(),ft="\u200B"+(it?a.value:"");a.value="\u21DA",a.value=ft,t.prevInput=it?"":"\u200B",a.selectionStart=1,a.selectionEnd=ft.length,n.selForContextMenu=i.doc.sel}}function ye(){if(t.contextMenuPending!=ye)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=b,a.style.cssText=g,j&&x<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),a.selectionStart!=null){(!j||j&&x<9)&&Se();var it=0,ft=function(){n.selForContextMenu==i.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="\u200B"?yi(i,us)(i):it++<10?n.detectingSelectAll=setTimeout(ft,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ft,200)}}if(j&&x>=9&&Se(),fe){I(e);var Ge=function(){kt(window,"mouseup",Ge),setTimeout(ye,20)};De(window,"mouseup",Ge)}else setTimeout(ye,50)},ni.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ni.prototype.setUneditable=function(){},ni.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?m(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=R();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=p.getValue()}var a;if(e.form&&(De(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(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(kt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var p=Xn(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return p}function au(e){e.off=kt,e.on=De,e.wheelEventPixels=dl,e.Doc=Ni,e.splitLines=_t,e.countColumn=oe,e.findColumn=ue,e.isWordChar=je,e.Pass=Oe,e.signal=Ue,e.Line=Bi,e.changeEnd=Ca,e.scrollbarModel=Bo,e.Pos=Ve,e.cmpPos=lt,e.modes=It,e.mimeModes=vt,e.resolveMode=Fe,e.getMode=st,e.modeExtensions=tt,e.extendMode=dt,e.copyState=Kt,e.startState=an,e.innerMode=Gt,e.commands=xr,e.keyMap=ga,e.keyName=Ss,e.isModifierKey=xs,e.lookupKey=Ja,e.normalizeKeyMap=Ll,e.StringStream=Vt,e.SharedTextMarker=_r,e.TextMarker=wa,e.LineWidget=br,e.e_preventDefault=w,e.e_stopPropagation=S,e.e_stop=I,e.addClass=ie,e.contains=E,e.rmClass=h,e.keyNames=Sa}Yl(Xn),ql(Xn);var ru="iter insert remove copy getEditor constructor".split(" ");for(var Zr in Ni.prototype)Ni.prototype.hasOwnProperty(Zr)&&Ae(ru,Zr)<0&&(Xn.prototype[Zr]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ni.prototype[Zr]));return Q(Ni),Xn.inputStyles={textarea:ni,contenteditable:Un},Xn.defineMode=function(e){!Xn.defaults.mode&&e!="null"&&(Xn.defaults.mode=e),Xt.apply(this,arguments)},Xn.defineMIME=Lt,Xn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Xn.defineMIME("text/plain","null"),Xn.defineExtension=function(e,t){Xn.prototype[e]=t},Xn.defineDocExtension=function(e,t){Ni.prototype[e]=t},Xn.fromTextArea=iu,au(Xn),Xn.version="5.58.2",Xn})},WaYH:function(Je,Ie,f){"use strict";var z=f("rePB"),ve=f("Ff2n"),re=f("VTBJ"),xe=f("1OyB"),me=f("vuIU"),ae=f("JX7q"),j=f("Ji7U"),x=f("LK+K"),k=f("q1tI"),P=f("TSYQ"),N=f.n(P),T=f("sboe"),ee=f("OZM5"),K=function(fe){var $=fe.prefixCls,h=fe.level,X=fe.isStart,y=fe.isEnd;if(!h)return null;for(var C="".concat($,"-indent-unit"),J=[],H=0;H<h;H+=1){var E;J.push(k.createElement("span",{key:H,className:N()(C,(E={},Object(z.a)(E,"".concat(C,"-start"),X[H+1]),Object(z.a)(E,"".concat(C,"-end"),y[H+1]),Object(z.a)(E,"".concat(C,"-end-first-level"),!H&&y[0]),E))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat($,"-indent")},J)},L=K,M=f("815F"),W="open",Y="close",_="---",we=function(le){Object(j.a)($,le);var fe=Object(x.a)($);function $(){var h;return Object(xe.a)(this,$),h=fe.apply(this,arguments),h.state={dragNodeHighlight:!1},h.onSelectorClick=function(X){var y=h.props.context.onNodeClick;y(X,Object(M.b)(h.props)),h.isSelectable()?h.onSelect(X):h.onCheck(X)},h.onSelectorDoubleClick=function(X){var y=h.props.context.onNodeDoubleClick;y(X,Object(M.b)(h.props))},h.onSelect=function(X){if(h.isDisabled())return;var y=h.props.context.onNodeSelect;X.preventDefault(),y(X,Object(M.b)(h.props))},h.onCheck=function(X){if(h.isDisabled())return;var y=h.props,C=y.disableCheckbox,J=y.checked,H=h.props.context.onNodeCheck;if(!h.isCheckable()||C)return;X.preventDefault();var E=!J;H(X,Object(M.b)(h.props),E)},h.onMouseEnter=function(X){var y=h.props.context.onNodeMouseEnter;y(X,Object(M.b)(h.props))},h.onMouseLeave=function(X){var y=h.props.context.onNodeMouseLeave;y(X,Object(M.b)(h.props))},h.onContextMenu=function(X){var y=h.props.context.onNodeContextMenu;y(X,Object(M.b)(h.props))},h.onDragStart=function(X){var y=h.props.context.onNodeDragStart;X.stopPropagation(),h.setState({dragNodeHighlight:!0}),y(X,Object(ae.a)(h));try{X.dataTransfer.setData("text/plain","")}catch(C){}},h.onDragEnter=function(X){var y=h.props.context.onNodeDragEnter;X.preventDefault(),X.stopPropagation(),y(X,Object(ae.a)(h))},h.onDragOver=function(X){var y=h.props.context.onNodeDragOver;X.preventDefault(),X.stopPropagation(),y(X,Object(ae.a)(h))},h.onDragLeave=function(X){var y=h.props.context.onNodeDragLeave;X.stopPropagation(),y(X,Object(ae.a)(h))},h.onDragEnd=function(X){var y=h.props.context.onNodeDragEnd;X.stopPropagation(),h.setState({dragNodeHighlight:!1}),y(X,Object(ae.a)(h))},h.onDrop=function(X){var y=h.props.context.onNodeDrop;X.preventDefault(),X.stopPropagation(),h.setState({dragNodeHighlight:!1}),y(X,Object(ae.a)(h))},h.onExpand=function(X){var y=h.props.context.onNodeExpand;y(X,Object(M.b)(h.props))},h.setSelectHandle=function(X){h.selectHandle=X},h.getNodeState=function(){var X=h.props.expanded;return h.isLeaf()?null:X?W:Y},h.hasChildren=function(){var X=h.props.eventKey,y=h.props.context.keyEntities,C=y[X]||{},J=C.children;return!!(J||[]).length},h.isLeaf=function(){var X=h.props,y=X.isLeaf,C=X.loaded,J=h.props.context.loadData,H=h.hasChildren();return y===!1?!1:y||!J&&!H||J&&C&&!H},h.isDisabled=function(){var X=h.props.disabled,y=h.props.context.disabled;return!!(y||X)},h.isCheckable=function(){var X=h.props.checkable,y=h.props.context.checkable;return!y||X===!1?!1:y},h.syncLoadData=function(X){var y=X.expanded,C=X.loading,J=X.loaded,H=h.props.context,E=H.loadData,R=H.onNodeLoad;if(C)return;E&&y&&!h.isLeaf()&&(!h.hasChildren()&&!J&&R(Object(M.b)(h.props)))},h.renderSwitcher=function(){var X=h.props,y=X.expanded,C=X.switcherIcon,J=h.props.context,H=J.prefixCls,E=J.switcherIcon,R=C||E;if(h.isLeaf())return k.createElement("span",{className:N()("".concat(H,"-switcher"),"".concat(H,"-switcher-noop"))},typeof R=="function"?R(Object(re.a)(Object(re.a)({},h.props),{},{isLeaf:!0})):R);var ie=N()("".concat(H,"-switcher"),"".concat(H,"-switcher_").concat(y?W:Y));return k.createElement("span",{onClick:h.onExpand,className:ie},typeof R=="function"?R(Object(re.a)(Object(re.a)({},h.props),{},{isLeaf:!1})):R)},h.renderCheckbox=function(){var X=h.props,y=X.checked,C=X.halfChecked,J=X.disableCheckbox,H=h.props.context.prefixCls,E=h.isDisabled(),R=h.isCheckable();if(!R)return null;var ie=typeof R!="boolean"?R:null;return k.createElement("span",{className:N()("".concat(H,"-checkbox"),y&&"".concat(H,"-checkbox-checked"),!y&&C&&"".concat(H,"-checkbox-indeterminate"),(E||J)&&"".concat(H,"-checkbox-disabled")),onClick:h.onCheck},ie)},h.renderIcon=function(){var X=h.props.loading,y=h.props.context.prefixCls;return k.createElement("span",{className:N()("".concat(y,"-iconEle"),"".concat(y,"-icon__").concat(h.getNodeState()||"docu"),X&&"".concat(y,"-icon_loading"))})},h.renderSelector=function(){var X=h.state.dragNodeHighlight,y=h.props,C=y.title,J=y.selected,H=y.icon,E=y.loading,R=y.data,ie=h.props.context,F=ie.prefixCls,be=ie.showIcon,O=ie.icon,m=ie.draggable,oe=ie.loadData,Be=ie.titleRender,Ae=h.isDisabled(),Xe="".concat(F,"-node-content-wrapper"),Oe;if(be){var Te=H||O;Oe=Te?k.createElement("span",{className:N()("".concat(F,"-iconEle"),"".concat(F,"-icon__customize"))},typeof Te=="function"?Te(h.props):Te):h.renderIcon()}else oe&&E&&(Oe=h.renderIcon());var V;typeof C=="function"?V=C(R):Be?V=Be(R):V=C;var B=k.createElement("span",{className:"".concat(F,"-title")},V);return k.createElement("span",{ref:h.setSelectHandle,title:typeof C=="string"?C:"",className:N()("".concat(Xe),"".concat(Xe,"-").concat(h.getNodeState()||"normal"),!Ae&&(J||X)&&"".concat(F,"-node-selected"),!Ae&&m&&"draggable"),draggable:!Ae&&m||void 0,"aria-grabbed":!Ae&&m||void 0,onMouseEnter:h.onMouseEnter,onMouseLeave:h.onMouseLeave,onContextMenu:h.onContextMenu,onClick:h.onSelectorClick,onDoubleClick:h.onSelectorDoubleClick,onDragStart:m?h.onDragStart:void 0},Oe,B)},h}return Object(me.a)($,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var X=this.props.selectable,y=this.props.context.selectable;return typeof X=="boolean"?X:y}},{key:"render",value:function(){var X,y=this.props,C=y.eventKey,J=y.className,H=y.style,E=y.dragOver,R=y.dragOverGapTop,ie=y.dragOverGapBottom,F=y.isLeaf,be=y.isStart,O=y.isEnd,m=y.expanded,oe=y.selected,Be=y.checked,Ae=y.halfChecked,Xe=y.loading,Oe=y.domRef,Te=y.active,V=y.onMouseMove,B=Object(ve.a)(y,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ue=this.props.context,D=ue.prefixCls,A=ue.filterTreeNode,pe=ue.draggable,he=ue.keyEntities,Ze=this.isDisabled(),Le=Object(ee.f)(B),He=he[C]||{},Pe=He.level,je=O[O.length-1];return k.createElement("div",Object.assign({ref:Oe,className:N()(J,"".concat(D,"-treenode"),(X={},Object(z.a)(X,"".concat(D,"-treenode-disabled"),Ze),Object(z.a)(X,"".concat(D,"-treenode-switcher-").concat(m?"open":"close"),!F),Object(z.a)(X,"".concat(D,"-treenode-checkbox-checked"),Be),Object(z.a)(X,"".concat(D,"-treenode-checkbox-indeterminate"),Ae),Object(z.a)(X,"".concat(D,"-treenode-selected"),oe),Object(z.a)(X,"".concat(D,"-treenode-loading"),Xe),Object(z.a)(X,"".concat(D,"-treenode-active"),Te),Object(z.a)(X,"".concat(D,"-treenode-leaf-last"),je),Object(z.a)(X,"drag-over",!Ze&&E),Object(z.a)(X,"drag-over-gap-top",!Ze&&R),Object(z.a)(X,"drag-over-gap-bottom",!Ze&&ie),Object(z.a)(X,"filter-node",A&&A(Object(M.b)(this.props))),X)),style:H,onDragEnter:pe?this.onDragEnter:void 0,onDragOver:pe?this.onDragOver:void 0,onDragLeave:pe?this.onDragLeave:void 0,onDrop:pe?this.onDrop:void 0,onDragEnd:pe?this.onDragEnd:void 0,onMouseMove:V},Le),k.createElement(L,{prefixCls:D,level:Pe,isStart:be,isEnd:O}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),$}(k.Component),ke=function(fe){return k.createElement(T.a.Consumer,null,function($){return k.createElement(we,Object.assign({},fe,{context:$}))})};ke.displayName="TreeNode",ke.defaultProps={title:_},ke.isTreeNode=1;var se=Ie.a=ke},Y1PL:function(Je,Ie,f){"use strict";f.r(Ie),f.d(Ie,"ResizableTextArea",function(){return Ae});var z=f("wx14"),ve=f("1OyB"),re=f("vuIU"),xe=f("Ji7U"),me=f("LK+K"),ae=f("q1tI"),j=f("VTBJ"),x=f("rePB"),k=f("Zm9Q"),P=f("Kwbf"),N=f("c+Xe"),T=f("m+aA"),ee=f("bdgK"),K=new Map;function L(Te){Te.forEach(function(V){var B,ue=V.target;(B=K.get(ue))===null||B===void 0||B.forEach(function(D){return D(ue)})})}var M=new ee.default(L),W=null,Y=null;function _(Te,V){K.has(Te)||(K.set(Te,new Set),M.observe(Te)),K.get(Te).add(V)}function we(Te,V){K.has(Te)&&(K.get(Te).delete(V),K.get(Te).size||(M.unobserve(Te),K.delete(Te)))}var ke=function(Te){Object(xe.a)(B,Te);var V=Object(me.a)(B);function B(){return Object(ve.a)(this,B),V.apply(this,arguments)}return Object(re.a)(B,[{key:"render",value:function(){return this.props.children}}]),B}(ae.Component),se=ae.createContext(null);function le(Te){var V=Te.children,B=Te.onBatchResize,ue=ae.useRef(0),D=ae.useRef([]),A=ae.useContext(se),pe=ae.useCallback(function(he,Ze,Le){ue.current+=1;var He=ue.current;D.current.push({size:he,element:Ze,data:Le}),Promise.resolve().then(function(){He===ue.current&&(B==null||B(D.current),D.current=[])}),A==null||A(he,Ze,Le)},[B,A]);return ae.createElement(se.Provider,{value:pe},V)}function fe(Te){var V=Te.children,B=Te.disabled,ue=ae.useRef(null),D=ae.useRef(null),A=ae.useContext(se),pe=ae.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),he=ae.isValidElement(V)&&Object(N.c)(V),Ze=he?V.ref:null,Le=ae.useMemo(function(){return Object(N.a)(Ze,ue)},[Ze,ue]),He=ae.useRef(Te);He.current=Te;var Pe=ae.useCallback(function(je){var Qe=He.current,nt=Qe.onResize,ot=Qe.data,$e=je.getBoundingClientRect(),Ke=$e.width,At=$e.height,mt=je.offsetWidth,St=je.offsetHeight,ct=Math.floor(Ke),Ot=Math.floor(At);if(pe.current.width!==ct||pe.current.height!==Ot||pe.current.offsetWidth!==mt||pe.current.offsetHeight!==St){var Ct={width:ct,height:Ot,offsetWidth:mt,offsetHeight:St};pe.current=Ct;var yt=mt===Math.round(Ke)?Ke:mt,De=St===Math.round(At)?At:St,Ut=Object(j.a)(Object(j.a)({},Ct),{},{offsetWidth:yt,offsetHeight:De});A==null||A(Ut,je,ot),nt&&Promise.resolve().then(function(){nt(Ut,je)})}},[]);return ae.useEffect(function(){var je=Object(T.a)(ue.current)||Object(T.a)(D.current);return je&&!B&&_(je,Pe),function(){return we(je,Pe)}},[ue.current,B]),ae.createElement(ke,{ref:D},he?ae.cloneElement(V,{ref:Le}):V)}var $="rc-observer-key";function h(Te){var V=Te.children,B=Object(k.a)(V);return B.map(function(ue,D){var A=(ue==null?void 0:ue.key)||"".concat($,"-").concat(D);return ae.createElement(fe,Object(z.a)({},Te,{key:A}),ue)})}h.Collection=le;var X=h,y=f("bT9E"),C=f("TSYQ"),J=f.n(C),H=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],R={},ie;function F(Te){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,B=Te.getAttribute("id")||Te.getAttribute("data-reactid")||Te.getAttribute("name");if(V&&R[B])return R[B];var ue=window.getComputedStyle(Te),D=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),A=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),pe=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),he=E.map(function(Le){return"".concat(Le,":").concat(ue.getPropertyValue(Le))}).join(";"),Ze={sizingStyle:he,paddingSize:A,borderSize:pe,boxSizing:D};return V&&B&&(R[B]=Ze),Ze}function be(Te){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ie||(ie=document.createElement("textarea"),ie.setAttribute("tab-index","-1"),ie.setAttribute("aria-hidden","true"),document.body.appendChild(ie)),Te.getAttribute("wrap")?ie.setAttribute("wrap",Te.getAttribute("wrap")):ie.removeAttribute("wrap");var D=F(Te,V),A=D.paddingSize,pe=D.borderSize,he=D.boxSizing,Ze=D.sizingStyle;ie.setAttribute("style","".concat(Ze,";").concat(H)),ie.value=Te.value||Te.placeholder||"";var Le=Number.MIN_SAFE_INTEGER,He=Number.MAX_SAFE_INTEGER,Pe=ie.scrollHeight,je;if(he==="border-box"?Pe+=pe:he==="content-box"&&(Pe-=A),B!==null||ue!==null){ie.value=" ";var Qe=ie.scrollHeight-A;B!==null&&(Le=Qe*B,he==="border-box"&&(Le=Le+A+pe),Pe=Math.max(Le,Pe)),ue!==null&&(He=Qe*ue,he==="border-box"&&(He=He+A+pe),je=Pe>He?"":"hidden",Pe=Math.min(He,Pe))}return{height:Pe,minHeight:Le,maxHeight:He,overflowY:je,resize:"none"}}var O=f("Gytx"),m=f.n(O),oe;(function(Te){Te[Te.NONE=0]="NONE",Te[Te.RESIZING=1]="RESIZING",Te[Te.RESIZED=2]="RESIZED"})(oe||(oe={}));var Be=function(Te){Object(xe.a)(B,Te);var V=Object(me.a)(B);function B(ue){var D;return Object(ve.a)(this,B),D=V.call(this,ue),D.nextFrameActionId=void 0,D.resizeFrameId=void 0,D.textArea=void 0,D.saveTextArea=function(A){D.textArea=A},D.handleResize=function(A){var pe=D.state.resizeStatus,he=D.props,Ze=he.autoSize,Le=he.onResize;if(pe!==oe.NONE)return;typeof Le=="function"&&Le(A),Ze&&D.resizeOnNextFrame()},D.resizeOnNextFrame=function(){cancelAnimationFrame(D.nextFrameActionId),D.nextFrameActionId=requestAnimationFrame(D.resizeTextarea)},D.resizeTextarea=function(){var A=D.props.autoSize;if(!A||!D.textArea)return;var pe=A.minRows,he=A.maxRows,Ze=be(D.textArea,!1,pe,he);D.setState({textareaStyles:Ze,resizeStatus:oe.RESIZING},function(){cancelAnimationFrame(D.resizeFrameId),D.resizeFrameId=requestAnimationFrame(function(){D.setState({resizeStatus:oe.RESIZED},function(){D.resizeFrameId=requestAnimationFrame(function(){D.setState({resizeStatus:oe.NONE}),D.fixFirefoxAutoScroll()})})})})},D.renderTextArea=function(){var A=D.props,pe=A.prefixCls,he=pe===void 0?"rc-textarea":pe,Ze=A.autoSize,Le=A.onResize,He=A.className,Pe=A.disabled,je=D.state,Qe=je.textareaStyles,nt=je.resizeStatus,ot=Object(y.a)(D.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),$e=J()(he,He,Object(x.a)({},"".concat(he,"-disabled"),Pe));"value"in ot&&(ot.value=ot.value||"");var Ke=Object(j.a)(Object(j.a)(Object(j.a)({},D.props.style),Qe),nt===oe.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return ae.createElement(X,{onResize:D.handleResize,disabled:!(Ze||Le)},ae.createElement("textarea",Object(z.a)({},ot,{className:$e,style:Ke,ref:D.saveTextArea})))},D.state={textareaStyles:{},resizeStatus:oe.NONE},D}return Object(re.a)(B,[{key:"componentDidUpdate",value:function(D){(D.value!==this.props.value||!m()(D.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 D=this.textArea.selectionStart,A=this.textArea.selectionEnd;this.textArea.setSelectionRange(D,A)}}catch(pe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),B}(ae.Component),Ae=Be,Xe=function(Te){Object(xe.a)(B,Te);var V=Object(me.a)(B);function B(ue){var D;Object(ve.a)(this,B),D=V.call(this,ue),D.resizableTextArea=void 0,D.focus=function(){D.resizableTextArea.textArea.focus()},D.saveTextArea=function(pe){D.resizableTextArea=pe},D.handleChange=function(pe){var he=D.props.onChange;D.setValue(pe.target.value,function(){D.resizableTextArea.resizeTextarea()}),he&&he(pe)},D.handleKeyDown=function(pe){var he=D.props,Ze=he.onPressEnter,Le=he.onKeyDown;pe.keyCode===13&&Ze&&Ze(pe),Le&&Le(pe)};var A=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return D.state={value:A},D}return Object(re.a)(B,[{key:"setValue",value:function(D,A){"value"in this.props||this.setState({value:D},A)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return ae.createElement(Ae,Object(z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(D){return"value"in D?{value:D.value}:null}}]),B}(ae.Component),Oe=Ie.default=Xe},YBdh:function(Je,Ie,f){Je.exports=f.p+"static/xiren.7fdb5947.svg"},ZW9T:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return ke});var z=f("k1fw"),ve=f("miYZ"),re=f("tsqr"),xe=f("rAM+"),me=f("tJVT"),ae=f("PpiC"),j=f("q1tI"),x=f.n(j),k=f("bdgK");function P(se,le,fe,$,h){var X=le.getWordUntilPosition(fe),y={startLineNumber:fe.lineNumber,endLineNumber:fe.lineNumber,startColumn:X.startColumn,endColumn:X.endColumn},C=$.map(function(J){return{label:J,kind:se.languages.CompletionItemKind.Keyword,insertText:J,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:y}});return h.map(function(J){C.push(Object(z.a)(Object(z.a)({},J),{},{range:y}))}),C}var N=function(se){var le={label:"ifelse",kind:se.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet},fe=["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"];se.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(y,C){var J=P(se,y,C,fe,[le]);return{suggestions:J}}});var $=["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"];se.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(y,C){var J=[{label:"print",kind:se.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=P(se,y,C,$,J);return{suggestions:H}}});var h=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];se.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(y,C){var J=[le,{label:"main",kind:se.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:se.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=P(se,y,C,h,J);return{suggestions:H}}})},T="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ee=f("LvDl");function K(se){return/^\d+$/.test(se)?"".concat(se,"px"):se}function L(){}var M=!1,W={"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 Y(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],le=se;if(Array.isArray(se)){for(var fe=0;fe<se.length;fe++){var $=W[se[fe]];if($)return $}return le[0]}return W[le]||le}var _=null,we=Ie.b=function(se){var le=se.width,fe=le===void 0?"100%":le,$=se.height,h=$===void 0?"100%":$,X=se.value,y=se.language,C=y===void 0?"javascript":y,J=se.style,H=J===void 0?{}:J,E=se.options,R=E===void 0?{}:E,ie=se.overrideServices,F=ie===void 0?{}:ie,be=se.theme,O=be===void 0?"vs-dark":be,m=se.onEditBlur,oe=se.onSave,Be=se.autoHeight,Ae=Be===void 0?!1:Be,Xe=se.forbidCopy,Oe=Xe===void 0?!1:Xe,Te=se.onChange,V=Te===void 0?L:Te,B=se.editorDidMount,ue=B===void 0?L:B,D=se.onFocus,A=D===void 0?L:D,pe=se.filename,he=pe===void 0?"educoder.txt":pe,Ze=Object(ae.a)(se,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Le=Object(j.useRef)(),He=Object(j.useRef)({}),Pe=Object(j.useRef)(),je=Object(j.useRef)(!1),Qe=Object(j.useRef)(),nt=Object(j.useState)(!1),ot=Object(me.a)(nt,2),$e=ot[0],Ke=ot[1];function At(){var U;return Le.current&&(U=new k.default(function(I){var de=Object(xe.a)(I),Ce;try{for(de.s();!(Ce=de.n()).done;){var Re=Ce.value;(Re.target.offsetHeight>0||Re.target.offsetWidth>0)&&He.current.instance.layout()}}catch(bt){de.e(bt)}finally{de.f()}}),U.observe(Le.current)),U}function mt(){re.b.warn(decodeURIComponent(T))}var St=function(){var I=He.current.instance;if(X!=null&&I&&$e){var de=I.getModel();de&&X!==de.getValue()&&(M=!0,de.setValue(X),I.layout(),M=!1)}};Object(j.useEffect)(function(){Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(function(){St()},500)},[X,$e,He.current]);function ct(){var U=He.current.instance;if(U){var I=U.getSelection(),de=He.current.pastePos||{},Ce=new _.Range(de.startLineNumber||I.endLineNumber,de.startColumn||I.endColumn,de.endLineNumber||I.endLineNumber,de.endColumn||I.endColumn);setTimeout(function(){U.executeEdits("",[{range:Ce,text:""}])},300)}}function Ot(U){(window.navigator.platform.match("Mac")?U.metaKey:U.ctrlKey)&&U.keyCode==83&&(U.preventDefault(),oe())}var Ct=function(){if(Ae&&He.current.instance){var I=He.current.instance.getContentHeight();w(I<h?h:I)}else w(h)};function yt(U){var I=document.createEvent("MouseEvents");I.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),U.dispatchEvent(I)}function De(U,I){var de=window.URL||window.webkitURL||window,Ce=new Blob([I]),Re=document.createElementNS("http://www.w3.org/1999/xhtml","a");Re.href=de.createObjectURL(Ce),Re.download=U,yt(Re)}Object(j.useEffect)(function(){Ct()},[Ct]),Object(j.useEffect)(function(){Le.current&&!$e&&f.e(27).then(f.t.bind(null,"M/lh",7)).then(function(U){try{_=U,He.current.instance=_.editor.create(Le.current,{value:X,language:Y(C),theme:O,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},F);var I=He.current.instance;if(ue(I,_),setTimeout(function(){Ct(),He.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){De(he||"educoder.txt",I.getValue())}})},500),He.current.subscription=I.onDidChangeModelContent(function(Ce){je.current?clearTimeout(Qe.current):(Ct(),V(I.getValue(),Ce)),Qe.current=setTimeout(function(){je.current=!1},500)}),window.Monaco||N(_),Oe&&(I.addCommand(_.KeyMod.CtrlCmd|_.KeyMod.Shift|_.KeyCode.KEY_V,function(){return mt(),null}),I.addCommand(_.KeyMod.CtrlCmd|_.KeyCode.KEY_C,function(){return mt(),null})),window.Monaco=_,m&&I.onDidBlurEditorWidget(function(){m(I.getValue())}),A&&I.onDidFocusEditorText(function(){A(I.getValue())}),Oe){I.addCommand(_.KeyMod.CtrlCmd|_.KeyCode.KEY_V,function(){return mt(),null}),I.onDidPaste(function(Ce){He.current.pastePos=Ce});try{window.addEventListener("paste",ct)}catch(Ce){}}var de=At();return Ke(!0),function(){var Ce=He.current.instance;Ce.dispose();var Re=Ce.getModel();Re&&Re.dispose(),He.current.subscription&&He.current.subscription.dispose(),Oe&&window.removeEventListener("paste",ct),de.unobserve(Le.current)}}catch(Ce){}})},[]),Object(j.useEffect)(function(){var U=He.current.instance;if(U&&$e)return document.addEventListener("keydown",Ot,!1),function(){document.removeEventListener("keydown",Ot)}},[oe,$e]),Object(j.useEffect)(function(){var U=He.current.instance;if(U&&$e){var I=Y(C);_.editor.setModelLanguage(U.getModel(),I),console.log("language:",C,U.getModel(),I)}},[C,$e]),Object(j.useEffect)(function(){var U=He.current.instance;U&&$e&&_.editor.setTheme(O)},[O,$e]),Object(j.useEffect)(function(){var U=He.current.instance;U&&$e&&(U.updateOptions(Object(z.a)({},R)),setTimeout(function(){U.getModel().updateOptions(Object(z.a)({},R))},200))},[JSON.stringify(R),$e]),Object(j.useEffect)(function(){var U=He.current.instance;U&&$e&&U.layout()},[fe,h,$e]);var Ut=Object(j.useState)(K(fe)),kt=Object(me.a)(Ut,2),Ue=kt[0],We=kt[1],G=Object(j.useState)(K(h)),q=Object(me.a)(G,2),Q=q[0],w=q[1],S=Object(z.a)(Object(z.a)({},H),{},{width:Ue,height:Q});return x.a.createElement("div",{className:"my-monaco-editor",ref:Le,style:S})};function ke(se){var le=se.width,fe=le===void 0?"100%":le,$=se.height,h=$===void 0?"100%":$,X=se.original,y=se.modified,C=se.language,J=se.options,H=J===void 0?{}:J,E=Object(j.useRef)(),R=Object(j.useState)(null),ie=Object(me.a)(R,2),F=ie[0],be=ie[1];function O(Ae){var Xe;return E.current&&(Xe=new k.default(function(Oe){var Te=Object(xe.a)(Oe),V;try{for(Te.s();!(V=Te.n()).done;){var B=V.value;(B.target.offsetHeight>0||B.target.offsetWidth>0)&&Ae.layout()}}catch(ue){Te.e(ue)}finally{Te.f()}}),Xe.observe(E.current)),Xe}Object(j.useEffect)(function(){E.current&&f.e(27).then(f.t.bind(null,"M/lh",7)).then(function(Ae){_=Ae;var Xe=_.editor.createDiffEditor(E.current,Object(z.a)(Object(z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},H),{},{wordWrap:!0}));be(Xe);var Oe=O(Xe);return function(){Xe.dispose();var Te=Xe.getModel();Te&&Te.dispose(),Oe.unobserve(E.current)}})},[]),Object(j.useEffect)(function(){F&&F.setModel({original:_.editor.createModel(X,C),modified:_.editor.createModel(y,C)})},[X,y,C,F]);var m=K(fe),oe=K(h),Be={width:m,height:oe};return x.a.createElement("div",{className:"my-diff-editor",ref:E,style:Be})}},ZpRC:function(Je,Ie,f){"use strict";function z(N){return typeof N=="object"&&N!=null&&N.nodeType===1}function ve(N,T){return(!T||N!=="hidden")&&N!=="visible"&&N!=="clip"}function re(N,T){if(N.clientHeight<N.scrollHeight||N.clientWidth<N.scrollWidth){var ee=getComputedStyle(N,null);return ve(ee.overflowY,T)||ve(ee.overflowX,T)||function(K){var L=function(M){if(!M.ownerDocument||!M.ownerDocument.defaultView)return null;try{return M.ownerDocument.defaultView.frameElement}catch(W){return null}}(K);return!!L&&(L.clientHeight<K.scrollHeight||L.clientWidth<K.scrollWidth)}(N)}return!1}function xe(N,T,ee,K,L,M,W,Y){return M<N&&W>T||M>N&&W<T?0:M<=N&&Y<=ee||W>=T&&Y>=ee?M-N-K:W>T&&Y<ee||M<N&&Y>ee?W-T+L:0}var me=function(N,T){var ee=window,K=T.scrollMode,L=T.block,M=T.inline,W=T.boundary,Y=T.skipOverflowHiddenElements,_=typeof W=="function"?W:function(Qe){return Qe!==W};if(!z(N))throw new TypeError("Invalid target");for(var we=document.scrollingElement||document.documentElement,ke=[],se=N;z(se)&&_(se);){if((se=se.parentElement)===we){ke.push(se);break}se!=null&&se===document.body&&re(se)&&!re(document.documentElement)||se!=null&&re(se,Y)&&ke.push(se)}for(var le=ee.visualViewport?ee.visualViewport.width:innerWidth,fe=ee.visualViewport?ee.visualViewport.height:innerHeight,$=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,X=N.getBoundingClientRect(),y=X.height,C=X.width,J=X.top,H=X.right,E=X.bottom,R=X.left,ie=L==="start"||L==="nearest"?J:L==="end"?E:J+y/2,F=M==="center"?R+C/2:M==="end"?H:R,be=[],O=0;O<ke.length;O++){var m=ke[O],oe=m.getBoundingClientRect(),Be=oe.height,Ae=oe.width,Xe=oe.top,Oe=oe.right,Te=oe.bottom,V=oe.left;if(K==="if-needed"&&J>=0&&R>=0&&E<=fe&&H<=le&&J>=Xe&&E<=Te&&R>=V&&H<=Oe)return be;var B=getComputedStyle(m),ue=parseInt(B.borderLeftWidth,10),D=parseInt(B.borderTopWidth,10),A=parseInt(B.borderRightWidth,10),pe=parseInt(B.borderBottomWidth,10),he=0,Ze=0,Le="offsetWidth"in m?m.offsetWidth-m.clientWidth-ue-A:0,He="offsetHeight"in m?m.offsetHeight-m.clientHeight-D-pe:0;if(we===m)he=L==="start"?ie:L==="end"?ie-fe:L==="nearest"?xe(h,h+fe,fe,D,pe,h+ie,h+ie+y,y):ie-fe/2,Ze=M==="start"?F:M==="center"?F-le/2:M==="end"?F-le:xe($,$+le,le,ue,A,$+F,$+F+C,C),he=Math.max(0,he+h),Ze=Math.max(0,Ze+$);else{he=L==="start"?ie-Xe-D:L==="end"?ie-Te+pe+He:L==="nearest"?xe(Xe,Te,Be,D,pe+He,ie,ie+y,y):ie-(Xe+Be/2)+He/2,Ze=M==="start"?F-V-ue:M==="center"?F-(V+Ae/2)+Le/2:M==="end"?F-Oe+A+Le:xe(V,Oe,Ae,ue,A+Le,F,F+C,C);var Pe=m.scrollLeft,je=m.scrollTop;ie+=je-(he=Math.max(0,Math.min(je+he,m.scrollHeight-Be+He))),F+=Pe-(Ze=Math.max(0,Math.min(Pe+Ze,m.scrollWidth-Ae+Le)))}be.push({el:m,top:he,left:Ze})}return be};function ae(N){return N===Object(N)&&Object.keys(N).length!==0}function j(N,T){T===void 0&&(T="auto");var ee="scrollBehavior"in document.body.style;N.forEach(function(K){var L=K.el,M=K.top,W=K.left;L.scroll&&ee?L.scroll({top:M,left:W,behavior:T}):(L.scrollTop=M,L.scrollLeft=W)})}function x(N){return N===!1?{block:"end",inline:"nearest"}:ae(N)?N:{block:"start",inline:"nearest"}}function k(N,T){var ee=!N.ownerDocument.documentElement.contains(N);if(ae(T)&&typeof T.behavior=="function")return T.behavior(ee?[]:me(N,T));if(ee)return;var K=x(T);return j(me(N,K),K.behavior)}var P=Ie.a=k},aRTE:function(Je,Ie){Je.exports={L:1,M:0,Q:3,H:2}},bT9E:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return ve});var z=f("VTBJ");function ve(re,xe){var me=Object(z.a)({},re);return Array.isArray(xe)&&xe.forEach(function(ae){delete me[ae]}),me}},c5Ni:function(Je,Ie,f){},dQei:function(Je,Ie){for(var f={glog:function(ve){if(ve<1)throw new Error("glog("+ve+")");return f.LOG_TABLE[ve]},gexp:function(ve){for(;ve<0;)ve+=255;for(;ve>=256;)ve-=255;return f.EXP_TABLE[ve]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},z=0;z<8;z++)f.EXP_TABLE[z]=1<<z;for(var z=8;z<256;z++)f.EXP_TABLE[z]=f.EXP_TABLE[z-4]^f.EXP_TABLE[z-5]^f.EXP_TABLE[z-6]^f.EXP_TABLE[z-8];for(var z=0;z<255;z++)f.LOG_TABLE[f.EXP_TABLE[z]]=z;Je.exports=f},dWSS:function(Je,Ie,f){var z=f("dQei");function ve(re,xe){if(re.length==null)throw new Error(re.length+"/"+xe);for(var me=0;me<re.length&&re[me]==0;)me++;this.num=new Array(re.length-me+xe);for(var ae=0;ae<re.length-me;ae++)this.num[ae]=re[ae+me]}ve.prototype={get:function(re){return this.num[re]},getLength:function(){return this.num.length},multiply:function(re){for(var xe=new Array(this.getLength()+re.getLength()-1),me=0;me<this.getLength();me++)for(var ae=0;ae<re.getLength();ae++)xe[me+ae]^=z.gexp(z.glog(this.get(me))+z.glog(re.get(ae)));return new ve(xe,0)},mod:function(re){if(this.getLength()-re.getLength()<0)return this;for(var xe=z.glog(this.get(0))-z.glog(re.get(0)),me=new Array(this.getLength()),ae=0;ae<this.getLength();ae++)me[ae]=this.get(ae);for(var ae=0;ae<re.getLength();ae++)me[ae]^=z.gexp(z.glog(re.get(ae))+xe);return new ve(me,0).mod(re)}},Je.exports=ve},dejd:function(Je,Ie,f){},dmUQ:function(Je,Ie,f){"use strict";var z=f("Ff2n"),ve=f("rePB"),re=f("1OyB"),xe=f("vuIU"),me=f("Ji7U"),ae=f("md7G"),j=f("foSv"),x=f("q1tI"),k=f.n(x),P=f("TSYQ"),N=f.n(P),T=f("4IlW");function ee(y,C){var J=Object.keys(y);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(y);C&&(H=H.filter(function(E){return Object.getOwnPropertyDescriptor(y,E).enumerable})),J.push.apply(J,H)}return J}function K(y){for(var C=1;C<arguments.length;C++){var J=arguments[C]!=null?arguments[C]:{};C%2?ee(Object(J),!0).forEach(function(H){Object(ve.a)(y,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(J)):ee(Object(J)).forEach(function(H){Object.defineProperty(y,H,Object.getOwnPropertyDescriptor(J,H))})}return y}function L(y){var C=M();return function(){var H=Object(j.a)(y),E;if(C){var R=Object(j.a)(this).constructor;E=Reflect.construct(H,arguments,R)}else E=H.apply(this,arguments);return Object(ae.a)(this,E)}}function M(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(y){return!1}}function W(){}function Y(y){y.preventDefault()}var _=function(C){return C.replace(/[^\w.-]+/g,"")},we=200,ke=600,se=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,le=function(C){return C!=null},fe=function(C,J){return J===C||typeof J=="number"&&typeof C=="number"&&isNaN(J)&&isNaN(C)},$=function(y){Object(me.a)(J,y);var C=L(J);function J(H){var E;Object(re.a)(this,J),E=C.call(this,H),E.onKeyDown=function(F){var be=E.props,O=be.onKeyDown,m=be.onPressEnter;if(F.keyCode===T.a.UP){var oe=E.getRatio(F);E.up(F,oe,null),E.stop()}else if(F.keyCode===T.a.DOWN){var Be=E.getRatio(F);E.down(F,Be,null),E.stop()}else F.keyCode===T.a.ENTER&&m&&m(F);if(E.recordCursorPosition(),E.lastKeyCode=F.keyCode,O){for(var Ae=arguments.length,Xe=new Array(Ae>1?Ae-1:0),Oe=1;Oe<Ae;Oe++)Xe[Oe-1]=arguments[Oe];O.apply(void 0,[F].concat(Xe))}},E.onKeyUp=function(F){var be=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),be){for(var O=arguments.length,m=new Array(O>1?O-1:0),oe=1;oe<O;oe++)m[oe-1]=arguments[oe];be.apply(void 0,[F].concat(m))}},E.onChange=function(F){var be=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(F)),E.setState({inputValue:E.rawInput}),be(E.toNumber(E.rawInput))},E.onMouseUp=function(){var F=E.props.onMouseUp;E.recordCursorPosition(),F&&F.apply(void 0,arguments)},E.onFocus=function(){var F;E.setState({focused:!0}),(F=E.props).onFocus.apply(F,arguments)},E.onBlur=function(){var F=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var be=E.getCurrentValidValue(E.state.inputValue),O=E.setValue(be,W);if(F){var m=E.input.value,oe=E.getInputDisplayValue({focus:!1,value:O});E.input.value=oe&&Number(oe),F.apply(void 0,arguments),E.input.value=m}},E.getRatio=function(F){var be=1;return F.metaKey||F.ctrlKey?be=.1:F.shiftKey&&(be=10),be},E.getFullNum=function(F){return isNaN(F)?F:/e/i.test(String(F))?Number(F).toFixed(18).replace(/\.?0+$/,""):F},E.getPrecision=function(F){if(le(E.props.precision))return E.props.precision;var be=String(F);if(be.indexOf("e-")>=0)return parseInt(be.slice(be.indexOf("e-")+2),10);var O=0;return be.indexOf(".")>=0&&(O=be.length-be.indexOf(".")-1),O},E.getInputDisplayValue=function(F){var be=F||E.state,O=be.focused,m=be.inputValue,oe=be.value,Be;O?Be=m:Be=E.toPrecisionAsStep(oe),Be==null&&(Be="");var Ae=E.formatWrapper(Be);return le(E.props.decimalSeparator)&&(Ae=Ae.toString().replace(".",E.props.decimalSeparator)),Ae},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(F){}},E.restoreByAfter=function(F){if(F===void 0)return!1;var be=E.input.value,O=be.lastIndexOf(F);if(O===-1)return!1;var m=E.cursorBefore.length;return E.lastKeyCode===T.a.DELETE&&E.cursorBefore.charAt(m-1)===F[0]?(E.fixCaret(m,m),!0):O+F.length===be.length?(E.fixCaret(O,O),!0):!1},E.partRestoreByAfter=function(F){return F===void 0?!1:Array.prototype.some.call(F,function(be,O){var m=F.substring(O);return E.restoreByAfter(m)})},E.isNotCompleteNumber=function(F){return isNaN(F)||F===""||F===null||F&&F.toString().indexOf(".")===F.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(F,be,O){E.pressingUpOrDown=!0,E.step("down",F,be,O)},E.up=function(F,be,O){E.pressingUpOrDown=!0,E.step("up",F,be,O)},E.saveInput=function(F){E.input=F};var R=H.value;R===void 0&&(R=H.defaultValue),E.state={focused:H.autoFocus};var ie=E.getValidValue(E.toNumber(R));return E.state=K(K({},E.state),{},{inputValue:E.toPrecisionAsStep(ie),value:ie}),E}return Object(xe.a)(J,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var R=this.props,ie=R.value,F=R.onChange,be=R.max,O=R.min,m=this.state.focused;if(E){if(!fe(E.value,ie)||!fe(E.max,be)||!fe(E.min,O)){var oe=m?ie:this.getValidValue(ie),Be;this.pressingUpOrDown?Be=oe:this.inputting?Be=this.rawInput:Be=this.toPrecisionAsStep(oe),this.setState({value:oe,inputValue:Be})}var Ae="value"in this.props?ie:this.state.value;"max"in this.props&&E.max!==be&&typeof Ae=="number"&&Ae>be&&F&&F(be),"min"in this.props&&E.min!==O&&typeof Ae=="number"&&Ae<O&&F&&F(O)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Xe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?Xe=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(Xe=this.cursorStart):Xe=this.input.value.length,this.fixCaret(Xe,Xe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Oe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(E){var R=E;return R===""?R="":this.isNotCompleteNumber(parseFloat(R))?R=this.state.value:R=this.getValidValue(R),this.toNumber(R)}},{key:"getValueFromEvent",value:function(E){var R=E.target.value.trim().replace(/。/g,".");return le(this.props.decimalSeparator)&&(R=R.replace(this.props.decimalSeparator,".")),R}},{key:"getValidValue",value:function(E){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,F=parseFloat(E);return isNaN(F)?E:(F<R&&(F=R),F>ie&&(F=ie),F)}},{key:"setValue",value:function(E,R){var ie=this.props.precision,F=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),be=this.state.value,O=be===void 0?null:be,m=this.state.inputValue,oe=m===void 0?null:m,Be=typeof F=="number"?F.toFixed(ie):"".concat(F),Ae=F!==O||Be!=="".concat(oe);return"value"in this.props?(oe=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:oe},R)):this.setState({value:F,inputValue:this.toPrecisionAsStep(E)},R),Ae&&this.props.onChange(F),F}},{key:"getMaxPrecision",value:function(E){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=this.props,F=ie.precision,be=ie.step;if(le(F))return F;var O=this.getPrecision(R),m=this.getPrecision(be),oe=this.getPrecision(E);return E?Math.max(oe,O+m):O+m}},{key:"getPrecisionFactor",value:function(E){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=this.getMaxPrecision(E,R);return Math.pow(10,ie)}},{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(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var R=Math.abs(this.getMaxPrecision(E));return isNaN(R)?E.toString():Number(E).toFixed(R)}},{key:"toNumber",value:function(E){var R=this.props.precision,ie=this.state.focused,F=E&&E.length>16&&ie;return this.isNotCompleteNumber(E)||F?E:le(R)?Math.round(E*Math.pow(10,R))/Math.pow(10,R):Number(E)}},{key:"upStep",value:function(E,R){var ie=this.props.step,F=this.getPrecisionFactor(E,R),be=Math.abs(this.getMaxPrecision(E,R)),O=((F*E+F*ie*R)/F).toFixed(be);return this.toNumber(O)}},{key:"downStep",value:function(E,R){var ie=this.props.step,F=this.getPrecisionFactor(E,R),be=Math.abs(this.getMaxPrecision(E,R)),O=((F*E-F*ie*R)/F).toFixed(be);return this.toNumber(O)}},{key:"step",value:function(E,R){var ie=this,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,be=arguments.length>3?arguments[3]:void 0;this.stop(),R&&(R.persist(),R.preventDefault());var O=this.props;if(O.disabled)return;var m=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(m))return;var oe=this["".concat(E,"Step")](m,F),Be=oe>O.max||oe<O.min;if(oe>O.max?oe=O.max:oe<O.min&&(oe=O.min),this.setValue(oe,null),this.setState({focused:!0},function(){ie.pressingUpOrDown=!1}),Be)return;this.autoStepTimer=setTimeout(function(){ie[E](R,F,!0)},be?we:ke)}},{key:"fixCaret",value:function(E,R){if(E===void 0||R===void 0||!this.input||!this.input.value)return;try{var ie=this.input.selectionStart,F=this.input.selectionEnd;(E!==ie||R!==F)&&this.input.setSelectionRange(E,R)}catch(be){}}},{key:"render",value:function(){var E,R=this.props,ie=R.prefixCls,F=R.disabled,be=R.readOnly,O=R.useTouch,m=R.autoComplete,oe=R.upHandler,Be=R.downHandler,Ae=R.className,Xe=R.max,Oe=R.min,Te=R.style,V=R.title,B=R.onMouseEnter,ue=R.onMouseLeave,D=R.onMouseOver,A=R.onMouseOut,pe=R.required,he=R.onClick,Ze=R.tabIndex,Le=R.type,He=R.placeholder,Pe=R.id,je=R.inputMode,Qe=R.pattern,nt=R.step,ot=R.maxLength,$e=R.autoFocus,Ke=R.name,At=R.onPaste,mt=R.onInput,St=Object(z.a)(R,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ct=this.state,Ot=ct.value,Ct=ct.focused,yt=N()(ie,(E={},Object(ve.a)(E,Ae,!!Ae),Object(ve.a)(E,"".concat(ie,"-disabled"),F),Object(ve.a)(E,"".concat(ie,"-focused"),Ct),E)),De={};Object.keys(St).forEach(function(I){(I.substr(0,5)==="data-"||I.substr(0,5)==="aria-"||I==="role")&&(De[I]=St[I])});var Ut=!be&&!F,kt=this.getInputDisplayValue(null),Ue=(Ot||Ot===0)&&(isNaN(Ot)||Number(Ot)>=Xe),We=(Ot||Ot===0)&&(isNaN(Ot)||Number(Ot)<=Oe),G=Ue||F||be,q=We||F||be,Q=N()("".concat(ie,"-handler"),"".concat(ie,"-handler-up"),Object(ve.a)({},"".concat(ie,"-handler-up-disabled"),G)),w=N()("".concat(ie,"-handler"),"".concat(ie,"-handler-down"),Object(ve.a)({},"".concat(ie,"-handler-down-disabled"),q)),S=O?{onTouchStart:G?W:this.up,onTouchEnd:this.stop}:{onMouseDown:G?W:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},U=O?{onTouchStart:q?W:this.down,onTouchEnd:this.stop}:{onMouseDown:q?W:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:yt,style:Te,title:V,onMouseEnter:B,onMouseLeave:ue,onMouseOver:D,onMouseOut:A,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(ie,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Increase Value","aria-disabled":G,className:Q}),oe||k.a.createElement("span",{unselectable:"on",className:"".concat(ie,"-handler-up-inner"),onClick:Y})),k.a.createElement("span",Object.assign({unselectable:"on"},U,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:w}),Be||k.a.createElement("span",{unselectable:"on",className:"".concat(ie,"-handler-down-inner"),onClick:Y}))),k.a.createElement("div",{className:"".concat(ie,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":Xe,"aria-valuenow":Ot,required:pe,type:Le,placeholder:He,onPaste:At,onClick:he,onMouseUp:this.onMouseUp,className:"".concat(ie,"-input"),tabIndex:Ze,autoComplete:m,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ut?this.onKeyDown:W,onKeyUp:Ut?this.onKeyUp:W,autoFocus:$e,maxLength:ot,readOnly:be,disabled:F,max:Xe,min:Oe,step:nt,name:Ke,title:V,id:Pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(kt),pattern:Qe,inputMode:je,onInput:mt},De))))}}]),J}(k.a.Component);$.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:se,min:-se,step:1,style:{},onChange:W,onKeyDown:W,onPressEnter:W,onFocus:W,onBlur:W,parser:_,required:!1,autoComplete:"off"};var h=$,X=Ie.a=h},"e+RI":function(Je,Ie,f){Je.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":function(Je,Ie,f){"use strict";var z=f("giR+"),ve=f("fyUT"),re=f("tJVT"),xe=f("PpiC"),me=f("OaEy"),ae=f("2fM7"),j=f("q1tI"),x=f.n(j),k=f("2sxD"),P=f.n(k),N=f("51dB"),T=f.n(N),ee=f("5MlY"),K=f.n(ee),L=f("lnNo"),M=f.n(L),W=f("YBdh"),Y=f.n(W),_=f("LvDl"),we=f.n(_),ke=f("TSYQ"),se=f.n(ke),le=ae.a.Option,fe=function(y){var C=parseInt(y);return Object(_.isNaN)(C)?0:C},$=function(y){var C,J,H=y.index,E=y.value,R=E===void 0?[]:E,ie=y.onChange,F=y.type,be=y.disabled,O=be===void 0?!1:be,m=y.expansion,oe=m===void 0?!0:m,Be=Object(xe.a)(y,["index","value","onChange","type","disabled","expansion"]),Ae=Object(j.useState)(!0),Xe=Object(re.a)(Ae,2),Oe=Xe[0],Te=Xe[1],V=function(ue,D){var A=Object(_.cloneDeep)(R);A.difficulties[D].num=ue,console.log(A,444),ie(A)};return console.log("---111-",R),x.a.createElement("div",{className:P.a.ListGroup,style:{borderWidth:H?1:0}},x.a.createElement("div",{className:P.a.a},H+1),x.a.createElement("div",{"data-type":"width",className:P.a.b},R==null?void 0:R.name),x.a.createElement("div",{className:P.a.c},R==null||((C=R.difficulties)===null||C===void 0)?void 0:C.map(function(B,ue){return x.a.createElement("div",{key:ue,style:{display:Oe?"flex":ue?"none":"flex"},className:P.a.c1},x.a.createElement("span",{style:{color:"#777777",marginRight:5}},"\u96BE\u5EA6"),B.difficulty===1&&x.a.createElement("span",{className:P.a.radio},"\u7B80\u5355"),B.difficulty===2&&x.a.createElement("span",{className:P.a.radio},"\u9002\u4E2D"),B.difficulty===3&&x.a.createElement("span",{className:P.a.radio},"\u56F0\u96BE"),x.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"\u62BD\u9898\u6570\u91CF"),H===0&&ue===0?x.a.createElement("div",{id:"".concat(F,"_sum")},x.a.createElement(ve.a,{disabled:O,parser:fe,onChange:function(A){return V(A,ue)},min:0,max:B==null?void 0:B.count,value:(B==null?void 0:B.num)||0,style:{width:66}}),x.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6570\u91CF")):x.a.createElement(ve.a,{disabled:O,parser:fe,onChange:function(A){return V(A,ue)},min:0,max:B==null?void 0:B.count,value:(B==null?void 0:B.num)||0,style:{width:66}}),x.a.createElement("span",{style:{marginLeft:5}},"/",B==null?void 0:B.count))})),x.a.createElement("div",{style:{display:(R==null||((J=R.difficulties)===null||J===void 0)?void 0:J.length)===1||!oe?"none":"block"},onClick:function(){return Te(!Oe)},className:P.a.d},Oe?"\u6536\u8D77":"\u5C55\u5F00",x.a.createElement("img",{style:{marginTop:-2,transform:Oe?"rotate(0deg)":"rotate(180deg)"},src:M.a,className:"ml5"})))},h=function(y){var C,J,H=y.value,E=H===void 0?[]:H,R=y.onChange,ie=y.listClassName,F=y.disabled,be=F===void 0?!1:F,O=y.expansion,m=O===void 0?!0:O,oe=Object(xe.a)(y,["value","onChange","listClassName","disabled","expansion"]),Be=Object(j.useState)(!0),Ae=Object(re.a)(Be,2),Xe=Ae[0],Oe=Ae[1],Te=function(A){var pe,he=A.score||0,Ze=[];A==null||((pe=A.item_banks)===null||pe===void 0)||pe.forEach(function(He){var Pe;He==null||((Pe=He.tag_disciplines)===null||Pe===void 0)||Pe.forEach(function(je){var Qe;je==null||((Qe=je.difficulties)===null||Qe===void 0)||Qe.forEach(function(nt){nt.num&&Ze.push(nt.num)})})});var Le=Ze.reduce(function(He,Pe){return He+Pe},0);return Le*he},V=[{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:"PHOTOGRAPH",name:"\u62CD\u7167\u4E0A\u4F20\u9898"},{type:"FILEUPLOAD",name:"\u6587\u4EF6\u4E0A\u4F20\u9898"},{type:"COMBINATION",name:"\u63A5\u9F99\u9898"}],B=function(A,pe,he){var Ze=Object(_.cloneDeep)(E);Ze.item_banks[pe].tag_disciplines[he]=A;var Le=Te(Ze);Ze.scoreTotal=Le,console.log(Ze,"newValue"),R(Ze)},ue=function(A){var pe=Object(_.cloneDeep)(E);pe.score=A;var he=Te(pe);pe.scoreTotal=he,R(pe)};return x.a.createElement("div",{className:se()(P.a.list,ie)},x.a.createElement("div",{className:P.a.head},x.a.createElement("div",{className:P.a.name},x.a.createElement("b",null),x.a.createElement("span",null,(C=V.find(function(D){return D.type===(E==null?void 0:E.item_type)}))===null||C===void 0?void 0:C.name)),x.a.createElement("div",{className:P.a.right},m&&x.a.createElement("div",{onClick:function(){return Oe(!Xe)},className:"current c-light-primary mb10"},Xe?"\u6536\u8D77":"\u5C55\u5F00",x.a.createElement("img",{style:{marginTop:-2,transform:Xe?"rotate(0deg)":"rotate(180deg)"},src:M.a,className:"ml5"})),x.a.createElement("div",null,x.a.createElement("img",{src:T.a}),x.a.createElement("span",{className:"ml10 mr20"},"\u603B\u5206",E.scoreTotal,"\u5206"),x.a.createElement("img",{className:"mr10",src:K.a}),x.a.createElement("span",null,(E==null?void 0:E.item_type)==="COMBINATION"?"\u6BCF\u5C0F\u9898":"\u6BCF\u9898"),x.a.createElement("div",{id:"".concat(E==null?void 0:E.item_type,"_score")},x.a.createElement(ve.a,{disabled:be,parser:fe,min:0,onChange:ue,value:E.score,style:{margin:"0 5px"}}),x.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6BCF\u9898\u5206\u6570")),x.a.createElement("span",null,"\u5206")))),x.a.createElement("div",{className:P.a.body,style:{display:Xe?"block":"none"}},E==null||((J=E.item_banks)===null||J===void 0)?void 0:J.map(function(D,A){var pe;return x.a.createElement(x.a.Fragment,{key:A},x.a.createElement("div",{className:P.a.top},x.a.createElement("img",{src:Y.a}),x.a.createElement("span",null,"\u8BFE\u7A0B/\u7AE0\u8282"),x.a.createElement("b",null),x.a.createElement("aside",null,D==null?void 0:D.disciplines,"/",D==null?void 0:D.sub_discipline)),x.a.createElement("div",{className:P.a.bottom},x.a.createElement("div",{className:P.a.l},"\u77E5\u8BC6\u70B9"),x.a.createElement("div",{className:P.a.r},D==null||((pe=D.tag_disciplines)===null||pe===void 0)?void 0:pe.map(function(he,Ze){return x.a.createElement($,{expansion:m,disabled:be,type:E==null?void 0:E.item_type,key:"".concat(A,"-").concat(Ze),value:he,index:Ze,onChange:function(He){return B(He,A,Ze)}})}))))})))};Ie.a=h},exQ7:function(Je,Ie,f){Je.exports=f.p+"static/te.22809158.svg"},f4xo:function(Je,Ie,f){var z=f("nVVt");function ve(re){this.mode=z.MODE_8BIT_BYTE,this.data=re}ve.prototype={getLength:function(re){return this.data.length},write:function(re){for(var xe=0;xe<this.data.length;xe++)re.put(this.data.charCodeAt(xe),8)}},Je.exports=ve},fAei:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return we.a});var z=f("rePB"),ve=f("VTBJ"),re=f("KQm4"),xe=f("1OyB"),me=f("vuIU"),ae=f("Ji7U"),j=f("LK+K"),x=f("q1tI"),k=f("4IlW"),P=f("Kwbf"),N=f("TSYQ"),T=f.n(N),ee=f("sboe"),K=f("OZM5"),L=f("815F"),M=f("ODXe"),W=f("Ff2n"),Y=f("+nKL"),_=f("8XRh"),we=f("WaYH"),ke=function(Oe,Te){var V=Oe.className,B=Oe.style,ue=Oe.motion,D=Oe.motionNodes,A=Oe.motionType,pe=Oe.onMotionStart,he=Oe.onMotionEnd,Ze=Oe.active,Le=Oe.treeNodeRequiredProps,He=Object(W.a)(Oe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Pe=x.useState(!0),je=Object(M.a)(Pe,2),Qe=je[0],nt=je[1],ot=x.useContext(ee.a),$e=ot.prefixCls,Ke=x.useRef(!1),At=function(){Ke.current||he(),Ke.current=!0};return Object(x.useEffect)(function(){D&&A==="hide"&&Qe&&nt(!1)},[D]),Object(x.useEffect)(function(){return D&&pe(),function(){D&&At()}},[]),D?x.createElement(_.default,Object.assign({ref:Te,visible:Qe},ue,{motionAppear:A==="show",onAppearEnd:At,onLeaveEnd:At}),function(mt,St){var ct=mt.className,Ot=mt.style;return x.createElement("div",{ref:St,className:T()("".concat($e,"-treenode-motion"),ct),style:Ot},D.map(function(Ct){var yt=Ct.data,De=yt.key,Ut=Object(W.a)(yt,["key"]),kt=Ct.isStart,Ue=Ct.isEnd;delete Ut.children;var We=Object(L.f)(De,Le);return x.createElement(we.a,Object.assign({},Ut,We,{active:Ze,data:Ct.data,key:De,isStart:kt,isEnd:Ue}))}))}):x.createElement(we.a,Object.assign({domRef:Te,className:V,style:B},He,{active:Ze}))};ke.displayName="MotionTreeNode";var se=x.forwardRef(ke),le=se;function fe(){var Xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Te=Xe.length,V=Oe.length;if(Math.abs(Te-V)!==1)return{add:!1,key:null};function B(ue,D){var A=new Map;ue.forEach(function(he){A.set(he,!0)});var pe=D.filter(function(he){return!A.has(he)});return pe.length===1?pe[0]:null}return Te<V?{add:!0,key:B(Xe,Oe)}:{add:!1,key:B(Oe,Xe)}}function $(Xe,Oe,Te){var V=Xe.findIndex(function(A){var pe=A.data;return pe.key===Te}),B=Xe[V+1],ue=Oe.findIndex(function(A){var pe=A.data;return pe.key===Te});if(B){var D=Oe.findIndex(function(A){var pe=A.data;return pe.key===B.data.key});return Oe.slice(ue+1,D)}return Oe.slice(ue+1)}var h={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},X=function(){},y="RC_TREE_MOTION_".concat(Math.random()),C={key:y},J={key:y,level:0,index:0,pos:"0",node:C},H={parent:null,children:[],pos:J.pos,data:C,isStart:[],isEnd:[]};function E(Xe,Oe,Te,V){return Oe===!1||!Te?Xe:Xe.slice(0,Math.ceil(Te/V)+1)}function R(Xe){var Oe=Xe.data.key,Te=Xe.pos;return Object(L.e)(Oe,Te)}function ie(Xe){for(var Oe=String(Xe.data.key),Te=Xe;Te.parent;)Te=Te.parent,Oe="".concat(Te.data.key," > ").concat(Oe);return Oe}var F=function(Oe,Te){var V=Oe.prefixCls,B=Oe.data,ue=Oe.selectable,D=Oe.checkable,A=Oe.expandedKeys,pe=Oe.selectedKeys,he=Oe.checkedKeys,Ze=Oe.loadedKeys,Le=Oe.loadingKeys,He=Oe.halfCheckedKeys,Pe=Oe.keyEntities,je=Oe.disabled,Qe=Oe.dragging,nt=Oe.dragOverNodeKey,ot=Oe.dropPosition,$e=Oe.motion,Ke=Oe.height,At=Oe.itemHeight,mt=Oe.virtual,St=Oe.focusable,ct=Oe.activeItem,Ot=Oe.focused,Ct=Oe.tabIndex,yt=Oe.onKeyDown,De=Oe.onFocus,Ut=Oe.onBlur,kt=Oe.onActiveChange,Ue=Oe.onListChangeStart,We=Oe.onListChangeEnd,G=Object(W.a)(Oe,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),q=x.useRef(null);x.useImperativeHandle(Te,function(){return{scrollTo:function(dt){q.current.scrollTo(dt)}}});var Q=x.useState(A),w=Object(M.a)(Q,2),S=w[0],U=w[1],I=x.useState(B),de=Object(M.a)(I,2),Ce=de[0],Re=de[1],bt=x.useState(B),rt=Object(M.a)(bt,2),ge=rt[0],ut=rt[1],_t=x.useState([]),et=Object(M.a)(_t,2),Bt=et[0],qe=et[1],zt=x.useState(null),It=Object(M.a)(zt,2),vt=It[0],Xt=It[1];function Lt(){Re(B),ut(B),qe([]),Xt(null),We()}x.useEffect(function(){U(A);var tt=fe(S,A);if(tt.key!==null)if(tt.add){var dt=Ce.findIndex(function(tn){var jt=tn.data.key;return jt===tt.key}),Kt=E($(Ce,B,tt.key),mt,Ke,At),Gt=Ce.slice();Gt.splice(dt+1,0,H),ut(Gt),qe(Kt),Xt("show")}else{var an=B.findIndex(function(tn){var jt=tn.data.key;return jt===tt.key}),Vt=E($(B,Ce,tt.key),mt,Ke,At),Et=B.slice();Et.splice(an+1,0,H),ut(Et),qe(Vt),Xt("hide")}else Ce!==B&&(Re(B),ut(B))},[A,B]),x.useEffect(function(){Qe||Lt()},[Qe]);var Fe=$e?ge:B,st={expandedKeys:A,selectedKeys:pe,loadedKeys:Ze,loadingKeys:Le,checkedKeys:he,halfCheckedKeys:He,dragOverNodeKey:nt,dropPosition:ot,keyEntities:Pe};return x.createElement(x.Fragment,null,Ot&&ct&&x.createElement("span",{style:h,"aria-live":"assertive"},ie(ct)),x.createElement("div",{role:"tree"},x.createElement("input",{style:h,disabled:St===!1||je,tabIndex:St!==!1?Ct:null,onKeyDown:yt,onFocus:De,onBlur:Ut,value:"",onChange:X})),x.createElement(Y.a,Object.assign({},G,{data:Fe,itemKey:R,height:Ke,fullHeight:!1,virtual:mt,itemHeight:At,prefixCls:"".concat(V,"-list"),ref:q}),function(tt){var dt=tt.pos,Kt=tt.data,Gt=Kt.key,an=Object(W.a)(Kt,["key"]),Vt=tt.isStart,Et=tt.isEnd,tn=Object(L.e)(Gt,dt);delete an.children;var jt=Object(L.f)(tn,st);return x.createElement(le,Object.assign({},an,jt,{active:ct&&Gt===ct.data.key,pos:dt,data:tt.data,isStart:Vt,isEnd:Et,motion:$e,motionNodes:Gt===y?Bt:null,motionType:vt,onMotionStart:Ue,onMotionEnd:Lt,treeNodeRequiredProps:st,onMouseMove:function(){kt(null)}}))}))},be=x.forwardRef(F);be.displayName="NodeList";var O=be,m=f("NvD2"),oe=function(Xe){Object(ae.a)(Te,Xe);var Oe=Object(j.a)(Te);function Te(){var V;return Object(xe.a)(this,Te),V=Oe.apply(this,arguments),V.destroyed=!1,V.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},V.listRef=x.createRef(),V.onNodeDragStart=function(B,ue){var D=V.state,A=D.expandedKeys,pe=D.keyEntities,he=V.props.onDragStart,Ze=ue.props.eventKey;V.dragNode=ue;var Le=Object(K.b)(A,Ze);V.setState({dragging:!0,dragNodesKeys:Object(K.g)(Ze,pe)}),V.setExpandedKeys(Le),he&&he({event:B,node:Object(L.b)(ue.props)})},V.onNodeDragEnter=function(B,ue){var D=V.state,A=D.expandedKeys,pe=D.keyEntities,he=D.dragNodesKeys,Ze=V.props.onDragEnter,Le=ue.props,He=Le.pos,Pe=Le.eventKey;if(!V.dragNode||he.indexOf(Pe)!==-1)return;var je=Object(K.c)(B,ue);if(V.dragNode.props.eventKey===Pe&&je===0){V.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){V.setState({dragOverNodeKey:Pe,dropPosition:je}),V.delayedDragEnterLogic||(V.delayedDragEnterLogic={}),Object.keys(V.delayedDragEnterLogic).forEach(function(Qe){clearTimeout(V.delayedDragEnterLogic[Qe])}),V.delayedDragEnterLogic[He]=window.setTimeout(function(){if(!V.state.dragging)return;var Qe=Object(re.a)(A),nt=pe[Pe];nt&&(nt.children||[]).length&&(Qe=Object(K.a)(A,Pe)),"expandedKeys"in V.props||V.setExpandedKeys(Qe),Ze&&Ze({event:B,node:Object(L.b)(ue.props),expandedKeys:Qe})},400)},0)},V.onNodeDragOver=function(B,ue){var D=V.state.dragNodesKeys,A=V.props.onDragOver,pe=ue.props.eventKey;if(D.indexOf(pe)!==-1)return;if(V.dragNode&&pe===V.state.dragOverNodeKey){var he=Object(K.c)(B,ue);if(he===V.state.dropPosition)return;V.setState({dropPosition:he})}A&&A({event:B,node:Object(L.b)(ue.props)})},V.onNodeDragLeave=function(B,ue){var D=V.props.onDragLeave;V.setState({dragOverNodeKey:""}),D&&D({event:B,node:Object(L.b)(ue.props)})},V.onNodeDragEnd=function(B,ue){var D=V.props.onDragEnd;V.setState({dragOverNodeKey:""}),V.cleanDragState(),D&&D({event:B,node:Object(L.b)(ue.props)}),V.dragNode=null},V.onNodeDrop=function(B,ue){var D=V.state,A=D.dragNodesKeys,pe=A===void 0?[]:A,he=D.dropPosition,Ze=V.props.onDrop,Le=ue.props,He=Le.eventKey,Pe=Le.pos;if(V.setState({dragOverNodeKey:""}),V.cleanDragState(),pe.indexOf(He)!==-1){Object(P.a)(!1,"Can not drop to dragNode(include it's children node)");return}var je=Object(K.k)(Pe),Qe={event:B,node:Object(L.b)(ue.props),dragNode:V.dragNode?Object(L.b)(V.dragNode.props):null,dragNodesKeys:pe.slice(),dropPosition:he+Number(je[je.length-1]),dropToGap:!1};he!==0&&(Qe.dropToGap=!0),Ze&&Ze(Qe),V.dragNode=null},V.cleanDragState=function(){var B=V.state.dragging;B&&V.setState({dragging:!1})},V.onNodeClick=function(B,ue){var D=V.props.onClick;D&&D(B,ue)},V.onNodeDoubleClick=function(B,ue){var D=V.props.onDoubleClick;D&&D(B,ue)},V.onNodeSelect=function(B,ue){var D=V.state.selectedKeys,A=V.state.keyEntities,pe=V.props,he=pe.onSelect,Ze=pe.multiple,Le=ue.selected,He=ue.key,Pe=!Le;Pe?Ze?D=Object(K.a)(D,He):D=[He]:D=Object(K.b)(D,He);var je=D.map(function(Qe){var nt=A[Qe];return nt?nt.node:null}).filter(function(Qe){return Qe});V.setUncontrolledState({selectedKeys:D}),he&&he(D,{event:"select",selected:Pe,node:ue,selectedNodes:je,nativeEvent:B.nativeEvent})},V.onNodeCheck=function(B,ue,D){var A=V.state,pe=A.keyEntities,he=A.checkedKeys,Ze=A.halfCheckedKeys,Le=V.props,He=Le.checkStrictly,Pe=Le.onCheck,je=ue.key,Qe,nt={event:"check",node:ue,checked:D,nativeEvent:B.nativeEvent};if(He){var ot=D?Object(K.a)(he,je):Object(K.b)(he,je),$e=Object(K.b)(Ze,je);Qe={checked:ot,halfChecked:$e},nt.checkedNodes=ot.map(function(Ot){return pe[Ot]}).filter(function(Ot){return Ot}).map(function(Ot){return Ot.node}),V.setUncontrolledState({checkedKeys:ot})}else{var Ke=Object(m.a)([].concat(Object(re.a)(he),[je]),!0,pe),At=Ke.checkedKeys,mt=Ke.halfCheckedKeys;if(!D){var St=new Set(At);St.delete(je);var ct=Object(m.a)(Array.from(St),{checked:!1,halfCheckedKeys:mt},pe);At=ct.checkedKeys,mt=ct.halfCheckedKeys}Qe=At,nt.checkedNodes=[],nt.checkedNodesPositions=[],nt.halfCheckedKeys=mt,At.forEach(function(Ot){var Ct=pe[Ot];if(!Ct)return;var yt=Ct.node,De=Ct.pos;nt.checkedNodes.push(yt),nt.checkedNodesPositions.push({node:yt,pos:De})}),V.setUncontrolledState({checkedKeys:At},!1,{halfCheckedKeys:mt})}Pe&&Pe(Qe,nt)},V.onNodeLoad=function(B){return new Promise(function(ue){V.setState(function(D){var A=D.loadedKeys,pe=A===void 0?[]:A,he=D.loadingKeys,Ze=he===void 0?[]:he,Le=V.props,He=Le.loadData,Pe=Le.onLoad,je=B.key;if(!He||pe.indexOf(je)!==-1||Ze.indexOf(je)!==-1)return{};var Qe=He(B);return Qe.then(function(){var nt=V.state,ot=nt.loadedKeys,$e=nt.loadingKeys,Ke=Object(K.a)(ot,je),At=Object(K.b)($e,je);Pe&&Pe(Ke,{event:"load",node:B}),V.setUncontrolledState({loadedKeys:Ke}),V.setState({loadingKeys:At}),ue()}),{loadingKeys:Object(K.a)(Ze,je)}})})},V.onNodeMouseEnter=function(B,ue){var D=V.props.onMouseEnter;D&&D({event:B,node:ue})},V.onNodeMouseLeave=function(B,ue){var D=V.props.onMouseLeave;D&&D({event:B,node:ue})},V.onNodeContextMenu=function(B,ue){var D=V.props.onRightClick;D&&(B.preventDefault(),D({event:B,node:ue}))},V.onFocus=function(){var B=V.props.onFocus;V.setState({focused:!0}),B&&B.apply(void 0,arguments)},V.onBlur=function(){var B=V.props.onBlur;V.setState({focused:!1}),V.onActiveChange(null),B&&B.apply(void 0,arguments)},V.getTreeNodeRequiredProps=function(){var B=V.state,ue=B.expandedKeys,D=B.selectedKeys,A=B.loadedKeys,pe=B.loadingKeys,he=B.checkedKeys,Ze=B.halfCheckedKeys,Le=B.dragOverNodeKey,He=B.dropPosition,Pe=B.keyEntities;return{expandedKeys:ue||[],selectedKeys:D||[],loadedKeys:A||[],loadingKeys:pe||[],checkedKeys:he||[],halfCheckedKeys:Ze||[],dragOverNodeKey:Le,dropPosition:He,keyEntities:Pe}},V.setExpandedKeys=function(B){var ue=V.state.treeData,D=Object(L.d)(ue,B);V.setUncontrolledState({expandedKeys:B,flattenNodes:D},!0)},V.onNodeExpand=function(B,ue){var D=V.state.expandedKeys,A=V.state.listChanging,pe=V.props,he=pe.onExpand,Ze=pe.loadData,Le=ue.key,He=ue.expanded;if(A)return;var Pe=D.indexOf(Le),je=!He;if(Object(P.a)(He&&Pe!==-1||!He&&Pe===-1,"Expand state not sync with index check"),je?D=Object(K.a)(D,Le):D=Object(K.b)(D,Le),V.setExpandedKeys(D),he&&he(D,{node:ue,expanded:je,nativeEvent:B.nativeEvent}),je&&Ze){var Qe=V.onNodeLoad(ue);Qe&&Qe.then(function(){var nt=Object(L.d)(V.state.treeData,D);V.setUncontrolledState({flattenNodes:nt})})}},V.onListChangeStart=function(){V.setUncontrolledState({listChanging:!0})},V.onListChangeEnd=function(){setTimeout(function(){V.setUncontrolledState({listChanging:!1})})},V.onActiveChange=function(B){var ue=V.state.activeKey,D=V.props.onActiveChange;if(ue===B)return;V.setState({activeKey:B}),B!==null&&V.scrollTo({key:B}),D&&D(B)},V.getActiveItem=function(){var B=V.state,ue=B.activeKey,D=B.flattenNodes;return ue===null?null:D.find(function(A){var pe=A.data.key;return pe===ue})||null},V.offsetActiveKey=function(B){var ue=V.state,D=ue.flattenNodes,A=ue.activeKey,pe=D.findIndex(function(Le){var He=Le.data.key;return He===A});pe===-1&&B<0&&(pe=D.length),pe=(pe+B+D.length)%D.length;var he=D[pe];if(he){var Ze=he.data.key;V.onActiveChange(Ze)}else V.onActiveChange(null)},V.onKeyDown=function(B){var ue=V.state,D=ue.activeKey,A=ue.expandedKeys,pe=ue.checkedKeys,he=V.props,Ze=he.onKeyDown,Le=he.checkable,He=he.selectable;switch(B.which){case k.a.UP:{V.offsetActiveKey(-1),B.preventDefault();break}case k.a.DOWN:{V.offsetActiveKey(1),B.preventDefault();break}}var Pe=V.getActiveItem();if(Pe&&Pe.data){var je=V.getTreeNodeRequiredProps(),Qe=Pe.data.isLeaf===!1||!!(Pe.data.children||[]).length,nt=Object(L.b)(Object(ve.a)(Object(ve.a)({},Object(L.f)(D,je)),{},{data:Pe.data,active:!0}));switch(B.which){case k.a.LEFT:{Qe&&A.includes(D)?V.onNodeExpand({},nt):Pe.parent&&V.onActiveChange(Pe.parent.data.key),B.preventDefault();break}case k.a.RIGHT:{Qe&&!A.includes(D)?V.onNodeExpand({},nt):Pe.children&&Pe.children.length&&V.onActiveChange(Pe.children[0].data.key),B.preventDefault();break}case k.a.ENTER:case k.a.SPACE:{Le&&!nt.disabled&&nt.checkable!==!1&&!nt.disableCheckbox?V.onNodeCheck({},nt,!pe.includes(D)):!Le&&He&&!nt.disabled&&nt.selectable!==!1&&V.onNodeSelect({},nt);break}}}Ze&&Ze(B)},V.setUncontrolledState=function(B){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(V.destroyed)return;var A=!1,pe=!0,he={};Object.keys(B).forEach(function(Ze){if(Ze in V.props){pe=!1;return}A=!0,he[Ze]=B[Ze]}),A&&(!ue||pe)&&V.setState(Object(ve.a)(Object(ve.a)({},he),D))},V.scrollTo=function(B){V.listRef.current.scrollTo(B)},V}return Object(me.a)(Te,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var B,ue=this.state,D=ue.focused,A=ue.flattenNodes,pe=ue.keyEntities,he=ue.dragging,Ze=ue.activeKey,Le=this.props,He=Le.prefixCls,Pe=Le.className,je=Le.style,Qe=Le.showLine,nt=Le.focusable,ot=Le.tabIndex,$e=ot===void 0?0:ot,Ke=Le.selectable,At=Le.showIcon,mt=Le.icon,St=Le.switcherIcon,ct=Le.draggable,Ot=Le.checkable,Ct=Le.checkStrictly,yt=Le.disabled,De=Le.motion,Ut=Le.loadData,kt=Le.filterTreeNode,Ue=Le.height,We=Le.itemHeight,G=Le.virtual,q=Le.titleRender,Q=Le.onContextMenu,w=Object(K.f)(this.props);return x.createElement(ee.a.Provider,{value:{prefixCls:He,selectable:Ke,showIcon:At,icon:mt,switcherIcon:St,draggable:ct,checkable:Ot,checkStrictly:Ct,disabled:yt,keyEntities:pe,loadData:Ut,filterTreeNode:kt,titleRender:q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},x.createElement("div",{className:T()(He,Pe,(B={},Object(z.a)(B,"".concat(He,"-show-line"),Qe),Object(z.a)(B,"".concat(He,"-focused"),D),Object(z.a)(B,"".concat(He,"-active-focused"),Ze!==null),B))},x.createElement(O,Object.assign({ref:this.listRef,prefixCls:He,style:je,data:A,disabled:yt,selectable:Ke,checkable:!!Ot,motion:De,dragging:he,height:Ue,itemHeight:We,virtual:G,focusable:nt,focused:D,tabIndex:$e,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Q},this.getTreeNodeRequiredProps(),w))))}}],[{key:"getDerivedStateFromProps",value:function(B,ue){var D=ue.prevProps,A={prevProps:B};function pe(mt){return!D&&mt in B||D&&D[mt]!==B[mt]}var he;if(pe("treeData")?he=B.treeData:pe("children")&&(Object(P.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),he=Object(L.c)(B.children)),he){A.treeData=he;var Ze=Object(L.a)(he);A.keyEntities=Object(ve.a)(Object(z.a)({},y,J),Ze.keyEntities)}var Le=A.keyEntities||ue.keyEntities;if(pe("expandedKeys")||D&&pe("autoExpandParent"))A.expandedKeys=B.autoExpandParent||!D&&B.defaultExpandParent?Object(K.e)(B.expandedKeys,Le):B.expandedKeys;else if(!D&&B.defaultExpandAll){var He=Object(ve.a)({},Le);delete He[y],A.expandedKeys=Object.keys(He).map(function(mt){return He[mt].key})}else!D&&B.defaultExpandedKeys&&(A.expandedKeys=B.autoExpandParent||B.defaultExpandParent?Object(K.e)(B.defaultExpandedKeys,Le):B.defaultExpandedKeys);if(A.expandedKeys||delete A.expandedKeys,he||A.expandedKeys){var Pe=Object(L.d)(he||ue.treeData,A.expandedKeys||ue.expandedKeys);A.flattenNodes=Pe}if(B.selectable&&(pe("selectedKeys")?A.selectedKeys=Object(K.d)(B.selectedKeys,B):!D&&B.defaultSelectedKeys&&(A.selectedKeys=Object(K.d)(B.defaultSelectedKeys,B))),B.checkable){var je;if(pe("checkedKeys")?je=Object(K.j)(B.checkedKeys)||{}:!D&&B.defaultCheckedKeys?je=Object(K.j)(B.defaultCheckedKeys)||{}:he&&(je=Object(K.j)(B.checkedKeys)||{checkedKeys:ue.checkedKeys,halfCheckedKeys:ue.halfCheckedKeys}),je){var Qe=je,nt=Qe.checkedKeys,ot=nt===void 0?[]:nt,$e=Qe.halfCheckedKeys,Ke=$e===void 0?[]:$e;if(!B.checkStrictly){var At=Object(m.a)(ot,!0,Le);ot=At.checkedKeys,Ke=At.halfCheckedKeys}A.checkedKeys=ot,A.halfCheckedKeys=Ke}}return pe("loadedKeys")&&(A.loadedKeys=B.loadedKeys),A}}]),Te}(x.Component);oe.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:[]},oe.TreeNode=we.a;var Be=oe,Ae=Ie.b=Be},k4n4:function(Je,Ie,f){"use strict";var z=f("tJVT"),ve=f("q1tI"),re=f.n(ve),xe=f("e+RI"),me=f.n(xe),ae=f("FTkQ"),j=f.n(ae),x=f("E/GV"),k=f.n(x),P=function(T){var ee=T.type,K=ee===void 0?1:ee,L=T.value,M=L===void 0?[]:L,W=T.onChange,Y=T.disabled,_=Y===void 0?!1:Y,we=T.icon,ke=Object(ve.useState)(),se=Object(z.a)(ke,2),le=se[0],fe=se[1],$=function(X){W(X)};return K===1?re.a.createElement("div",null,M==null?void 0:M.map(function(h,X){return re.a.createElement("div",{key:X,className:_?"".concat(me.a.btn," ").concat(me.a.btnDisabled):me.a.btn},re.a.createElement("span",{className:me.a.s1},h.name),re.a.createElement("img",{src:j.a,className:me.a.s2,onClick:function(){return $(h.id)}}))})):re.a.createElement("div",null,M==null?void 0:M.map(function(h,X){return re.a.createElement("div",{key:X,className:me.a.btn2},re.a.createElement("span",{className:me.a.s1},re.a.createElement("img",{src:we||k.a}),h.name),re.a.createElement("img",{src:j.a,className:me.a.s2,onClick:function(){return $(h.id)}}))}))};Ie.a=P},kSUc:function(Je,Ie,f){},kqOp:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return P});var z=f("0Owb"),ve=f("fWQN"),re=f("mtLc"),xe=f("yKVA"),me=f("879j"),ae=f("q1tI"),j=f.n(ae),x=f("Ot1p"),k="\u2581",P=function(N){Object(xe.a)(ee,N);var T=Object(me.a)(ee);function ee(){var K;Object(ve.a)(this,ee);for(var L=arguments.length,M=new Array(L),W=0;W<L;W++)M[W]=arguments[W];return K=T.call.apply(T,[this].concat(M)),K.getChCountBeforeCursor=function(Y,_){for(var we=_.line,ke=0,se=0;se<we;se++)ke+=Y.getLine(se).split(k).length-1;var le=Y.getLine(we).substring(0,_.ch);return ke+=le.split(k).length-1,ke},K.onCMBeforeChange=function(Y,_){var we=Y.getRange(_.from,_.to),ke=0;if(_.text.forEach(function($){ke+=$.split(k).length-1}),we&&we.indexOf(k)!=-1){var se=we.split(k).length-1,le=K.getChCountBeforeCursor(Y,_.from);console.log("\u5220\u9664".concat(se,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(le,"\u4E2A\uFF0C\u65B0\u589E").concat(ke,"\u4E2A")),K.props.deleteEmptyDisabled?_.cancel():K.props.onPlaceholderChange&&K.props.onPlaceholderChange(le,se,ke)}else if(ke){var fe=K.getChCountBeforeCursor(Y,_.from);console.log("\u65B0\u589E".concat(ke,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(fe,"\u4E2A")),K.props.onPlaceholderChange&&K.props.onPlaceholderChange(fe,0,ke)}},K}return Object(re.a)(ee,[{key:"render",value:function(){return j.a.createElement(x.a,Object(z.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),ee}(ae.Component)},lZu9:function(Je,Ie,f){(function(z){z(f("VrN/"),f("1eCo"),f("8EBN"))})(function(z){"use strict";z.defineMode("markdown",function(ve,re){var xe=z.getMode(ve,"text/html"),me=xe.name=="null";function ae(O){if(z.findModeByName){var m=z.findModeByName(O);m&&(O=m.mime||m.mimes[0])}var oe=z.getMode(ve,O);return oe.name=="null"?null:oe}re.highlightFormatting===void 0&&(re.highlightFormatting=!1),re.maxBlockquoteDepth===void 0&&(re.maxBlockquoteDepth=0),re.taskLists===void 0&&(re.taskLists=!1),re.strikethrough===void 0&&(re.strikethrough=!1),re.emoji===void 0&&(re.emoji=!1),re.fencedCodeBlockHighlighting===void 0&&(re.fencedCodeBlockHighlighting=!0),re.fencedCodeBlockDefaultMode===void 0&&(re.fencedCodeBlockDefaultMode="text/plain"),re.xml===void 0&&(re.xml=!0),re.tokenTypeOverrides===void 0&&(re.tokenTypeOverrides={});var j={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var x in j)j.hasOwnProperty(x)&&re.tokenTypeOverrides[x]&&(j[x]=re.tokenTypeOverrides[x]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,N=/^\[(x| )\](?=\s)/i,T=re.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,K=/^[^#!\[\]*_\\<>` "'(~:]+/,L=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,M=/^\s*\[[^\]]+?\]:.*$/,W=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Y=" ";function _(O,m,oe){return m.f=m.inline=oe,oe(O,m)}function we(O,m,oe){return m.f=m.block=oe,oe(O,m)}function ke(O){return!O||!/\S/.test(O.string)}function se(O){if(O.linkTitle=!1,O.linkHref=!1,O.linkText=!1,O.em=!1,O.strong=!1,O.strikethrough=!1,O.quote=0,O.indentedCode=!1,O.f==fe){var m=me;if(!m){var oe=z.innerMode(xe,O.htmlState);m=oe.mode.name=="xml"&&oe.state.tagStart===null&&!oe.state.context&&oe.state.tokenize.isInText}m&&(O.f=y,O.block=le,O.htmlState=null)}return O.trailingSpace=0,O.trailingSpaceNewLine=!1,O.prevLine=O.thisLine,O.thisLine={stream:null},null}function le(O,m){var oe=O.column()===m.indentation,Be=ke(m.prevLine.stream),Ae=m.indentedCode,Xe=m.prevLine.hr,Oe=m.list!==!1,Te=(m.listStack[m.listStack.length-1]||0)+3;m.indentedCode=!1;var V=m.indentation;if(m.indentationDiff===null&&(m.indentationDiff=m.indentation,Oe)){for(m.list=null;V<m.listStack[m.listStack.length-1];)m.listStack.pop(),m.listStack.length?m.indentation=m.listStack[m.listStack.length-1]:m.list=!1;m.list!==!1&&(m.indentationDiff=V-m.listStack[m.listStack.length-1])}var B=!Be&&!Xe&&!m.prevLine.header&&(!Oe||!Ae)&&!m.prevLine.fencedCodeEnd,ue=(m.list===!1||Xe||Be)&&m.indentation<=Te&&O.match(k),D=null;if(m.indentationDiff>=4&&(Ae||m.prevLine.fencedCodeEnd||m.prevLine.header||Be))return O.skipToEnd(),m.indentedCode=!0,j.code;if(O.eatSpace())return null;if(oe&&m.indentation<=Te&&(D=O.match(T))&&D[1].length<=6)return m.quote=0,m.header=D[1].length,m.thisLine.header=!0,re.highlightFormatting&&(m.formatting="header"),m.f=m.inline,h(m);if(m.indentation<=Te&&O.eat(">"))return m.quote=oe?1:m.quote+1,re.highlightFormatting&&(m.formatting="quote"),O.eatSpace(),h(m);if(!ue&&!m.setext&&oe&&m.indentation<=Te&&(D=O.match(P))){var A=D[1]?"ol":"ul";return m.indentation=V+O.current().length,m.list=!0,m.quote=0,m.listStack.push(m.indentation),m.em=!1,m.strong=!1,m.code=!1,m.strikethrough=!1,re.taskLists&&O.match(N,!1)&&(m.taskList=!0),m.f=m.inline,re.highlightFormatting&&(m.formatting=["list","list-"+A]),h(m)}else{if(oe&&m.indentation<=Te&&(D=O.match(L,!0)))return m.quote=0,m.fencedEndRE=new RegExp(D[1]+"+ *$"),m.localMode=re.fencedCodeBlockHighlighting&&ae(D[2]||re.fencedCodeBlockDefaultMode),m.localMode&&(m.localState=z.startState(m.localMode)),m.f=m.block=$,re.highlightFormatting&&(m.formatting="code-block"),m.code=-1,h(m);if(m.setext||(!B||!Oe)&&!m.quote&&m.list===!1&&!m.code&&!ue&&!M.test(O.string)&&(D=O.lookAhead(1))&&(D=D.match(ee)))return m.setext?(m.header=m.setext,m.setext=0,O.skipToEnd(),re.highlightFormatting&&(m.formatting="header")):(m.header=D[0].charAt(0)=="="?1:2,m.setext=m.header),m.thisLine.header=!0,m.f=m.inline,h(m);if(ue)return O.skipToEnd(),m.hr=!0,m.thisLine.hr=!0,j.hr;if(O.peek()==="[")return _(O,m,R)}return _(O,m,m.inline)}function fe(O,m){var oe=xe.token(O,m.htmlState);if(!me){var Be=z.innerMode(xe,m.htmlState);(Be.mode.name=="xml"&&Be.state.tagStart===null&&!Be.state.context&&Be.state.tokenize.isInText||m.md_inside&&O.current().indexOf(">")>-1)&&(m.f=y,m.block=le,m.htmlState=null)}return oe}function $(O,m){var oe=m.listStack[m.listStack.length-1]||0,Be=m.indentation<oe,Ae=oe+3;if(m.fencedEndRE&&m.indentation<=Ae&&(Be||O.match(m.fencedEndRE))){re.highlightFormatting&&(m.formatting="code-block");var Xe;return Be||(Xe=h(m)),m.localMode=m.localState=null,m.block=le,m.f=y,m.fencedEndRE=null,m.code=0,m.thisLine.fencedCodeEnd=!0,Be?we(O,m,m.block):Xe}else return m.localMode?m.localMode.token(O,m.localState):(O.skipToEnd(),j.code)}function h(O){var m=[];if(O.formatting){m.push(j.formatting),typeof O.formatting=="string"&&(O.formatting=[O.formatting]);for(var oe=0;oe<O.formatting.length;oe++)m.push(j.formatting+"-"+O.formatting[oe]),O.formatting[oe]==="header"&&m.push(j.formatting+"-"+O.formatting[oe]+"-"+O.header),O.formatting[oe]==="quote"&&(!re.maxBlockquoteDepth||re.maxBlockquoteDepth>=O.quote?m.push(j.formatting+"-"+O.formatting[oe]+"-"+O.quote):m.push("error"))}if(O.taskOpen)return m.push("meta"),m.length?m.join(" "):null;if(O.taskClosed)return m.push("property"),m.length?m.join(" "):null;if(O.linkHref?m.push(j.linkHref,"url"):(O.strong&&m.push(j.strong),O.em&&m.push(j.em),O.strikethrough&&m.push(j.strikethrough),O.emoji&&m.push(j.emoji),O.linkText&&m.push(j.linkText),O.code&&m.push(j.code),O.image&&m.push(j.image),O.imageAltText&&m.push(j.imageAltText,"link"),O.imageMarker&&m.push(j.imageMarker)),O.header&&m.push(j.header,j.header+"-"+O.header),O.quote&&(m.push(j.quote),!re.maxBlockquoteDepth||re.maxBlockquoteDepth>=O.quote?m.push(j.quote+"-"+O.quote):m.push(j.quote+"-"+re.maxBlockquoteDepth)),O.list!==!1){var Be=(O.listStack.length-1)%3;Be?Be===1?m.push(j.list2):m.push(j.list3):m.push(j.list1)}return O.trailingSpaceNewLine?m.push("trailing-space-new-line"):O.trailingSpace&&m.push("trailing-space-"+(O.trailingSpace%2?"a":"b")),m.length?m.join(" "):null}function X(O,m){return O.match(K,!0)?h(m):void 0}function y(O,m){var oe=m.text(O,m);if(typeof oe!="undefined")return oe;if(m.list)return m.list=null,h(m);if(m.taskList){var Be=O.match(N,!0)[1]===" ";return Be?m.taskOpen=!0:m.taskClosed=!0,re.highlightFormatting&&(m.formatting="task"),m.taskList=!1,h(m)}if(m.taskOpen=!1,m.taskClosed=!1,m.header&&O.match(/^#+$/,!0))return re.highlightFormatting&&(m.formatting="header"),h(m);var Ae=O.next();if(m.linkTitle){m.linkTitle=!1;var Xe=Ae;Ae==="("&&(Xe=")"),Xe=(Xe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+Xe+"\\\\]+|\\\\\\\\|\\\\.)"+Xe;if(O.match(new RegExp(Oe),!0))return j.linkHref}if(Ae==="`"){var Te=m.formatting;re.highlightFormatting&&(m.formatting="code"),O.eatWhile("`");var V=O.current().length;if(m.code==0&&(!m.quote||V==1))return m.code=V,h(m);if(V==m.code){var B=h(m);return m.code=0,B}else return m.formatting=Te,h(m)}else if(m.code)return h(m);if(Ae==="\\"&&(O.next(),re.highlightFormatting)){var ue=h(m),D=j.formatting+"-escape";return ue?ue+" "+D:D}if(Ae==="!"&&O.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return m.imageMarker=!0,m.image=!0,re.highlightFormatting&&(m.formatting="image"),h(m);if(Ae==="["&&m.imageMarker&&O.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return m.imageMarker=!1,m.imageAltText=!0,re.highlightFormatting&&(m.formatting="image"),h(m);if(Ae==="]"&&m.imageAltText){re.highlightFormatting&&(m.formatting="image");var ue=h(m);return m.imageAltText=!1,m.image=!1,m.inline=m.f=J,ue}if(Ae==="["&&!m.image)return m.linkText&&O.match(/^.*?\]/)||(m.linkText=!0,re.highlightFormatting&&(m.formatting="link")),h(m);if(Ae==="]"&&m.linkText){re.highlightFormatting&&(m.formatting="link");var ue=h(m);return m.linkText=!1,m.inline=m.f=O.match(/\(.*?\)| ?\[.*?\]/,!1)?J:y,ue}if(Ae==="<"&&O.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=C,re.highlightFormatting&&(m.formatting="link");var ue=h(m);return ue?ue+=" ":ue="",ue+j.linkInline}if(Ae==="<"&&O.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=C,re.highlightFormatting&&(m.formatting="link");var ue=h(m);return ue?ue+=" ":ue="",ue+j.linkEmail}if(re.xml&&Ae==="<"&&O.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var A=O.string.indexOf(">",O.pos);if(A!=-1){var pe=O.string.substring(O.start,A);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(pe)&&(m.md_inside=!0)}return O.backUp(1),m.htmlState=z.startState(xe),we(O,m,fe)}if(re.xml&&Ae==="<"&&O.match(/^\/\w*?>/))return m.md_inside=!1,"tag";if(Ae==="*"||Ae==="_"){for(var he=1,Ze=O.pos==1?" ":O.string.charAt(O.pos-2);he<3&&O.eat(Ae);)he++;var Le=O.peek()||" ",He=!/\s/.test(Le)&&(!W.test(Le)||/\s/.test(Ze)||W.test(Ze)),Pe=!/\s/.test(Ze)&&(!W.test(Ze)||/\s/.test(Le)||W.test(Le)),je=null,Qe=null;if(he%2&&(!m.em&&He&&(Ae==="*"||!Pe||W.test(Ze))?je=!0:m.em==Ae&&Pe&&(Ae==="*"||!He||W.test(Le))&&(je=!1)),he>1&&(!m.strong&&He&&(Ae==="*"||!Pe||W.test(Ze))?Qe=!0:m.strong==Ae&&Pe&&(Ae==="*"||!He||W.test(Le))&&(Qe=!1)),Qe!=null||je!=null){re.highlightFormatting&&(m.formatting=je==null?"strong":Qe==null?"em":"strong em"),je===!0&&(m.em=Ae),Qe===!0&&(m.strong=Ae);var B=h(m);return je===!1&&(m.em=!1),Qe===!1&&(m.strong=!1),B}}else if(Ae===" "&&(O.eat("*")||O.eat("_"))){if(O.peek()===" ")return h(m);O.backUp(1)}if(re.strikethrough){if(Ae==="~"&&O.eatWhile(Ae)){if(m.strikethrough){re.highlightFormatting&&(m.formatting="strikethrough");var B=h(m);return m.strikethrough=!1,B}else if(O.match(/^[^\s]/,!1))return m.strikethrough=!0,re.highlightFormatting&&(m.formatting="strikethrough"),h(m)}else if(Ae===" "&&O.match(/^~~/,!0)){if(O.peek()===" ")return h(m);O.backUp(2)}}if(re.emoji&&Ae===":"&&O.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){m.emoji=!0,re.highlightFormatting&&(m.formatting="emoji");var nt=h(m);return m.emoji=!1,nt}return Ae===" "&&(O.match(/^ +$/,!1)?m.trailingSpace++:m.trailingSpace&&(m.trailingSpaceNewLine=!0)),h(m)}function C(O,m){var oe=O.next();if(oe===">"){m.f=m.inline=y,re.highlightFormatting&&(m.formatting="link");var Be=h(m);return Be?Be+=" ":Be="",Be+j.linkInline}return O.match(/^[^>]+/,!0),j.linkInline}function J(O,m){if(O.eatSpace())return null;var oe=O.next();return oe==="("||oe==="["?(m.f=m.inline=E(oe==="("?")":"]"),re.highlightFormatting&&(m.formatting="link-string"),m.linkHref=!0,h(m)):"error"}var H={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(O){return function(m,oe){var Be=m.next();if(Be===O){oe.f=oe.inline=y,re.highlightFormatting&&(oe.formatting="link-string");var Ae=h(oe);return oe.linkHref=!1,Ae}return m.match(H[O]),oe.linkHref=!0,h(oe)}}function R(O,m){return O.match(/^([^\]\\]|\\.)*\]:/,!1)?(m.f=ie,O.next(),re.highlightFormatting&&(m.formatting="link"),m.linkText=!0,h(m)):_(O,m,y)}function ie(O,m){if(O.match(/^\]:/,!0)){m.f=m.inline=F,re.highlightFormatting&&(m.formatting="link");var oe=h(m);return m.linkText=!1,oe}return O.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function F(O,m){return O.eatSpace()?null:(O.match(/^[^\s]+/,!0),O.peek()===void 0?m.linkTitle=!0:O.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),m.f=m.inline=y,j.linkHref+" url")}var be={startState:function(){return{f:le,prevLine:{stream:null},thisLine:{stream:null},block:le,htmlState:null,indentation:0,inline:y,text:X,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(O){return{f:O.f,prevLine:O.prevLine,thisLine:O.thisLine,block:O.block,htmlState:O.htmlState&&z.copyState(xe,O.htmlState),indentation:O.indentation,localMode:O.localMode,localState:O.localMode?z.copyState(O.localMode,O.localState):null,inline:O.inline,text:O.text,formatting:!1,linkText:O.linkText,linkTitle:O.linkTitle,linkHref:O.linkHref,code:O.code,em:O.em,strong:O.strong,strikethrough:O.strikethrough,emoji:O.emoji,header:O.header,setext:O.setext,hr:O.hr,taskList:O.taskList,list:O.list,listStack:O.listStack.slice(0),quote:O.quote,indentedCode:O.indentedCode,trailingSpace:O.trailingSpace,trailingSpaceNewLine:O.trailingSpaceNewLine,md_inside:O.md_inside,fencedEndRE:O.fencedEndRE}},token:function(O,m){if(m.formatting=!1,O!=m.thisLine.stream){if(m.header=0,m.hr=!1,O.match(/^\s*$/,!0))return se(m),null;if(m.prevLine=m.thisLine,m.thisLine={stream:O},m.taskList=!1,m.trailingSpace=0,m.trailingSpaceNewLine=!1,!m.localState&&(m.f=m.block,m.f!=fe)){var oe=O.match(/^\s*/,!0)[0].replace(/\t/g,Y).length;if(m.indentation=oe,m.indentationDiff=null,oe>0)return null}}return m.f(O,m)},innerMode:function(O){return O.block==fe?{state:O.htmlState,mode:xe}:O.localState?{state:O.localState,mode:O.localMode}:{state:O,mode:be}},indent:function(O,m,oe){return O.block==fe&&xe.indent?xe.indent(O.htmlState,m,oe):O.localState&&O.localMode.indent?O.localMode.indent(O.localState,m,oe):z.Pass},blankLine:se,getType:h,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return be},"xml"),z.defineMIME("text/markdown","markdown"),z.defineMIME("text/x-markdown","markdown")})},lnNo:function(Je,Ie,f){Je.exports=f.p+"static/up.a9d336fc.svg"},m3fD:function(Je,Ie,f){Je.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"}},nVVt:function(Je,Ie){Je.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(Je,Ie,f){(function(z){z(f("VrN/"))})(function(z){"use strict";var ve=z.Pos;function re(W,Y){return W.line-Y.line||W.ch-Y.ch}var xe="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",me=xe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ae=new RegExp("<(/?)(["+xe+"]["+me+"]*)","g");function j(W,Y,_,we){this.line=Y,this.ch=_,this.cm=W,this.text=W.getLine(Y),this.min=we?Math.max(we.from,W.firstLine()):W.firstLine(),this.max=we?Math.min(we.to-1,W.lastLine()):W.lastLine()}function x(W,Y){var _=W.cm.getTokenTypeAt(ve(W.line,Y));return _&&/\btag\b/.test(_)}function k(W){return W.line>=W.max?void 0:(W.ch=0,W.text=W.cm.getLine(++W.line),!0)}function P(W){return W.line<=W.min?void 0:(W.text=W.cm.getLine(--W.line),W.ch=W.text.length,!0)}function N(W){for(;;){var Y=W.text.indexOf(">",W.ch);if(Y==-1){if(k(W))continue;return}if(!x(W,Y+1)){W.ch=Y+1;continue}var _=W.text.lastIndexOf("/",Y),we=_>-1&&!/\S/.test(W.text.slice(_+1,Y));return W.ch=Y+1,we?"selfClose":"regular"}}function T(W){for(;;){var Y=W.ch?W.text.lastIndexOf("<",W.ch-1):-1;if(Y==-1){if(P(W))continue;return}if(!x(W,Y+1)){W.ch=Y;continue}ae.lastIndex=Y,W.ch=Y;var _=ae.exec(W.text);if(_&&_.index==Y)return _}}function ee(W){for(;;){ae.lastIndex=W.ch;var Y=ae.exec(W.text);if(!Y){if(k(W))continue;return}if(!x(W,Y.index+1)){W.ch=Y.index+1;continue}return W.ch=Y.index+Y[0].length,Y}}function K(W){for(;;){var Y=W.ch?W.text.lastIndexOf(">",W.ch-1):-1;if(Y==-1){if(P(W))continue;return}if(!x(W,Y+1)){W.ch=Y;continue}var _=W.text.lastIndexOf("/",Y),we=_>-1&&!/\S/.test(W.text.slice(_+1,Y));return W.ch=Y+1,we?"selfClose":"regular"}}function L(W,Y){for(var _=[];;){var we=ee(W),ke,se=W.line,le=W.ch-(we?we[0].length:0);if(!we||!(ke=N(W)))return;if(ke=="selfClose")continue;if(we[1]){for(var fe=_.length-1;fe>=0;--fe)if(_[fe]==we[2]){_.length=fe;break}if(fe<0&&(!Y||Y==we[2]))return{tag:we[2],from:ve(se,le),to:ve(W.line,W.ch)}}else _.push(we[2])}}function M(W,Y){for(var _=[];;){var we=K(W);if(!we)return;if(we=="selfClose"){T(W);continue}var ke=W.line,se=W.ch,le=T(W);if(!le)return;if(le[1])_.push(le[2]);else{for(var fe=_.length-1;fe>=0;--fe)if(_[fe]==le[2]){_.length=fe;break}if(fe<0&&(!Y||Y==le[2]))return{tag:le[2],from:ve(W.line,W.ch),to:ve(ke,se)}}}}z.registerHelper("fold","xml",function(W,Y){for(var _=new j(W,Y.line,0);;){var we=ee(_);if(!we||_.line!=Y.line)return;var ke=N(_);if(!ke)return;if(!we[1]&&ke!="selfClose"){var se=ve(_.line,_.ch),le=L(_,we[2]);return le&&re(le.from,se)>0?{from:se,to:le.from}:null}}}),z.findMatchingTag=function(W,Y,_){var we=new j(W,Y.line,Y.ch,_);if(we.text.indexOf(">")==-1&&we.text.indexOf("<")==-1)return;var ke=N(we),se=ke&&ve(we.line,we.ch),le=ke&&T(we);if(!ke||!le||re(we,Y)>0)return;var fe={from:ve(we.line,we.ch),to:se,tag:le[2]};return ke=="selfClose"?{open:fe,close:null,at:"open"}:le[1]?{open:M(we,le[2]),close:fe,at:"close"}:(we=new j(W,se.line,se.ch,_),{open:fe,close:L(we,le[2]),at:"open"})},z.findEnclosingTag=function(W,Y,_,we){for(var ke=new j(W,Y.line,Y.ch,_);;){var se=M(ke,we);if(!se)break;var le=new j(W,Y.line,Y.ch,_),fe=L(le,se.tag);if(fe)return{open:se,close:fe}}},z.scanForClosingTag=function(W,Y,_,we){var ke=new j(W,Y.line,Y.ch,we?{from:0,to:we}:null);return L(ke,_)}})},p5ED:function(Je,Ie,f){"use strict";var z=f("+L6B"),ve=f("2/Rp"),re=f("5Dmo"),xe=f("3S7+"),me=f("k1fw"),ae=f("tJVT"),j=f("q1tI"),x=f.n(j),k=f("vHTk"),P=f.n(k),N=f("yEEn"),T=f("ZW9T"),ee=f("1vsH");Ie.a=function(K){var L=K.name,M=K.data,W=K.theme,Y=K.type,_=K.filename,we=K.monacoEditor,ke=K.className,se=K.style,le=K.close,fe=K.onClose,$=K.hasMask,h=Object(j.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),X=Object(ae.a)(h,2),y=X[0],C=X[1],J=Object(j.useState)(""),H=Object(ae.a)(J,2),E=H[0],R=H[1],ie=Object(j.useRef)();_&&(we.filename=_),Object(j.useEffect)(function(){var O,m,oe=(O=document.cookie)===null||O===void 0||((m=O.replace(/\s/g,""))===null||m===void 0)?void 0:m.split(";");oe==null||oe.map(function(Be){var Ae=Be.split("=");Ae[0]==="_educoder_session"&&R(Ae[1])})},[]);var F=function(){if(M.startsWith("http")||M.startsWith("/")){be();return}Object(ee.x)(_||"educoder",M,_)},be=function(){Object(ee.v)(_||L,M)};return console.log("data:",M,"fileanme:",_," name:",L),x.a.createElement("div",{style:Object(me.a)({},se||{}),className:"".concat($&&P.a.bgBlack," ").concat(Y?P.a.wrp:"hide")},le&&x.a.createElement("div",{className:P.a.close,ref:ie},x.a.createElement(xe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ie.current}},x.a.createElement("span",{onClick:be},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(xe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ie.current}},x.a.createElement("span",{className:"",onClick:fe},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(P.a[ke]," ").concat(ke," ").concat(P.a.monaco," ").concat(Y==="txt"?"show":"hide")},Y==="txt"&&x.a.createElement(T.b,we)),Y==="audio"&&x.a.createElement("audio",{src:"".concat(M!=null&&M.startsWith("/")||(M==null?void 0:M.indexOf("https://"))>-1?M:"data:audio/mp3;base64,").concat(M),autoPlay:!0}),Y==="video"&&x.a.createElement(x.a.Fragment,null,M!=null&&M.startsWith("/")?x.a.createElement("video",{controls:!0,src:"".concat(M),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(M),autoPlay:!0})),Y==="html"&&x.a.createElement("iframe",{src:M+"&disposition=inline"}),Y==="pdf"&&x.a.createElement("embed",{className:P.a.embed,src:M}),Y==="pdfeditor"&&x.a.createElement("div",null,x.a.createElement("iframe",{src:"https://a1office.co/solutions/editor/pdf-editor/\u67E5\u91CD\u6587\u68631-8839d79b81e8bda0d298ca058913ab88.pdf"}),x.a.createElement("div",{style:{position:"absolute",left:"1px",top:"1px",width:180,height:60,background:"#f9f9f9"}})),Y==="image"&&x.a.createElement(x.a.Fragment,null,x.a.createElement("img",{src:"".concat(M!=null&&M.startsWith("/")||(M==null?void 0:M.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(M)})),Y==="other"&&x.a.createElement("div",null,x.a.createElement(ve.a,{type:"primary",size:"large",onClick:F},x.a.createElement(N.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(Y==="download"||Y==="office")&&x.a.createElement(ve.a,{type:"primary",size:"large",onClick:F},x.a.createElement(N.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Je,Ie,f){},"rAM+":function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return ve});var z=f("Qw5x");function ve(re,xe){var me;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(me=Object(z.a)(re))||xe&&re&&typeof re.length=="number"){me&&(re=me);var ae=0,j=function(){};return{s:j,n:function(){return ae>=re.length?{done:!0}:{done:!1,value:re[ae++]}},e:function(T){throw T},f:j}}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 x=!0,k=!1,P;return{s:function(){me=re[Symbol.iterator]()},n:function(){var T=me.next();return x=T.done,T},e:function(T){k=!0,P=T},f:function(){try{!x&&me.return!=null&&me.return()}finally{if(k)throw P}}}}},rUJ1:function(Je,Ie){const f=/[&<>"']/,z=/[&<>"']/g,ve=/[<>"']|&(?!#?\w+;)/,re=/[<>"']|&(?!#?\w+;)/g,xe={"&":"&","<":"<",">":">",'"':""","'":"'"},me=$=>xe[$];function ae($,h){if(h){if(f.test($))return $.replace(z,me)}else if(ve.test($))return $.replace(re,me);return $}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function x($){return $.replace(j,(h,X)=>(X=X.toLowerCase(),X==="colon"?":":X.charAt(0)==="#"?X.charAt(1)==="x"?String.fromCharCode(parseInt(X.substring(2),16)):String.fromCharCode(+X.substring(1)):""))}const k=/(^|[^\[])\^/g;function P($,h){$=$.source||$,h=h||"";const X={replace:(y,C)=>(C=C.source||C,C=C.replace(k,"$1"),$=$.replace(y,C),X),getRegex:()=>new RegExp($,h)};return X}const N=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ee($,h,X){if($){let y;try{y=decodeURIComponent(x(X)).replace(N,"").toLowerCase()}catch(C){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}h&&!T.test(X)&&(X=Y(h,X));try{X=encodeURI(X).replace(/%25/g,"%")}catch(y){return null}return X}const K={},L=/^[^:]+:\/*[^/]*$/,M=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Y($,h){K[" "+$]||(L.test($)?K[" "+$]=$+"/":K[" "+$]=se($,"/",!0)),$=K[" "+$];const X=$.indexOf(":")===-1;return h.substring(0,2)==="//"?X?h:$.replace(M,"$1")+h:h.charAt(0)==="/"?X?h:$.replace(W,"$1")+h:$+h}const _={exec:function(){}};function we($){let h=1,X,y;for(;h<arguments.length;h++){X=arguments[h];for(y in X)Object.prototype.hasOwnProperty.call(X,y)&&($[y]=X[y])}return $}function ke($,h){const X=$.replace(/\|/g,(J,H,E)=>{let R=!1,ie=H;for(;--ie>=0&&E[ie]==="\\";)R=!R;return R?"|":" |"}),y=X.split(/ \|/);let C=0;if(y.length>h)y.splice(h);else for(;y.length<h;)y.push("");for(;C<y.length;C++)y[C]=y[C].trim().replace(/\\\|/g,"|");return y}function se($,h,X){const y=$.length;if(y===0)return"";let C=0;for(;C<y;){const J=$.charAt(y-C-1);if(J===h&&!X)C++;else if(J!==h&&X)C++;else break}return $.substr(0,y-C)}function le($,h){if($.indexOf(h[1])===-1)return-1;const X=$.length;let y=0,C=0;for(;C<X;C++)if($[C]==="\\")C++;else if($[C]===h[0])y++;else if($[C]===h[1]&&(y--,y<0))return C;return-1}function fe($){$&&$.sanitize&&!$.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Je.exports={escape:ae,unescape:x,edit:P,cleanUrl:ee,resolveUrl:Y,noopTest:_,merge:we,splitCells:ke,rtrim:se,findClosingBracket:le,checkSanitizeDeprecation:fe}},rcnY:function(Je,Ie,f){var z=f("aRTE");function ve(re,xe){this.totalCount=re,this.dataCount=xe}ve.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],ve.getRSBlocks=function(re,xe){var me=ve.getRsBlockTable(re,xe);if(me==null)throw new Error("bad rs block @ typeNumber:"+re+"/errorCorrectLevel:"+xe);for(var ae=me.length/3,j=new Array,x=0;x<ae;x++)for(var k=me[x*3+0],P=me[x*3+1],N=me[x*3+2],T=0;T<k;T++)j.push(new ve(P,N));return j},ve.getRsBlockTable=function(re,xe){switch(xe){case z.L:return ve.RS_BLOCK_TABLE[(re-1)*4+0];case z.M:return ve.RS_BLOCK_TABLE[(re-1)*4+1];case z.Q:return ve.RS_BLOCK_TABLE[(re-1)*4+2];case z.H:return ve.RS_BLOCK_TABLE[(re-1)*4+3];default:return}},Je.exports=ve},sbIO:function(Je,Ie,f){"use strict";var z=f("DjyN"),ve=f("NUBc"),re=f("5Dmo"),xe=f("3S7+"),me=f("/zsF"),ae=f("PArb"),j=f("Q9mQ"),x=f("diRs"),k=f("+L6B"),P=f("2/Rp"),N=f("7Kak"),T=f("9yH6"),ee=f("5NDa"),K=f("5rEg"),L=f("miYZ"),M=f("tsqr"),W=f("9og8"),Y=f("giR+"),_=f("fyUT"),we=f("2qtc"),ke=f("kLXV"),se=f("tJVT"),le=f("WmNS"),fe=f.n(le),$=f("q1tI"),h=f.n($),X=f("PsQE"),y=f.n(X),C=f("0eGx"),J=f.n(C),H=f("9Bee"),E=f("Ty5D"),R=f("9kvl"),ie=f("ErOA"),F=f("+yhJ"),be=f.n(F),O=f("RZ/O"),m=f.n(O),oe=f("LvDl"),Be=f("6K3P"),Ae=f.n(Be),Xe=f("sRBo"),Oe=f("kaz8"),Te=f("oBTY"),V=f("PpiC"),B=f("Ot1p"),ue=f("kqOp"),D=f("7qnI"),A=f("1vsH"),pe=f("PGNT"),he=f.n(pe),Ze=["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"],Le=function(G,q){var Q=G.globalSetting,w=G.loading,S=G.dispatch,U=G.isEdit,I=G.editData,de=Object(V.a)(G,["globalSetting","loading","dispatch","isEdit","editData"]),Ce=Object($.useState)(""),Re=Object(se.a)(Ce,2),bt=Re[0],rt=Re[1],ge=Object($.useState)(""),ut=Object(se.a)(ge,2),_t=ut[0],et=ut[1],Bt=Object($.useState)([]),qe=Object(se.a)(Bt,2),zt=qe[0],It=qe[1],vt=Object($.useState)(""),Xt=Object(se.a)(vt,2),Lt=Xt[0],Fe=Xt[1],st=Object($.useState)(),tt=Object(se.a)(st,2),dt=tt[0],Kt=tt[1],Gt=Object($.useState)(!1),an=Object(se.a)(Gt,2),Vt=an[0],Et=an[1];Object($.useEffect)(function(){if(!I||!U)return;rt(I==null?void 0:I.name),et(I==null?void 0:I.analysis),Kt(I==null?void 0:I.is_ordered),Et(!0)},[I]),Object($.useEffect)(function(){if(!Vt)return;var Ve=I==null?void 0:I.standard_answer.map(function(lt){return lt.answer_text});It(Ve),Et(!1)},[Vt]),Object($.useImperativeHandle)(q,function(){return{onSave:tn,Clear:jt}});var tn=function(){var lt=[],gn=!1;return bt?(zt.forEach(function(yn,An){lt.push({position:An+1,answer_text:[]}),yn.forEach(function(Kn,d){lt[An].answer_text.push(Kn),(!Kn||!Object(A.bb)(Kn,1e4))&&(Fe("".concat(An,"-").concat(d)),M.b.info(Kn?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),gn=!0)})}),gn?!1:(lt==null?void 0:lt.length)>20?(M.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:bt,analysis:_t,standard_answers:lt,is_ordered:dt}):(M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},jt=function(){rt(""),et(""),It([]),Kt(!1)},dn=function(lt,gn,yn){var An=zt.slice();if(gn&&An.splice(lt,gn),yn)for(var Kn=0;Kn<yn;Kn++)An.splice(lt+Kn,0,[""]);It(An)},$t=function(lt,gn,yn){Fe("");var An=zt.slice();An[lt][gn]=yn,It(An)},mn=function(lt){var gn=zt.slice();gn[lt]=[].concat(Object(Te.a)(gn[lt]),[""]),It(gn)},On=function(lt,gn){var yn=zt.slice();if(!yn[lt][gn]){yn[lt]=yn[lt].filter(function(An,Kn){return Kn!==gn}),It(yn);return}ke.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){yn[lt]=yn[lt].filter(function(Kn,d){return d!==gn}),It(yn)}})},nn=function(lt){ke.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){var yn=zt.slice();yn=zt.filter(function(An,Kn){return lt!==Kn}),It(yn)}})};return h.a.createElement("section",{className:he.a.wrap},h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement("div",null,h.a.createElement(ue.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:bt,onChange:function(lt){return rt(lt)},showNullButton:!0,onPlaceholderChange:dn})),h.a.createElement("div",{className:"mt20"},zt.map(function(Ve,lt){return h.a.createElement(D.a,{key:lt,answers:Ve,index:lt,flex:1,is_md:!0,activeOptionErrorIndex:Lt,onAnswerChange:$t,addChildAnswer:mn,deleteChildAnswer:On,deleteChildAnswermain:nn})})),h.a.createElement("div",{className:"mt20"},zt.length>1&&h.a.createElement("span",null,h.a.createElement(Oe.a,{checked:dt,onChange:function(lt){return Kt(lt.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),h.a.createElement("span",{className:"".concat(he.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"))),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:_t,onChange:function(lt){return et(lt)}}))},He=Object(R.a)(function(We){var G=We.loading,q=We.globalSetting;return{globalSetting:q,loading:G.effects}},null,null,{forwardRef:!0})(Object($.forwardRef)(Le)),Pe=["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"],je=function(G,q){var Q=G.globalSetting,w=G.loading,S=G.editData,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,Re=Object(V.a)(G,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),bt=Object($.useState)(),rt=Object(se.a)(bt,2),ge=rt[0],ut=rt[1],_t=Object($.useState)(""),et=Object(se.a)(_t,2),Bt=et[0],qe=et[1],zt=Object($.useState)(""),It=Object(se.a)(zt,2),vt=It[0],Xt=It[1];Object($.useEffect)(function(){if(!S||!Ce)return;qe(S==null?void 0:S.name),Xt(S==null?void 0:S.analysis);var st=S==null?void 0:S.choices.find(function(tt){return tt.is_answer});ut(st.choice_text==="\u6B63\u786E"?"0":"1")},[S]),Object($.useImperativeHandle)(q,function(){return{onSave:Lt,Clear:Fe}});var Lt=function(){if(!Bt)return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!ge)return M.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var tt=[{choice_text:"\u6B63\u786E",is_answer:ge==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:ge==="1"?1:0}];return{name:Bt,choices:tt,analysis:vt}},Fe=function(){qe(""),Xt(""),ut("")};return h.a.createElement("section",{className:he.a.wrap},h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Bt,onChange:function(tt){return qe(tt)}}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),h.a.createElement(T.a.Group,{buttonStyle:"solid",value:ge,onChange:function(tt){return ut(tt.target.value)}},h.a.createElement(T.a.Button,{value:"0",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),h.a.createElement(T.a.Button,{value:"1",className:he.a.radio},"\u9519\u8BEF")),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:vt,onChange:function(tt){return Xt(tt)}}))},Qe=Object(R.a)(function(We){var G=We.loading,q=We.globalSetting;return{globalSetting:q,loading:G.effects}},null,null,{forwardRef:!0})(Object($.forwardRef)(je)),nt=["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"],ot=function(G,q){var Q=G.editData,w=G.globalSetting,S=G.loading,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,Re=Object(V.a)(G,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),bt=Object($.useState)([]),rt=Object(se.a)(bt,2),ge=rt[0],ut=rt[1],_t=Object($.useState)(),et=Object(se.a)(_t,2),Bt=et[0],qe=et[1],zt=Object($.useState)([]),It=Object(se.a)(zt,2),vt=It[0],Xt=It[1],Lt=Object($.useState)(""),Fe=Object(se.a)(Lt,2),st=Fe[0],tt=Fe[1],dt=Object($.useState)(""),Kt=Object(se.a)(dt,2),Gt=Kt[0],an=Kt[1];Object($.useEffect)(function(){ut(["","","",""])},[]),Object($.useEffect)(function(){if(!Q||!Ce)return;tt(Q==null?void 0:Q.name),an(Q==null?void 0:Q.analysis),ut(Q==null?void 0:Q.choices.map(function(jt){return jt.choice_text}));var tn=[];Q==null||Q.choices.map(function(jt,dn){jt.is_answer&&tn.push(dn)}),Xt(tn)},[Q]),Object($.useImperativeHandle)(q,function(){return{onSave:Vt,Clear:Et}});var Vt=function(){if(!st)return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var jt=ge.findIndex(function($t){return!$t});if(jt>-1)return M.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(nt[jt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!vt.length)return M.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(vt.length<2)return M.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var dn=ge.map(function($t,mn){return{choice_text:$t,is_answer:vt.includes(mn)?1:0}});return{name:st,choices:dn,analysis:Gt}},Et=function(){ut(["","","",""]),tt(""),an(""),Xt("")};return h.a.createElement("section",{className:he.a.wrap},h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:st,onChange:function(jt){return tt(jt)}}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ge.map(function(tn,jt){return h.a.createElement("div",{className:he.a.choiceWrap,key:jt},h.a.createElement(xe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},h.a.createElement("div",{className:"".concat(he.a.answer," ").concat(vt.includes(jt)?he.a.activeAnswer:""),onClick:function(){vt.includes(jt)?Xt(vt.filter(function($t){return $t!==jt})):Xt([].concat(Object(Te.a)(vt),[jt]))}},nt[jt])),h.a.createElement("div",{className:he.a.editorWrap},Bt===jt?h.a.createElement(B.a,{id:"single-question-option-".concat(jt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tn,onChange:function($t){ge[jt]=$t,ut(ge)}}):h.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return qe(jt)}},h.a.createElement(H.a,{value:tn}))),jt>1&&h.a.createElement(xe.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){ut(ge.filter(function($t,mn){return mn!==jt})),vt.includes(jt)?Xt(vt.filter(function($t){return $t!==jt})):Xt([].concat(Object(Te.a)(vt),[jt]))}})),jt<7&&jt===ge.length-1&&h.a.createElement(xe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},h.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ut([].concat(Object(Te.a)(ge),[""]))}})))}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(jt){return an(jt)}}))},$e=Object(R.a)(function(We){var G=We.loading,q=We.globalSetting;return{globalSetting:q,loading:G.effects}},null,null,{forwardRef:!0})(Object($.forwardRef)(ot)),Ke=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],At=function(G,q){var Q=G.editData,w=G.globalSetting,S=G.loading,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,Re=Object(V.a)(G,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),bt=Object($.useState)([]),rt=Object(se.a)(bt,2),ge=rt[0],ut=rt[1],_t=Object($.useState)(),et=Object(se.a)(_t,2),Bt=et[0],qe=et[1],zt=Object($.useState)(),It=Object(se.a)(zt,2),vt=It[0],Xt=It[1],Lt=Object($.useState)(""),Fe=Object(se.a)(Lt,2),st=Fe[0],tt=Fe[1],dt=Object($.useState)(""),Kt=Object(se.a)(dt,2),Gt=Kt[0],an=Kt[1];Object($.useEffect)(function(){ut(["","","",""])},[]),Object($.useEffect)(function(){if(!Q||!Ce)return;tt(Q==null?void 0:Q.name),an(Q==null?void 0:Q.analysis),ut(Q==null?void 0:Q.choices.map(function(tn){return tn.choice_text})),Xt(Q==null?void 0:Q.choices.findIndex(function(tn){return tn.is_answer}))},[Q]),Object($.useImperativeHandle)(q,function(){return{onSave:Vt,Clear:Et}});var Vt=function(){if(!st)return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var jt=ge.findIndex(function($t){return!$t});if(jt>-1)return M.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ke[jt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",vt),!(typeof vt=="number"))return M.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 dn=ge.map(function($t,mn){return{choice_text:$t,is_answer:vt===mn?1:0}});return{name:st,choices:dn,analysis:Gt}},Et=function(){ut(["","","",""]),tt(""),an(""),Xt("")};return h.a.createElement("section",{className:he.a.wrap},h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:st,onChange:function(jt){return tt(jt)}}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ge.map(function(tn,jt){return h.a.createElement("div",{className:he.a.choiceWrap,key:jt},h.a.createElement(xe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},h.a.createElement("div",{className:"".concat(he.a.answer," ").concat(vt===jt?he.a.activeAnswer:""),onClick:function(){return Xt(jt)}},Ke[jt])),h.a.createElement("div",{className:he.a.editorWrap},Bt===jt?h.a.createElement(B.a,{id:"single-question-option-".concat(jt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tn,onChange:function($t){ge[jt]=$t,ut(ge)}}):h.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return qe(jt)}},h.a.createElement(H.a,{value:tn}))),jt>1&&h.a.createElement(xe.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){ut(ge.filter(function($t,mn){return mn!==jt})),jt===vt&&Xt(null)}})),jt<7&&jt===ge.length-1&&h.a.createElement(xe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},h.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ut([].concat(Object(Te.a)(ge),[""]))}})))}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(jt){return an(jt)}}))},mt=Object(R.a)(function(We){var G=We.loading,q=We.globalSetting;return{globalSetting:q,loading:G.effects}},null,null,{forwardRef:!0})(Object($.forwardRef)(At)),St=["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(G,q){var Q=G.editData,w=G.globalSetting,S=G.loading,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,Re=Object(V.a)(G,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),bt=Object($.useState)(""),rt=Object(se.a)(bt,2),ge=rt[0],ut=rt[1],_t=Object($.useState)(""),et=Object(se.a)(_t,2),Bt=et[0],qe=et[1],zt=Object($.useState)(""),It=Object(se.a)(zt,2),vt=It[0],Xt=It[1];Object($.useEffect)(function(){var st;if(!Q||!Ce)return;ut(Q==null?void 0:Q.name),qe(Q==null?void 0:Q.analysis),Xt(Q==null||((st=Q.answer_texts)===null||st===void 0)?void 0:st[0])},[Q]),Object($.useImperativeHandle)(q,function(){return{onSave:Lt,Clear:Fe}});var Lt=function(){return ge?vt?{name:ge,answer_texts:[vt],analysis:Bt}:(M.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Fe=function(){ut(""),qe(""),Xt("")};return h.a.createElement("section",{className:he.a.wrap},h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ge,onChange:function(tt){return ut(tt)}}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),h.a.createElement(B.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:vt,onChange:function(tt){return Xt(tt)}}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Bt,onChange:function(tt){return qe(tt)}}))},Ot=Object(R.a)(function(We){var G=We.loading,q=We.globalSetting;return{globalSetting:q,loading:G.effects}},null,null,{forwardRef:!0})(Object($.forwardRef)(ct)),Ct=f("k1fw"),yt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],De=function(G,q){var Q=G.globalSetting,w=G.loading,S=G.dispatch,U=G.editData,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,Re=Object(V.a)(G,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),bt=Object($.useState)(""),rt=Object(se.a)(bt,2),ge=rt[0],ut=rt[1],_t=Object($.useState)([]),et=Object(se.a)(_t,2),Bt=et[0],qe=et[1];console.log(Bt),Object($.useEffect)(function(){var Lt;if(!U||!Ce)return;ut(U==null?void 0:U.name);var Fe=U==null||((Lt=U.sub_item_banks)===null||Lt===void 0)?void 0:Lt.map(function(st){var tt,dt,Kt;return Object(Ct.a)(Object(Ct.a)({},st),{},{id:st.id,open:!1,qusList:st==null||((tt=st.choices)===null||tt===void 0)?void 0:tt.map(function(Gt){return Gt.choice_text}),activeQusEditor:null,qusAnswer:(dt=[st==null||((Kt=st.choices)===null||Kt===void 0)?void 0:Kt.findIndex(function(Gt){return Gt.is_answer})])===null||dt===void 0?void 0:dt.filter(function(Gt){return Gt!==-1})})});qe(Fe)},[U]),Object($.useImperativeHandle)(q,function(){return{onSave:zt,Clear:It}});var zt=function(){if(!ge)return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Bt.length===0)return M.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var Fe=0;Fe<Bt.length;Fe++){var st,tt=Bt[Fe];if(!(tt!=null&&tt.name))return M.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Fe+1,"\u5C0F\u9898\u9898\u5E72")),!1;var dt=tt==null||((st=tt.qusList)===null||st===void 0)?void 0:st.findIndex(function(Gt){return!Gt});if(dt>-1)return M.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Fe+1,"\u5C0F\u9898").concat(yt[dt],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(tt!=null&&tt.qusAnswer.length))return M.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Fe+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Kt=Bt.map(function(Gt){return{id:Gt.id>1?Gt.id:null,name:Gt.name,item_type:Gt.item_type,analysis:Gt.analysis,choices:Gt.qusList.map(function(an,Vt){return{choice_text:an,is_answer:Gt.qusAnswer[0]===Vt?1:0}})}});return{name:ge,sub_item_banks:Kt}},It=function(){ut(""),qe([])},vt=function(){var Fe={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};qe(Bt.concat(Fe))},Xt=function(Fe,st,tt){var dt=Object(oe.cloneDeep)(Bt);if(Fe==="open"&&(dt[st].open=!dt[st].open),Fe==="delete"&&dt.splice(st,1),Fe==="value"&&(dt[st].name=tt),Fe==="answer"&&(dt[st].qusAnswer=[tt]),Fe==="edit"&&(dt[st].activeQusEditor=tt),Fe==="details"&&(dt[st].qusList[dt[st].activeQusEditor]=tt),Fe==="addQus"&&(dt[st].qusList=dt[st].qusList.concat("")),Fe==="deleteQus"){var Kt;dt[st].qusList=dt[st].qusList.filter(function(Gt,an){return an!==tt}),dt[st].qusAnswer=(Kt=dt[st].qusAnswer)===null||Kt===void 0?void 0:Kt.filter(function(Gt){return Gt!==tt})}Fe==="analysis"&&(dt[st].analysis=tt),qe(dt)};return h.a.createElement("section",{className:he.a.wrap},h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),h.a.createElement(B.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ge,onChange:function(Fe){return ut(Fe)}}),Bt==null?void 0:Bt.map(function(Lt,Fe){var st;return h.a.createElement("div",{className:he.a.fold,key:Lt.id},h.a.createElement("div",{onClick:function(){return Xt("open",Fe)},className:he.a.head},h.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Lt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),h.a.createElement("span",null,"\u7B2C",Fe+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),h.a.createElement("b",{style:{visibility:"hidden"},onClick:function(dt){dt.stopPropagation(),Xt("delete",Fe)},className:"iconfont icon-shanchu8"})),h.a.createElement("div",{className:"mb10",style:{display:Lt.open?"block":"none"}},h.a.createElement(B.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Lt==null?void 0:Lt.name,onChange:function(dt){return Xt("value",Fe,dt)}}),h.a.createElement("p",{className:he.a.titleWrap},h.a.createElement("span",{className:he.a.required},"*"),h.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Lt==null||((st=Lt.qusList)===null||st===void 0)?void 0:st.map(function(tt,dt){var Kt,Gt;return h.a.createElement("div",{className:he.a.choiceWrap,key:dt},h.a.createElement(xe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},h.a.createElement("div",{className:"".concat(he.a.answer," ").concat(Lt!=null&&(Kt=Lt.qusAnswer)!==null&&Kt!==void 0&&Kt.includes(dt)?he.a.activeAnswer:""),onClick:function(){return Xt("answer",Fe,dt)}},yt[dt])),h.a.createElement("div",{className:he.a.editorWrap},(Lt==null?void 0:Lt.activeQusEditor)===dt?h.a.createElement(B.a,{id:"single-question-option-".concat(dt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tt,onChange:function(Vt){return Xt("details",Fe,Vt)}}):h.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return Xt("edit",Fe,dt)}},h.a.createElement(H.a,{value:tt}))),dt>1&&h.a.createElement(xe.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Xt("deleteQus",Fe,dt)}})),dt<7&&dt===(Lt==null||((Gt=Lt.qusList)===null||Gt===void 0)?void 0:Gt.length)-1&&h.a.createElement(xe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},h.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Xt("addQus",Fe)}})))}),h.a.createElement("p",{className:"mb10 mt10"},h.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),h.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Lt.analysis,onChange:function(dt){return Xt("analysis",Fe,dt)}})))}))},Ut=Object(R.a)(function(We){var G=We.loading,q=We.globalSetting;return{globalSetting:q,loading:G.effects}},null,null,{forwardRef:!0})(Object($.forwardRef)(De)),kt=function(G){var q,Q,w,S,U,I,de,Ce,Re=G.data,bt=G.submit,rt=G.goBack,ge=G.loading,ut=G.onTypeScore,_t=G.editPreview,et=_t===void 0?!1:_t,Bt=G.onSkipExamination,qe=G.selectValue,zt=G.onExchange,It=Object($.useRef)(),vt=Object($.useRef)(Object(oe.debounce)(function(){return dn()},100,{leading:!0,trailing:!0})),Xt=Object($.useState)(null),Lt=Object(se.a)(Xt,2),Fe=Lt[0],st=Lt[1],tt=Object($.useState)(!1),dt=Object(se.a)(tt,2),Kt=dt[0],Gt=dt[1],an=Object(E.i)();Object($.useEffect)(function(){return window.addEventListener("scroll",vt==null?void 0:vt.current),function(){window.removeEventListener("scroll",vt==null?void 0:vt.current)}},[]),Object($.useEffect)(function(){Gt(!0)},[]),Object($.useEffect)(function(){var Ee,ce,ze,Rt,Pt=(Ee=document.getElementById("examName"))===null||Ee===void 0||((ce=Ee.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||ce===void 0||((ze=ce[0])===null||ze===void 0||((Rt=ze.childNodes)===null||Rt===void 0)))?void 0:Rt[2];Pt&&(Pt.nodeValue="\u4EFD")},[Re]);var Vt=function(ce){var ze=parseInt(ce);return isNaN(ze)?"":ze};function Et(){var Ee=0,ce=0,ze=0;return document.body&&(ce=document.body.scrollTop),document.documentElement&&(ze=document.documentElement.scrollTop),Ee=ce-ze>0?ce:ze,Ee}function tn(){var Ee=0,ce=0,ze=0;return document.body&&(ce=document.body.scrollHeight),document.documentElement&&(ze=document.documentElement.scrollHeight),Ee=ce-ze>0?ce:ze,Ee}function jt(){var Ee=0;return document.compatMode=="CSS1Compat"?Ee=document.documentElement.clientHeight:Ee=document.body.clientHeight,Ee}var dn=function(){var ce=document.getElementById("preview_btns"),ze=document.getElementById("preview_btns_else");Et()+jt()>=tn()-68?(ce.style.visibility="hidden",ze.style.visibility="visible"):(ce.style.visibility="visible",ze.style.visibility="hidden")},$t=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],mn=function(ce){var ze,Rt=[];return h.a.createElement(h.a.Fragment,null,h.a.createElement("aside",{className:y.a.single},ce==null||((ze=ce.choices)===null||ze===void 0)?void 0:ze.map(function(Pt,Tt){return Pt.is_answer&&Rt.push(gn[Tt]),h.a.createElement("ul",{key:Tt},h.a.createElement("li",null,gn[Tt],"\u3001"),h.a.createElement("li",null,h.a.createElement(H.a,{value:Pt.choice_text})))})),h.a.createElement("div",{className:y.a.analysis},h.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Rt.join(""),h.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",$t[ce.difficulty])),h.a.createElement("aside",null,h.a.createElement("span",{className:y.a.text},"\u89E3\u6790:"),h.a.createElement(H.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),h.a.createElement("ul",null,h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},On=function(ce){var ze,Rt=ce==null||((ze=ce.standard_answer)===null||ze===void 0)?void 0:ze.map(function(Pt){var Tt;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Pt.position,"\uFF09\uFF1A").concat(Pt==null||((Tt=Pt.answer_text)===null||Tt===void 0)?void 0:Tt.join("\u3001"))});return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{className:y.a.analysis},h.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Rt),h.a.createElement("aside",null,h.a.createElement("span",{className:y.a.text},"\u89E3\u6790:"),h.a.createElement(H.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),h.a.createElement("ul",null,h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},nn=function(ce){var ze;return h.a.createElement("div",{className:y.a.analysis},h.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ce==null||((ze=ce.answer_texts)===null||ze===void 0)?void 0:ze[0]),h.a.createElement("aside",null,h.a.createElement("span",{className:y.a.text},"\u89E3\u6790:"),h.a.createElement(H.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),h.a.createElement("ul",null,h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name)))},Ve=function(ce){var ze;return h.a.createElement("div",{className:y.a.analysis},h.a.createElement("aside",null,h.a.createElement("span",{className:y.a.text},"\u9884\u671F\u8F93\u51FA:"),h.a.createElement(H.a,{value:ce==null||((ze=ce.program_attr)===null||ze===void 0)?void 0:ze.description})),h.a.createElement("ul",null,h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name)))},lt=function(ce,ze){var Rt;return h.a.createElement("div",null,ce==null||((Rt=ce.sub_item_banks)===null||Rt===void 0)?void 0:Rt.map(function(Pt,Tt){var Wt,bn=[];return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},ze+1+"."+(Tt+1),"\uFF08\u5355\u9009\u9898\uFF09",Pt.name),h.a.createElement("aside",{className:y.a.single},Pt==null||((Wt=Pt.choices)===null||Wt===void 0)?void 0:Wt.map(function(Fn,En){return Fn.is_answer&&bn.push(gn[En]),h.a.createElement("ul",{key:En},h.a.createElement("li",null,gn[En],"\u3001"),h.a.createElement("li",null,h.a.createElement(H.a,{value:Fn.choice_text})))})),h.a.createElement("div",{className:y.a.analysis},h.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",bn.join(""),h.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",$t[Pt.difficulty])),h.a.createElement("aside",null,h.a.createElement("span",{className:y.a.text},"\u89E3\u6790:"),h.a.createElement(H.a,{value:Pt.analysis?Pt.analysis:"\u6682\u65E0\u89E3\u6790"})),h.a.createElement("ul",null,h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),h.a.createElement("li",null,h.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))}))},gn=["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"],yn=function(ce){console.log("---",ce);var ze=[];ce.questions.map(function(Pt){return Pt==null?void 0:Pt.sub_item_banks.map(function(Tt){ze.push(Tt)})});var Rt=0;ce.type==="COMBINATION"?Rt=ce.questions_score/ze.length:Rt=ce.questions_score/ce.questions_count,ke.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:h.a.createElement("div",{className:y.a.modalColumn},h.a.createElement("div",{className:y.a.modalRow,style:{justifyContent:"flex-start"}},h.a.createElement("sup",{className:y.a.sup},"*"),h.a.createElement("span",null,ce==null?void 0:ce.name,(ce==null?void 0:ce.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),h.a.createElement(_.a,{min:1,parser:Vt,defaultValue:Rt,onChange:function(Tt){Rt=Tt}}),h.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Pt=Object(W.a)(fe.a.mark(function Wt(){var bn,Fn;return fe.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(Rt){Zt.next=3;break}return M.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Zt.abrupt("return",Promise.reject());case 3:ce.type==="COMBINATION"?(bn={type:ce==null?void 0:ce.type,score:Rt,scoreTotal:Rt*(ze==null?void 0:ze.length)},ut(bn)):(Fn={type:ce==null?void 0:ce.type,score:Rt,scoreTotal:Rt*ce.questions_count},ut(Fn));case 4:case"end":return Zt.stop()}},Wt)}));function Tt(){return Pt.apply(this,arguments)}return Tt}()})},An=function(){var ce="";ke.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:h.a.createElement("div",{className:y.a.modalColumn},h.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},h.a.createElement("img",{style:{marginRight:5},src:Ae.a}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),h.a.createElement("div",{className:y.a.modalRow,style:{marginTop:20}},h.a.createElement("sup",{className:y.a.sup},"*"),h.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),h.a.createElement(K.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:ce,onChange:function(Rt){ce=Rt.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var ze=Object(W.a)(fe.a.mark(function Pt(){var Tt,Wt,bn,Fn,En;return fe.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(ce){In.next=3;break}return M.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),In.abrupt("return",Promise.reject());case 3:return Wt=[],bn=[],Fn=[],Re==null||((Tt=Re.questionList)===null||Tt===void 0)||Tt.forEach(function(li){var Wn;(Wn=li.questions)===null||Wn===void 0||Wn.forEach(function(gi){Wt.push(gi.id),bn.push(li.questions_score/li.questions_count),li.type==="COMBINATION"&&Fn.push({id:gi.id,sub_item_bank_ids:gi.sub_item_banks.map(function(Bn){return Bn.id})})})}),console.log("-----",Fn),En={item_bank_ids:Wt,item_bank_scores:bn,name:ce,combination_item_banks:Fn},In.next=11,bt(En);case 11:case"end":return In.stop()}},Pt)}));function Rt(){return ze.apply(this,arguments)}return Rt}()})},Kn=function(ce,ze,Rt,Pt){var Tt,Wt=(Tt=Pt.questions)===null||Tt===void 0?void 0:Tt.map(function(En){return En.id}),bn="default",Fn=ke.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:h.a.createElement("div",null,h.a.createElement("p",null,"\u7CFB\u7EDF\u6309\u4EE5\u4E0B\u89C4\u5219\u4E3A\u60A8\u66F4\u6362\u8BE5\u8BD5\u9898"),h.a.createElement("div",null,h.a.createElement("span",null,"\u4F7F\u7528\u9891\u5EA6\uFF1A"),h.a.createElement(T.a.Group,{defaultValue:bn,onChange:function(Zt){bn=Zt.target.value}},h.a.createElement(T.a,{value:"default"},"\u4E0D\u8BBE\u5B9A"),h.a.createElement(T.a,{value:"high"},"\u4F7F\u7528\u6B21\u6570\u9AD8"),h.a.createElement(T.a,{value:"low"},"\u4F7F\u7528\u6B21\u6570\u4F4E")))),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var En=Object(W.a)(fe.a.mark(function In(){return fe.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Fn.update({cancelButtonProps:{disabled:!0}}),Wn.next=3,zt({single_question_id:ce,seleted_item_bank_ids:Wt,type:bn},{type:ze,index:Rt});case 3:Fn.update({cancelButtonProps:{disabled:!1}}),M.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return Wn.stop()}},In)}));function Zt(){return En.apply(this,arguments)}return Zt}()})},d=function(ce){var ze,Rt=(ze=ce.questions)===null||ze===void 0?void 0:ze.map(function(Wt){return Wt.id}),Pt=ce.name,Tt=ke.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(Pt,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Wt=Object(W.a)(fe.a.mark(function Fn(){return fe.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Tt.update({cancelButtonProps:{disabled:!0}}),Zt.next=3,zt({seleted_item_bank_ids:Rt},{type:ce.type});case 3:Tt.update({cancelButtonProps:{disabled:!1}}),M.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(Pt,"\u8BD5\u9898"));case 5:case"end":return Zt.stop()}},Fn)}));function bn(){return Wt.apply(this,arguments)}return bn}()})},r=function(){var ce=ke.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 ze=Object(W.a)(fe.a.mark(function Pt(){return fe.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return ce.update({cancelButtonProps:{disabled:!0}}),Wt.next=3,zt();case 3:ce.update({cancelButtonProps:{disabled:!1}}),M.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Wt.stop()}},Pt)}));function Rt(){return ze.apply(this,arguments)}return Rt}()})},o=function(ce){console.log(ce,"key"),Bt(ce-1)},u=function(){return h.a.createElement(h.a.Fragment,null,h.a.createElement(x.a,{color:"#55575D",overlayClassName:y.a.popover,visible:Kt,getPopupContainer:function(ze){return ze==null?void 0:ze.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"},h.a.createElement(P.a,{onMouseEnter:function(){return Gt(!0)},onMouseLeave:function(){return Gt(!1)},onClick:function(){An()}},"\u4FDD\u5B58")),h.a.createElement(P.a,{onClick:function(){document.body.scrollIntoView(),rt()}},"\u8FD4\u56DE"),h.a.createElement(P.a,{loading:ge,onClick:function(){return bt()},type:"primary"},"\u63D0\u4EA4"))},v=function(){var ce;return h.a.createElement(h.a.Fragment,null,h.a.createElement(P.a,{onClick:rt},"\u8FD4\u56DE"),qe>0&&h.a.createElement(P.a,{onClick:function(){return o(qe)},type:"primary"},"\u4E0A\u4E00\u4EFD"),qe<(Re==null||((ce=Re.exam)===null||ce===void 0)?void 0:ce.total_num)-1&&h.a.createElement(P.a,{onClick:function(){return o(qe+2)}},"\u4E0B\u4E00\u4EFD"))},c=function(ce,ze){if(console.log(ce,222),ze==="SINGLE")return h.a.createElement(h.a.Fragment,null,h.a.createElement(mt,{ref:It,editData:ce,isEdit:!0}),h.a.createElement(ae.a,null));if(ze==="MULTIPLE")return h.a.createElement(h.a.Fragment,null,h.a.createElement($e,{ref:It,editData:ce,isEdit:!0}),h.a.createElement(ae.a,null));if(ze==="JUDGMENT")return h.a.createElement(h.a.Fragment,null,h.a.createElement(Qe,{ref:It,editData:ce,isEdit:!0}),h.a.createElement(ae.a,null));if(ze==="COMPLETION")return h.a.createElement(h.a.Fragment,null,h.a.createElement(He,{ref:It,editData:ce,isEdit:!0}),h.a.createElement(ae.a,null));if(ze==="SUBJECTIVE")return h.a.createElement(h.a.Fragment,null,h.a.createElement(Ot,{ref:It,editData:ce,isEdit:!0}),h.a.createElement(ae.a,null));if(ze==="COMBINATION")return h.a.createElement(h.a.Fragment,null,h.a.createElement(Ut,{ref:It,editData:ce,isEdit:!0}),h.a.createElement(ae.a,null));if(ze==="PROGRAM"){var Rt;R.d.push("/problems/".concat(ce==null||((Rt=ce.program_attr)===null||Rt===void 0)?void 0:Rt.identifier,"/edit?type=exercises&express_id=").concat(an.categoryId,"&question_id=").concat(ce==null?void 0:ce.id,"&score=").concat(ce==null?void 0:ce.score,"&callback_url=").concat(location.pathname,"&select=").concat(qe,"&exercise=true"))}},ne=function(){var Ee=Object(W.a)(fe.a.mark(function ce(ze,Rt){var Pt,Tt,Wt,bn,Fn,En,Zt,In,li,Wn;return fe.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,(Pt=It.current)===null||Pt===void 0?void 0:Pt.onSave();case 2:if(Tt=Bn.sent,Tt){Bn.next=5;break}return Bn.abrupt("return");case 5:return Wt={question_score:Rt.score,analysis:Tt.analysis},console.log(Tt,"editorData"),(ze==="SINGLE"||ze==="MULTIPLE"||ze==="JUDGMENT")&&(Fn=[],En=[],Wt.question_type=ze==="JUDGMENT"?2:1,Wt.question_title=Tt==null?void 0:Tt.name,Tt==null||((bn=Tt.choices)===null||bn===void 0)||bn.forEach(function(Gn,Xi){Fn.push(Gn.choice_text),Gn!=null&&Gn.is_answer&&En.push(Xi+1)}),Wt.question_choices=Fn,Wt.standard_answers=En),ze==="COMPLETION"&&(Wt.is_ordered=Tt.is_ordered,Wt.question_title=Tt==null?void 0:Tt.name,Wt.question_type=3,In=[],Tt==null||((Zt=Tt.standard_answers)===null||Zt===void 0)||Zt.forEach(function(Gn,Xi){In.push({choice_id:Gn.position,answer_text:Gn.answer_text})}),Wt.standard_answers=In),ze==="SUBJECTIVE"&&(Wt.question_title=Tt==null?void 0:Tt.name,Wt.question_type=3,Wt.standard_answers=Tt==null?void 0:Tt.answer_texts),ze==="COMBINATION"&&(Wt.question_title=Tt==null?void 0:Tt.name,Wt.question_type=7,Wt.sub_questions=Tt==null||((li=Tt.sub_item_banks)===null||li===void 0)?void 0:li.map(function(Gn,Xi){return{id:Gn.id,question_title:Gn.name,question_type:1,question_choices:Gn.choices.map(function(ii){return ii.choice_text}),standard_answers:[Gn.choices.findIndex(function(ii){return ii.is_answer})+1],analysis:Gn.analysis}}),delete Wt.analysis),Bn.next=13,Object(ie.a)("/api/exercise_questions/".concat(Rt.id,".json"),{method:"put",body:Wt});case 13:Wn=Bn.sent,(Wn==null?void 0:Wn.status)===0&&(M.b.success("\u7F16\u8F91\u6210\u529F"),o(qe+1)),st(null);case 16:case"end":return Bn.stop()}},ce)}));return function(ze,Rt){return Ee.apply(this,arguments)}}(),Ye=function(){for(var ce=[],ze=0;ze<(Re==null||((Rt=Re.exam)===null||Rt===void 0)?void 0:Rt.total_num);ze++){var Rt;ce.push({})}return ce};console.log(Ye(),"data");var _e=Re==null||((q=Re.questionList)===null||q===void 0)?void 0:q.reduce(function(Ee,ce){return Ee+ce.questions_score},0),Dt=et&&(Re==null||((Q=Re.exam)===null||Q===void 0)?void 0:Q.exercise_status)!==1;return h.a.createElement("section",{className:y.a.wrap},h.a.createElement("div",{id:"id_left_preview",className:y.a.left,onMouseEnter:function(ce){var ze=document.getElementById("id_left_preview");ze.style.overflowY="auto"},onMouseLeave:function(ce){var ze=document.getElementById("id_left_preview");ze.style.overflowY="hidden"}},h.a.createElement("div",{className:y.a.title},h.a.createElement("div",null,h.a.createElement("b",null),h.a.createElement("span",null,"\u7B54\u9898\u5361"))),h.a.createElement("div",{className:y.a.total},h.a.createElement("div",null,h.a.createElement("img",{src:be.a}),h.a.createElement("span",null,"\u9898\u6570(\u9053)"),h.a.createElement("aside",null,Re==null?void 0:Re.all_questions_count)),h.a.createElement("div",{className:"mr30 ml30"},h.a.createElement("img",{src:m.a}),h.a.createElement("span",null,"\u603B\u5206(\u5206)"),h.a.createElement("aside",null,_e)),h.a.createElement("div",null,h.a.createElement("img",{src:J.a}),h.a.createElement("span",null,"\u65F6\u957F(\u5206)"),h.a.createElement("aside",null,Re==null||((w=Re.exam)===null||w===void 0)?void 0:w.time))),Re==null||((S=Re.questionList)===null||S===void 0)?void 0:S.map(function(Ee,ce){var ze;return h.a.createElement("div",{className:y.a.list,key:ce},h.a.createElement("div",{className:y.a.name},h.a.createElement("b",null),h.a.createElement("span",null,Ee.name)),h.a.createElement("aside",null,h.a.createElement("div",null,"\u5171",h.a.createElement("span",{className:y.a.b},Ee.questions_count),"\u9898 ",h.a.createElement("span",{className:y.a.l},"|"),"\u5171",h.a.createElement("span",{className:y.a.r},Ee.questions_score),"\u5206"),h.a.createElement("div",{className:y.a.answerSheet},Ee==null||((ze=Ee.questions)===null||ze===void 0)?void 0:ze.map(function(Rt,Pt){return h.a.createElement("div",{onClick:function(){var Wt="Anchor_".concat(Rt.id),bn=document.getElementById(Wt);bn&&setTimeout(function(){return bn.scrollIntoView({block:"center",behavior:"smooth"})})},key:Rt.id,className:y.a.tag},Pt+1)}))))})),h.a.createElement("div",{className:y.a.right},h.a.createElement("div",{className:y.a.examName,id:"examName"},h.a.createElement("div",{className:y.a.name},h.a.createElement(xe.a,{title:Re==null||((U=Re.exam)===null||U===void 0)?void 0:U.name,getPopupContainer:function(ce){return ce.parentNode}},h.a.createElement("span",{className:y.a.t},Re==null||((I=Re.exam)===null||I===void 0)?void 0:I.name))),et?h.a.createElement(ve.a,{showTotal:function(ce){return h.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",h.a.createElement("span",{className:"c-light-primary"},ce),"\u4EFD\u8BD5\u5377")},total:Re==null||((de=Re.exam)===null||de===void 0)?void 0:de.total_num,pageSize:1,current:qe+1,showSizeChanger:!1,onChange:o,showQuickJumper:!0,hideOnSinglePage:!1}):h.a.createElement(P.a,{onClick:r,type:"primary"},"\u968F\u673A\u66F4\u6362")),h.a.createElement("div",{className:y.a.topWarp},Re==null||((Ce=Re.questionList)===null||Ce===void 0)?void 0:Ce.map(function(Ee,ce){var ze,Rt;return h.a.createElement(h.a.Fragment,{key:ce},h.a.createElement("div",{className:y.a.head,style:ce===0?{border:0,marginTop:-16}:{}},h.a.createElement("div",{className:y.a.name},h.a.createElement("b",null),h.a.createElement("span",null,Ee.name)),h.a.createElement("div",{className:y.a.so},"\u5171",h.a.createElement("span",{className:y.a.b},Ee.questions_count," "),"\u9898 ",Ee.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(Ee==null||((ze=Ee.questions)===null||ze===void 0)?void 0:ze.map(function(Pt){var Tt;return Pt==null||((Tt=Pt.sub_item_banks)===null||Tt===void 0)?void 0:Tt.length}).reduce(function(Pt,Tt){return Pt+Tt}),"\u5C0F\u9898\uFF09"),h.a.createElement("span",{className:y.a.l},"|"),"\u5171",h.a.createElement("span",{className:y.a.r},Ee.questions_score),"\u5206"),!et&&h.a.createElement("div",{className:y.a.btn},h.a.createElement(P.a,{onClick:function(){yn(Ee)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),h.a.createElement(P.a,{onClick:function(){return d(Ee)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),Ee==null||((Rt=Ee.questions)===null||Rt===void 0)?void 0:Rt.map(function(Pt,Tt){return Fe===Pt.id?h.a.createElement("div",{id:"Anchor_".concat(Pt.id),className:y.a.content,style:{padding:0,marginTop:10},key:Pt.id},h.a.createElement("div",{style:{float:"right",marginTop:-6}},h.a.createElement(P.a,{onClick:function(){return st(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),h.a.createElement(P.a,{onClick:function(){return ne(Ee==null?void 0:Ee.type,Pt)},type:"primary"},"\u4FDD\u5B58")),c(Pt,Ee.type)):h.a.createElement("div",{id:"Anchor_".concat(Pt.id),className:y.a.content,key:Pt.id},h.a.createElement("div",{className:y.a.titleWrap},h.a.createElement(H.a,{style:{paddingRight:10},className:y.a.titleHtml,value:Tt+1+"\u3001"+"".concat((Pt==null?void 0:Pt.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+Pt.name}),et&&h.a.createElement(P.a,{disabled:Dt,onClick:function(){if(Fe){M.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}st(Pt.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),h.a.createElement(P.a,{disabled:Dt,onClick:function(){return Kn(Pt.id,Ee.type,Tt,Ee)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Ee.type==="SINGLE"||Ee.type==="JUDGMENT"||Ee.type==="MULTIPLE")&&mn(Pt),Ee.type==="COMPLETION"&&On(Pt),Ee.type==="SUBJECTIVE"&&nn(Pt),Ee.type==="FILEUPLOAD"&&nn(Pt),Ee.type==="PHOTOGRAPH"&&nn(Pt),Ee.type==="PROGRAM"&&Ve(Pt),Ee.type==="COMBINATION"&<(Pt,Tt),h.a.createElement("div",null))}))})),h.a.createElement("div",{className:y.a.btnsElse,id:"preview_btns_else"},et?v():u()),h.a.createElement("div",{className:y.a.btnsWrap,id:"preview_btns"},h.a.createElement("div",{className:y.a.btns},et?v():u()))))},Ue=Ie.a=kt},sboe:function(Je,Ie,f){"use strict";f.d(Ie,"a",function(){return re});var z=f("q1tI"),ve=f.n(z),re=z.createContext(null)},tmPe:function(Je,Ie,f){Je.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(Je,Ie,f){Je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(Je,Ie){function f(){this.buffer=new Array,this.length=0}f.prototype={get:function(z){var ve=Math.floor(z/8);return(this.buffer[ve]>>>7-z%8&1)==1},put:function(z,ve){for(var re=0;re<ve;re++)this.putBit((z>>>ve-re-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(z){var ve=Math.floor(this.length/8);this.buffer.length<=ve&&this.buffer.push(0),z&&(this.buffer[ve]|=128>>>this.length%8),this.length++}},Je.exports=f}}]);
|