(window.webpackJsonp=window.webpackJsonp||[]).push([[198,7,8],{"+NIl":function(At,ht,re){(function(ae){ae(re("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function($,R){"use strict";function X(T,A){T.cmdState.push(A)}function N(T){return T.cmdState.length>0?T.cmdState[T.cmdState.length-1]:null}function I(T){var A=T.cmdState.pop();A&&A.closeBracket()}function z(T){for(var A=T.cmdState,C=A.length-1;C>=0;C--){var h=A[C];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function B(T,A,C){return function(){this.name=T,this.bracketNo=0,this.style=A,this.styles=C,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=B("importmodule","tag",["string","builtin"]),O.documentclass=B("documentclass","tag",["","atom"]),O.usepackage=B("usepackage","tag",["atom"]),O.begin=B("begin","tag",["atom"]),O.end=B("end","tag",["atom"]),O.label=B("label","tag",["atom"]),O.ref=B("ref","tag",["atom"]),O.eqref=B("eqref","tag",["atom"]),O.cite=B("cite","tag",["atom"]),O.bibitem=B("bibitem","tag",["atom"]),O.Bibitem=B("Bibitem","tag",["atom"]),O.RBibitem=B("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(T,A){T.f=A}function E(T,A){var C;if(T.match(/^\\[a-zA-Z@]+/)){var h=T.current().slice(1);return C=O.hasOwnProperty(h)?O[h]:O.DEFAULT,C=new C,X(A,C),D(A,k),C.style}if(T.match(/^\\[$&%#{}_]/))return"tag";if(T.match(/^\\[,;!\/\\]/))return"tag";if(T.match("\\["))return D(A,function(c,d){return L(c,d,"\\]")}),"keyword";if(T.match("\\("))return D(A,function(c,d){return L(c,d,"\\)")}),"keyword";if(T.match("$$"))return D(A,function(c,d){return L(c,d,"$$")}),"keyword";if(T.match("$"))return D(A,function(c,d){return L(c,d,"$")}),"keyword";var o=T.next();if(o=="%")return T.skipToEnd(),"comment";if(o=="}"||o=="]"){if(C=N(A),C)C.closeBracket(o),D(A,k);else return"error";return"bracket"}else return o=="{"||o=="["?(C=O.DEFAULT,C=new C,X(A,C),"bracket"):/\d/.test(o)?(T.eatWhile(/[\w.%]/),"atom"):(T.eatWhile(/[\w\-_]/),C=z(A),C.name=="begin"&&(C.argument=T.current()),C.styleIdentifier())}function L(T,A,C){if(T.eatSpace())return null;if(C&&T.match(C))return D(A,E),"keyword";if(T.match(/^\\[a-zA-Z@]+/))return"tag";if(T.match(/^[a-zA-Z]+/))return"variable-2";if(T.match(/^\\[$&%#{}_]/))return"tag";if(T.match(/^\\[,;!\/]/))return"tag";if(T.match(/^[\^_&]/))return"tag";if(T.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(T.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=T.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(T.skipToEnd(),"comment"):"error"}function k(T,A){var C=T.peek(),h;return C=="{"||C=="["?(h=N(A),h.openBracket(C),T.eat(C),D(A,E),"bracket"):/[ \t\r]/.test(C)?(T.eat(C),null):(D(A,E),I(A),E(T,A))}return{startState:function(){var T=R.inMathMode?function(A,C){return L(A,C)}:E;return{cmdState:[],f:T}},copyState:function(T){return{cmdState:T.cmdState.slice(),f:T.f}},token:function(T,A){return A.f(T,A)},blankLine:function(T){T.f=E,T.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"+yhJ":function(At,ht,re){At.exports=re.p+"static/xixi.d492fb65.svg"},"0eGx":function(At,ht,re){At.exports=re.p+"static/zhong.c1924b73.svg"},"19Vz":function(At,ht,re){(function(ae){ae(re("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(B,O,D){var E=D&&D!=ae.Init;if(O&&!E)B.on("blur",N),B.on("change",I),B.on("swapDoc",I),ae.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){X(B)}),I(B);else if(!O&&E){B.off("blur",N),B.off("change",I),B.off("swapDoc",I),ae.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),$(B);var L=B.getWrapperElement();L.className=L.className.replace(" CodeMirror-empty","")}O&&!B.hasFocus()&&N(B)});function $(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function R(B){$(B);var O=B.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=B.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var D=B.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),O.appendChild(D),B.display.lineSpace.insertBefore(O,B.display.lineSpace.firstChild)}function X(B){setTimeout(function(){var O=!1,D=B.getInputField();D.nodeName=="TEXTAREA"?O=!D.value:B.lineCount()==1&&(O=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),O?R(B):$(B)},20)}function N(B){z(B)&&R(B)}function I(B){var O=B.getWrapperElement(),D=z(B);O.className=O.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?R(B):$(B)}function z(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(At,ht,re){(function(ae){ae(re("VrN/"))})(function(ae){"use strict";var $={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(X,N){var I=X.indentUnit,z={},B=N.htmlMode?$:R;for(var O in B)z[O]=B[O];for(var O in N)z[O]=N[O];var D,E;function L(a,b){function v(H){return b.tokenize=H,H(a,b)}var S=a.next();if(S=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?v(A("atom","]]>")):null:a.match("--")?v(A("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),v(C(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=A("meta","?>"),"meta"):(D=a.eat("/")?"closeTag":"openTag",b.tokenize=k,"tag bracket");if(S=="&"){var M;return a.eat("#")?a.eat("x")?M=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):M=a.eatWhile(/[\d]/)&&a.eat(";"):M=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),M?"atom":"error"}else return a.eatWhile(/[^&<]/),null}L.isInText=!0;function k(a,b){var v=a.next();if(v==">"||v=="/"&&a.eat(">"))return b.tokenize=L,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){b.tokenize=L,b.state=d,b.tagName=b.tagStart=null;var S=b.tokenize(a,b);return S?S+" tag error":"tag error"}else return/[\'\"]/.test(v)?(b.tokenize=T(v),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function T(a){var b=function(v,S){for(;!v.eol();)if(v.next()==a){S.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function A(a,b){return function(v,S){for(;!v.eol();){if(v.match(b)){S.tokenize=L;break}v.next()}return a}}function C(a){return function(b,v){for(var S;(S=b.next())!=null;){if(S=="<")return v.tokenize=C(a+1),v.tokenize(b,v);if(S==">")if(a==1){v.tokenize=L;break}else return v.tokenize=C(a-1),v.tokenize(b,v)}return"meta"}}function h(a,b,v){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=v,(z.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function c(a,b){for(var v;;){if(!a.context)return;if(v=a.context.tagName,!z.contextGrabbers.hasOwnProperty(v)||!z.contextGrabbers[v].hasOwnProperty(b))return;o(a)}}function d(a,b,v){return a=="openTag"?(v.tagStart=b.column(),_):a=="closeTag"?y:d}function _(a,b,v){return a=="word"?(v.tagName=b.current(),E="tag",x):z.allowMissingTagName&&a=="endTag"?(E="tag bracket",x(a,b,v)):(E="error",_)}function y(a,b,v){if(a=="word"){var S=b.current();return v.context&&v.context.tagName!=S&&z.implicitlyClosed.hasOwnProperty(v.context.tagName)&&o(v),v.context&&v.context.tagName==S||z.matchClosing===!1?(E="tag",m):(E="tag error",l)}else return z.allowMissingTagName&&a=="endTag"?(E="tag bracket",m(a,b,v)):(E="error",l)}function m(a,b,v){return a!="endTag"?(E="error",m):(o(v),d)}function l(a,b,v){return E="error",m(a,b,v)}function x(a,b,v){if(a=="word")return E="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var S=v.tagName,M=v.tagStart;return v.tagName=v.tagStart=null,a=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(S)?c(v,S):(c(v,S),v.context=new h(v,S,M==v.indented)),d}return E="error",x}function f(a,b,v){return a=="equals"?p:(z.allowMissing||(E="error"),x(a,b,v))}function p(a,b,v){return a=="string"?s:a=="word"&&z.allowUnquoted?(E="string",x):(E="error",x(a,b,v))}function s(a,b,v){return a=="string"?s:x(a,b,v)}return{startState:function(a){var b={tokenize:L,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;D=null;var v=b.tokenize(a,b);return(v||D)&&v!="comment"&&(E=null,b.state=b.state(D||v,a,b),E&&(v=E=="error"?v+" error":E)),v},indent:function(a,b,v){var S=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+I;if(S&&S.noIndent)return ae.Pass;if(a.tokenize!=k&&a.tokenize!=L)return v?v.match(/^(\s*)/)[0].length:0;if(a.tagName)return z.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+I*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/$/,blockCommentStart:"",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(a){a.state==p&&(a.state=x)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],v=a.context;v;v=v.prev)v.tagName&&b.push(v.tagName);return b.reverse()}}}),ae.defineMIME("text/xml","xml"),ae.defineMIME("application/xml","xml"),ae.mimeModes.hasOwnProperty("text/html")||ae.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"6+eU":function(At,ht,re){"use strict";re.d(ht,"a",function(){return m});var ae=re("wx14"),$=re("rePB"),R=re("VTBJ"),X=re("1OyB"),N=re("vuIU"),I=re("Ji7U"),z=re("LK+K"),B=re("q1tI"),O=re.n(B),D=re("TSYQ"),E=re.n(D),L=function(x){var f,p="".concat(x.rootPrefixCls,"-item"),s=E()(p,"".concat(p,"-").concat(x.page),(f={},Object($.a)(f,"".concat(p,"-active"),x.active),Object($.a)(f,x.className,!!x.className),Object($.a)(f,"".concat(p,"-disabled"),!x.page),f)),a=function(){x.onClick(x.page)},b=function(S){x.onKeyPress(S,x.onClick,x.page)};return O.a.createElement("li",{title:x.showTitle?x.page:null,className:s,onClick:a,onKeyPress:b,tabIndex:"0"},x.itemRender(x.page,"page",O.a.createElement("a",{rel:"nofollow"},x.page)))},k=L,T={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},A=function(l){Object(I.a)(f,l);var x=Object(z.a)(f);function f(){var p;Object(X.a)(this,f);for(var s=arguments.length,a=new Array(s),b=0;b=0||v.relatedTarget.className.indexOf("".concat(V,"-next"))>=0))return;p.setState({goInputText:""}),H(p.getValidValue())},p.go=function(v){var S=p.state.goInputText;if(S==="")return;(v.keyCode===T.ENTER||v.type==="click")&&(p.setState({goInputText:""}),p.props.quickGo(p.getValidValue()))},p}return Object(N.a)(f,[{key:"getValidValue",value:function(){var s=this.state,a=s.goInputText,b=s.current;return!a||isNaN(a)?b:Number(a)}},{key:"getPageSizeOptions",value:function(){var s=this.props,a=s.pageSize,b=s.pageSizeOptions;return b.some(function(v){return v.toString()===a.toString()})?b:b.concat([a.toString()]).sort(function(v,S){var M=isNaN(Number(v))?0:Number(v),H=isNaN(Number(S))?0:Number(S);return M-H})}},{key:"render",value:function(){var s=this,a=this.props,b=a.pageSize,v=a.locale,S=a.rootPrefixCls,M=a.changeSize,H=a.quickGo,V=a.goButton,Q=a.selectComponentClass,G=a.buildOptionText,W=a.selectPrefixCls,q=a.disabled,oe=this.state.goInputText,fe="".concat(S,"-options"),ve=Q,De=null,Ee=null,_e=null;if(!M&&!H)return null;var Te=this.getPageSizeOptions();if(M&&ve){var Ce=Te.map(function(me,ne){return O.a.createElement(ve.Option,{key:ne,value:me.toString()},(G||s.buildOptionText)(me))});De=O.a.createElement(ve,{disabled:q,prefixCls:W,showSearch:!1,className:"".concat(fe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||Te[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ne){return ne.parentNode}},Ce)}return H&&(V&&(_e=typeof V=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:q,className:"".concat(fe,"-quick-jumper-button")},v.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},V)),Ee=O.a.createElement("div",{className:"".concat(fe,"-quick-jumper")},v.jump_to,O.a.createElement("input",{disabled:q,type:"text",value:oe,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),v.page,_e)),O.a.createElement("li",{className:"".concat(fe)},De,Ee)}}]),f}(O.a.Component);A.defaultProps={pageSizeOptions:["10","20","50","100"]};var C=A,h=re("N2Kk");function o(){}function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}function d(l,x,f){return f}function _(l,x,f){var p=typeof l=="undefined"?x.pageSize:l;return Math.floor((f.total-1)/p)+1}var y=function(l){Object(I.a)(f,l);var x=Object(z.a)(f);function f(p){var s;Object(X.a)(this,f),s=x.call(this,p),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(_(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(M,H){var V=s.props.prefixCls,Q=M||O.a.createElement("button",{type:"button","aria-label":H,className:"".concat(V,"-item-link")});return typeof M=="function"&&(Q=O.a.createElement(M,Object(R.a)({},s.props))),Q},s.savePaginationNode=function(M){s.paginationNode=M},s.isValid=function(M){return c(M)&&M!==s.state.current},s.shouldDisplayQuickJumper=function(){var M=s.props,H=M.showQuickJumper,V=M.pageSize,Q=M.total;return Q<=V?!1:H},s.handleKeyDown=function(M){(M.keyCode===T.ARROW_UP||M.keyCode===T.ARROW_DOWN)&&M.preventDefault()},s.handleKeyUp=function(M){var H=s.getValidValue(M),V=s.state.currentInputValue;H!==V&&s.setState({currentInputValue:H}),M.keyCode===T.ENTER?s.handleChange(H):M.keyCode===T.ARROW_UP?s.handleChange(H-1):M.keyCode===T.ARROW_DOWN&&s.handleChange(H+1)},s.changePageSize=function(M){var H=s.state.current,V=_(M,s.state,s.props);H=H>V?V:H,V===0&&(H=s.state.current),typeof M=="number"&&("pageSize"in s.props||s.setState({pageSize:M}),"current"in s.props||s.setState({current:H,currentInputValue:H})),s.props.onShowSizeChange(H,M),"onChange"in s.props&&s.props.onChange&&s.props.onChange(H,M)},s.handleChange=function(M){var H=s.props.disabled,V=M;if(s.isValid(V)&&!H){var Q=_(void 0,s.state,s.props);V>Q?V=Q:V<1&&(V=1),"current"in s.props||s.setState({current:V,currentInputValue:V});var G=s.state.pageSize;return s.props.onChange(V,G),V}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current<_(void 0,s.state,s.props)},s.runIfEnter=function(M,H){if(M.key==="Enter"||M.charCode===13){for(var V=arguments.length,Q=new Array(V>2?V-2:0),G=2;G=b?S=b:S=Number(a),S}},{key:"getShowSizeChanger",value:function(){var s=this.props,a=s.showSizeChanger,b=s.total,v=s.totalBoundaryShowSizeChanger;return typeof a!="undefined"?a:b>v}},{key:"renderPrev",value:function(s){var a=this.props,b=a.prevIcon,v=a.itemRender,S=v(s,"prev",this.getItemIcon(b,"prev page")),M=!this.hasPrev();return Object(B.isValidElement)(S)?Object(B.cloneElement)(S,{disabled:M}):S}},{key:"renderNext",value:function(s){var a=this.props,b=a.nextIcon,v=a.itemRender,S=v(s,"next",this.getItemIcon(b,"next page")),M=!this.hasNext();return Object(B.isValidElement)(S)?Object(B.cloneElement)(S,{disabled:M}):S}},{key:"render",value:function(){var s=this,a=this.props,b=a.prefixCls,v=a.className,S=a.style,M=a.disabled,H=a.hideOnSinglePage,V=a.total,Q=a.locale,G=a.showQuickJumper,W=a.showLessItems,q=a.showTitle,oe=a.showTotal,fe=a.simple,ve=a.itemRender,De=a.showPrevNextJumpers,Ee=a.jumpPrevIcon,_e=a.jumpNextIcon,Te=a.selectComponentClass,Ce=a.selectPrefixCls,me=a.pageSizeOptions,ne=this.state,Ae=ne.current,rt=ne.pageSize,$e=ne.currentInputValue;if(H===!0&&V<=rt)return null;var Xe=_(void 0,this.state,this.props),Ve=[],Le=null,Me=null,ze=null,Ge=null,He=null,Be=G&&G.goButton,Pe=W?1:2,pt=Ae-1>0?Ae-1:0,it=Ae+1=Pe*2&&Ae!==1+2&&(Ve[0]=Object(B.cloneElement)(Ve[0],{className:"".concat(b,"-item-after-jump-prev")}),Ve.unshift(Le)),Xe-Ae>=Pe*2&&Ae!==Xe-2&&(Ve[Ve.length-1]=Object(B.cloneElement)(Ve[Ve.length-1],{className:"".concat(b,"-item-before-jump-next")}),Ve.push(Me)),gt!==1&&Ve.unshift(ze),lt!==Xe&&Ve.push(Ge)}var ge=null;oe&&(ge=O.a.createElement("li",{className:"".concat(b,"-total-text")},oe(V,[V===0?0:(Ae-1)*rt+1,Ae*rt>V?V:Ae*rt])));var de=!this.hasPrev()||!Xe,pe=!this.hasNext()||!Xe;return O.a.createElement("ul",Object(ae.a)({className:E()(b,v,Object($.a)({},"".concat(b,"-disabled"),M)),style:S,unselectable:"unselectable",ref:this.savePaginationNode},et),ge,O.a.createElement("li",{title:q?Q.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(b,"-prev"),Object($.a)({},"".concat(b,"-disabled"),de)),"aria-disabled":de},this.renderPrev(pt)),Ve,O.a.createElement("li",{title:q?Q.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(b,"-next"),Object($.a)({},"".concat(b,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(it)),O.a.createElement(C,{disabled:M,locale:Q,rootPrefixCls:b,selectComponentClass:Te,selectPrefixCls:Ce,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ae,pageSize:rt,pageSizeOptions:me,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Be}))}}],[{key:"getDerivedStateFromProps",value:function(s,a){var b={};if("current"in s&&(b.current=s.current,s.current!==a.current&&(b.currentInputValue=b.current)),"pageSize"in s&&s.pageSize!==a.pageSize){var v=a.current,S=_(s.pageSize,a,s);v=v>S?S:v,"current"in s||(b.current=v,b.currentInputValue=v),b.pageSize=s.pageSize}return b}}]),f}(O.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:o,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:o,locale:h.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var m=y},"6K3P":function(At,ht,re){At.exports=re.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(At,ht,re){"use strict";var ae=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function R(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae($)}var X=/^(?:[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 N(k){return typeof k=="string"&&X.test(k)}for(var I=N,z=[],B=0;B<256;++B)z.push((B+256).toString(16).substr(1));function O(k){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(z[k[T+0]]+z[k[T+1]]+z[k[T+2]]+z[k[T+3]]+"-"+z[k[T+4]]+z[k[T+5]]+"-"+z[k[T+6]]+z[k[T+7]]+"-"+z[k[T+8]]+z[k[T+9]]+"-"+z[k[T+10]]+z[k[T+11]]+z[k[T+12]]+z[k[T+13]]+z[k[T+14]]+z[k[T+15]]).toLowerCase();if(!I(A))throw TypeError("Stringified UUID is invalid");return A}var D=O;function E(k,T,A){k=k||{};var C=k.random||(k.rng||R)();if(C[6]=C[6]&15|64,C[8]=C[8]&63|128,T){A=A||0;for(var h=0;h<16;++h)T[A+h]=C[h];return T}return D(C)}var L=ht.a=E},"7ahc":function(At,ht,re){"use strict";re.d(ht,"a",function(){return _});var ae=re("k1fw"),$=re("0Owb"),R=re("+L6B"),X=re("2/Rp"),N=re("y8nQ"),I=re("Vl3Y"),z=re("tJVT"),B=re("OaEy"),O=re("2fM7"),D=re("q1tI"),E=re.n(D),L=re("VrN/"),k=re.n(L),T=re("p77/"),A=re.n(T),C=re("c5Ni"),h=re.n(C),o=O.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};ht.b=function(y){var m=y.callback,l=y.onCancel,x=Object(D.useState)("python"),f=Object(z.a)(x,2),p=f[0],s=f[1];function a(v){s(d[v][1])}function b(v){m(v)}return E.a.createElement(I.a,Object($.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),E.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(O.a,{onChange:a},Object.keys(d).map(function(v){return E.a.createElement(o,{key:v,value:v},d[v][0])}))),E.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(_,{mode:p})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(X.a,{type:"ghost",onClick:l},"\u53D6\u6D88")))};function _(y){var m=y.value,l=y.onChange,x=y.mode,f=y.options,p=f===void 0?{}:f,s=Object(D.useRef)(),a=Object(D.useState)(),b=Object(z.a)(a,2),v=b[0],S=b[1];return Object(D.useEffect)(function(){if(v){function M(H){var V=H.getValue();l&&l(V)}return v.on("change",M),function(){v.off("change",M)}}},[v,l]),Object(D.useEffect)(function(){v&&v.setOption("mode",x)},[v,x]),Object(D.useEffect)(function(){v&&((m!==v.getValue()||m==="")&&setTimeout(function(){v.setValue(m||" ")},300))},[v,m]),Object(D.useEffect)(function(){if(s.current&&!v){var M=k.a.fromTextArea(s.current,Object(ae.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},p));S(M)}},[s.current,v]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:s}))}},"7ixt":function(At,ht,re){"use strict";re.d(ht,"a",function(){return R});var ae={adjustX:1,adjustY:1},$=[0,0],R={left:{points:["cr","cl"],overflow:ae,offset:[-4,0],targetOffset:$},right:{points:["cl","cr"],overflow:ae,offset:[4,0],targetOffset:$},top:{points:["bc","tc"],overflow:ae,offset:[0,-4],targetOffset:$},bottom:{points:["tc","bc"],overflow:ae,offset:[0,4],targetOffset:$},topLeft:{points:["bl","tl"],overflow:ae,offset:[0,-4],targetOffset:$},leftTop:{points:["tr","tl"],overflow:ae,offset:[-4,0],targetOffset:$},topRight:{points:["br","tr"],overflow:ae,offset:[0,-4],targetOffset:$},rightTop:{points:["tl","tr"],overflow:ae,offset:[4,0],targetOffset:$},bottomRight:{points:["tr","br"],overflow:ae,offset:[0,4],targetOffset:$},rightBottom:{points:["bl","br"],overflow:ae,offset:[4,0],targetOffset:$},bottomLeft:{points:["tl","bl"],overflow:ae,offset:[0,4],targetOffset:$},leftBottom:{points:["br","bl"],overflow:ae,offset:[-4,0],targetOffset:$}},X=R},"7qnI":function(At,ht,re){"use strict";var ae=re("5Dmo"),$=re("3S7+"),R=re("fWQN"),X=re("mtLc"),N=re("yKVA"),I=re("879j"),z=re("5NDa"),B=re("5rEg"),O=re("q1tI"),D=re.n(O),E=re("O2Wb"),L=re.n(E),k=B.a.TextArea,T=function(A){Object(N.a)(h,A);var C=Object(I.a)(h);function h(){return Object(R.a)(this,h),C.apply(this,arguments)}return Object(X.a)(h,[{key:"render",value:function(){var c=this,d=this.props,_=d.index,y=d.onAnswerChange,m=d.addChildAnswer,l=d.exerciseIsPublish,x=d.answers,f=d.activeOptionErrorIndex,p=d.flex,s=p===void 0?"0 0 1000px":p;return D.a.createElement("div",{className:L.a.flex},D.a.createElement("div",{className:"".concat(L.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",_+1,"):"),D.a.createElement("div",{className:"".concat(L.a.flex," ").concat(L.a.flex1),style:{flexDirection:"column"}},x.map(function(a,b){var v="".concat(_,"-").concat(b);return D.a.createElement("div",{className:"".concat(L.a.flex," ").concat(L.a.flex1),key:b},D.a.createElement("div",{className:L.a.flex1,style:{flex:s}},D.a.createElement("div",null,D.a.createElement(k,{className:v===f?L.a.error:"",spellCheck:!1,rows:4,value:a||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(b==0?"":"(\u53EF\u9009)"),onChange:function(M){return y(_,b,M.target.value)},style:{minHeight:95}}))),!l&&D.a.createElement(D.a.Fragment,null,b!=0&&D.a.createElement($.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(L.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswer(_,b)},style:{float:"right"}})),b===0&&D.a.createElement($.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(L.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswermain(_,b)},style:{float:"right"}})),D.a.createElement($.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(L.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return m(_)},style:{float:"right",visibility:b==x.length-1?"":"hidden"}}))))})))}}]),h}(O.Component);ht.a=T},"8EBN":function(At,ht,re){(function(ae){ae(re("VrN/"))})(function(ae){"use strict";ae.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 $=0;$-1&&X.substring(z+1,X.length);if(B)return ae.findModeByExtension(B)},ae.findModeByName=function(X){X=X.toLowerCase();for(var N=0;N=P.length?J.slice(P.length):J}).join(`
`)}var h=[],o=[""],c=new T.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _(){h.length=0,o=[""]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(U,u,g,P){if(u>=U.length||U[u].level<=g)return u;var J=U[u];P.push("- "+J.text+""),u++;var j=[];return u=m(U,u,J.level,j),j.length>0&&(P.push("
"),j.forEach(function(ce){P.push(ce)}),P.push("
")),P.push(" "),u=m(U,u,g,P),u}function l(){return m(h,0,0,o),o.push("
"),o.join("")}var x={heading:function(u){var g=d.exec(u);if(g)return{type:"heading",raw:g[0],depth:g[1].length,text:g[2]}},fences:function(u){var g=this.rules.block.fences.exec(u);if(g){var P=g[0],J=C(P,g[3]||""),j=g[2]?g[2].trim():g[2];if(["latex","katex","math"].indexOf(j)>=0){var ce=s(),Ne=J;J=ce,a[ce]={type:"block",expression:Ne}}return{type:"code",raw:P,lang:j,text:J}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,p=0,s=function(){return"__special_katext_id_".concat(p++,"__")},a={};function b(){return a}function v(){p=0,a={}}function S(U){return U=U.replace(f,function(u,g){var P=s();return a[P]={type:"inline",expression:g},P}),U}var M=c.listitem;c.listitem=function(U){return M(S(U))};var H=c.paragraph;c.paragraph=function(U){return H(S(U))};var V=c.tablecell;c.tablecell=function(U,u){return V(S(U),u)},c.code=function(U,u,g){var P=(u||"").match(/\S*/)[0];return P?["latex","katex","math"].indexOf(P)>=0?"".concat(U,"
"):'
').concat(g?U:Object(A.escape)(U,!0),`
`):''+(g?U:Object(A.escape)(U,!0))+"
"},c.heading=function(U,u,g){var P=this.options.headerPrefix+g.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:P,level:u,text:U}),"'+U+""},T.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),T.a.use({tokenizer:x,renderer:c});var Q=T.a,G=re("SJMd"),W=re("ulZh"),q=re.n(W),oe=re("m3rI"),fe=re("Oy/b"),ve=re("p5ED"),De=re("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ee=function(U,u){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,P){g.__proto__=P}||function(g,P){for(var J in P)Object.prototype.hasOwnProperty.call(P,J)&&(g[J]=P[J])})(U,u)};function _e(U,u){function g(){this.constructor=U}Ee(U,u),U.prototype=u===null?Object.create(u):(g.prototype=u.prototype,new g)}function Te(U,u,g,P){return new(g||(g=Promise))(function(J,j){function ce(Tt){try{qe(P.next(Tt))}catch(Ue){j(Ue)}}function Ne(Tt){try{qe(P.throw(Tt))}catch(Ue){j(Ue)}}function qe(Tt){var Ue;Tt.done?J(Tt.value):(Ue=Tt.value,Ue instanceof g?Ue:new g(function(Pt){Pt(Ue)})).then(ce,Ne)}qe((P=P.apply(U,u||[])).next())})}function Ce(U,u){var g,P,J,j,ce={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return j={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function Ne(qe){return function(Tt){return function(Ue){if(g)throw new TypeError("Generator is already executing.");for(;ce;)try{if(g=1,P&&(J=2&Ue[0]?P.return:Ue[0]?P.throw||((J=P.return)&&J.call(P),0):P.next)&&!(J=J.call(P,Ue[1])).done)return J;switch(P=0,J&&(Ue=[2&Ue[0],J.value]),Ue[0]){case 0:case 1:J=Ue;break;case 4:return ce.label++,{value:Ue[1],done:!1};case 5:ce.label++,P=Ue[1],Ue=[0];continue;case 7:Ue=ce.ops.pop(),ce.trys.pop();continue;default:if(!(J=ce.trys,(J=J.length>0&&J[J.length-1])||Ue[0]!==6&&Ue[0]!==2)){ce=0;continue}if(Ue[0]===3&&(!J||Ue[1]>J[0]&&Ue[1]',"select"),this.addActionButton(P,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(P,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(P,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(P,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(P,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(P,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(P,'',"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(j){var ce=document.createElement("div");ce.className=""+g.toolbarButtonStyleClass.name,ce.setAttribute("data-type-name",j.typeName),ce.innerHTML=j.icon,ce.addEventListener("click",function(){g.markerToolbarButtonClicked(ce,j)}),g.buttons.push(ce),g.markerButtons.push(ce)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'',"render"),this.addActionButton(J,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},U.prototype.addButtonClickListener=function(u){this.buttonClickListeners.push(u)},U.prototype.removeButtonClickListener=function(u){this.buttonClickListeners.indexOf(u)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(u),1)},U.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},U.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var u=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var g=0;g0&&this.buttonClickListeners.forEach(function(P){return P("marker",g)}),this.markerButtonOverflowBlock.style.display="none"},U.prototype.actionToolbarButtonClicked=function(u,g){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(P){return P("action",g)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},U.prototype.setActiveButton=function(u){this.resetButtonStyles(),u.className=u.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),u.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},U.prototype.setActiveMarkerButton=function(u){var g=this.markerButtons.find(function(P){return P.getAttribute("data-type-name")===u});g&&this.setActiveButton(g)},U.prototype.setCurrentMarker=function(u){var g=this;this.currentMarker=u,this.buttons.filter(function(P){return/delete|notes/.test(P.getAttribute("data-action"))}).forEach(function(P){g.currentMarker===void 0?(P.style.fillOpacity="0.4",P.style.pointerEvents="none"):(P.style.fillOpacity="1",P.style.pointerEvents="all")})},U}(),ze=function(){function U(u,g,P,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=u,this.displayMode=g,this.uiStyleSettings=P,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return U.prototype.addStyles=function(){var u;this.toolboxStyleClass=this.styles.addClass(new Le("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 Le("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var g=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Le("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Le("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Le("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 Le("toolbox-panel-row_colors",`
background-color: `+((u=this.uiStyleSettings.toolboxBackgroundColor)!==null&&u!==void 0?u:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Le("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
padding: `+g+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},U.prototype.show=function(u){var g;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolboxStyleClass.name+" "+((g=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},U.prototype.setPanelButtons=function(u){var g,P,J=this;this.panels=u,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((g=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((P=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&P!==void 0?P:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(j){var ce;j.uiStyleSettings=J.uiStyleSettings;var Ne=document.createElement("div");Ne.className=J.toolboxButtonStyleClass.name+" "+((ce=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ce!==void 0?ce:J.toolboxButtonStyleColorsClass.name),Ne.innerHTML=j.icon,Ne.title=j.title,Ne.addEventListener("click",function(){J.panelButtonClick(j)}),J.panelButtons.push(Ne),J.buttonRow.appendChild(Ne)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},U.prototype.panelButtonClick=function(u){var g=this,P=-1;if(u!==this.activePanel){P=this.panels.indexOf(u),this.panelRow.innerHTML="";var J=u.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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=u}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){g.displayMode==="inline"?g.panelRow.style.display="none":g.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(j,ce){var Ne,qe;j.className=g.toolboxButtonStyleClass.name+" "+(ce===P?""+((Ne=g.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ne!==void 0?Ne:g.toolboxActiveButtonStyleColorsClass.name):""+((qe=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:g.toolboxButtonStyleColorsClass.name))})},U}(),Ge=function(U,u){this.title=U,this.icon=u},He=function(U){function u(g,P,J,j){var ce=U.call(this,g,j||'')||this;return ce.colors=[],ce.addTransparent=!1,ce.colorBoxes=[],ce.colors=P,ce.currentColor=J,ce.setCurrentColor=ce.setCurrentColor.bind(ce),ce.getColorBox=ce.getColorBox.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,P=document.createElement("div");return P.style.overflow="hidden",P.style.whiteSpace="nowrap",this.colors.forEach(function(J){var j=g.getColorBox(J);P.appendChild(j),g.colorBoxes.push(j)}),P},u.prototype.getColorBox=function(g){var P=this,J=this.uiStyleSettings.toolbarHeight/4,j=this.uiStyleSettings.toolbarHeight-J,ce=document.createElement("div");ce.style.display="inline-block",ce.style.boxSizing="content-box",ce.style.width=j-2+"px",ce.style.height=j-2+"px",ce.style.padding="1px",ce.style.marginRight="2px",ce.style.marginBottom="2px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderRadius=(j+2)/2+"px",ce.style.borderColor=g===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){P.setCurrentColor(g,ce)});var Ne=document.createElement("div");return Ne.style.display="inline-block",Ne.style.width=j-2+"px",Ne.style.height=j-2+"px",Ne.style.backgroundColor=g,Ne.style.borderRadius=j/2+"px",g==="transparent"&&(Ne.style.fill=this.uiStyleSettings.toolboxAccentColor,Ne.innerHTML=``),ce.appendChild(Ne),ce},u.prototype.setCurrentColor=function(g,P){var J=this;this.currentColor=g,this.colorBoxes.forEach(function(j){j.style.borderColor=j===P?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(g)},u}(Ge),Be=function(){function U(u,g,P){this._state="new",this._isSelected=!1,this._container=u,this._overlayContainer=g,this.globalSettings=P,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(U.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(u){return!1},Object.defineProperty(U.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),U.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},U.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},U.prototype.pointerDown=function(u,g){},U.prototype.dblClick=function(u,g){},U.prototype.manipulate=function(u){},U.prototype.pointerUp=function(u){this.stateChanged()},U.prototype.dispose=function(){},U.prototype.addMarkerVisualToContainer=function(u){this.container.childNodes.length>0?this.container.insertBefore(u,this.container.childNodes[0]):this.container.appendChild(u)},U.prototype.getState=function(){return{typeName:U.typeName,state:this.state,notes:this.notes}},U.prototype.restoreState=function(u){this._state=u.state,this.notes=u.notes},U.prototype.scale=function(u,g){},U.prototype.colorChanged=function(u){this.onColorChanged&&this.onColorChanged(u),this.stateChanged()},U.prototype.fillColorChanged=function(u){this.onFillColorChanged&&this.onFillColorChanged(u),this.stateChanged()},U.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var u=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),u.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(u)&&this.onStateChanged(this)}},U.typeName="MarkerBase",U}(),Pe=function(){function U(){this.findGripByVisual=this.findGripByVisual.bind(this)}return U.prototype.findGripByVisual=function(u){return this.topLeft.ownsTarget(u)?this.topLeft:this.topCenter.ownsTarget(u)?this.topCenter:this.topRight.ownsTarget(u)?this.topRight:this.centerLeft.ownsTarget(u)?this.centerLeft:this.centerRight.ownsTarget(u)?this.centerRight:this.bottomLeft.ownsTarget(u)?this.bottomLeft:this.bottomCenter.ownsTarget(u)?this.bottomCenter:this.bottomRight.ownsTarget(u)?this.bottomRight:void 0},U}(),pt=function(){function U(){this.GRIP_SIZE=10,this.visual=ne.createGroup(),this.visual.appendChild(ne.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ne.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return U.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},U}(),it=function(){function U(){}return U.toITransformMatrix=function(u){return{a:u.a,b:u.b,c:u.c,d:u.d,e:u.e,f:u.f}},U.toSVGMatrix=function(u,g){return u.a=g.a,u.b=g.b,u.c=g.c,u.d=g.d,u.e=g.e,u.f=g.f,u},U}(),et=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.left=0,j.top=0,j.width=0,j.height=0,j.defaultSize={x:50,y:20},j.offsetX=0,j.offsetY=0,j.rotationAngle=0,j.CB_DISTANCE=10,j._suppressMarkerCreateEvent=!1,j.container.transform.baseVal.appendItem(ne.createTransform()),j.setupControlBox(),j}return _e(u,U),Object.defineProperty(u.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"visual",{get:function(){return this._visual},set:function(g){this._visual=g;var P=ne.createTransform();this._visual.transform.baseVal.appendItem(P)},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(g){return!!U.prototype.ownsTarget.call(this,g)||!!(this.controlGrips.findGripByVisual(g)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(g))},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.state==="new"&&(this.left=g.x,this.top=g.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(g);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(P),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(P)){this.activeGrip=this.rotatorGrip;var j=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=j.x-this.width/2,this.top=j.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ce=this.container.transform.baseVal.getItem(0);ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},u.prototype.pointerUp=function(g){var P=this.state;U.prototype.pointerUp.call(this,g),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(g),this._state="select",P==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},u.prototype.moveVisual=function(g){this.visual.style.transform="translate("+g.x+"px, "+g.y+"px)"},u.prototype.manipulate=function(g){var P=this.unrotatePoint(g);this.state==="creating"?this.resize(g):this.state==="move"?(this.left=this.manipulationStartLeft+(P.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(P.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(P):this.state==="rotate"&&this.rotate(g)},u.prototype.resize=function(g){var P=this.manipulationStartLeft,J=this.manipulationStartWidth,j=this.manipulationStartTop,ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:P=this.manipulationStartLeft+g.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-P;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+g.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:j=this.manipulationStartTop+g.y-this.manipulationStartY,ce=this.manipulationStartHeight+this.manipulationStartTop-j;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ce=this.manipulationStartHeight+g.y-this.manipulationStartY}J>=0?(this.left=P,this.width=J):(this.left=P+J,this.width=-J),ce>=0?(this.top=j,this.height=ce):(this.top=j+ce,this.height=-ce),this.setSize()},u.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},u.prototype.rotate=function(g){if(Math.abs(g.x-this.centerX)>.1){var P=Math.sign(g.x-this.centerX);this.rotationAngle=180*Math.atan((g.y-this.centerY)/(g.x-this.centerX))/Math.PI+90*P,this.applyRotation()}},u.prototype.applyRotation=function(){var g=this.container.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(g,0)},u.prototype.rotatePoint=function(g){if(this.rotationAngle===0)return g;var P=this.container.getCTM(),J=ne.createPoint(g.x,g.y);return{x:(J=J.matrixTransform(P)).x,y:J.y}},u.prototype.unrotatePoint=function(g){if(this.rotationAngle===0)return g;var P=this.container.getCTM();P=P.inverse();var J=ne.createPoint(g.x,g.y);return{x:(J=J.matrixTransform(P)).x,y:J.y}},u.prototype.select=function(){U.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){U.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=ne.createGroup();var g=ne.createTransform();g.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(g),this.container.appendChild(this.controlBox),this.controlRect=ne.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=ne.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 Pe,this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){var g=this.controlBox.transform.baseVal.getItem(0);g.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(g,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()},u.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()},u.prototype.createGrip=function(){var g=new pt;return g.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(g.visual),g},u.prototype.positionGrips=function(){var g=this.controlGrips.topLeft.GRIP_SIZE,P=-g/2,J=P,j=(this.width+this.CB_DISTANCE)/2-g/2,ce=(this.height+this.CB_DISTANCE)/2-g/2,Ne=this.height+this.CB_DISTANCE-g/2,qe=this.width+this.CB_DISTANCE-g/2;this.positionGrip(this.controlGrips.topLeft.visual,P,J),this.positionGrip(this.controlGrips.topCenter.visual,j,J),this.positionGrip(this.controlGrips.topRight.visual,qe,J),this.positionGrip(this.controlGrips.centerLeft.visual,P,ce),this.positionGrip(this.controlGrips.centerRight.visual,qe,ce),this.positionGrip(this.controlGrips.bottomLeft.visual,P,Ne),this.positionGrip(this.controlGrips.bottomCenter.visual,j,Ne),this.positionGrip(this.controlGrips.bottomRight.visual,qe,Ne),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,j,J-3*this.CB_DISTANCE)},u.prototype.positionGrip=function(g,P,J){var j=g.transform.baseVal.getItem(0);j.setTranslate(P,J),g.transform.baseVal.replaceItem(j,0)},u.prototype.hideControlBox=function(){this.controlBox.style.display="none"},u.prototype.showControlBox=function(){this.controlBox.style.display=""},u.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:it.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:it.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},U.prototype.getState.call(this))},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var P=g;this.left=P.left,this.top=P.top,this.width=P.width,this.height=P.height,this.rotationAngle=P.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,P.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,P.containerTransformMatrix))},u.prototype.scale=function(g,P){U.prototype.scale.call(this,g,P);var J=this.rotatePoint({x:this.left,y:this.top}),j=this.unrotatePoint({x:J.x*g,y:J.y*P});this.left=j.x,this.top=j.y,this.width=this.width*g,this.height=this.height*P,this.adjustControlBox()},u}(Be),at=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.fillColor="transparent",j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.opacity=1,j.setStrokeColor=j.setStrokeColor.bind(j),j.setFillColor=j.setFillColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.createVisual=j.createVisual.bind(j),j}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual)},u.prototype.createVisual=function(){this.visual=ne.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)},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},u.prototype.manipulate=function(g){U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),this.setSize()},u.prototype.setSize=function(){U.prototype.setSize.call(this),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(g){U.prototype.pointerUp.call(this,g),this.setSize()},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},u.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},U.prototype.getState.call(this))},u.prototype.restoreState=function(g){var P=g;this.fillColor=P.fillColor,this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.opacity=P.opacity,this.createVisual(),U.prototype.restoreState.call(this,g),this.setSize()},u.prototype.scale=function(g,P){U.prototype.scale.call(this,g,P),this.setSize()},u.title="Rectangle marker",u}(et),Et=function(U){function u(g,P,J,j){var ce=U.call(this,g,j||'')||this;return ce.widths=[],ce.widthBoxes=[],ce.widths=P,ce.currentWidth=J,ce.setCurrentWidth=ce.setCurrentWidth.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,P=document.createElement("div");return P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2",this.widths.forEach(function(J){var j=document.createElement("div");j.style.display="flex",j.style.flexGrow="2",j.style.alignItems="center",j.style.justifyContent="space-between",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.borderColor=J===g.currentWidth?g.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){g.setCurrentWidth(J,j)}),P.appendChild(j);var ce=document.createElement("div");ce.innerText=J.toString(),ce.style.marginRight="5px",j.appendChild(ce);var Ne=document.createElement("div");Ne.style.minHeight="20px",Ne.style.flexGrow="2",Ne.style.display="flex",Ne.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=J+"px solid "+g.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",Ne.appendChild(qe),j.appendChild(Ne),g.widthBoxes.push(j)}),P},u.prototype.setCurrentWidth=function(g,P){var J=this;this.currentWidth=g,this.widthBoxes.forEach(function(j){j.style.borderColor=j===P?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},u}(Ge),ct=function(U){function u(g,P,J,j){var ce=U.call(this,g,j||'')||this;return ce.styles=[],ce.styleBoxes=[],ce.styles=P,ce.currentStyle=J,ce.setCurrentStyle=ce.setCurrentStyle.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,P=document.createElement("div");return P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2",this.styles.forEach(function(J){var j=document.createElement("div");j.style.display="flex",j.style.alignItems="center",j.style.justifyContent="space-between",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.overflow="hidden",j.style.maxWidth=100/g.styles.length-5+"%",j.style.borderColor=J===g.currentStyle?g.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){g.setCurrentStyle(J,j)}),P.appendChild(j);var ce=document.createElement("div");ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.overflow="hidden";var Ne=``;ce.innerHTML=Ne,j.appendChild(ce),g.styleBoxes.push(j)}),P},u.prototype.setCurrentStyle=function(g,P){var J=this;this.currentStyle=g,this.styleBoxes.forEach(function(j){j.style.borderColor=j===P?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},u}(Ge),dt=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.strokeColor=J.defaultColor,j.strokeWidth=J.defaultStrokeWidth,j.strokeDasharray=J.defaultStrokeDasharray,j.strokePanel=new He("Line color",J.defaultColorSet,J.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.strokeWidthPanel=new Et("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new ct("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j}return _e(u,U),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="FrameMarker",u.title="Frame marker",u.icon='',u}(at),we=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},gt=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.x1=0,j.y1=0,j.x2=0,j.y2=0,j.defaultLength=50,j.manipulationStartX=0,j.manipulationStartY=0,j.manipulationStartX1=0,j.manipulationStartY1=0,j.manipulationStartX2=0,j.manipulationStartY2=0,j.setupControlBox(),j}return _e(u,U),u.prototype.ownsTarget=function(g){return!!U.prototype.ownsTarget.call(this,g)||!(!this.grip1.ownsTarget(g)&&!this.grip2.ownsTarget(g))},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.state==="new"&&(this.x1=g.x,this.y1=g.y,this.x2=g.x,this.y2=g.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(P)?this.activeGrip=this.grip1:this.grip2.ownsTarget(P)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},u.prototype.pointerUp=function(g){var P=this.state;U.prototype.pointerUp.call(this,g),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(g),this._state="select",P==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},u.prototype.adjustVisual=function(){},u.prototype.manipulate=function(g){this.state==="creating"?this.resize(g):this.state==="move"?(this.x1=this.manipulationStartX1+g.x-this.manipulationStartX,this.y1=this.manipulationStartY1+g.y-this.manipulationStartY,this.x2=this.manipulationStartX2+g.x-this.manipulationStartX,this.y2=this.manipulationStartY2+g.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(g)},u.prototype.resize=function(g){switch(this.activeGrip){case this.grip1:this.x1=g.x,this.y1=g.y;break;case this.grip2:case void 0:this.x2=g.x,this.y2=g.y}this.adjustVisual(),this.adjustControlBox()},u.prototype.select=function(){U.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){U.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=ne.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){this.positionGrips()},u.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},u.prototype.createGrip=function(){var g=new pt;return g.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(g.visual),g},u.prototype.positionGrips=function(){var g=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-g/2,this.y1-g/2),this.positionGrip(this.grip2.visual,this.x2-g/2,this.y2-g/2)},u.prototype.positionGrip=function(g,P,J){var j=g.transform.baseVal.getItem(0);j.setTranslate(P,J),g.transform.baseVal.replaceItem(j,0)},u.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},U.prototype.getState.call(this))},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var P=g;this.x1=P.x1,this.y1=P.y1,this.x2=P.x2,this.y2=P.y2},u.prototype.scale=function(g,P){U.prototype.scale.call(this,g,P),this.x1=this.x1*g,this.y1=this.y1*P,this.x2=this.x2*g,this.y2=this.y2*P,this.adjustVisual(),this.adjustControlBox()},u}(Be),lt=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.setStrokeColor=j.setStrokeColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.strokeColor=J.defaultColor,j.strokeWidth=J.defaultStrokeWidth,j.strokeDasharray=J.defaultStrokeDasharray,j.strokePanel=new He("Line color",J.defaultColorSet,J.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.strokeWidthPanel=new Et("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new ct("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorLine&&g!==this.visibleLine)},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorLine=ne.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ne.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)},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},u.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()),ne.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var P=g;this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.createVisual(),this.adjustVisual()},u.typeName="LineMarker",u.title="Line marker",u.icon='',u}(gt),Re=function(U){function u(g,P,J,j){var ce=U.call(this,g,j||'')||this;return ce.fonts=[],ce.fontBoxes=[],ce.fonts=P,ce.currentFont=J,ce.setCurrentFont=ce.setCurrentFont.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,P=document.createElement("div");return P.style.overflow="hidden",P.style.flexGrow="2",this.fonts.forEach(function(J){var j=document.createElement("div");j.style.display="inline-block",j.style.alignItems="center",j.style.justifyContent="space-between",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.overflow="hidden",j.style.maxWidth=100/g.fonts.length-5+"%",j.style.borderColor=J===g.currentFont?g.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){g.setCurrentFont(J,j)}),P.appendChild(j);var ce=document.createElement("div");ce.style.display="flex",ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.fontFamily=J,ce.style.overflow="hidden";var Ne=document.createElement("div");Ne.style.whiteSpace="nowrap",Ne.style.overflow="hidden",Ne.style.textOverflow="ellipsis",Ne.innerHTML="The quick brown fox jumps over the lazy dog",ce.appendChild(Ne),j.appendChild(ce),g.fontBoxes.push(j)}),P},u.prototype.setCurrentFont=function(g,P){var J=this;this.currentFont=g,this.fontBoxes.forEach(function(j){j.style.borderColor=j===P?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},u}(Ge),je=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.color="transparent",j.padding=5,j.DEFAULT_TEXT="your text here",j.text=j.DEFAULT_TEXT,j.isMoved=!1,j.color=J.defaultColor,j.fontFamily=J.defaultFontFamily,j.defaultSize={x:100,y:30},j.setColor=j.setColor.bind(j),j.setFont=j.setFont.bind(j),j.renderText=j.renderText.bind(j),j.sizeText=j.sizeText.bind(j),j.textEditDivClicked=j.textEditDivClicked.bind(j),j.showTextEditor=j.showTextEditor.bind(j),j.setSize=j.setSize.bind(j),j.positionTextEditor=j.positionTextEditor.bind(j),j.colorPanel=new He("Color",J.defaultColorSet,J.defaultColor),j.colorPanel.onColorChanged=j.setColor,j.fontFamilyPanel=new Re("Font",J.defaultFontFamilies,J.defaultFontFamily),j.fontFamilyPanel.onFontChanged=j.setFont,j}return _e(u,U),u.prototype.ownsTarget=function(g){if(U.prototype.ownsTarget.call(this,g)||g===this.visual||g===this.textElement||g===this.bgRectangle)return!0;var P=!1;return this.textElement.childNodes.forEach(function(J){J===g&&(P=!0)}),P},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.bgRectangle=ne.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ne.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.isMoved=!1,this.pointerDownPoint=g,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},u.prototype.renderText=function(){var g=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(P){g.textElement.appendChild(ne.createTSpan(P.trim()===""?" ":P.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},u.prototype.getTextScale=function(){var g=this.textElement.getBBox(),P=1;if(g.width>0&&g.height>0){var J=(1*this.width-this.width*this.padding*2/100)/g.width,j=(1*this.height-this.height*this.padding*2/100)/g.height;P=Math.min(J,j)}return P},u.prototype.getTextPosition=function(g){var P=this.textElement.getBBox(),J=0,j=0;return P.width>0&&P.height>0&&(J=(this.width-P.width*g)/2,j=this.height/2-P.height*g/2),{x:J,y:j}},u.prototype.sizeText=function(){var g=this.textElement.getBBox(),P=this.getTextScale(),J=this.getTextPosition(P);J.y-=g.y*P,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+P+", "+P+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(P,P))},u.prototype.manipulate=function(g){U.prototype.manipulate.call(this,g),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(g.x-this.pointerDownPoint.x)>5||Math.abs(g.y-this.pointerDownPoint.y)>5)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),this.isMoved=!0,this.setSize(),this.sizeText()},u.prototype.setSize=function(){U.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},u.prototype.pointerUp=function(g){var P=this.state;P==="creating"&&(this._suppressMarkerCreateEvent=!0),U.prototype.pointerUp.call(this,g),this.setSize(),(P==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},u.prototype.showTextEditor=function(){var g=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(P){P.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var P=Number.parseFloat(g.textEditor.style.fontSize);g.textEditor.clientWidth>=Number.parseInt(g.textEditor.style.maxWidth)&&P>.9;)P-=.1,g.textEditor.style.fontSize=Math.max(P,.9)+"em"}),this.textEditor.addEventListener("keyup",function(P){P.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(P){if(P.clipboardData){var J=P.clipboardData.getData("text"),j=window.getSelection();if(!j.rangeCount)return!1;j.deleteFromDocument(),j.getRangeAt(0).insertNode(document.createTextNode(J)),P.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){g.textEditDivClicked(g.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},u.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var g=this.getTextScale(),P=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),j={x:J.width*g,y:J.height*g};P.x-=j.x/2,P.y-=j.y/2,this.textEditor.style.top=P.y+"px",this.textEditor.style.left=P.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-P.x+"px",this.textEditor.style.fontSize=Math.max(16*g,12)+"px",this.textElement.style.display="none"}},u.prototype.textEditDivClicked=function(g){this.text=g.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},u.prototype.select=function(){U.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},u.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),U.prototype.deselect.call(this)},u.prototype.dblClick=function(g,P){U.prototype.dblClick.call(this,g,P),this.showTextEditor()},u.prototype.setColor=function(g){this.textElement&&ne.setAttributes(this.textElement,[["fill",g]]),this.color=g,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(g)},u.prototype.setFont=function(g){this.textElement&&ne.setAttributes(this.textElement,[["font-family",g]]),this.fontFamily=g,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},u.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},u.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){var P=g;this.color=P.color,this.fontFamily=P.fontFamily,this.padding=P.padding,this.text=P.text,this.createVisual(),U.prototype.restoreState.call(this,g),this.setSize()},u.prototype.scale=function(g,P){U.prototype.scale.call(this,g,P),this.setSize(),this.sizeText(),this.positionTextEditor()},u.typeName="TextMarker",u.title="Text marker",u.icon='',u}(et),ge=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.color="transparent",j.lineWidth=3,j.drawing=!1,j.pixelRatio=1,j.color=J.defaultColor,j.lineWidth=J.defaultStrokeWidth,j.pixelRatio=J.freehandPixelRatio,j.setColor=j.setColor.bind(j),j.addCanvas=j.addCanvas.bind(j),j.finishCreation=j.finishCreation.bind(j),j.setLineWidth=j.setLineWidth.bind(j),j.colorPanel=new He("Color",J.defaultColorSet,J.defaultColor),j.colorPanel.onColorChanged=j.setColor,j.lineWidthPanel=new Et("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),j.lineWidthPanel.onWidthChanged=j.setLineWidth,j}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.drawingImage)},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.drawingImage=ne.createImage(),this.visual.appendChild(this.drawingImage);var g=ne.createTransform();this.visual.transform.baseVal.appendItem(g),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(g,P){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(g.x,g.y),this.drawing=!0):U.prototype.pointerDown.call(this,g,P)},u.prototype.manipulate=function(g){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(g.x,g.y),this.canvasContext.stroke()):U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(g){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):U.prototype.pointerUp.call(this,g)},u.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)},u.prototype.select=function(){this.state==="creating"&&this.finishCreation(),U.prototype.select.call(this)},u.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),U.prototype.deselect.call(this)},u.prototype.finishCreation=function(){for(var g=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),P=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=P[0],j=P[1],ce=P[2],Ne=P[3],qe=!1,Tt=0;Tt0&&(qe=!0,TtNe&&(Ne=Tt),Ue>ce&&(ce=Ue));if(qe){this.left=J/this.pixelRatio,this.top=j/this.pixelRatio,this.width=(ce-J)/this.pixelRatio,this.height=(Ne-j)/this.pixelRatio;var Pt=document.createElement("canvas");Pt.width=ce-J,Pt.height=Ne-j,Pt.getContext("2d").putImageData(this.canvasContext.getImageData(J,j,ce-J,Ne-j),0,0),this.drawingImgUrl=Pt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},u.prototype.setDrawingImage=function(){ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},u.prototype.setColor=function(g){this.color=g,this.colorChanged(g)},u.prototype.setLineWidth=function(g){this.lineWidth=g},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({drawingImgUrl:this.drawingImgUrl},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){this.createVisual(),U.prototype.restoreState.call(this,g),this.drawingImgUrl=g.drawingImgUrl,this.setDrawingImage()},u.prototype.scale=function(g,P){U.prototype.scale.call(this,g,P),this.setDrawingImage()},u.typeName="FreehandMarker",u.title="Freehand marker",u.icon='',u}(et),de=function(U){function u(g,P,J){var j=U.call(this,g,J||'')||this;return j.typeBoxes=[],j.currentType=P,j.setCurrentType=j.setCurrentType.bind(j),j}return _e(u,U),u.prototype.getUi=function(){var g=this,P=document.createElement("div");P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2";for(var J=function(Ne){var qe="both";switch(Ne){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="none"}var Tt=document.createElement("div");if(Tt.style.display="flex",Tt.style.flexGrow="2",Tt.style.alignItems="center",Tt.style.justifyContent="space-between",Tt.style.padding="5px",Tt.style.borderWidth="2px",Tt.style.borderStyle="solid",Tt.style.borderColor=qe===j.currentType?j.uiStyleSettings.toolboxAccentColor:"transparent",Tt.addEventListener("click",function(){g.setCurrentType(qe,Tt)}),P.appendChild(Tt),qe==="both"||qe==="start"){var Ue=document.createElement("div");Ue.style.display="flex",Ue.style.alignItems="center",Ue.style.minHeight="20px",Ue.innerHTML=``,Ue.style.marginLeft="5px",Tt.appendChild(Ue)}var Pt=document.createElement("div");Pt.style.display="flex",Pt.style.alignItems="center",Pt.style.minHeight="20px",Pt.style.flexGrow="2";var er=document.createElement("hr");if(er.style.minWidth="20px",er.style.border="0px",er.style.borderTop="3px solid "+(j.uiStyleSettings!==void 0?j.uiStyleSettings.toolboxColor:"#eeeeee"),er.style.flexGrow="2",Pt.appendChild(er),Tt.appendChild(Pt),qe==="both"||qe==="end"){var fr=document.createElement("div");fr.style.display="flex",fr.style.alignItems="center",fr.style.minHeight="20px",fr.innerHTML=``,fr.style.marginRight="5px",Tt.appendChild(fr)}j.typeBoxes.push(Tt)},j=this,ce=0;ce<4;ce++)J(ce);return P},u.prototype.setCurrentType=function(g,P){var J=this;this.currentType=g,this.typeBoxes.forEach(function(j){j.style.borderColor=j===P?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},u}(Ge),pe=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.arrowType="end",j.arrowBaseHeight=10,j.arrowBaseWidth=10,j.getArrowPoints=j.getArrowPoints.bind(j),j.setArrowType=j.setArrowType.bind(j),j.arrowTypePanel=new de("Arrow type","end"),j.arrowTypePanel.onArrowTypeChanged=j.setArrowType,j}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.arrow1&&g!==this.arrow2)},u.prototype.getArrowPoints=function(g,P){var J=this.arrowBaseWidth+2*this.strokeWidth,j=this.arrowBaseHeight+2*this.strokeWidth;return g-J/2+","+(P+j/2)+" "+g+","+(P-j/2)+" "+(g+J/2)+","+(P+j/2)},u.prototype.createTips=function(){this.arrow1=ne.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ne.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow2)},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(U.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",ne.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ne.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var g=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),P=this.arrow1.transform.baseVal.getItem(0);P.setRotate(g,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(P,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(g+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},u.prototype.setArrowType=function(g){this.arrowType=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({arrowType:this.arrowType},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var P=g;this.arrowType=P.arrowType,this.createTips(),this.adjustVisual()},u.typeName="ArrowMarker",u.title="Arrow marker",u.icon='',u}(lt),ee=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.fillColor=J.defaultFillColor,j.strokeWidth=0,j.fillPanel=new He("Color",J.defaultColorSet,J.defaultFillColor),j.fillPanel.onColorChanged=j.setFillColor,j}return _e(u,U),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="CoverMarker",u.title="Cover marker",u.icon='',u}(at),te=function(U){function u(g,P,J,j){var ce=U.call(this,g,j||'')||this;return ce.opacities=[],ce.opacityBoxes=[],ce.opacities=P,ce.currentOpacity=J,ce.setCurrentOpacity=ce.setCurrentOpacity.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,P=document.createElement("div");return P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2",P.style.justifyContent="space-between",this.opacities.forEach(function(J){var j=document.createElement("div");j.style.display="flex",j.style.alignItems="center",j.style.justifyContent="center",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.borderColor=J===g.currentOpacity?g.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){g.setCurrentOpacity(J,j)}),P.appendChild(j);var ce=document.createElement("div");ce.innerText=100*J+"%",j.appendChild(ce),g.opacityBoxes.push(j)}),P},u.prototype.setCurrentOpacity=function(g,P){var J=this;this.currentOpacity=g,this.opacityBoxes.forEach(function(j){j.style.borderColor=j===P?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},u}(Ge),ie=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.setOpacity=j.setOpacity.bind(j),j.fillColor=J.defaultHighlightColor,j.strokeWidth=0,j.opacity=J.defaultHighlightOpacity,j.fillPanel=new He("Color",J.defaultColorSet,j.fillColor),j.fillPanel.onColorChanged=j.setFillColor,j.opacityPanel=new te("Opacity",J.defaultOpacitySteps,j.opacity),j.opacityPanel.onOpacityChanged=j.setOpacity,j}return _e(u,U),u.prototype.setOpacity=function(g){this.opacity=g,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="HighlightMarker",u.title="Highlight marker",u.icon='',u}(ee),se='',ue=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.bgColor="transparent",j.tipPosition={x:0,y:0},j.tipBase1Position={x:0,y:0},j.tipBase2Position={x:0,y:0},j.tipMoving=!1,j.color=J.defaultStrokeColor,j.bgColor=J.defaultFillColor,j.fontFamily=J.defaultFontFamily,j.defaultSize={x:100,y:30},j.setBgColor=j.setBgColor.bind(j),j.getTipPoints=j.getTipPoints.bind(j),j.positionTip=j.positionTip.bind(j),j.setTipPoints=j.setTipPoints.bind(j),j.colorPanel=new He("Text color",J.defaultColorSet,j.color,''),j.colorPanel.onColorChanged=j.setColor,j.bgColorPanel=new He("Fill color",J.defaultColorSet,j.bgColor,se),j.bgColorPanel.onColorChanged=j.setBgColor,j.fontFamilyPanel=new Re("Font",J.defaultFontFamilies,J.defaultFontFamily),j.fontFamilyPanel.onFontChanged=j.setFont,j.tipGrip=new pt,j.tipGrip.visual.transform.baseVal.appendItem(ne.createTransform()),j.controlBox.appendChild(j.tipGrip.visual),j}return _e(u,U),u.prototype.ownsTarget=function(g){return U.prototype.ownsTarget.call(this,g)||this.tipGrip.ownsTarget(g)||this.tip===g},u.prototype.createTip=function(){ne.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ne.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},u.prototype.pointerDown=function(g,P){this.state==="new"&&U.prototype.pointerDown.call(this,g,P),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(P)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):U.prototype.pointerDown.call(this,g,P)},u.prototype.pointerUp=function(g){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,U.prototype.pointerUp.call(this,g);else{var P=this.state==="creating";U.prototype.pointerUp.call(this,g),this.setTipPoints(P),this.positionTip()}},u.prototype.manipulate=function(g){if(this.tipMoving){var P=this.unrotatePoint(g);this.tipPosition={x:P.x-this.manipulationStartLeft,y:P.y-this.manipulationStartTop},this.positionTip()}else U.prototype.manipulate.call(this,g)},u.prototype.setBgColor=function(g){this.bgRectangle&&this.tip&&(ne.setAttributes(this.bgRectangle,[["fill",g]]),ne.setAttributes(this.tip,[["fill",g]])),this.bgColor=g,this.fillColorChanged(g)},u.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},u.prototype.setTipPoints=function(g){g===void 0&&(g=!1);var P=Math.min(this.height/2,15),J=this.height/5;g&&(this.tipPosition={x:P+J/2,y:this.height+20});var j=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?j',u}(je),Se=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.fillColor="transparent",j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.opacity=1,j.strokeColor=J.defaultColor,j.strokeWidth=J.defaultStrokeWidth,j.strokeDasharray=J.defaultStrokeDasharray,j.fillColor=J.defaultFillColor,j.setStrokeColor=j.setStrokeColor.bind(j),j.setFillColor=j.setFillColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.setOpacity=j.setOpacity.bind(j),j.createVisual=j.createVisual.bind(j),j.strokePanel=new He("Line color",me(J.defaultColorSet,["transparent"]),J.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.fillPanel=new He("Fill color",me(J.defaultColorSet,["transparent"]),j.fillColor,se),j.fillPanel.onColorChanged=j.setFillColor,j.strokeWidthPanel=new Et("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new ct("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j.opacityPanel=new te("Opacity",J.defaultOpacitySteps,j.opacity),j.opacityPanel.onOpacityChanged=j.setOpacity,j}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual)},u.prototype.createVisual=function(){this.visual=ne.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)},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},u.prototype.manipulate=function(g){U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),this.setSize()},u.prototype.setSize=function(){U.prototype.setSize.call(this),ne.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},u.prototype.pointerUp=function(g){U.prototype.pointerUp.call(this,g),this.setSize()},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},u.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(g),this.stateChanged()},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.setOpacity=function(g){this.opacity=g,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){var P=g;this.fillColor=P.fillColor,this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.opacity=P.opacity,this.createVisual(),U.prototype.restoreState.call(this,g),this.setSize()},u.prototype.scale=function(g,P){U.prototype.scale.call(this,g,P),this.setSize()},u.typeName="EllipseMarker",u.title="Ellipse marker",u.icon='',u}(et),ke=function(U){function u(g,P,J){return U.call(this,g,P,J)||this}return _e(u,U),Object.defineProperty(u.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.tip1&&g!==this.tip2)},u.prototype.createTips=function(){this.tip1=ne.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(ne.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ne.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(ne.createTransform()),this.visual.appendChild(this.tip2)},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(U.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ne.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()]]),ne.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 g=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),P=this.tip1.transform.baseVal.getItem(0);P.setRotate(g,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(P,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(g+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g),this.createTips(),this.adjustVisual()},u.typeName="MeasurementMarker",u.title="Measurement marker",u.icon='',u}(lt),Je=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.strokePanel.colors=J.defaultColorSet,j.fillColor="transparent",j}return _e(u,U),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="EllipseFrameMarker",u.title="Ellipse frame marker",u.icon='',u}(Se),Qe=function(){function U(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(U.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),U.prototype.addUndoStep=function(u){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(u)||(this.undoStack.push(u),JSON.stringify(this.lastRedoStep)!==JSON.stringify(u)&&this.redoStack.splice(0,this.redoStack.length))},U.prototype.replaceLastUndoStep=function(u){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=u)},U.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},U.prototype.undo=function(){if(this.undoStack.length>1){var u=this.undoStack.pop();return u!==void 0&&this.redoStack.push(u),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},U.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},U}(),bt=function(U){function u(g,P,J){var j=U.call(this,g,P,J)||this;return j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.curveX=0,j.curveY=0,j.manipulationStartCurveX=0,j.manipulationStartCurveY=0,j.setStrokeColor=j.setStrokeColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.positionGrips=j.positionGrips.bind(j),j.addControlGrips=j.addControlGrips.bind(j),j.adjustVisual=j.adjustVisual.bind(j),j.setupControlBox=j.setupControlBox.bind(j),j.resize=j.resize.bind(j),j.strokeColor=J.defaultColor,j.strokeWidth=J.defaultStrokeWidth,j.strokeDasharray=J.defaultStrokeDasharray,j.strokePanel=new He("Line color",J.defaultColorSet,J.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.strokeWidthPanel=new Et("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new ct("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorCurve&&g!==this.visibleCurve&&!this.curveGrip.ownsTarget(g))},u.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorCurve=ne.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ne.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)},u.prototype.pointerDown=function(g,P){U.prototype.pointerDown.call(this,g,P),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=g.x,this.curveY=g.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(P)&&(this.activeGrip=this.curveGrip,this._state="resize")},u.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ne.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setupControlBox=function(){U.prototype.setupControlBox.call(this),this.curveControlLine1=ne.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ne.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)},u.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,U.prototype.addControlGrips.call(this)},u.prototype.positionGrips=function(){U.prototype.positionGrips.call(this);var g=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-g/2,this.curveY-g/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()))},u.prototype.manipulate=function(g){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+g.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+g.y-this.manipulationStartY),U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){this.activeGrip===this.curveGrip&&(this.curveX=g.x,this.curveY=g.y),U.prototype.resize.call(this,g),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual()},u.prototype.scale=function(g,P){this.curveX=this.curveX*g,this.curveY=this.curveY*P,U.prototype.scale.call(this,g,P)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var P=g;this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.curveX=P.curveX,this.curveY=P.curveY,this.createVisual(),this.adjustVisual()},u.typeName="CurveMarker",u.title="Curve marker",u.icon='',u}(gt),Dt=function(){function U(u,g){g===void 0&&(g=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=u,this.cancelable=g}return Object.defineProperty(U.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),U.prototype.preventDefault=function(){this._defaultPrevented=!0},U}(),Ze=function(U){function u(g,P,J){var j=U.call(this,g,!1)||this;return j.dataUrl=P,j.state=J,j}return _e(u,U),u}(Dt),ut=function(U){function u(g,P,J){J===void 0&&(J=!1);var j=U.call(this,g,J)||this;return j.marker=P,j}return _e(u,U),u}(Dt),Ft=function(){function U(){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 U.prototype.addEventListener=function(u,g){this[u].push(g)},U.prototype.removeEventListener=function(u,g){var P=this[u].indexOf(g);P>-1&&this[u].splice(P,1)},U}(),Ct=function(){function U(u){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new we,this._isOpen=!1,this.undoRedoManager=new Qe,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=U.instanceCounter++,this.styles=new Xe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=u,this.targetRoot=document.body,this.width=u.clientWidth,this.height=u.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(U.prototype,"ALL_MARKER_TYPES",{get:function(){return[dt,ge,pe,je,Je,Se,ie,ue,ke,ee,lt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[dt,ge,pe,je,Se,ie,ue]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"BASIC_MARKER_TYPES",{get:function(){return[dt,ge,pe,je,ie]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(u){var g=this;this._availableMarkerTypes.splice(0),u.forEach(function(P){if(typeof P=="string"){var J=g.ALL_MARKER_TYPES.find(function(j){return j.typeName===P});J!==void 0&&g._availableMarkerTypes.push(J)}else g._availableMarkerTypes.push(P)})},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(u){this._zoomLevel=u,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(U.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),U.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ae.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},U.prototype.show=function(){var u=this;this.styles.styleSheetRoot===void 0&&$e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=$e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(g){return g(new Dt(u))})},U.prototype.render=function(){return Te(this,void 0,void 0,function(){var u;return Ce(this,function(g){switch(g.label){case 0:return this.setCurrentMarker(),(u=new rt).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.markersOnly=this.renderMarkersOnly,u.width=this.renderWidth,u.height=this.renderHeight,[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return g.sent(),[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,g.sent()]}})})},U.prototype.close=function(u){var g=this;if(u===void 0&&(u=!1),this.isOpen){var P=!1;u||this.eventListeners.beforeclose.forEach(function(J){var j=new Dt(g,!0);J(j),j.defaultPrevented&&(P=!0)}),P||(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(J){return J(new Dt(g))}),this.detachEvents(),this._isOpen=!1)}},U.prototype.addMarkersToToolbar=function(){for(var u,g=[],P=0;Pthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*u:this.editorCanvas.clientWidth,P=g',u.title="Powered by marker.js",u.style.display="grid",u.style.alignItems="center",u.style.justifyItems="center",u.style.padding="3px",u.style.width="20px",u.style.height="20px",this.logoUI.appendChild(u),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},U.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")},U.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"},U.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},U.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 u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"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 Me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(u),1),u.dispose()},U.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())},U.prototype.toolbarButtonClicked=function(u,g){if(u==="marker"&&g!==void 0)this.createNewMarker(g);else if(u==="action")switch(g){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()}},U.prototype.deleteSelectedMarker=function(){var u=this;if(this._currentMarker!==void 0){var g=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var j=new ut(u,u._currentMarker,!0);J(j),j.defaultPrevented&&(g=!0)}),!g){var P=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(J){return J(new ut(u,P))})}}},U.prototype.clear=function(){var u=this,g=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ce){var Ne=new ut(u,void 0,!0);ce(Ne),Ne.defaultPrevented&&(g=!0)}),!g)){this.setCurrentMarker();for(var P=function(ce){var Ne=J.markers[ce];J.setCurrentMarker(J.markers[ce]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(qe){return qe(new ut(u,Ne))})},J=this,j=this.markers.length-1;j>=0;j--)P(j);this.addUndoStep()}},Object.defineProperty(U.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),U.prototype.showNotesEditor=function(){var u;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=(u=this._currentMarker.notes)!==null&&u!==void 0?u:"",this.overlayContainer.appendChild(this.notesArea))},U.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)},U.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},U.prototype.addUndoStep=function(){var u=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var g=this.getState(),P=this.undoRedoManager.getLastUndoStep();if(!P||P.width===g.width&&P.height===g.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(g),J1&&this.panTo({x:u.clientX,y:u.clientY}))},U.prototype.onPointerUp=function(u){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(u.clientX,u.clientY)),this.isDragging=!1,this.addUndoStep()},U.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},U.prototype.onKeyUp=function(u){this._currentMarker===void 0||this.notesArea!==void 0||u.key!=="Delete"&&u.key!=="Backspace"||this.deleteSelectedMarker()},U.prototype.clientToLocalCoordinates=function(u,g){var P=this.markerImage.getBoundingClientRect();return{x:(u-P.left)/this.zoomLevel,y:(g-P.top)/this.zoomLevel}},U.prototype.onWindowResize=function(){this.positionUI()},U.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"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()},U.prototype.addLicenseKey=function(u){Ae.addKey(u)},U.prototype.addEventListener=function(u,g){this.eventListeners.addEventListener(u,g)},U.prototype.removeEventListener=function(u,g){this.eventListeners.removeEventListener(u,g)},U.prototype.renderState=function(u){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(u),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(U.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),U.prototype.focus=function(){var u=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(g){return g(new Dt(u))}))},U.prototype.blur=function(){var u=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(g){return g(new Dt(u))}))},U.instanceCounter=0,U}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var jt=function(U,u){return(jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,P){g.__proto__=P}||function(g,P){for(var J in P)Object.prototype.hasOwnProperty.call(P,J)&&(g[J]=P[J])})(U,u)};function $t(U,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function g(){this.constructor=U}jt(U,u),U.prototype=u===null?Object.create(u):(g.prototype=u.prototype,new g)}function Lt(U,u,g,P){return new(g||(g=Promise))(function(J,j){function ce(Tt){try{qe(P.next(Tt))}catch(Ue){j(Ue)}}function Ne(Tt){try{qe(P.throw(Tt))}catch(Ue){j(Ue)}}function qe(Tt){var Ue;Tt.done?J(Tt.value):(Ue=Tt.value,Ue instanceof g?Ue:new g(function(Pt){Pt(Ue)})).then(ce,Ne)}qe((P=P.apply(U,u||[])).next())})}function Qt(U,u){var g,P,J,j,ce={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return j={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function Ne(qe){return function(Tt){return function(Ue){if(g)throw new TypeError("Generator is already executing.");for(;ce;)try{if(g=1,P&&(J=2&Ue[0]?P.return:Ue[0]?P.throw||((J=P.return)&&J.call(P),0):P.next)&&!(J=J.call(P,Ue[1])).done)return J;switch(P=0,J&&(Ue=[2&Ue[0],J.value]),Ue[0]){case 0:case 1:J=Ue;break;case 4:return ce.label++,{value:Ue[1],done:!1};case 5:ce.label++,P=Ue[1],Ue=[0];continue;case 7:Ue=ce.ops.pop(),ce.trys.pop();continue;default:if(!(J=ce.trys,(J=J.length>0&&J[J.length-1])||Ue[0]!==6&&Ue[0]!==2)){ce=0;continue}if(Ue[0]===3&&(!J||Ue[1]>J[0]&&Ue[1]0&&g>0){var P=new nr(u,g),J=P.ratio>=1?20:P.getHorizontalLength(20),j=P.ratio<1?20:P.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var Ne=ft.createDefs();ce.appendChild(Ne);var qe=ft.createElement("clipPath",[["id","text-bg-clip"]]);Ne.appendChild(qe);var Tt=ft.createPath(ft.getHollowRectanglePath((24-J)/2,(24-j)/2,J,j,(24-J)/2+2,(24-j)/2+2,J-4,j-4));ce.appendChild(Tt);var Ue=ft.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ue.appendChild(ft.createTSpan(u+":"+g)),ce.appendChild(Ue);var Pt=Ue.getBBox();ft.setAttributes(Ue,[["x",((24-Pt.width)/2).toString()],["y",((24-Pt.height)/2-Pt.y).toString()]]);var er=ft.createPath(ft.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Pt.width))/2,(24-Math.ceil(Pt.height))/2,Math.ceil(Pt.width),Math.ceil(Pt.height)));return qe.appendChild(er),ft.setAttributes(Tt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.outerHTML}return''},U}(),qt=function(U){function u(g,P,J){var j=U.call(this,g,P)||this;return j.isDropdownOpen=!1,j.onClick=j.dropdownButtonClicked,j.dropdownButtons=J,j}return $t(u,U),u.prototype.setupDropdown=function(){var g=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(P){P.className=g.className,P.colorsClassName=g.colorsClassName,g.dropdownBlock.appendChild(P.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},u.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},u.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},u.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},u.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},u.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},u}(tt),Wt=function(){function U(u,g){this.GRIP_SIZE=10,this.color=u,this.fillColor=g,this.visual=ft.createGroup(),this.visual.appendChild(ft.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ft.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return U.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},U.prototype.setCenter=function(u,g){this.visual.childNodes.forEach(function(P){return ft.setAttributes(P,[["cx",u.toString()],["cy",g.toString()]])})},U}(),Tr=function(){function U(u,g,P,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=u,this.canvasHeight=g,this.margin=P,this.container=J,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(U.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(u){this._aspectRatio=u,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.gridContainer&&ft.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(u){this._zoomFactor=u,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),U.prototype.open=function(){var u=this;this.cropShadeElement=ft.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ft.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var g=0;gthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-g.height/2),ft.setAttributes(this.cropRectElement,[["x",g.x.toString()],["y",g.y.toString()],["width",g.width.toString()],["height",g.height.toString()]]);var P=g.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(j,ce){var Ne=g.y+P*(ce+1);ft.setAttributes(j,[["x1",""+g.x],["y1",""+Ne],["x2",""+(g.x+g.width)],["y2",""+Ne]])});var J=g.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(j,ce){var Ne=g.x+J*(ce+1);ft.setAttributes(j,[["x1",""+Ne],["y1",""+g.y],["x2",""+Ne],["y2",""+(g.y+g.height)]])}),ft.setAttributes(this.cropShadeElement,[["d",ft.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,g.x,g.y,g.width,g.height)]]),this.topLeftGrip.setCenter(g.x,g.y),this.topRightGrip.setCenter(g.x+g.width,g.y),this.bottomLeftGrip.setCenter(g.x,g.y+g.height),this.bottomRightGrip.setCenter(g.x+g.width,g.y+g.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},U.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)},U.prototype.clientToLocalCoordinates=function(u,g){var P=this.container.getBoundingClientRect();return{x:u-P.left+this.margin,y:g-P.top+this.margin}},U.prototype.onPointerDown=function(u){this.container.setPointerCapture(u.pointerId),this.previousPoint=this.clientToLocalCoordinates(u.clientX,u.clientY),this.cropRectElement===u.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(u.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(u.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(u.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(u.target)&&(this.activeGrip=this.bottomRightGrip)},U.prototype.onPointerMove=function(u){if(this.isMoving)this.move(this.clientToLocalCoordinates(u.clientX,u.clientY));else if(this.activeGrip){var g=this.clientToLocalCoordinates(u.clientX,u.clientY);this.resize(g)}u.preventDefault()},U.prototype.onPointerUp=function(u){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(u.pointerId)},U.prototype.move=function(u){var g=u.x-this.previousPoint.x,P=u.y-this.previousPoint.y;this.zoomFactor!==1&&(g=-g/this.zoomFactor,P=-P/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+g),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+P),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=u},U.prototype.resize=function(u){var g=Object.assign({},this.cropRect),P=u.x-this.previousPoint.x,J=u.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:g.x+Pthis.canvasWidth*this.zoomFactor&&(P=this.canvasWidth*this.zoomFactor-g.width),g.width+=P}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(g.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(P),g.height=this.aspectRatio.getVerticalLength(g.width)):(g.y+=J,g.height=this.cropRect.y+this.cropRect.height-g.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?g.height=this.aspectRatio.getVerticalLength(g.width):g.height+=J}g.width<10&&(g.x=this.cropRect.x,g.width=10),g.height<10&&(g.y=this.cropRect.y,g.height=10),this.previousPoint=u,g.x>=this.margin&&g.y>=this.margin&&g.x-this.margin+g.width<=this.canvasWidth&&g.y-this.margin+g.height<=this.canvasHeight&&(this.cropRect=g,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},U.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var u=this.cropRect.x+this.cropRect.width/2,g=this.cropRect.y+this.cropRect.height/2,P=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);P/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=u-this.cropRect.width/2,this.cropRect.y=g-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)}},U.prototype.getRescaledRect=function(u,g,P,J,j,ce){var Ne=P/u,qe=J/g;return{x:(j.x-ce)*Ne+ce,y:(j.y-ce)*qe+ce,width:j.width*Ne,height:j.height*qe}},U.prototype.scaleCanvas=function(u,g){var P=this.getRescaledRect(this.canvasWidth,this.canvasHeight,u,g,this.cropRect,this.margin);this.canvasWidth=u,this.canvasHeight=g,this.onCropChange&&this.onCropChange(P),this.setCropRectangle(P)},U}(),ir=function(){function U(u){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=u,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(U.prototype,"angle",{get:function(){return this._angle},set:function(u){this._angle=u,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),U.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},U.prototype.onPointerDown=function(u){this.controlContainer.setPointerCapture(u.pointerId),this.isDragging=!0,this.previousPoint={x:u.clientX,y:u.clientY}},U.prototype.onPointerMove=function(u){this.isDragging&&(this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.previousPoint.x=u.clientX)},U.prototype.onPointerUp=function(u){this.isDragging&&this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(u.pointerId)},U.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var u=this.angleLabelText.getBBox();ft.setAttributes(this.angleLabelElement,[["x",((this.width-u.width)/2).toString()],["y",(this.height/2).toString()]])}},U.prototype.positionScaleShape=function(){if(this.scaleShape){var u=this.scaleShape.transform.baseVal.getItem(0);u.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(u,0)}},U.prototype.getVisual=function(){var u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("xmlns","http://www.w3.org/2000/svg"),u.setAttribute("width",this.width+"px"),u.setAttribute("height",this.height+"px"),u.setAttribute("viewBox","0 0 "+this.width+" "+this.height),u.style.flexShrink="0",document.body.appendChild(u);for(var g="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,P=1;P<=this.width/5+10;P++){var J=P%5==0?this.height/3:this.height/6;g+="h4v"+-J+"h1v"+J}g+="v1H0Z",this.scaleShape=ft.createPath(g);var j=ft.createTransform();this.scaleShape.transform.baseVal.appendItem(j),u.appendChild(this.scaleShape),this.angleLabelElement=ft.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ft.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=ft.createTSpan("");return ce.innerHTML="°",this.angleLabelElement.appendChild(ce),u.appendChild(this.angleLabelElement),document.body.removeChild(u),u},U}(),Rt=function(){function U(){this.naturalSize=!1,this.imageType="image/png"}return U.prototype.rasterize=function(u,g,P,J,j,ce,Ne){var qe=this;return new Promise(function(Tt){var Ue=document.createElement("canvas");Ue.width=u.width.baseVal.value-2*J,Ue.height=u.height.baseVal.value-2*J;var Pt=1,er=1;qe.naturalSize===!0?(Pt=g.naturalWidth/(u.width.baseVal.value-2*J)/ce,er=g.naturalHeight/(u.height.baseVal.value-2*J)/Ne,Ue.width=g.naturalWidth/ce,Ue.height=g.naturalHeight/Ne):qe.width!==void 0&&qe.height!==void 0&&(Pt=qe.width/P.width,er=qe.height/P.height,Ue.width*=Pt,Ue.height*=er);var fr=Ue.getContext("2d");fr.translate(Ue.width/2,Ue.height/2),fr.rotate(j*Math.PI/180),fr.scale(ce,Ne),fr.translate(-Ue.width/2,-Ue.height/2),fr.drawImage(g,0,0,Ue.width,Ue.height);var Gr=document.createElement("canvas");Gr.width=P.width*Pt,Gr.height=P.height*er,Gr.getContext("2d").putImageData(fr.getImageData((P.x-J)*Pt,(P.y-J)*er,P.width*Pt,P.height*er),0,0),Tt(Gr.toDataURL(qe.imageType,qe.imageQuality))})},U}(),Ie=function(){function U(u){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=U.instanceCounter++,this.styles=new Xt(this.instanceNo),this.target=u,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(U.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(u){this._zoomToCropEnabled=u,u?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"gridLines",{get:function(){return this._gridLines},set:function(u){this._gridLines=u,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(u){this._rotationAngle=u,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"aspectRatio",{get:function(){var u;return(u=this._aspectRatio)!==null&&u!==void 0?u:this.aspectRatios[0]},set:function(u){this._aspectRatio=u},enumerable:!1,configurable:!0}),U.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},U.prototype.show=function(){this.showUI(),this.open()},U.prototype.close=function(u){u===void 0&&(u=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),u||this.closeEventListeners.forEach(function(g){return g()}),this._isOpen=!1)},U.prototype.addRenderEventListener=function(u){this.renderEventListeners.push(u)},U.prototype.removeRenderEventListener=function(u){this.renderEventListeners.indexOf(u)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(u),1)},U.prototype.addCloseEventListener=function(u){this.closeEventListeners.push(u)},U.prototype.removeCloseEventListener=function(u){this.closeEventListeners.indexOf(u)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(u),1)},U.prototype.setupResizeObserver=function(){var u=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){u.resize(u.target.clientWidth,u.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))},U.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var u=1*this.target.clientWidth/this.target.clientHeight,g=this.contentDiv.clientWidth/u>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*u:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,P=g+2*this.CANVAS_MARGINu+this.CANVAS_MARGIN?this.target.offsetTop-(u+this.CANVAS_MARGIN):0;this.coverDiv.style.top=g+"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},U.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},U.prototype.addTopToolbar=function(){var u=this;this.topToolbar=new Ut,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 g=new St;g.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(g);var P=[];this.aspectRatios.forEach(function(er){var fr=new tt(Vt.getIcon(er.horizontal,er.vertical),er.horizontal===0&&er.vertical===0?"FREE":er.horizontal+":"+er.vertical);fr.onClick=function(){return u.ratioButtonClicked(er)},P.push(fr)}),this.aspectRatioButton=new qt(Vt.getIcon(0,0),"Aspect ratio",P),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,g.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new tt('',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){u.isGridVisible=!u.isGridVisible,J.isActive=u.isGridVisible},g.addButton(J);var j=new tt('',"Zoom to selection");if(j.isActive=this.zoomToCropEnabled,j.onClick=function(){u.zoomToCropEnabled=!u.zoomToCropEnabled,j.isActive=u.zoomToCropEnabled},g.addButton(j),!Zt.isLicensed){var ce=new Fe;this.topToolbar.addElementBlock(ce);var Ne=document.createElement("div");Ne.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var qe=document.createElement("a");qe.style.color="currentColor",qe.href="https://markerjs.com/products/cropro",qe.target="_blank",qe.innerHTML='',Ne.appendChild(qe),ce.addElement(Ne)}var Tt=new St;Tt.minWidth=3*this.toolbarHeight+"px",Tt.contentAlign="end",this.topToolbar.addButtonBlock(Tt);var Ue=new tt('',"OK");Ue.onClick=this.startRenderAndClose,Tt.addButton(Ue),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ue.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Pt=new tt('',"Close");Pt.onClick=this.close,Tt.addButton(Pt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Pt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},U.prototype.addBottomToolbar=function(){var u=this;this.bottomToolbar=new Ut,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 g=new St;g.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(g);var P=new tt('',"Rotate left");P.onClick=this.rotateLeftButtonClicked,g.addButton(P);var J=new tt('',"Rotate right");J.onClick=this.rotateRightButtonClicked,g.addButton(J);var j=new Fe;j.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(j),this.straightener=new ir("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(Tt){u.rotateBy(Tt),u.straightener.angle=u.rotationAngle},j.addElement(this.straightener.getUI());var ce=new St;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var Ne=new tt('',"Flip horizontal");Ne.onClick=this.flipHorizontallyButtonClicked,ce.addButton(Ne);var qe=new tt('',"Flip vertical");qe.onClick=this.flipVerticallyButtonClicked,ce.addButton(qe)},U.prototype.ratioButtonClicked=function(u){this.aspectRatio=u,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},U.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},U.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new nr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},U.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},U.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},U.prototype.restoreState=function(u){if(u){var g=this.cropLayer.getRescaledRect(u.width,u.height,this.imageWidth,this.imageHeight,u.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(g),this.cropRectChanged(g),this.flippedHorizontally=u.flippedHorizontally,this.flippedVertically=u.flippedVertically,this.applyFlip(),this.rotationAngle=u.rotationAngle,this.applyRotation()}},U.prototype.clientToLocalCoordinates=function(u,g){var P=this.cropImage.getBoundingClientRect();return{x:u-P.left,y:g-P.top}},U.prototype.onWindowResize=function(){this.positionUI()},U.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var u=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=u+"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()},U.prototype.rotateLeftButtonClicked=function(){var u=this.rotationAngle-90;this.rotationAngle%90!=0&&(u+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(u)},U.prototype.rotateRightButtonClicked=function(){var u=this.rotationAngle+90;this.rotationAngle%90!=0&&(u-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(u)},U.prototype.rotateTo=function(u){u=(u=u>180?u-360:u)<=-180?u+360:u,this.rotationAngle=u,this.applyRotation()},U.prototype.rotateBy=function(u){this.rotateTo((this.rotationAngle+u)%360)},U.prototype.applyRotation=function(){var u=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var g=this.editingTargetRotationContainer.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(g,0);var P=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/P.width,this.imageHeight/P.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=u},U.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},U.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},U.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},U.prototype.startRenderAndClose=function(){return Lt(this,void 0,void 0,function(){var u,g;return Qt(this,function(P){switch(P.label){case 0:return[4,this.render()];case 1:return u=P.sent(),g=this.getState(),this.renderEventListeners.forEach(function(J){return J(u,g)}),this.close(!0),[2]}})})},U.prototype.render=function(){return Lt(this,void 0,void 0,function(){var u;return Qt(this,function(g){switch(g.label){case 0:return(u=new Rt).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.width=this.renderWidth,u.height=this.renderHeight,this.unzoomFromCrop(),ft.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,u.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 g.sent(),[4,u.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,g.sent()]}})})},U.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Gt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var u=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*u)+`px;
height: `+(this.toolbarHeight-2*u)+`px;
padding: `+u+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new zt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new zt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*u)+`px;
padding: `+u+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Gt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},U.instanceCounter=0,U}(),xt=re("8hTe"),Dr=re.n(xt),un=/]*>/g;function dn(U){var u=document.createElement("div");return u.innerHTML=U,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var xr=ht.a=function(U){var u=U.value,g=u===void 0?"":u,P=U.edit,J=P===void 0?!1:P,j=U.className,ce=U.showTextOnly,Ne=U.showLines,qe=U.replaces,Tt=U.zoomImg,Ue=U.hasMask,Pt=U.style,er=Pt===void 0?{}:Pt,fr=U.stylesPrev,Gr=fr===void 0?{}:fr,Mr=String(g),Ir=Object(D.useRef)(),cn=Object(D.useRef)(),Sn=Object(D.useState)(""),wr=Object(z.a)(Sn,2),nt=wr[0],be=wr[1],Ke=Object(D.useState)("office"),wt=Object(z.a)(Ke,2),mt=wt[0],vt=wt[1],It=function(){var tr=new Ie(cn.current);tr.displayMode="popup",tr.addRenderEventListener(function(){var pr=Object(I.a)(O.a.mark(function Ht(br){var lr;return O.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:return Ir.current.style.display="none",Nr.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:br}});case 3:lr=Nr.sent,lr!=null&&lr.id&&qe(cn.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(lr==null?void 0:lr.id,"?type=").concat(lr.content_type));case 5:case"end":return Nr.stop()}},Ht)}));return function(Ht){return pr.apply(this,arguments)}}()),tr.show()},gr=function(){var tr=new Ct(cn.current);tr.settings.displayMode="popup",tr.addEventListener("render",function(){var pr=Object(I.a)(O.a.mark(function Ht(br){var lr;return O.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:if(Ir.current.style.display="none",!cn.current){Nr.next=6;break}return Nr.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:br.dataUrl}});case 4:lr=Nr.sent,lr!=null&&lr.id&&qe(cn.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(lr==null?void 0:lr.id,"?type=").concat(lr.content_type));case 6:case"end":return Nr.stop()}},Ht)}));return function(Ht){return pr.apply(this,arguments)}}()),tr.show(),window.markerArea=tr},cr=Object(D.useMemo)(function(){Ir.current&&(Ir.current.style.zIndex=-1);try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,tr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Mr=Mr.replace(or,"("+oe.a.API_SERVER+"/api/attachments/").replace(tr,'"'+oe.a.API_SERVER+"/api/attachments/").replace(pr,'"'+oe.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,`
`)}catch(vn){}var Ht=Q(Mr),br=b();if(Mr.match(/\[TOC\]/)&&(Ht=Ht.replace("[TOC]
",l()),_()),Ht=Ht.replace(/(__special_katext_id_\d+__)/g,function(vn,Nr){var Yr=br[Nr],Yn=Yr.type,An=Yr.expression;return Object(fe.renderToString)(dn(An)||"",{displayMode:Yn==="block",throwOnError:!1,output:"html"})}),Ht=Ht.replace(/▁/g,"\u2581\u2581\u2581"),v(),ce){var lr=document.createElement("div");return lr.innerHTML=Ht,lr.innerText}return setTimeout(function(){return Sr()},500),Ht},[Mr]),hr=Object(D.useRef)();y.WebkitLineClamp=Ne,Ne&&(er=Object(N.a)(Object(N.a)({},er),y));function Lr(or){var tr=or.target;if(tr.tagName.toUpperCase()==="IMG"){if(Tt){var pr=tr.getAttribute("src");be(pr),vt("image")}}else if(tr.tagName.toUpperCase()==="A"){var Ht=tr.getAttribute("href");if(Ht.indexOf("office")>-1)or.preventDefault(),be(Ht),vt("office");else if(Ht.indexOf("application/pdf")>-1)or.preventDefault(),be(Ht),vt("pdf");else if(Ht.indexOf("text/html")>-1)or.preventDefault(),be(Ht),vt("html");else if(Ht.startsWith("#")){or.preventDefault();var br=document.getElementById(Ht.replace("#",""));br&&br.scrollIntoView(!0)}}}var Sr=function(){var tr,pr=(tr=hr.current)===null||tr===void 0?void 0:tr.querySelectorAll("video");pr==null||pr.forEach(function(Ht){if(Ht.oncontextmenu=function(){return!1},Ht.src.indexOf(".m3u8")>-1&&!Ht.canPlayType("application/vnd.apple.mpegurl")){if(q.a.isSupported()){var br=new q.a;br.loadSource(Ht.src),br.attachMedia(Ht)}}})};Object(D.useEffect)(function(){if(hr.current&&cr&&(cr.match(un)&&window.PR.prettyPrint()),hr.current)return hr.current.addEventListener("click",Lr),function(){hr.current.removeEventListener("click",Lr),v(),_()}},[cr,hr.current,Lr]);var Wr=function(tr){if(!J)return;tr.target.nodeName==="IMG"?(Ir.current.style.zIndex=1,Ir.current.style.display="flex",Ir.current.style.width=tr.target.clientWidth+"px",Ir.current.style.height=tr.target.clientHeight+"px",Ir.current.style.top=tr.target.offsetTop+"px",Ir.current.style.left=tr.target.offsetLeft+"px",cn.current.src=tr.target.getAttribute("src")):Ir.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:hr,style:Object(N.a)({},er),className:"".concat(j||""," markdown-body ").concat(Dr.a.mdBody),onMouseOver:Wr,dangerouslySetInnerHTML:{__html:cr}}),E.a.createElement("div",{ref:Ir,className:Dr.a.button},E.a.createElement($.a,null,E.a.createElement(X.a,{onClick:function(){return It()}},"\u88C1\u526A"),E.a.createElement(X.a,{onClick:function(){return gr()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(ve.a,{close:!0,data:nt,type:nt!=null&&nt.length?mt:"",style:Object(N.a)({},Gr),onClose:function(){return be("")}}))}},"9VGf":function(At,ht,re){"use strict";re.d(ht,"a",function(){return R});var ae=re("q1tI"),$=re.n(ae);function R(X,N){var I=Object(ae.useRef)();Object(ae.useEffect)(function(){I.current=X}),Object(ae.useEffect)(function(){function z(){I.current()}if(N!==null){var B=setInterval(z,N);return function(){return clearInterval(B)}}},[N])}},Bd2K:function(At,ht,re){(function(ae){ae(re("VrN/"),re("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(O,D,E){if(E!=ae.Init&&E&&O.removeKeyMap("autoCloseTags"),!D)return;var L={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(L["'/'"]=function(k){return I(k)}),(typeof D!="object"||D.whenOpening!==!1)&&(L["'>'"]=function(k){return X(k)}),O.addKeyMap(L)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 X(O){if(O.getOption("disableInput"))return ae.Pass;for(var D=O.listSelections(),E=[],L=O.getOption("autoCloseTags"),k=0;kT.ch&&(c=c.slice(0,c.length-A.end+T.ch));var m=c.toLowerCase();if(!c||A.type=="string"&&(A.end!=T.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&o.close||A.string.indexOf("/")==T.ch-A.start-1||_&&z(_,m)>-1||B(O,C.mode.xmlCurrentContext&&C.mode.xmlCurrentContext(h)||[],c,T,!0))return ae.Pass;var l=typeof L=="object"&&L.emptyTags;if(l&&z(l,c)>-1){E[k]={text:"/>",newPos:ae.Pos(T.line,T.ch+2)};continue}var x=y&&z(y,m)>-1;E[k]={indent:x,text:">"+(x?`
`:"")+""+c+">",newPos:x?ae.Pos(T.line+1,0):ae.Pos(T.line,T.ch+1)}}for(var f=typeof L=="object"&&L.dontIndentOnAutoClose,k=D.length-1;k>=0;k--){var p=E[k];O.replaceRange(p.text,D[k].head,D[k].anchor,"+insert");var s=O.listSelections().slice(0);s[k]={head:p.newPos,anchor:p.newPos},O.setSelections(s),!f&&p.indent&&(O.indentLine(p.newPos.line,null,!0),O.indentLine(p.newPos.line+1,null,!0))}}function N(O,D){for(var E=O.listSelections(),L=[],k=D?"/":"",T=O.getOption("autoCloseTags"),A=typeof T=="object"&&T.dontIndentOnSlash,C=0;C"&&(_+=">"),L[C]=_}if(O.replaceSelections(L),E=O.listSelections(),!A)for(var C=0;C=0&&D[h]==E;h--)++C;L=A.to;for(var h=1;h0){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"",D=[],E=0;Ege.length)&&(de=ge.length);for(var pe=0,ee=new Array(de);pe=ge.length?{done:!0}:{done:!1,value:ge[ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return pe=ge[Symbol.iterator](),pe.next.bind(pe)}function I(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var z=I(function(ge){function de(){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 pe(ee){ge.exports.defaults=ee}ge.exports={defaults:de(),getDefaults:de,changeDefaults:pe}}),B=z.defaults,O=z.getDefaults,D=z.changeDefaults,E=/[&<>"']/,L=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,T=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},C=function(de){return A[de]};function h(ge,de){if(de){if(E.test(ge))return ge.replace(L,C)}else if(k.test(ge))return ge.replace(T,C);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(ge){return ge.replace(o,function(de,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var d=/(^|[^\[])\^/g;function _(ge,de){ge=ge.source||ge,de=de||"";var pe={replace:function(te,ie){return ie=ie.source||ie,ie=ie.replace(d,"$1"),ge=ge.replace(te,ie),pe},getRegex:function(){return new RegExp(ge,de)}};return pe}var y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l(ge,de,pe){if(ge){var ee;try{ee=decodeURIComponent(c(pe)).replace(y,"").toLowerCase()}catch(te){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}de&&!m.test(pe)&&(pe=a(de,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(te){return null}return pe}var x={},f=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){x[" "+ge]||(f.test(ge)?x[" "+ge]=ge+"/":x[" "+ge]=M(ge,"/",!0)),ge=x[" "+ge];var pe=ge.indexOf(":")===-1;return de.substring(0,2)==="//"?pe?de:ge.replace(p,"$1")+de:de.charAt(0)==="/"?pe?de:ge.replace(s,"$1")+de:ge+de}var b={exec:function(){}};function v(ge){for(var de=1,pe,ee;de=0&&ue[ke]==="\\";)Se=!Se;return Se?"|":" |"}),ee=pe.split(/ \|/),te=0;if(ee.length>de)ee.splice(de);else for(;ee.length=ee.length?te.slice(ee.length):te}).join(`
`)}var Ee=function(){function ge(pe){this.options=pe||G}var de=ge.prototype;return de.space=function(ee){var te=this.rules.block.newline.exec(ee);if(te)return te[0].length>1?{type:"space",raw:te[0]}:{raw:`
`}},de.code=function(ee,te){var ie=this.rules.block.code.exec(ee);if(ie){var se=te[te.length-1];if(se&&se.type==="paragraph")return{raw:ie[0],text:ie[0].trimRight()};var ue=ie[0].replace(/^ {4}/gm,"");return{type:"code",raw:ie[0],codeBlockStyle:"indented",text:this.options.pedantic?ue:W(ue,`
`)}}},de.fences=function(ee){var te=this.rules.block.fences.exec(ee);if(te){var ie=te[0],se=De(ie,te[3]||"");return{type:"code",raw:ie,lang:te[2]?te[2].trim():te[2],text:se}}},de.heading=function(ee){var te=this.rules.block.heading.exec(ee);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},de.nptable=function(ee){var te=this.rules.block.nptable.exec(ee);if(te){var ie={type:"table",header:q(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[],raw:te[0]};if(ie.header.length===ie.align.length){var se=ie.align.length,ue;for(ue=0;ue ?/gm,"");return{type:"blockquote",raw:te[0],text:ie}}},de.list=function(ee){var te=this.rules.block.list.exec(ee);if(te){for(var ie=te[0],se=te[2],ue=se.length>1,Se=se[se.length-1]===")",ke={type:"list",raw:ie,ordered:ue,start:ue?+se.slice(0,-1):"",loose:!1,items:[]},Je=te[0].match(this.rules.block.item),Qe=!1,bt,Dt,Ze,ut,Ft,Ct,jt,$t=Je.length,Lt=0;Lt<$t;Lt++)bt=Je[Lt],ie=bt,Dt=bt.length,bt=bt.replace(/^ *([*+-]|\d+[.)]) */,""),~bt.indexOf(`
`)&&(Dt-=bt.length,bt=this.options.pedantic?bt.replace(/^ {1,4}/gm,""):bt.replace(new RegExp("^ {1,"+Dt+"}","gm"),"")),Lt!==$t-1&&(Ze=this.rules.block.bullet.exec(Je[Lt+1])[0],(ue?Ze.length===1||!Se&&Ze[Ze.length-1]===")":Ze.length>1||this.options.smartLists&&Ze!==se)&&(ut=Je.slice(Lt+1).join(`
`),ke.raw=ke.raw.substring(0,ke.raw.length-ut.length),Lt=$t-1)),Ft=Qe||/\n\n(?!\s*$)/.test(bt),Lt!==$t-1&&(Qe=bt.charAt(bt.length-1)===`
`,Ft||(Ft=Qe)),Ft&&(ke.loose=!0),Ct=/^\[[ xX]\] /.test(bt),jt=void 0,Ct&&(jt=bt[1]!==" ",bt=bt.replace(/^\[[ xX]\] +/,"")),ke.items.push({type:"list_item",raw:ie,task:Ct,checked:jt,loose:Ft,text:bt});return ke}},de.html=function(ee){var te=this.rules.block.html.exec(ee);if(te)return{type:this.options.sanitize?"paragraph":"html",raw:te[0],pre:!this.options.sanitizer&&(te[1]==="pre"||te[1]==="script"||te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):oe(te[0]):te[0]}},de.def=function(ee){var te=this.rules.block.def.exec(ee);if(te){te[3]&&(te[3]=te[3].substring(1,te[3].length-1));var ie=te[1].toLowerCase().replace(/\s+/g," ");return{tag:ie,raw:te[0],href:te[2],title:te[3]}}},de.table=function(ee){var te=this.rules.block.table.exec(ee);if(te){var ie={type:"table",header:q(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[]};if(ie.header.length===ie.align.length){ie.raw=te[0];var se=ie.align.length,ue;for(ue=0;ue/i.test(se[0])&&(te=!1),!ie&&/^<(pre|code|kbd|script)(\s|>)/i.test(se[0])?ie=!0:ie&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(se[0])&&(ie=!1),{type:this.options.sanitize?"text":"html",raw:se[0],inLink:te,inRawBlock:ie,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):oe(se[0]):se[0]}},de.link=function(ee){var te=this.rules.inline.link.exec(ee);if(te){var ie=fe(te[2],"()");if(ie>-1){var se=te[0].indexOf("!")===0?5:4,ue=se+te[1].length+ie;te[2]=te[2].substring(0,ie),te[0]=te[0].substring(0,ue).trim(),te[3]=""}var Se=te[2],ke="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Se);Je?(Se=Je[1],ke=Je[3]):ke=""}else ke=te[3]?te[3].slice(1,-1):"";Se=Se.trim().replace(/^<([\s\S]*)>$/,"$1");var Qe=ve(te,{href:Se&&Se.replace(this.rules.inline._escapes,"$1"),title:ke&&ke.replace(this.rules.inline._escapes,"$1")},te[0]);return Qe}},de.reflink=function(ee,te){var ie;if((ie=this.rules.inline.reflink.exec(ee))||(ie=this.rules.inline.nolink.exec(ee))){var se=(ie[2]||ie[1]).replace(/\s+/g," ");if(se=te[se.toLowerCase()],!se||!se.href){var ue=ie[0].charAt(0);return{type:"text",raw:ue,text:ue}}var Se=ve(ie,se,ie[0]);return Se}},de.strong=function(ee,te,ie){ie===void 0&&(ie="");var se=this.rules.inline.strong.start.exec(ee);if(se&&(!se[1]||se[1]&&(ie===""||this.rules.inline.punctuation.exec(ie)))){te=te.slice(-1*ee.length);var ue=se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ue.lastIndex=0;for(var Se;(se=ue.exec(te))!=null;)if(Se=this.rules.inline.strong.middle.exec(te.slice(0,se.index+3)),Se)return{type:"strong",raw:ee.slice(0,Se[0].length),text:ee.slice(2,Se[0].length-2)}}},de.em=function(ee,te,ie){ie===void 0&&(ie="");var se=this.rules.inline.em.start.exec(ee);if(se&&(!se[1]||se[1]&&(ie===""||this.rules.inline.punctuation.exec(ie)))){te=te.slice(-1*ee.length);var ue=se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ue.lastIndex=0;for(var Se;(se=ue.exec(te))!=null;)if(Se=this.rules.inline.em.middle.exec(te.slice(0,se.index+2)),Se)return{type:"em",raw:ee.slice(0,Se[0].length),text:ee.slice(1,Se[0].length-1)}}},de.codespan=function(ee){var te=this.rules.inline.code.exec(ee);if(te){var ie=te[2].replace(/\n/g," "),se=/[^ ]/.test(ie),ue=ie.startsWith(" ")&&ie.endsWith(" ");return se&&ue&&(ie=ie.substring(1,ie.length-1)),ie=oe(ie,!0),{type:"codespan",raw:te[0],text:ie}}},de.br=function(ee){var te=this.rules.inline.br.exec(ee);if(te)return{type:"br",raw:te[0]}},de.del=function(ee){var te=this.rules.inline.del.exec(ee);if(te)return{type:"del",raw:te[0],text:te[1]}},de.autolink=function(ee,te){var ie=this.rules.inline.autolink.exec(ee);if(ie){var se,ue;return ie[2]==="@"?(se=oe(this.options.mangle?te(ie[1]):ie[1]),ue="mailto:"+se):(se=oe(ie[1]),ue=se),{type:"link",raw:ie[0],text:se,href:ue,tokens:[{type:"text",raw:se,text:se}]}}},de.url=function(ee,te){var ie;if(ie=this.rules.inline.url.exec(ee)){var se,ue;if(ie[2]==="@")se=oe(this.options.mangle?te(ie[0]):ie[0]),ue="mailto:"+se;else{var Se;do Se=ie[0],ie[0]=this.rules.inline._backpedal.exec(ie[0])[0];while(Se!==ie[0]);se=oe(ie[0]),ie[1]==="www."?ue="http://"+se:ue=se}return{type:"link",raw:ie[0],text:se,href:ue,tokens:[{type:"text",raw:se,text:se}]}}},de.inlineText=function(ee,te,ie){var se=this.rules.inline.text.exec(ee);if(se){var ue;return te?ue=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):oe(se[0]):se[0]:ue=oe(this.options.smartypants?ie(se[0]):se[0]),{type:"text",raw:se[0],text:ue}}},ge}(),_e=Q.noopTest,Te=Q.edit,Ce=Q.merge,me={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*|\\n*|\\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:_e,table:_e,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=Te(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=Te(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=Te(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=//,me.html=Te(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=Te(me._paragraph).replace("hr",me.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",me._tag).getRegex(),me.blockquote=Te(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=Ce({},me),me.gfm=Ce({},me.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*|$)"}),me.gfm.nptable=Te(me.gfm.nptable).replace("hr",me.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",me._tag).getRegex(),me.gfm.table=Te(me.gfm.table).replace("hr",me.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",me._tag).getRegex(),me.pedantic=Ce({},me.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:_e,paragraph:Te(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:_e,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:_e,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ne.punctuation=Te(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ne._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ne.em.start=Te(ne.em.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.middle=Te(ne.em.middle).replace(/punctuation/g,ne._punctuation).replace(/overlapSkip/g,ne._overlapSkip).getRegex(),ne.em.endAst=Te(ne.em.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.endUnd=Te(ne.em.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.start=Te(ne.strong.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.middle=Te(ne.strong.middle).replace(/punctuation/g,ne._punctuation).replace(/blockSkip/g,ne._blockSkip).getRegex(),ne.strong.endAst=Te(ne.strong.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.endUnd=Te(ne.strong.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=Te(ne._blockSkip,"g").getRegex(),ne.overlapSkip=Te(ne._overlapSkip,"g").getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=Te(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=Te(ne.tag).replace("comment",me._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=Te(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=Te(ne.reflink).replace("label",ne._label).getRegex(),ne.reflinkSearch=Te(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=Ce({},ne),ne.pedantic=Ce({},ne.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=Ce({},ne.normal,{escape:Te(ne.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ee="x"+ee.toString(16)),de+=""+ee+";";return de}var Me=function(){function ge(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||rt,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:$e.normal,inline:Xe.normal};this.options.pedantic?(ee.block=$e.pedantic,ee.inline=Xe.pedantic):this.options.gfm&&(ee.block=$e.gfm,this.options.breaks?ee.inline=Xe.breaks:ee.inline=Xe.gfm),this.tokenizer.rules=ee}ge.lex=function(ee,te){var ie=new ge(te);return ie.lex(ee)};var de=ge.prototype;return de.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(ee,te,ie){te===void 0&&(te=[]),ie===void 0&&(ie=!0),ee=ee.replace(/^ +$/gm,"");for(var se,ue,Se,ke;ee;){if(se=this.tokenizer.space(ee)){ee=ee.substring(se.raw.length),se.type&&te.push(se);continue}if(se=this.tokenizer.code(ee,te)){ee=ee.substring(se.raw.length),se.type?te.push(se):(ke=te[te.length-1],ke.raw+=`
`+se.raw,ke.text+=`
`+se.text);continue}if(se=this.tokenizer.fences(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.heading(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.nptable(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.hr(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.blockquote(ee)){ee=ee.substring(se.raw.length),se.tokens=this.blockTokens(se.text,[],ie),te.push(se);continue}if(se=this.tokenizer.list(ee)){for(ee=ee.substring(se.raw.length),Se=se.items.length,ue=0;ue0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(ke))!=null;)Qe.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(ke=ke.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(ke))!=null;)ke=ke.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(Se=this.tokenizer.escape(ee)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.tag(ee,ie,se)){ee=ee.substring(Se.raw.length),ie=Se.inLink,se=Se.inRawBlock,te.push(Se);continue}if(Se=this.tokenizer.link(ee)){ee=ee.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,se)),te.push(Se);continue}if(Se=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,se)),te.push(Se);continue}if(Se=this.tokenizer.strong(ee,ke,ue)){ee=ee.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ie,se),te.push(Se);continue}if(Se=this.tokenizer.em(ee,ke,ue)){ee=ee.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ie,se),te.push(Se);continue}if(Se=this.tokenizer.codespan(ee)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.br(ee)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.del(ee)){ee=ee.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ie,se),te.push(Se);continue}if(Se=this.tokenizer.autolink(ee,Le)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(!ie&&(Se=this.tokenizer.url(ee,Le))){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.inlineText(ee,se,Ve)){ee=ee.substring(Se.raw.length),ue=Se.raw.slice(-1),te.push(Se);continue}if(ee){var bt="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return te},$(ge,null,[{key:"rules",get:function(){return{block:$e,inline:Xe}}}]),ge}(),ze=z.defaults,Ge=Q.cleanUrl,He=Q.escape,Be=function(){function ge(pe){this.options=pe||ze}var de=ge.prototype;return de.code=function(ee,te,ie){var se=(te||"").match(/\S*/)[0];if(this.options.highlight){var ue=this.options.highlight(ee,se);ue!=null&&ue!==ee&&(ie=!0,ee=ue)}return se?''+(ie?ee:He(ee,!0))+`
`:""+(ie?ee:He(ee,!0))+`
`},de.blockquote=function(ee){return`
`+ee+`
`},de.html=function(ee){return ee},de.heading=function(ee,te,ie,se){return this.options.headerIds?"
`:""+ee+"
`},de.hr=function(){return this.options.xhtml?`
`:`
`},de.list=function(ee,te,ie){var se=te?"ol":"ul",ue=te&&ie!==1?' start="'+ie+'"':"";return"<"+se+ue+`>
`+ee+""+se+`>
`},de.listitem=function(ee){return""+ee+`
`},de.checkbox=function(ee){return" "},de.paragraph=function(ee){return""+ee+`
`},de.table=function(ee,te){return te&&(te=""+te+""),`
`},de.tablerow=function(ee){return`
`+ee+`
`},de.tablecell=function(ee,te){var ie=te.header?"th":"td",se=te.align?"<"+ie+' align="'+te.align+'">':"<"+ie+">";return se+ee+""+ie+`>
`},de.strong=function(ee){return""+ee+""},de.em=function(ee){return""+ee+""},de.codespan=function(ee){return""+ee+""},de.br=function(){return this.options.xhtml?"
":"
"},de.del=function(ee){return""+ee+""},de.link=function(ee,te,ie){if(ee=Ge(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ie;var se='"+ie+"",se},de.image=function(ee,te,ie){if(ee=Ge(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ie;var se='
":">",se},de.text=function(ee){return ee},ge}(),Pe=function(){function ge(){}var de=ge.prototype;return de.strong=function(ee){return ee},de.em=function(ee){return ee},de.codespan=function(ee){return ee},de.del=function(ee){return ee},de.html=function(ee){return ee},de.text=function(ee){return ee},de.link=function(ee,te,ie){return""+ie},de.image=function(ee,te,ie){return""+ie},de.br=function(){return""},ge}(),pt=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(ee){var te=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(te)){var ie=te;do this.seen[ie]++,te=ie+"-"+this.seen[ie];while(this.seen.hasOwnProperty(te))}return this.seen[te]=0,te},ge}(),it=z.defaults,et=Q.unescape,at=function(){function ge(pe){this.options=pe||it,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new pt}ge.parse=function(ee,te){var ie=new ge(te);return ie.parse(ee)};var de=ge.prototype;return de.parse=function(ee,te){te===void 0&&(te=!0);var ie="",se,ue,Se,ke,Je,Qe,bt,Dt,Ze,ut,Ft,Ct,jt,$t,Lt,Qt,Zt,ft,Xt=ee.length;for(se=0;se0&&Lt.tokens[0].type==="text"?(Lt.tokens[0].text=ft+" "+Lt.tokens[0].text,Lt.tokens[0].tokens&&Lt.tokens[0].tokens.length>0&&Lt.tokens[0].tokens[0].type==="text"&&(Lt.tokens[0].tokens[0].text=ft+" "+Lt.tokens[0].tokens[0].text)):Lt.tokens.unshift({type:"text",text:ft}):$t+=ft),$t+=this.parse(Lt.tokens,jt),Ze+=this.renderer.listitem($t,Zt,Qt);ie+=this.renderer.list(Ze,Ft,Ct);continue}case"html":{ie+=this.renderer.html(ut.text);continue}case"paragraph":{ie+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(Ze=ut.tokens?this.parseInline(ut.tokens):ut.text;se+1An error occurred:
"+dt(Se.message+"",!0)+"
";throw Se}}Re.options=Re.setOptions=function(ge){return Et(Re.defaults,ge),gt(Re.defaults),Re},Re.getDefaults=we,Re.defaults=lt,Re.use=function(ge){var de=Et({},ge);if(ge.renderer&&function(){var ee=Re.defaults.renderer||new Be,te=function(ue){var Se=ee[ue];ee[ue]=function(){for(var ke=arguments.length,Je=new Array(ke),Qe=0;Qe`,triples:"",explode:"[]{}"},R=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(A,C,h){h&&h!=ae.Init&&(A.removeKeyMap(N),A.state.closeBrackets=null),C&&(I(X(C,"pairs")),A.state.closeBrackets=C,A.addKeyMap(N))});function X(A,C){return C=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[C]!=null?A[C]:$[C]}var N={Backspace:O,Enter:D};function I(A){for(var C=0;C=0;c--){var _=o[c].head;A.replaceRange("",R(_.line,_.ch-1),R(_.line,_.ch+1),"+delete")}}function D(A){var C=B(A),h=C&&X(C,"explode");if(!h||A.getOption("disableInput"))return ae.Pass;for(var o=A.listSelections(),c=0;c0;return{anchor:new R(A.anchor.line,A.anchor.ch+(C?-1:1)),head:new R(A.head.line,A.head.ch+(C?1:-1))}}function L(A,C){var h=B(A);if(!h||A.getOption("disableInput"))return ae.Pass;var o=X(h,"pairs"),c=o.indexOf(C);if(c==-1)return ae.Pass;for(var d=X(h,"closeBefore"),_=X(h,"triples"),y=o.charAt(c+1)==C,m=A.listSelections(),l=c%2==0,x,f=0;f=0&&A.getRange(s,R(s.line,s.ch+3))==C+C+C?a="skipThree":a="skip";else if(y&&s.ch>1&&_.indexOf(C)>=0&&A.getRange(R(s.line,s.ch-2),s)==C+C){if(s.ch>2&&/\bstring/.test(A.getTokenTypeAt(R(s.line,s.ch-2))))return ae.Pass;a="addFour"}else if(y){var v=s.ch==0?" ":A.getRange(R(s.line,s.ch-1),s);if(!ae.isWordChar(b)&&v!=C&&!ae.isWordChar(v))a="both";else return ae.Pass}else if(l&&(b.length===0||/\s/.test(b)||d.indexOf(b)>-1))a="both";else return ae.Pass;if(!x)x=a;else if(x!=a)return ae.Pass}var S=c%2?o.charAt(c-1):C,M=c%2?C:o.charAt(c+1);A.operation(function(){if(x=="skip")A.execCommand("goCharRight");else if(x=="skipThree")for(var H=0;H<3;H++)A.execCommand("goCharRight");else if(x=="surround"){for(var V=A.getSelections(),H=0;H1&&arguments[1]!==void 0?arguments[1]:1,pe=Pe.length,ee=0;ee1&&arguments[1]!==void 0?arguments[1]:!1;return Object(l.a)(W).map(function(oe,fe){if(!N.isValidElement(oe)||!oe.type)return null;var ve=oe.type.isSelectOptGroup,De=oe.key,Ee=oe.props,_e=Ee.children,Te=Object(z.a)(Ee,["children"]);return q||!ve?x(oe):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(De===null?fe:De,"__"),label:De},Te),{},{options:f(_e)})}).filter(function(oe){return oe})}var p=re("2Qr1"),s=re("qNPg"),a=re("U8pU"),b=re("Kwbf"),v=re("WKfj");function S(W){var q=W.mode,oe=W.options,fe=W.children,ve=W.backfill,De=W.allowClear,Ee=W.placeholder,_e=W.getInputElement,Te=W.showSearch,Ce=W.onSearch,me=W.defaultOpen,ne=W.autoFocus,Ae=W.labelInValue,rt=W.value,$e=W.inputValue,Xe=W.optionLabelProp,Ve=q==="multiple"||q==="tags",Le=Te!==void 0?Te:Ve||q==="combobox",Me=oe||f(fe);if(Object(b.a)(q!=="tags"||Me.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),q==="tags"||q==="combobox"){var ze=Me.some(function(Be){return Be.options?Be.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(b.a)(!ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(q!=="combobox"||!Xe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(q==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(b.a)(q==="combobox"||!_e,"`getInputElement` only work with `combobox` mode."),Object(b.b)(q!=="combobox"||!_e||!De||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ce&&!Le&&q!=="combobox"&&q!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!me||ne,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),rt!=null){var Ge=Object(v.d)(rt);Object(b.a)(!Ae||Ge.every(function(Be){return Object(a.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ve||Array.isArray(rt),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var He=null;Object(l.a)(fe).some(function(Be){if(!N.isValidElement(Be)||!Be.type)return!1;var Pe=Be.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var pt=Object(l.a)(Be.props.children).every(function(it){return!N.isValidElement(it)||!Be.type||it.type.isSelectOption?!0:(He=it.type,!1)});return!pt}return He=Pe,!0}),He&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(b.a)($e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=S,H=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:f,flattenOptions:p.d,getLabeledValue:p.e,filterOptions:p.b,isValueDisabled:p.g,findValueOption:p.c,warningProps:M,fillOptionsWithMissingValue:p.a}),V=function(W){Object(R.a)(oe,W);var q=Object(X.a)(oe);function oe(){var fe;return Object(ae.a)(this,oe),fe=q.apply(this,arguments),fe.selectRef=N.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object($.a)(oe,[{key:"render",value:function(){return N.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),oe}(N.Component);V.Option=d,V.OptGroup=y;var Q=V,G=ht.c=Q},M8RZ:function(At,ht,re){"use strict";re.d(ht,"a",function(){return O});var ae=re("fWQN"),$=re("mtLc"),R=re("yKVA"),X=re("879j"),N=re("q1tI"),I=re.n(N),z=re("i8i4"),B=re.n(z),O=function(D){Object(R.a)(L,D);var E=Object(X.a)(L);function L(k){var T;Object(ae.a)(this,L),T=E.call(this,k);var A=window.document;return T.node=A.createElement("div"),A.body.appendChild(T.node),T}return Object($.a)(L,[{key:"render",value:function(){var T=this.props.children;return Object(z.createPortal)(T,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),L}(I.a.Component)},O2Wb:function(At,ht,re){At.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(At,ht,re){"use strict";var ae=re("U8pU"),$=re("VTBJ"),R=re("Ff2n"),X=re("q1tI"),N=re("uciX"),I=re("7ixt"),z=function(k){var T=k.overlay,A=k.prefixCls,C=k.id,h=k.overlayInnerStyle;return X.createElement("div",{className:"".concat(A,"-inner"),id:C,role:"tooltip",style:h},typeof T=="function"?T():T)},B=z,O=function(k,T){var A=k.overlayClassName,C=k.trigger,h=C===void 0?["hover"]:C,o=k.mouseEnterDelay,c=o===void 0?0:o,d=k.mouseLeaveDelay,_=d===void 0?.1:d,y=k.overlayStyle,m=k.prefixCls,l=m===void 0?"rc-tooltip":m,x=k.children,f=k.onVisibleChange,p=k.afterVisibleChange,s=k.transitionName,a=k.animation,b=k.placement,v=b===void 0?"right":b,S=k.align,M=S===void 0?{}:S,H=k.destroyTooltipOnHide,V=H===void 0?!1:H,Q=k.defaultVisible,G=k.getTooltipContainer,W=k.overlayInnerStyle,q=Object(R.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),oe=Object(X.useRef)(null);Object(X.useImperativeHandle)(T,function(){return oe.current});var fe=Object($.a)({},q);"visible"in k&&(fe.popupVisible=k.visible);var ve=function(){var Ce=k.arrowContent,me=Ce===void 0?null:Ce,ne=k.overlay,Ae=k.id;return[X.createElement("div",{className:"".concat(l,"-arrow"),key:"arrow"},me),X.createElement(B,{key:"content",prefixCls:l,id:Ae,overlay:ne,overlayInnerStyle:W})]},De=!1,Ee=!1;if(typeof V=="boolean")De=V;else if(V&&Object(ae.a)(V)==="object"){var _e=V.keepParent;De=_e===!0,Ee=_e===!1}return X.createElement(N.a,Object.assign({popupClassName:A,prefixCls:l,popup:ve,action:h,builtinPlacements:I.a,popupPlacement:v,ref:oe,popupAlign:M,getPopupContainer:G,onPopupVisibleChange:f,afterPopupVisibleChange:p,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:Q,destroyPopupOnHide:De,autoDestroy:Ee,mouseLeaveDelay:_,popupStyle:y,mouseEnterDelay:c},fe),x)},D=Object(X.forwardRef)(O),E=ht.a=D},Ot1p:function(At,ht,re){"use strict";var ae=re("2qtc"),$=re("kLXV"),R=re("rAM+"),X=re("miYZ"),N=re("tsqr"),I=re("9og8"),z=re("tJVT"),B=re("jrin"),O=re("WmNS"),D=re.n(O),E=re("q1tI"),L=re.n(E),k=re("VrN/"),T=re.n(k),A=re("bdgK"),C=re("p77/"),h=re("Bd2K"),o=re("ELLl"),c=re("19Vz"),d=re("lZu9"),_=re("+NIl"),y=re("kSUc"),m=re("9Bee"),l=function(ue){var Se=ue.value,ke=Se===void 0?"":Se,Je=ue.className,Qe=ue.showTextOnly,bt=ue.showLines,Dt=ue.style,Ze=Dt===void 0?{}:Dt,ut=Object(E.useMemo)(function(){return""},[ke]);return L.a.createElement(L.a.Fragment,null,L.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},x=re("0Owb"),f=re("dejd"),p=re("C+DQ"),s=re("1vsH"),a=re("m3rI"),b=[{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 v(ue){var Se=ue.onActionCallback,ke=ue.title,Je=ue.icon,Qe=ue.actionName,bt=ue.className,Dt=bt===void 0?"":bt,Ze=ue.children;function ut(){Se(Qe)}return L.a.createElement("a",{title:ke,className:Dt,onClick:ut},L.a.createElement("i",{className:"md-iconfont ".concat(Je)}),Ze)}var S=function(ue){var Se=ue.watch,ke=ue.showNullButton,Je=ue.onActionCallback,Qe=ue.fullScreen,bt=ue.insertTemp,Dt=ue.hidetoolBar,Ze=ue.uuid,ut=ue.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(Ze,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ft=[].concat(b,[{title:"".concat(Se?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Se?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return L.a.createElement("ul",{className:"markdown-toolbar-container"},!Dt&&Ft.map(function(Ct,jt){return L.a.createElement("li",{key:jt},Ct.actionName?L.a.createElement(v,Object(x.a)({},Ct,{onActionCallback:Je})):L.a.createElement("span",{className:"v-line"}))}),ke?L.a.createElement("li",null,L.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Je},L.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,bt&&L.a.createElement("li",null,L.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(bt),onActionCallback:Je},L.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),L.a.createElement("li",{className:"btn-full-screen"},L.a.createElement(v,{icon:"".concat(Qe?"icon-shrink":"icon-enlarge"),title:Qe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Je})))},M=re("M8RZ"),H=re("+L6B"),V=re("2/Rp"),Q=re("y8nQ"),G=re("Vl3Y"),W=re("5NDa"),q=re("5rEg"),oe={labelCol:{span:4},wrapperCol:{span:20}},fe=function(ue){var Se=ue.callback,ke=ue.onCancel;function Je(Qe){Se(Qe)}return L.a.createElement(G.a,Object(x.a)({},oe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Je}),L.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},L.a.createElement(q.a,null)),L.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},L.a.createElement(q.a,null)),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(V.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))},ve=re("7ahc"),De=re("HmJG"),Ee=re("BjJ7"),_e=G.a.useForm,Te={width:280,marginRight:10},Ce={labelCol:{span:5},wrapperCol:{span:19}},me=function(ue){var Se=ue.callback,ke=ue.onCancel,Je=_e(),Qe=Object(z.a)(Je,1),bt=Qe[0];function Dt(Ft){Se(Ft)}function Ze(Ft,Ct){if(Ft.status===-1){N.b.error(Ft.message);return}bt.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:Ct.type})}function ut(Ft){var Ct=Ft.target.files[0];Ae(Ct,Ze)}return L.a.createElement(G.a,Object(x.a)({form:bt},Ce,{className:"upload-image-panel",onFinish:Dt}),L.a.createElement(G.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},L.a.createElement("div",{className:"flex-container"},L.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},L.a.createElement(q.a,{style:Te})),L.a.createElement(ne,{onFileChange:ut}))),L.a.createElement(G.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},L.a.createElement(q.a,{style:{width:264}})),L.a.createElement(G.a.Item,{style:{textAlign:"right"}},L.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(V.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))};function ne(ue){var Se=ue.onFileChange;return L.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",L.a.createElement("input",{type:"file",onChange:Se}))}function Ae(ue,Se){if(!ue)throw new String("\u6CA1\u6709\u6587\u4EF6");var ke=new FormData;ke.append("editormd-image-file",ue),ke.append("file_param_name","editormd-image-file"),ke.append("byxhr","true");var Je=new window.XMLHttpRequest;Je.withCredentials=!0,Je.addEventListener("load",function(Qe){Se(JSON.parse(Qe.target.responseText),ue)},!1),Je.addEventListener("error",function(Qe){console.error(Qe)},!1),Je.open("POST","".concat(Ee.a,"/api/attachments.json")),Je.send(ke)}var rt=re("giR+"),$e=re("fyUT"),Xe=re("7Kak"),Ve=re("9yH6"),Le=Ve.a.Group,Me={margin:"0 8px"},ze=function(ue){var Se=ue.callback,ke=ue.onCancel;function Je(Qe){Se(Qe)}return L.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Je},L.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},L.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),L.a.createElement("span",{style:Me},"\u884C\u6570"),L.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},L.a.createElement($e.a,null)),L.a.createElement("span",{style:Me},"\u5217\u6570"),L.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},L.a.createElement($e.a,null))),L.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},L.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),L.a.createElement(G.a.Item,{name:"align"},L.a.createElement(Le,null,L.a.createElement(Ve.a,{value:"default"},L.a.createElement("i",{className:"fa fa-align-justify"})),L.a.createElement(Ve.a,{value:"left"},L.a.createElement("i",{className:"fa fa-align-left"})),L.a.createElement(Ve.a,{value:"center"},L.a.createElement("i",{className:"fa fa-align-center"})),L.a.createElement(Ve.a,{value:"right"},L.a.createElement("i",{className:"fa fa-align-right"}))))),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(V.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))},Ge=re("ErOA"),He=re("7Cbv"),Be="link",Pe="upload-image",pt="code-block",it="add-table",et="------------",at={default:et,left:":".concat(et),center:":".concat(et,":"),right:"".concat(et,":")},Et=re("9VGf"),ct,dt;function we(){}var gt=0,lt=1e4,Re="\u2581",je=`
**\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 ge(ue){return/^\d+$/.test(ue)?"".concat(ue,"px"):ue}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=de?"Cmd":"Ctrl",ee=["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"],te=(ct={},Object(B.a)(ct,pe+"-B","bold"),Object(B.a)(ct,pe+"-I","italic"),ct),ie=(dt={},Object(B.a)(dt,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(dt,pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(dt,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(dt,it,"\u6DFB\u52A0\u8868\u683C"),dt),se=ht.a=function(ue){var Se=ue.defaultValue,ke=Se===void 0?"":Se,Je=ue.onChange,Qe=ue.width,bt=Qe===void 0?"100%":Qe,Dt=ue.height,Ze=Dt===void 0?400:Dt,ut=ue.miniToolbar,Ft=ut===void 0?!1:ut,Ct=ue.isFocus,jt=Ct===void 0?!1:Ct,$t=ue.watch,Lt=ue.insertTemp,Qt=ue.mode,Zt=Qt===void 0?"markdown":Qt,ft=ue.id,Xt=ft===void 0?"markdown-editor-id":ft,zt=ue.showResizeBar,Gt=zt===void 0?!1:zt,Ut=ue.noStorage,Mt=Ut===void 0?!1:Ut,St=ue.showNullButton,tt=St===void 0?!1:St,Fe=ue.hidetoolBar,nr=Fe===void 0?!1:Fe,Vt=ue.fullScreen,qt=Vt===void 0?!1:Vt,Wt=ue.onBlur,Tr=ue.onCMBeforeChange,ir=ue.onFullScreen,Rt=ue.className,Ie=Rt===void 0?"":Rt,xt=ue.disablePaste,Dr=xt===void 0?!1:xt,un=ue.placeholder,dn=un===void 0?"":un,xr=ue.values,U=xr===void 0?"":xr,u=Object(E.useState)(null),g=Object(z.a)(u,2),P=g[0],J=g[1],j=Object(E.useState)(ke),ce=Object(z.a)(j,2),Ne=ce[0],qe=ce[1],Tt=Object(E.useState)($t),Ue=Object(z.a)(Tt,2),Pt=Ue[0],er=Ue[1],fr=Object(E.useState)(qt),Gr=Object(z.a)(fr,2),Mr=Gr[0],Ir=Gr[1],cn=Object(E.useState)(""),Sn=Object(z.a)(cn,2),wr=Sn[0],nt=Sn[1],be=Object(E.useState)(0),Ke=Object(z.a)(be,2),wt=Ke[0],mt=Ke[1],vt=Object(E.useState)(Ze),It=Object(z.a)(vt,2),gr=It[0],cr=It[1],hr=Object(E.useState)(!1),Lr=Object(z.a)(hr,2),Sr=Lr[0],Wr=Lr[1],or=Object(E.useRef)(Object(He.a)()),tr=Object(E.useRef)(!1),pr=Object(E.useRef)(),Ht=Object(E.useRef)(),br=Object(E.useRef)(),lr=Object(E.useRef)(),vn=Object(E.useRef)(),Nr=function(){var kt=Object(I.a)(D.a.mark(function Kt(){var Nt,Jt;return D.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return vr.next=2,Object(Ge.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:or.current}});case 2:Jt=vr.sent,Jt!=null&&(Nt=Jt.attachments)!==null&&Nt!==void 0&&Nt.length&&(console.log("cm:",P,Ht),Jt.attachments.map(function(ar){ar.content_type.indexOf("image")>-1?P.replaceSelection(".concat(ar.content_type,")")):ar.content_type.indexOf("video")>-1?P.replaceSelection('')):ar.content_type.indexOf("pdf")>-1?P.replaceSelection('').concat(ar.name,"")):P.replaceSelection("[".concat(ar.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(ar.id,"?type=").concat(ar.content_type,")"))}));case 4:case"end":return vr.stop()}},Kt)}));return function(){return kt.apply(this,arguments)}}();Object(E.useEffect)(function(){qe(U),P==null||P.setValue(U)},[U]),Object(E.useEffect)(function(){ir==null||ir(Mr)},[Mr]),Object(E.useEffect)(function(){if(Ht.current){var kt=T.a.fromTextArea(Ht.current,{mode:Zt,lineNumbers:!Ft,lineWrapping:!0,value:ke,autoCloseTags:!0,autoCloseBrackets:!0});jt&&kt.focus();function Kt(Nt,Jt){if(Dr){Jt.preventDefault();return}var sr=Jt.clipboardData;if(sr){var vr=sr.types.toString(),ar=sr.items;if(vr==="Files"||sr.types.indexOf("Files")>-1){if(Jt.preventDefault(),Zt=="stex")return;try{var Pr,Qr=ar[1];((Pr=ar[0])===null||Pr===void 0?void 0:Pr.kind)==="file"&&(Qr=ar[0]);var rr=Qr.getAsFile(),Cn=rr.name.split(".").pop();Ae(rr,function(ur){if(ur.id){var Zr,Kr,hn;(rr==null||((Zr=rr.type)===null||Zr===void 0)?void 0:Zr.indexOf("image"))>-1?kt.replaceSelection(".concat(ur.content_type,")")):(rr==null||((Kr=rr.type)===null||Kr===void 0)?void 0:Kr.indexOf("video"))>-1?kt.replaceSelection('')):(rr==null||((hn=rr.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?kt.replaceSelection('').concat(rr.name,"")):ee.includes(Cn)?kt.replaceSelection('').concat(rr.name,"")):kt.replaceSelection("[".concat(rr.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(ur.id,"?type=").concat(ur.content_type,")"))}else(ur==null?void 0:ur.status)===401&&(document.location.href="/user/login")})}catch(ur){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return kt.on("paste",Kt),kt.on("dragleave",function(Nt,Jt){br.current.classList.remove("mouse-hover-md")}),kt.on("dragover",function(Nt,Jt){br.current.classList.add("mouse-hover-md")}),kt.on("drop",function(Nt,Jt){br.current.classList.add("mouse-hover-md");var sr;if(sr=Jt.dataTransfer.files,sr.length>0){Jt.preventDefault(),Jt.stopPropagation();for(var vr=function(Qr){var rr=sr[Qr],Cn=rr.name.split(".").pop();Ae(rr,function(ur){if(ur.id){var Zr,Kr,hn;(rr==null||((Zr=rr.type)===null||Zr===void 0)?void 0:Zr.indexOf("image"))>-1?kt.replaceSelection(".concat(ur.content_type,")")):(rr==null||((Kr=rr.type)===null||Kr===void 0)?void 0:Kr.indexOf("video"))>-1?kt.replaceSelection('')):(rr==null||((hn=rr.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?kt.replaceSelection('').concat(rr.name,"")):ee.includes(Cn)?kt.replaceSelection('').concat(rr.name,"")):kt.replaceSelection("[".concat(rr.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(ur.id,"?type=").concat(ur.content_type,")"))}else(ur==null?void 0:ur.status)===401&&(document.location.href="/user/login")})},ar=0;ar0||ar.target.offsetWidth>0)&&(Yr(),P.setSize("100%","100%"),P.refresh())}}catch(Pr){sr.e(Pr)}finally{sr.f()}});return Nt.observe(Ht.current.parentElement),Nt}if(P){var Kt=kt();return function(){Kt.unobserve(Ht.current.parentElement)}}},[P,Yr]),Object(E.useEffect)(function(){if(P){for(var kt=[],Kt=function(){var ar=Jt[Nt];sr=Object(z.a)(ar,2);var Pr=sr[0],Qr=sr[1],rr=Object(B.a)({},Pr,function(){Yn(Qr)});kt.push(rr),P.addKeyMap(rr)},Nt=0,Jt=Object.entries(te);Nt0){var kt=new Date().getTime(),Kt=window.sessionStorage.getItem(Xt);kt>=wt+lt&&(!Kt||Kt!==Ne)&&(window.sessionStorage.setItem(Xt,Ne),Wr(!0))}},lt),Object(E.useEffect)(function(){er($t)},[P,$t]),Object(E.useEffect)(function(){P&&(jt&&P.focus())},[P,jt]),Object(E.useEffect)(function(){if(Pt&&P){var kt=P.getScrollerElement();function Kt(Nt){var Jt=Nt.target;if(vn.current){var sr=Jt.scrollTop/Jt.scrollHeight;vn.current.scrollTop=vn.current.scrollHeight*sr}}return kt.addEventListener("scroll",Kt),function(){kt.removeEventListener("scroll",Kt)}}},[P,Pt]),Object(E.useEffect)(function(){if(P&&Tr){function kt(Kt,Nt){Tr(Kt,Nt)}return P.on("beforeChange",kt),function(){P.off("beforeChange",kt)}}},[P,Tr]),Object(E.useEffect)(function(){if(P&&Wt){function kt(){Wt(P.getValue())}return P.on("blur",kt),function(){P.off("blur",kt)}}},[P,Wt]),Object(E.useEffect)(function(){if(P){function kt(Kt){var Nt=Kt.getValue();qe(Nt),mt(new Date().getTime()),Kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Je&&Je(Nt)}return P.on("change",kt),function(){P.off("change",kt)}}},[P,Je]),Object(E.useEffect)(function(){P&&(ke==null?(P.setValue(""),qe("")):ke!==P.getValue()&&(P.setValue(ke),qe(ke),P.setCursor(P.lineCount(),0)))},[P,ke]);var Yn=Object(E.useCallback)(function(kt){var Kt=P.getCursor(),Nt=P.getSelection(),Jt=Nt.split(`
`);switch(kt){case"bold":return P.replaceSelection("**"+Nt+"**"),Nt===""&&P.setCursor(Kt.line,Kt.ch+2),P.focus();case"italic":return P.replaceSelection("*"+Nt+"*"),Nt===""&&P.setCursor(Kt.line,Kt.ch+1),P.focus();case"code":return P.replaceSelection("`"+Nt+"`"),Nt===""&&P.setCursor(Kt.line,Kt.ch+1),P.focus();case"inline-latex":return P.replaceSelection("`$$"+Nt+"$$`"),Nt===""&&P.setCursor(Kt.line,Kt.ch+3),P.focus();case"latex":return P.replaceSelection("```latex\n"+Nt+"\n```"),P.setCursor(Kt.line+1,Nt.length+1),P.focus();case"line-break":return P.replaceSelection(`
`),P.focus();case"list-ul":return Nt===""?P.replaceSelection("- "+Nt):P.replaceSelection(Jt.map(function(sr){return sr===""?"":"- ".concat(sr)}).join(`
`)),P.focus();case"list-ol":return Nt===""?P.replaceSelection("1. "+Nt):P.replaceSelection(Jt.map(function(sr,vr){return sr===""?"":"".concat(vr+1,". ").concat(sr)}).join(`
`)),P.focus();case"add-null-ch":return Nt===""&&P.setCursor(Kt.line,Kt.ch+1),P.replaceSelection(Re),P.focus();case"inster-template-1":return Nt===""&&P.setCursor(Kt.line,Kt.ch),P.replaceSelection(je),P.focus();case"eraser":return P.setValue(""),P.focus();case"trigger-watch":return er(!Pt),P.focus();case"trigger-full-screen":return Ir(!Mr),P.focus();case Be:nt(Be);return;case pt:nt(pt);return;case Pe:nt(Pe);return;case it:nt(it);return;default:throw new Error}},[P,Pt,Mr]),An=Object(E.useCallback)(function(kt){nt("");switch(wr){case Be:var Kt=kt.title,Nt=kt.link;return P.replaceSelection("[".concat(Kt,"](").concat(Nt,")")),P.focus();case pt:var Jt=kt.language,sr=kt.content;return P.replaceSelection(["```"+Jt,sr,"```"].join(`
`)),P.focus();case Pe:var vr=kt.src,ar=kt.alt;return ar?P.replaceSelection(".concat(vr,' "').concat(ar,'" )')):P.replaceSelection("")),P.focus();case it:for(var Pr=kt.row,Qr=kt.col,rr=kt.align,Cn=`
`,ur=0;ur300&&(Pr=300);var Qr=Ze+Pr+"px";cr(Qr)}}return kt.addEventListener("mousedown",Jt),document.addEventListener("mousemove",vr),document.addEventListener("mouseup",sr),function(){kt.removeEventListener("mousedown",Jt),document.removeEventListener("mousemove",vr),document.removeEventListener("mouseup",sr)}}},[P,lr]),Object(E.useEffect)(function(){cr(Ze)},[Ze]);var yn=ge(bt),fi=ge(gr),fn={width:yn,height:fi},pi=Object(E.useMemo)(function(){if(wt){var kt=new Date(wt),Kt=kt.getHours(),Nt=kt.getMinutes(),Jt=kt.getSeconds();return Kt=Kt<10?"0"+Kt:Kt,Nt=Nt<10?"0"+Nt:Nt,Jt=Jt<10?"0"+Jt:Jt,"".concat(Kt,":").concat(Nt,":").concat(Jt)}return 0},[wt]);function ji(){window.sessionStorage.removeItem(Xt),Wr(!1),mt(0)}function Un(){Wr(!1),mt(0),P.setValue(window.sessionStorage.getItem(Xt))}function ua(kt,Kt){var Nt=P.getValue();Nt=Nt.replace(kt,Kt),qe(Nt),P==null||P.setValue(Nt)}return L.a.createElement(E.Fragment,null,L.a.createElement("div",{className:"markdown-editor-wrapper",ref:br},L.a.createElement("div",{className:"markdown-editor-container ".concat(Ie," ").concat(Pt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Mr?"full-screen":""),style:fn},L.a.createElement(S,{insertTemp:Lt,watch:Pt,fullScreen:Mr,showNullButton:tt,onActionCallback:Yn,hidetoolBar:nr,uuid:or.current,setOpenPhones:function(){tr.current=!0}}),L.a.createElement("div",{className:"markdown-editor-body"},L.a.createElement("div",{className:"codemirror-container"},L.a.createElement("textarea",{ref:Ht,placeholder:dn})),Pt?L.a.createElement("div",{ref:vn,className:"preview-container"},Zt==="stex"&&L.a.createElement(l,{value:Ne}),Zt!=="stex"&&L.a.createElement(m.a,{edit:!0,value:Ne,replaces:ua})):null))),Gt?L.a.createElement("a",{ref:lr,className:"editor-resize"}):null,L.a.createElement(M.a,null,ie[wr]?L.a.createElement($.a,{centered:!0,title:ie[wr],visible:!0,onCancel:Ln,footer:null,className:"markdown-popup-form"},hi):null))}},PGNT:function(At,ht,re){At.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE:function(At,ht,re){At.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},"RZ/O":function(At,ht,re){At.exports=re.p+"static/bi.9c9b0364.svg"},SJMd:function(At,ht){/**
* @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 re,ae,$,R=!1,X,N;window.PR_SHOULD_USE_CONTINUATION=!0;var I,z;(function(){var B=window,O=["break,continue,do,else,for,if,return,while"],D=[O,"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"],E=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],L=[E,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],k=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],T=[E,"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"],A="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",C=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",o=[O,"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"],c=[O,"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"],d=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],_=[L,T,k,C,h,o,c,d],y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",l="kwd",x="com",f="typ",p="lit",s="pun",a="pln",b="tag",v="dec",S="src",M="atn",H="atv",V="nocode",Q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(Le){for(var Me=0,ze=!1,Ge=!1,He=0,Be=Le.length;He122||(ee<65||pe>90||gt.push([Math.max(65,pe)|32,Math.min(ee,90)|32]),ee<97||pe>122||gt.push([Math.max(97,pe)&~32,Math.min(ee,122)&~32]))}}gt.sort(function(ue,Se){return ue[0]-Se[0]||Se[1]-ue[1]});for(var te=[],ie=[],je=0;jese[0]&&(se[1]+1>se[0]&&Re.push("-"),Re.push(et(se[1])))}return Re.push("]"),Re.join("")}function Et(dt){for(var we=dt.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")),gt=we.length,lt=[],Re=0,je=0;Re=2&&pe==="["?we[Re]=at(ge):pe!=="\\"&&(we[Re]=ge.replace(/[a-zA-Z]/g,function(ie){var se=ie.charCodeAt(0);return"["+String.fromCharCode(se&~32,se|32)+"]"}))}return we.join("")}for(var ct=[],He=0,Be=Le.length;He=0;)ze[ct.charAt(dt)]=Et;var we=Et[1],gt=""+we;it.hasOwnProperty(gt)||(pt.push(we),it[gt]=null)}pt.push(/[\0-\uffff]/),Ge=G(pt)})();var He=Me.length,Be=function(Pe){for(var pt=Pe.sourceCode,it=Pe.basePos,et=Pe.sourceNode,at=[it,a],Et=0,ct=pt.match(Ge)||[],dt={},we=0,gt=ct.length;we=5&&Re.substring(0,5)==="lang-",ge&&!(je&&typeof je[1]=="string")&&(ge=!1,Re=S),ge||(dt[lt]=Re)}var ee=Et;if(Et+=lt.length,!ge)at.push(it+ee,Re);else{var te=je[1],ie=lt.indexOf(te),se=ie+te.length;je[2]&&(se=lt.length-je[2].length,ie=se-te.length);var ue=Re.substring(5);q(et,it+ee,lt.substring(0,ie),Be,at),q(et,it+ee+ie,te,ne(ue,te),at),q(et,it+ee+se,lt.substring(se),Be,at)}}Pe.decorations=at};return Be}function De(Le){var Me=[],ze=[];Le.tripleQuotedStrings?Me.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Le.multiLineStrings?Me.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Le.verbatimStrings&&ze.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ge=Le.hashComments;Ge&&(Le.cStyleComments?(Ge>1?Me.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ze.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([x,/^#[^\r\n]*/,null,"#"])),Le.cStyleComments&&(ze.push([x,/^\/\/[^\r\n]*/,null]),ze.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=Le.regexLiterals;if(He){var Be=He>1?"":`
\r`,Pe=Be?".":"[\\S\\s]",pt="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";ze.push(["lang-regex",RegExp("^"+Q+"("+pt+")")])}var it=Le.types;it&&ze.push([f,it]);var et=(""+Le.keywords).replace(/^ | $/g,"");et.length&&ze.push([l,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([a,/^\s+/,null,` \r
\xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return Le.regexLiterals&&(at+="(?!s*/)"),ze.push([p,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[p,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(at),null]),ve(Me,ze)}var Ee=De({keywords:_,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function _e(Le,Me,ze){for(var Ge=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,Be=Le.ownerDocument,Pe=Be.createElement("li");Le.firstChild;)Pe.appendChild(Le.firstChild);var pt=[Pe];function it(we){var gt=we.nodeType;if(gt==1&&!Ge.test(we.className))if(we.nodeName==="br")et(we),we.parentNode&&we.parentNode.removeChild(we);else for(var lt=we.firstChild;lt;lt=lt.nextSibling)it(lt);else if((gt==3||gt==4)&&ze){var Re=we.nodeValue,je=Re.match(He);if(je){var ge=Re.substring(0,je.index);we.nodeValue=ge;var de=Re.substring(je.index+je[0].length);if(de){var pe=we.parentNode;pe.insertBefore(Be.createTextNode(de),we.nextSibling)}et(we),ge||we.parentNode.removeChild(we)}}}function et(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function gt(je,ge){var de=ge?je.cloneNode(!1):je,pe=je.parentNode;if(pe){var ee=gt(pe,1),te=je.nextSibling;ee.appendChild(de);for(var ie=te;ie;ie=te)te=ie.nextSibling,ee.appendChild(ie)}return de}for(var lt=gt(we.nextSibling,0),Re;(Re=lt.parentNode)&&Re.nodeType===1;)lt=Re;pt.push(lt)}for(var at=0;at=pe&&(it+=2),Be>=ee&&(Et+=2)}}finally{Re&&(Re.style.display=je)}}var Ce={};function me(Le,Me){for(var ze=Me.length;--ze>=0;){var Ge=Me[ze];Ce.hasOwnProperty(Ge)?B.console&&console.warn("cannot override language handler %s",Ge):Ce[Ge]=Le}}function ne(Le,Me){return Le&&Ce.hasOwnProperty(Le)||(Le=/^\s*]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^