(window.webpackJsonp=window.webpackJsonp||[]).push([[244,7,9,14],{"+NIl":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function(X,M){"use strict";function K(O,A){O.cmdState.push(A)}function D(O){return O.cmdState.length>0?O.cmdState[O.cmdState.length-1]:null}function P(O){var A=O.cmdState.pop();A&&A.closeBracket()}function H(O){for(var A=O.cmdState,x=A.length-1;x>=0;x--){var d=A[x];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function W(O,A,x){return function(){this.name=O,this.bracketNo=0,this.style=A,this.styles=x,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var _={};_.importmodule=W("importmodule","tag",["string","builtin"]),_.documentclass=W("documentclass","tag",["","atom"]),_.usepackage=W("usepackage","tag",["atom"]),_.begin=W("begin","tag",["atom"]),_.end=W("end","tag",["atom"]),_.label=W("label","tag",["atom"]),_.ref=W("ref","tag",["atom"]),_.eqref=W("eqref","tag",["atom"]),_.cite=W("cite","tag",["atom"]),_.bibitem=W("bibitem","tag",["atom"]),_.Bibitem=W("Bibitem","tag",["atom"]),_.RBibitem=W("RBibitem","tag",["atom"]),_.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(O,A){O.f=A}function y(O,A){var x;if(O.match(/^\\[a-zA-Z@]+/)){var d=O.current().slice(1);return x=_.hasOwnProperty(d)?_[d]:_.DEFAULT,x=new x,K(A,x),L(A,k),x.style}if(O.match(/^\\[$&%#{}_]/))return"tag";if(O.match(/^\\[,;!\/\\]/))return"tag";if(O.match("\\["))return L(A,function(l,s){return C(l,s,"\\]")}),"keyword";if(O.match("\\("))return L(A,function(l,s){return C(l,s,"\\)")}),"keyword";if(O.match("$$"))return L(A,function(l,s){return C(l,s,"$$")}),"keyword";if(O.match("$"))return L(A,function(l,s){return C(l,s,"$")}),"keyword";var a=O.next();if(a=="%")return O.skipToEnd(),"comment";if(a=="}"||a=="]"){if(x=D(A),x)x.closeBracket(a),L(A,k);else return"error";return"bracket"}else return a=="{"||a=="["?(x=_.DEFAULT,x=new x,K(A,x),"bracket"):/\d/.test(a)?(O.eatWhile(/[\w.%]/),"atom"):(O.eatWhile(/[\w\-_]/),x=H(A),x.name=="begin"&&(x.argument=O.current()),x.styleIdentifier())}function C(O,A,x){if(O.eatSpace())return null;if(x&&O.match(x))return L(A,y),"keyword";if(O.match(/^\\[a-zA-Z@]+/))return"tag";if(O.match(/^[a-zA-Z]+/))return"variable-2";if(O.match(/^\\[$&%#{}_]/))return"tag";if(O.match(/^\\[,;!\/]/))return"tag";if(O.match(/^[\^_&]/))return"tag";if(O.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(O.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=O.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(O.skipToEnd(),"comment"):"error"}function k(O,A){var x=O.peek(),d;return x=="{"||x=="["?(d=D(A),d.openBracket(x),O.eat(x),L(A,y),"bracket"):/[ \t\r]/.test(x)?(O.eat(x),null):(L(A,y),P(A),y(O,A))}return{startState:function(){var O=M.inMathMode?function(A,x){return C(A,x)}:y;return{cmdState:[],f:O}},copyState:function(O){return{cmdState:O.cmdState.slice(),f:O.f}},token:function(O,A){return A.f(O,A)},blankLine:function(O){O.f=y,O.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"/GNS":function(Ge,Fe,Q){Ge.exports=Q.p+"static/search1.c4136dd4.png"},"19Vz":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(W,_,L){var y=L&&L!=ae.Init;if(_&&!y)W.on("blur",D),W.on("change",P),W.on("swapDoc",P),ae.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){K(W)}),P(W);else if(!_&&y){W.off("blur",D),W.off("change",P),W.off("swapDoc",P),ae.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),X(W);var C=W.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}_&&!W.hasFocus()&&D(W)});function X(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(W){X(W);var _=W.state.placeholder=document.createElement("pre");_.style.cssText="height: 0; overflow: visible",_.style.direction=W.getOption("direction"),_.className="CodeMirror-placeholder CodeMirror-line-like";var L=W.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),_.appendChild(L),W.display.lineSpace.insertBefore(_,W.display.lineSpace.firstChild)}function K(W){setTimeout(function(){var _=!1,L=W.getInputField();L.nodeName=="TEXTAREA"?_=!L.value:W.lineCount()==1&&(_=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),_?M(W):X(W)},20)}function D(W){H(W)&&M(W)}function P(W){var _=W.getWrapperElement(),L=H(W);_.className=_.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?M(W):X(W)}function H(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";var X={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(K,D){var P=K.indentUnit,H={},W=D.htmlMode?X:M;for(var _ in W)H[_]=W[_];for(var _ in D)H[_]=D[_];var L,y;function C(o,S){function b(z){return S.tokenize=z,z(o,S)}var T=o.next();if(T=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?b(A("atom","]]>")):null:o.match("--")?b(A("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),b(x(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),S.tokenize=A("meta","?>"),"meta"):(L=o.eat("/")?"closeTag":"openTag",S.tokenize=k,"tag bracket");if(T=="&"){var N;return o.eat("#")?o.eat("x")?N=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):N=o.eatWhile(/[\d]/)&&o.eat(";"):N=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),N?"atom":"error"}else return o.eatWhile(/[^&<]/),null}C.isInText=!0;function k(o,S){var b=o.next();if(b==">"||b=="/"&&o.eat(">"))return S.tokenize=C,L=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return L="equals",null;if(b=="<"){S.tokenize=C,S.state=s,S.tagName=S.tagStart=null;var T=S.tokenize(o,S);return T?T+" tag error":"tag error"}else return/[\'\"]/.test(b)?(S.tokenize=O(b),S.stringStartCol=o.column(),S.tokenize(o,S)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function O(o){var S=function(b,T){for(;!b.eol();)if(b.next()==o){T.tokenize=k;break}return"string"};return S.isInAttribute=!0,S}function A(o,S){return function(b,T){for(;!b.eol();){if(b.match(S)){T.tokenize=C;break}b.next()}return o}}function x(o){return function(S,b){for(var T;(T=S.next())!=null;){if(T=="<")return b.tokenize=x(o+1),b.tokenize(S,b);if(T==">")if(o==1){b.tokenize=C;break}else return b.tokenize=x(o-1),b.tokenize(S,b)}return"meta"}}function d(o,S,b){this.prev=o.context,this.tagName=S,this.indent=o.indented,this.startOfLine=b,(H.doNotIndent.hasOwnProperty(S)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function l(o,S){for(var b;;){if(!o.context)return;if(b=o.context.tagName,!H.contextGrabbers.hasOwnProperty(b)||!H.contextGrabbers[b].hasOwnProperty(S))return;a(o)}}function s(o,S,b){return o=="openTag"?(b.tagStart=S.column(),v):o=="closeTag"?c:s}function v(o,S,b){return o=="word"?(b.tagName=S.current(),y="tag",E):H.allowMissingTagName&&o=="endTag"?(y="tag bracket",E(o,S,b)):(y="error",v)}function c(o,S,b){if(o=="word"){var T=S.current();return b.context&&b.context.tagName!=T&&H.implicitlyClosed.hasOwnProperty(b.context.tagName)&&a(b),b.context&&b.context.tagName==T||H.matchClosing===!1?(y="tag",m):(y="tag error",R)}else return H.allowMissingTagName&&o=="endTag"?(y="tag bracket",m(o,S,b)):(y="error",R)}function m(o,S,b){return o!="endTag"?(y="error",m):(a(b),s)}function R(o,S,b){return y="error",m(o,S,b)}function E(o,S,b){if(o=="word")return y="attribute",f;if(o=="endTag"||o=="selfcloseTag"){var T=b.tagName,N=b.tagStart;return b.tagName=b.tagStart=null,o=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(T)?l(b,T):(l(b,T),b.context=new d(b,T,N==b.indented)),s}return y="error",E}function f(o,S,b){return o=="equals"?g:(H.allowMissing||(y="error"),E(o,S,b))}function g(o,S,b){return o=="string"?h:o=="word"&&H.allowUnquoted?(y="string",E):(y="error",E(o,S,b))}function h(o,S,b){return o=="string"?h:E(o,S,b)}return{startState:function(o){var S={tokenize:C,state:s,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(S.baseIndent=o),S},token:function(o,S){if(!S.tagName&&o.sol()&&(S.indented=o.indentation()),o.eatSpace())return null;L=null;var b=S.tokenize(o,S);return(b||L)&&b!="comment"&&(y=null,S.state=S.state(L||b,o,S),y&&(b=y=="error"?b+" error":y)),b},indent:function(o,S,b){var T=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+P;if(T&&T.noIndent)return ae.Pass;if(o.tokenize!=k&&o.tokenize!=C)return b?b.match(/^(\s*)/)[0].length:0;if(o.tagName)return H.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+P*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(o){o.state==g&&(o.state=E)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var S=[],b=o.context;b;b=b.prev)b.tagName&&S.push(b.tagName);return S.reverse()}}}),ae.defineMIME("text/xml","xml"),ae.defineMIME("application/xml","xml"),ae.mimeModes.hasOwnProperty("text/html")||ae.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4qgm":function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6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6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Ge,Fe,Q){"use strict";var ae=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function M(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae(X)}var K=/^(?:[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 D(k){return typeof k=="string"&&K.test(k)}for(var P=D,H=[],W=0;W<256;++W)H.push((W+256).toString(16).substr(1));function _(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(H[k[O+0]]+H[k[O+1]]+H[k[O+2]]+H[k[O+3]]+"-"+H[k[O+4]]+H[k[O+5]]+"-"+H[k[O+6]]+H[k[O+7]]+"-"+H[k[O+8]]+H[k[O+9]]+"-"+H[k[O+10]]+H[k[O+11]]+H[k[O+12]]+H[k[O+13]]+H[k[O+14]]+H[k[O+15]]).toLowerCase();if(!P(A))throw TypeError("Stringified UUID is invalid");return A}var L=_;function y(k,O,A){k=k||{};var x=k.random||(k.rng||M)();if(x[6]=x[6]&15|64,x[8]=x[8]&63|128,O){A=A||0;for(var d=0;d<16;++d)O[A+d]=x[d];return O}return L(x)}var C=Fe.a=y},"7ZXX":function(Ge,Fe,Q){Ge.exports=Q.p+"static/err.6e7c5817.png"},"7ahc":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return v});var ae=Q("k1fw"),X=Q("0Owb"),M=Q("+L6B"),K=Q("2/Rp"),D=Q("y8nQ"),P=Q("Vl3Y"),H=Q("tJVT"),W=Q("OaEy"),_=Q("2fM7"),L=Q("q1tI"),y=Q.n(L),C=Q("VrN/"),k=Q.n(C),O=Q("p77/"),A=Q.n(O),x=Q("c5Ni"),d=Q.n(x),a=_.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};Fe.b=function(c){var m=c.callback,R=c.onCancel,E=Object(L.useState)("python"),f=Object(H.a)(E,2),g=f[0],h=f[1];function o(b){h(s[b][1])}function S(b){m(b)}return y.a.createElement(P.a,Object(X.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(_.a,{onChange:o},Object.keys(s).map(function(b){return y.a.createElement(a,{key:b,value:b},s[b][0])}))),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(v,{mode:g})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(K.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function v(c){var m=c.value,R=c.onChange,E=c.mode,f=c.options,g=f===void 0?{}:f,h=Object(L.useRef)(),o=Object(L.useState)(),S=Object(H.a)(o,2),b=S[0],T=S[1];return Object(L.useEffect)(function(){if(b){function N(z){var Y=z.getValue();R&&R(Y)}return b.on("change",N),function(){b.off("change",N)}}},[b,R]),Object(L.useEffect)(function(){b&&b.setOption("mode",E)},[b,E]),Object(L.useEffect)(function(){b&&((m!==b.getValue()||m==="")&&setTimeout(function(){b.setValue(m||" ")},300))},[b,m]),Object(L.useEffect)(function(){if(h.current&&!b){var N=k.a.fromTextArea(h.current,Object(ae.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},g));T(N)}},[h.current,b]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:h}))}},"7ixt":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return M});var ae={adjustX:1,adjustY:1},X=[0,0],M={left:{points:["cr","cl"],overflow:ae,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:ae,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:ae,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:ae,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:ae,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:ae,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:ae,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:ae,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:ae,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:ae,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:ae,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:ae,offset:[-4,0],targetOffset:X}},K=M},"7qnI":function(Ge,Fe,Q){"use strict";var ae=Q("5Dmo"),X=Q("3S7+"),M=Q("fWQN"),K=Q("mtLc"),D=Q("yKVA"),P=Q("879j"),H=Q("5NDa"),W=Q("5rEg"),_=Q("q1tI"),L=Q.n(_),y=Q("O2Wb"),C=Q.n(y),k=W.a.TextArea,O=function(A){Object(D.a)(d,A);var x=Object(P.a)(d);function d(){return Object(M.a)(this,d),x.apply(this,arguments)}return Object(K.a)(d,[{key:"render",value:function(){var l=this,s=this.props,v=s.index,c=s.onAnswerChange,m=s.addChildAnswer,R=s.exerciseIsPublish,E=s.answers,f=s.activeOptionErrorIndex,g=s.flex,h=g===void 0?"0 0 1000px":g;return L.a.createElement("div",{className:C.a.flex},L.a.createElement("div",{className:"".concat(C.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",v+1,"):"),L.a.createElement("div",{className:"".concat(C.a.flex," ").concat(C.a.flex1),style:{flexDirection:"column"}},E.map(function(o,S){var b="".concat(v,"-").concat(S);return L.a.createElement("div",{className:"".concat(C.a.flex," ").concat(C.a.flex1),key:S},L.a.createElement("div",{className:C.a.flex1,style:{flex:h}},L.a.createElement("div",null,L.a.createElement(k,{className:b===f?C.a.error:"",spellCheck:!1,rows:4,value:o||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(S==0?"":"(\u53EF\u9009)"),onChange:function(N){return c(v,S,N.target.value)},style:{minHeight:95}}))),!R&&L.a.createElement(L.a.Fragment,null,S!=0&&L.a.createElement(X.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(C.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return l.props.deleteChildAnswer(v,S)},style:{float:"right"}})),S===0&&L.a.createElement(X.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(C.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return l.props.deleteChildAnswermain(v,S)},style:{float:"right"}})),L.a.createElement(X.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},L.a.createElement("i",{className:"".concat(C.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return m(v)},style:{float:"right",visibility:S==E.length-1?"":"hidden"}}))))})))}}]),d}(_.Component);Fe.a=O},"7v3h":function(Ge,Fe,Q){Ge.exports=Q.p+"static/empty2.dd73f390.png"},"8/bI":function(Ge,Fe,Q){Ge.exports=Q.p+"static/empty.8918e228.png"},"8EBN":function(Ge,Fe,Q){(function(ae){ae(Q("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 X=0;X-1&&K.substring(H+1,K.length);if(W)return ae.findModeByExtension(W)},ae.findModeByName=function(K){K=K.toLowerCase();for(var D=0;D=I.length?Z.slice(I.length):Z}).join(`
`)}var d=[],a=[""],l=new O.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){d.length=0,a=[""]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(j,u,p,I){if(u>=j.length||j[u].level<=p)return u;var Z=j[u];I.push("- "+Z.text+""),u++;var U=[];return u=m(j,u,Z.level,U),U.length>0&&(I.push("
"),U.forEach(function(be){I.push(be)}),I.push("
")),I.push(" "),u=m(j,u,p,I),u}function R(){return m(d,0,0,a),a.push("
"),a.join("")}var E={heading:function(u){var p=s.exec(u);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(u){var p=this.rules.block.fences.exec(u);if(p){var I=p[0],Z=x(I,p[3]||""),U=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(U)>=0){var be=h(),Xe=Z;Z=be,o[be]={type:"block",expression:Xe}}return{type:"code",raw:I,lang:U,text:Z}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,h=function(){return"__special_katext_id_".concat(g++,"__")},o={};function S(){return o}function b(){g=0,o={}}function T(j){return j=j.replace(f,function(u,p){var I=h();return o[I]={type:"inline",expression:p},I}),j}var N=l.listitem;l.listitem=function(j){return N(T(j))};var z=l.paragraph;l.paragraph=function(j){return z(T(j))};var Y=l.tablecell;l.tablecell=function(j,u){return Y(T(j),u)},l.code=function(j,u,p){var I=(u||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"".concat(j,"
"):'
').concat(p?j:Object(A.escape)(j,!0),`
`):''+(p?j:Object(A.escape)(j,!0))+"
"},l.heading=function(j,u,p){var I=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:I,level:u,text:j}),"'+j+""},O.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),O.a.use({tokenizer:E,renderer:l});var te=O.a,G=Q("SJMd"),F=Q("ulZh"),re=Q.n(F),le=Q("m3rI"),Ee=Q("Oy/b"),Oe=Q("p5ED"),Ye=Q("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Pe=function(j,u){return(Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var Z in I)Object.prototype.hasOwnProperty.call(I,Z)&&(p[Z]=I[Z])})(j,u)};function Be(j,u){function p(){this.constructor=j}Pe(j,u),j.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}function Ue(j,u,p,I){return new(p||(p=Promise))(function(Z,U){function be(It){try{gt(I.next(It))}catch(qe){U(qe)}}function Xe(It){try{gt(I.throw(It))}catch(qe){U(qe)}}function gt(It){var qe;It.done?Z(It.value):(qe=It.value,qe instanceof p?qe:new p(function(jt){jt(qe)})).then(be,Xe)}gt((I=I.apply(j,u||[])).next())})}function Ne(j,u){var p,I,Z,U,be={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return U={next:Xe(0),throw:Xe(1),return:Xe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Xe(gt){return function(It){return function(qe){if(p)throw new TypeError("Generator is already executing.");for(;be;)try{if(p=1,I&&(Z=2&qe[0]?I.return:qe[0]?I.throw||((Z=I.return)&&Z.call(I),0):I.next)&&!(Z=Z.call(I,qe[1])).done)return Z;switch(I=0,Z&&(qe=[2&qe[0],Z.value]),qe[0]){case 0:case 1:Z=qe;break;case 4:return be.label++,{value:qe[1],done:!1};case 5:be.label++,I=qe[1],qe=[0];continue;case 7:qe=be.ops.pop(),be.trys.pop();continue;default:if(!(Z=be.trys,(Z=Z.length>0&&Z[Z.length-1])||qe[0]!==6&&qe[0]!==2)){be=0;continue}if(qe[0]===3&&(!Z||qe[1]>Z[0]&&qe[1]',"select"),this.addActionButton(I,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(I,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(I,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(I,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(I,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(I,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(I,'',"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(U){var be=document.createElement("div");be.className=""+p.toolbarButtonStyleClass.name,be.setAttribute("data-type-name",U.typeName),be.innerHTML=U.icon,be.addEventListener("click",function(){p.markerToolbarButtonClicked(be,U)}),p.buttons.push(be),p.markerButtons.push(be)}),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 Z=document.createElement("div");Z.className=this.toolbarBlockStyleClass.name,Z.style.whiteSpace="nowrap",Z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Z),this.addActionButton(Z,'',"render"),this.addActionButton(Z,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},j.prototype.addButtonClickListener=function(u){this.buttonClickListeners.push(u)},j.prototype.removeButtonClickListener=function(u){this.buttonClickListeners.indexOf(u)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(u),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.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 p=0;p0&&this.buttonClickListeners.forEach(function(I){return I("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(u,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},j.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)},j.prototype.setActiveMarkerButton=function(u){var p=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===u});p&&this.setActiveButton(p)},j.prototype.setCurrentMarker=function(u){var p=this;this.currentMarker=u,this.buttons.filter(function(I){return/delete|notes/.test(I.getAttribute("data-action"))}).forEach(function(I){p.currentMarker===void 0?(I.style.fillOpacity="0.4",I.style.pointerEvents="none"):(I.style.fillOpacity="1",I.style.pointerEvents="all")})},j}(),ut=function(){function j(u,p,I,Z){this.panels=[],this.panelButtons=[],this.markerjsContainer=u,this.displayMode=p,this.uiStyleSettings=I,this.styles=Z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var u;this.toolboxStyleClass=this.styles.addClass(new He("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 He("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new He("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new He("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new He("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 He("toolbox-panel-row_colors",`
background-color: `+((u=this.uiStyleSettings.toolboxBackgroundColor)!==null&&u!==void 0?u:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new He("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
padding: `+p+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new He("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new He("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ct("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ct("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},j.prototype.show=function(u){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(u){var p,I,Z=this;this.panels=u,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var be;U.uiStyleSettings=Z.uiStyleSettings;var Xe=document.createElement("div");Xe.className=Z.toolboxButtonStyleClass.name+" "+((be=Z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&be!==void 0?be:Z.toolboxButtonStyleColorsClass.name),Xe.innerHTML=U.icon,Xe.title=U.title,Xe.addEventListener("click",function(){Z.panelButtonClick(U)}),Z.panelButtons.push(Xe),Z.buttonRow.appendChild(Xe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(u){var p=this,I=-1;if(u!==this.activePanel){I=this.panels.indexOf(u),this.panelRow.innerHTML="";var Z=u.getUi();Z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Z),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(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,be){var Xe,gt;U.className=p.toolboxButtonStyleClass.name+" "+(be===I?""+((Xe=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Xe!==void 0?Xe:p.toolboxActiveButtonStyleColorsClass.name):""+((gt=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&>!==void 0?gt:p.toolboxButtonStyleColorsClass.name))})},j}(),vt=function(j,u){this.title=j,this.icon=u},ht=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'')||this;return be.colors=[],be.addTransparent=!1,be.colorBoxes=[],be.colors=I,be.currentColor=Z,be.setCurrentColor=be.setCurrentColor.bind(be),be.getColorBox=be.getColorBox.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.whiteSpace="nowrap",this.colors.forEach(function(Z){var U=p.getColorBox(Z);I.appendChild(U),p.colorBoxes.push(U)}),I},u.prototype.getColorBox=function(p){var I=this,Z=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-Z,be=document.createElement("div");be.style.display="inline-block",be.style.boxSizing="content-box",be.style.width=U-2+"px",be.style.height=U-2+"px",be.style.padding="1px",be.style.marginRight="2px",be.style.marginBottom="2px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderRadius=(U+2)/2+"px",be.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){I.setCurrentColor(p,be)});var Xe=document.createElement("div");return Xe.style.display="inline-block",Xe.style.width=U-2+"px",Xe.style.height=U-2+"px",Xe.style.backgroundColor=p,Xe.style.borderRadius=U/2+"px",p==="transparent"&&(Xe.style.fill=this.uiStyleSettings.toolboxAccentColor,Xe.innerHTML=``),be.appendChild(Xe),be},u.prototype.setCurrentColor=function(p,I){var Z=this;this.currentColor=p,this.colorBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},u}(vt),et=function(){function j(u,p,I){this._state="new",this._isSelected=!1,this._container=u,this._overlayContainer=p,this.globalSettings=I,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(u){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(u,p){},j.prototype.dblClick=function(u,p){},j.prototype.manipulate=function(u){},j.prototype.pointerUp=function(u){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(u){this.container.childNodes.length>0?this.container.insertBefore(u,this.container.childNodes[0]):this.container.appendChild(u)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(u){this._state=u.state,this.notes=u.notes},j.prototype.scale=function(u,p){},j.prototype.colorChanged=function(u){this.onColorChanged&&this.onColorChanged(u),this.stateChanged()},j.prototype.fillColorChanged=function(u){this.onFillColorChanged&&this.onFillColorChanged(u),this.stateChanged()},j.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)}},j.typeName="MarkerBase",j}(),Ze=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.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},j}(),Tt=function(){function j(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},j}(),bt=function(){function j(){}return j.toITransformMatrix=function(u){return{a:u.a,b:u.b,c:u.c,d:u.d,e:u.e,f:u.f}},j.toSVGMatrix=function(u,p){return u.a=p.a,u.b=p.b,u.c=p.c,u.d=p.d,u.e=p.e,u.f=p.f,u},j}(),St=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.left=0,U.top=0,U.width=0,U.height=0,U.defaultSize={x:50,y:20},U.offsetX=0,U.offsetY=0,U.rotationAngle=0,U.CB_DISTANCE=10,U._suppressMarkerCreateEvent=!1,U.container.transform.baseVal.appendItem(se.createTransform()),U.setupControlBox(),U}return Be(u,j),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(p){this._visual=p;var I=se.createTransform();this._visual.transform.baseVal.appendItem(I)},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Z=this.unrotatePoint(p);if(this.manipulationStartX=Z.x,this.manipulationStartY=Z.y,this.offsetX=Z.x-this.left,this.offsetY=Z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(I),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I)){this.activeGrip=this.rotatorGrip;var U=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=U.x-this.width/2,this.top=U.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var be=this.container.transform.baseVal.getItem(0);be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},u.prototype.pointerUp=function(p){var I=this.state;j.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},u.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},u.prototype.manipulate=function(p){var I=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(I.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(I.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(I):this.state==="rotate"&&this.rotate(p)},u.prototype.resize=function(p){var I=this.manipulationStartLeft,Z=this.manipulationStartWidth,U=this.manipulationStartTop,be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:I=this.manipulationStartLeft+p.x-this.manipulationStartX,Z=this.manipulationStartWidth+this.manipulationStartLeft-I;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Z=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+p.y-this.manipulationStartY,be=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:be=this.manipulationStartHeight+p.y-this.manipulationStartY}Z>=0?(this.left=I,this.width=Z):(this.left=I+Z,this.width=-Z),be>=0?(this.top=U,this.height=be):(this.top=U+be,this.height=-be),this.setSize()},u.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},u.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var I=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*I,this.applyRotation()}},u.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},u.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM(),Z=se.createPoint(p.x,p.y);return{x:(Z=Z.matrixTransform(I)).x,y:Z.y}},u.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM();I=I.inverse();var Z=se.createPoint(p.x,p.y);return{x:(Z=Z.matrixTransform(I)).x,y:Z.y}},u.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var p=se.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=se.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=se.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 Ze,this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,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 p=new Tt;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},u.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,I=-p/2,Z=I,U=(this.width+this.CB_DISTANCE)/2-p/2,be=(this.height+this.CB_DISTANCE)/2-p/2,Xe=this.height+this.CB_DISTANCE-p/2,gt=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,I,Z),this.positionGrip(this.controlGrips.topCenter.visual,U,Z),this.positionGrip(this.controlGrips.topRight.visual,gt,Z),this.positionGrip(this.controlGrips.centerLeft.visual,I,be),this.positionGrip(this.controlGrips.centerRight.visual,gt,be),this.positionGrip(this.controlGrips.bottomLeft.visual,I,Xe),this.positionGrip(this.controlGrips.bottomCenter.visual,U,Xe),this.positionGrip(this.controlGrips.bottomRight.visual,gt,Xe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,Z-3*this.CB_DISTANCE)},u.prototype.positionGrip=function(p,I,Z){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,Z),p.transform.baseVal.replaceItem(U,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:bt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:bt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.left=I.left,this.top=I.top,this.width=I.width,this.height=I.height,this.rotationAngle=I.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(bt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(bt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I);var Z=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:Z.x*p,y:Z.y*I});this.left=U.x,this.top=U.y,this.width=this.width*p,this.height=this.height*I,this.adjustControlBox()},u}(et),lt=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.createVisual=U.createVisual.bind(U),U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},u.prototype.createVisual=function(){this.visual=se.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(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},u.prototype.setSize=function(){j.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},u.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.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},j.prototype.getState.call(this))},u.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},u.title="Rectangle marker",u}(St),yt=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'')||this;return be.widths=[],be.widthBoxes=[],be.widths=I,be.currentWidth=Z,be.setCurrentWidth=be.setCurrentWidth.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.widths.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.flexGrow="2",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=Z===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentWidth(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.innerText=Z.toString(),be.style.marginRight="5px",U.appendChild(be);var Xe=document.createElement("div");Xe.style.minHeight="20px",Xe.style.flexGrow="2",Xe.style.display="flex",Xe.style.alignItems="center";var gt=document.createElement("hr");gt.style.minWidth="20px",gt.style.border="0px",gt.style.borderTop=Z+"px solid "+p.uiStyleSettings.toolboxColor,gt.style.flexGrow="2",Xe.appendChild(gt),U.appendChild(Xe),p.widthBoxes.push(U)}),I},u.prototype.setCurrentWidth=function(p,I){var Z=this;this.currentWidth=p,this.widthBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},u}(vt),dt=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'')||this;return be.styles=[],be.styleBoxes=[],be.styles=I,be.currentStyle=Z,be.setCurrentStyle=be.setCurrentStyle.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.styles.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.styles.length-5+"%",U.style.borderColor=Z===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentStyle(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.overflow="hidden";var Xe=``;be.innerHTML=Xe,U.appendChild(be),p.styleBoxes.push(U)}),I},u.prototype.setCurrentStyle=function(p,I){var Z=this;this.currentStyle=p,this.styleBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},u}(vt),Qe=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ht("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Be(u,j),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="FrameMarker",u.title="Frame marker",u.icon='',u}(lt),Ie=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},Et=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.x1=0,U.y1=0,U.x2=0,U.y2=0,U.defaultLength=50,U.manipulationStartX=0,U.manipulationStartY=0,U.manipulationStartX1=0,U.manipulationStartY1=0,U.manipulationStartX2=0,U.manipulationStartY2=0,U.setupControlBox(),U}return Be(u,j),u.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.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(I)?this.activeGrip=this.grip1:this.grip2.ownsTarget(I)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},u.prototype.pointerUp=function(p){var I=this.state;j.prototype.pointerUp.call(this,p),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(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},u.prototype.adjustVisual=function(){},u.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},u.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},u.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=se.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 p=new Tt;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},u.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},u.prototype.positionGrip=function(p,I,Z){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,Z),p.transform.baseVal.replaceItem(U,0)},u.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.x1=this.x1*p,this.y1=this.y1*I,this.x2=this.x2*p,this.y2=this.y2*I,this.adjustVisual(),this.adjustControlBox()},u}(et),$e=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ht("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.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(p,I){j.prototype.pointerDown.call(this,p,I),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()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,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 p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},u.typeName="LineMarker",u.title="Line marker",u.icon='',u}(Et),_e=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'')||this;return be.fonts=[],be.fontBoxes=[],be.fonts=I,be.currentFont=Z,be.setCurrentFont=be.setCurrentFont.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.flexGrow="2",this.fonts.forEach(function(Z){var U=document.createElement("div");U.style.display="inline-block",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.fonts.length-5+"%",U.style.borderColor=Z===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentFont(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.style.display="flex",be.style.minHeight="20px",be.style.flexGrow="2",be.style.fontFamily=Z,be.style.overflow="hidden";var Xe=document.createElement("div");Xe.style.whiteSpace="nowrap",Xe.style.overflow="hidden",Xe.style.textOverflow="ellipsis",Xe.innerHTML="The quick brown fox jumps over the lazy dog",be.appendChild(Xe),U.appendChild(be),p.fontBoxes.push(U)}),I},u.prototype.setCurrentFont=function(p,I){var Z=this;this.currentFont=p,this.fontBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},u}(vt),Je=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.color="transparent",U.padding=5,U.DEFAULT_TEXT="your text here",U.text=U.DEFAULT_TEXT,U.isMoved=!1,U.color=Z.defaultColor,U.fontFamily=Z.defaultFontFamily,U.defaultSize={x:100,y:30},U.setColor=U.setColor.bind(U),U.setFont=U.setFont.bind(U),U.renderText=U.renderText.bind(U),U.sizeText=U.sizeText.bind(U),U.textEditDivClicked=U.textEditDivClicked.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.setSize=U.setSize.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.colorPanel=new ht("Color",Z.defaultColorSet,Z.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.fontFamilyPanel=new _e("Font",Z.defaultFontFamilies,Z.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U}return Be(u,j),u.prototype.ownsTarget=function(p){if(j.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var I=!1;return this.textElement.childNodes.forEach(function(Z){Z===p&&(I=!0)}),I},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.renderText=function(){var p=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(I){p.textElement.appendChild(se.createTSpan(I.trim()===""?" ":I.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},u.prototype.getTextScale=function(){var p=this.textElement.getBBox(),I=1;if(p.width>0&&p.height>0){var Z=(1*this.width-this.width*this.padding*2/100)/p.width,U=(1*this.height-this.height*this.padding*2/100)/p.height;I=Math.min(Z,U)}return I},u.prototype.getTextPosition=function(p){var I=this.textElement.getBBox(),Z=0,U=0;return I.width>0&&I.height>0&&(Z=(this.width-I.width*p)/2,U=this.height/2-I.height*p/2),{x:Z,y:U}},u.prototype.sizeText=function(){var p=this.textElement.getBBox(),I=this.getTextScale(),Z=this.getTextPosition(I);Z.y-=p.y*I,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Z.x+"px, "+Z.y+"px) scale("+I+", "+I+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Z.x,Z.y),this.textElement.transform.baseVal.getItem(1).setScale(I,I))},u.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},u.prototype.setSize=function(){j.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},u.prototype.pointerUp=function(p){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,p),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},u.prototype.showTextEditor=function(){var p=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(I){I.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var I=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&I>.9;)I-=.1,p.textEditor.style.fontSize=Math.max(I,.9)+"em"}),this.textEditor.addEventListener("keyup",function(I){I.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(I){if(I.clipboardData){var Z=I.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(Z)),I.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.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 p=this.getTextScale(),I=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Z=this.textElement.getBBox(),U={x:Z.width*p,y:Z.height*p};I.x-=U.x/2,I.y-=U.y/2,this.textEditor.style.top=I.y+"px",this.textEditor.style.left=I.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-I.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},u.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},u.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},u.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},u.prototype.dblClick=function(p,I){j.prototype.dblClick.call(this,p,I),this.showTextEditor()},u.prototype.setColor=function(p){this.textElement&&se.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},u.prototype.setFont=function(p){this.textElement&&se.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,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 p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var I=p;this.color=I.color,this.fontFamily=I.fontFamily,this.padding=I.padding,this.text=I.text,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize(),this.sizeText(),this.positionTextEditor()},u.typeName="TextMarker",u.title="Text marker",u.icon='',u}(St),Se=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=Z.defaultColor,U.lineWidth=Z.defaultStrokeWidth,U.pixelRatio=Z.freehandPixelRatio,U.setColor=U.setColor.bind(U),U.addCanvas=U.addCanvas.bind(U),U.finishCreation=U.finishCreation.bind(U),U.setLineWidth=U.setLineWidth.bind(U),U.colorPanel=new ht("Color",Z.defaultColorSet,Z.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var p=se.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,I){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(p.x,p.y),this.drawing=!0):j.prototype.pointerDown.call(this,p,I)},u.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,p)},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(),j.prototype.select.call(this)},u.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},u.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),I=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Z=I[0],U=I[1],be=I[2],Xe=I[3],gt=!1,It=0;It0&&(gt=!0,ItXe&&(Xe=It),qe>be&&(be=qe));if(gt){this.left=Z/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(be-Z)/this.pixelRatio,this.height=(Xe-U)/this.pixelRatio;var jt=document.createElement("canvas");jt.width=be-Z,jt.height=Xe-U,jt.getContext("2d").putImageData(this.canvasContext.getImageData(Z,U,be-Z,Xe-U),0,0),this.drawingImgUrl=jt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},u.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},u.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},u.prototype.setLineWidth=function(p){this.lineWidth=p},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 p=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){this.createVisual(),j.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setDrawingImage()},u.typeName="FreehandMarker",u.title="Freehand marker",u.icon='',u}(St),me=function(j){function u(p,I,Z){var U=j.call(this,p,Z||'')||this;return U.typeBoxes=[],U.currentType=I,U.setCurrentType=U.setCurrentType.bind(U),U}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2";for(var Z=function(Xe){var gt="both";switch(Xe){case 0:gt="both";break;case 1:gt="start";break;case 2:gt="end";break;case 3:gt="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=gt===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){p.setCurrentType(gt,It)}),I.appendChild(It),gt==="both"||gt==="start"){var qe=document.createElement("div");qe.style.display="flex",qe.style.alignItems="center",qe.style.minHeight="20px",qe.innerHTML=``,qe.style.marginLeft="5px",It.appendChild(qe)}var jt=document.createElement("div");jt.style.display="flex",jt.style.alignItems="center",jt.style.minHeight="20px",jt.style.flexGrow="2";var Cr=document.createElement("hr");if(Cr.style.minWidth="20px",Cr.style.border="0px",Cr.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Cr.style.flexGrow="2",jt.appendChild(Cr),It.appendChild(jt),gt==="both"||gt==="end"){var Nr=document.createElement("div");Nr.style.display="flex",Nr.style.alignItems="center",Nr.style.minHeight="20px",Nr.innerHTML=``,Nr.style.marginRight="5px",It.appendChild(Nr)}U.typeBoxes.push(It)},U=this,be=0;be<4;be++)Z(be);return I},u.prototype.setCurrentType=function(p,I){var Z=this;this.currentType=p,this.typeBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},u}(vt),ve=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.arrowType="end",U.arrowBaseHeight=10,U.arrowBaseWidth=10,U.getArrowPoints=U.getArrowPoints.bind(U),U.setArrowType=U.setArrowType.bind(U),U.arrowTypePanel=new me("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},u.prototype.getArrowPoints=function(p,I){var Z=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return p-Z/2+","+(I+U/2)+" "+p+","+(I-U/2)+" "+(p+Z/2)+","+(I+U/2)},u.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(j.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",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.arrow1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(I,0);var Z=this.arrow2.transform.baseVal.getItem(0);Z.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Z,0)}},u.prototype.setArrowType=function(p){this.arrowType=p,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 p=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},u.typeName="ArrowMarker",u.title="Arrow marker",u.icon='',u}($e),ne=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.fillColor=Z.defaultFillColor,U.strokeWidth=0,U.fillPanel=new ht("Color",Z.defaultColorSet,Z.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Be(u,j),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="CoverMarker",u.title="Cover marker",u.icon='',u}(lt),ie=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'')||this;return be.opacities=[],be.opacityBoxes=[],be.opacities=I,be.currentOpacity=Z,be.setCurrentOpacity=be.setCurrentOpacity.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",I.style.justifyContent="space-between",this.opacities.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=Z===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentOpacity(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.innerText=100*Z+"%",U.appendChild(be),p.opacityBoxes.push(U)}),I},u.prototype.setCurrentOpacity=function(p,I){var Z=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},u}(vt),de=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=Z.defaultHighlightColor,U.strokeWidth=0,U.opacity=Z.defaultHighlightOpacity,U.fillPanel=new ht("Color",Z.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new ie("Opacity",Z.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Be(u,j),u.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.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 p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="HighlightMarker",u.title="Highlight marker",u.icon='',u}(ne),pe='',xe=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.bgColor="transparent",U.tipPosition={x:0,y:0},U.tipBase1Position={x:0,y:0},U.tipBase2Position={x:0,y:0},U.tipMoving=!1,U.color=Z.defaultStrokeColor,U.bgColor=Z.defaultFillColor,U.fontFamily=Z.defaultFontFamily,U.defaultSize={x:100,y:30},U.setBgColor=U.setBgColor.bind(U),U.getTipPoints=U.getTipPoints.bind(U),U.positionTip=U.positionTip.bind(U),U.setTipPoints=U.setTipPoints.bind(U),U.colorPanel=new ht("Text color",Z.defaultColorSet,U.color,''),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new ht("Fill color",Z.defaultColorSet,U.bgColor,pe),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new _e("Font",Z.defaultFontFamilies,Z.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new Tt,U.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Be(u,j),u.prototype.ownsTarget=function(p){return j.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},u.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},u.prototype.pointerDown=function(p,I){this.state==="new"&&j.prototype.pointerDown.call(this,p,I),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(I)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):j.prototype.pointerDown.call(this,p,I)},u.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,p);else{var I=this.state==="creating";j.prototype.pointerUp.call(this,p),this.setTipPoints(I),this.positionTip()}},u.prototype.manipulate=function(p){if(this.tipMoving){var I=this.unrotatePoint(p);this.tipPosition={x:I.x-this.manipulationStartLeft,y:I.y-this.manipulationStartTop},this.positionTip()}else j.prototype.manipulate.call(this,p)},u.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",p]]),se.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},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(p){p===void 0&&(p=!1);var I=Math.min(this.height/2,15),Z=this.height/5;p&&(this.tipPosition={x:I+Z/2,y:this.height+20});var U=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?U',u}(Je),Le=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.fillColor=Z.defaultFillColor,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.setOpacity=U.setOpacity.bind(U),U.createVisual=U.createVisual.bind(U),U.strokePanel=new ht("Line color",Te(Z.defaultColorSet,["transparent"]),Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new ht("Fill color",Te(Z.defaultColorSet,["transparent"]),U.fillColor,pe),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new ie("Opacity",Z.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},u.prototype.createVisual=function(){this.visual=se.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(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},u.prototype.setSize=function(){j.prototype.setSize.call(this),se.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(p){j.prototype.pointerUp.call(this,p),this.setSize()},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},u.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.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 p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},u.typeName="EllipseMarker",u.title="Ellipse marker",u.icon='',u}(St),je=function(j){function u(p,I,Z){return j.call(this,p,I,Z)||this}return Be(u,j),Object.defineProperty(u.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},u.prototype.createTips=function(){this.tip1=se.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(se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=se.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(se.createTransform()),this.visual.appendChild(this.tip2)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.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()]]),se.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 p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.tip1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(I,0);var Z=this.tip2.transform.baseVal.getItem(0);Z.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Z,0)}},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},u.typeName="MeasurementMarker",u.title="Measurement marker",u.icon='',u}($e),mt=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokePanel.colors=Z.defaultColorSet,U.fillColor="transparent",U}return Be(u,j),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="EllipseFrameMarker",u.title="Ellipse frame marker",u.icon='',u}(Le),Mt=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.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))},j.prototype.replaceLastUndoStep=function(u){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=u)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.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}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),Rt=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.curveX=0,U.curveY=0,U.manipulationStartCurveX=0,U.manipulationStartCurveY=0,U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.positionGrips=U.positionGrips.bind(U),U.addControlGrips=U.addControlGrips.bind(U),U.adjustVisual=U.adjustVisual.bind(U),U.setupControlBox=U.setupControlBox.bind(U),U.resize=U.resize.bind(U),U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ht("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},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=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.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(p,I){j.prototype.pointerDown.call(this,p,I),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(I)&&(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()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setupControlBox=function(){j.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.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,j.prototype.addControlGrips.call(this)},u.prototype.positionGrips=function(){j.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/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(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),j.prototype.resize.call(this,p),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(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},u.prototype.scale=function(p,I){this.curveX=this.curveX*p,this.curveY=this.curveY*I,j.prototype.scale.call(this,p,I)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.curveX=I.curveX,this.curveY=I.curveY,this.createVisual(),this.adjustVisual()},u.typeName="CurveMarker",u.title="Curve marker",u.icon='',u}(Et),Kt=function(){function j(u,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=u,this.cancelable=p}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),_t=function(j){function u(p,I,Z){var U=j.call(this,p,!1)||this;return U.dataUrl=I,U.state=Z,U}return Be(u,j),u}(Kt),ot=function(j){function u(p,I,Z){Z===void 0&&(Z=!1);var U=j.call(this,p,Z)||this;return U.marker=I,U}return Be(u,j),u}(Kt),Jt=function(){function j(){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 j.prototype.addEventListener=function(u,p){this[u].push(p)},j.prototype.removeEventListener=function(u,p){var I=this[u].indexOf(p);I>-1&&this[u].splice(I,1)},j}(),Ut=function(){function j(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 Ie,this._isOpen=!1,this.undoRedoManager=new Mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Jt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=j.instanceCounter++,this.styles=new ft(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(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,Se,ve,Je,mt,Le,de,xe,je,ne,$e,Rt]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,Se,ve,Je,Le,de,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,Se,ve,Je,de]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(u){var p=this;this._availableMarkerTypes.splice(0),u.forEach(function(I){if(typeof I=="string"){var Z=p.ALL_MARKER_TYPES.find(function(U){return U.typeName===I});Z!==void 0&&p._availableMarkerTypes.push(Z)}else p._availableMarkerTypes.push(I)})},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ze.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var u=this;this.styles.styleSheetRoot===void 0&&ct.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ct.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new Kt(u))})},j.prototype.render=function(){return Ue(this,void 0,void 0,function(){var u;return Ne(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(u=new xt).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 p.sent(),[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},j.prototype.close=function(u){var p=this;if(u===void 0&&(u=!1),this.isOpen){var I=!1;u||this.eventListeners.beforeclose.forEach(function(Z){var U=new Kt(p,!0);Z(U),U.defaultPrevented&&(I=!0)}),I||(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(Z){return Z(new Kt(p))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var u,p=[],I=0;Ithis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*u:this.editorCanvas.clientWidth,I=p',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()},j.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")},j.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"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.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 Ke(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()},j.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())},j.prototype.toolbarButtonClicked=function(u,p){if(u==="marker"&&p!==void 0)this.createNewMarker(p);else if(u==="action")switch(p){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()}},j.prototype.deleteSelectedMarker=function(){var u=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Z){var U=new ot(u,u._currentMarker,!0);Z(U),U.defaultPrevented&&(p=!0)}),!p){var I=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(Z){return Z(new ot(u,I))})}}},j.prototype.clear=function(){var u=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(be){var Xe=new ot(u,void 0,!0);be(Xe),Xe.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var I=function(be){var Xe=Z.markers[be];Z.setCurrentMarker(Z.markers[be]),Z._currentMarker.dispose(),Z.markerImage.removeChild(Z._currentMarker.container),Z.markers.splice(Z.markers.indexOf(Z._currentMarker),1),Z.eventListeners.markerdelete.forEach(function(gt){return gt(new ot(u,Xe))})},Z=this,U=this.markers.length-1;U>=0;U--)I(U);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.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))},j.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)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var u=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),I=this.undoRedoManager.getLastUndoStep();if(!I||I.width===p.width&&I.height===p.height){var Z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),Z1&&this.panTo({x:u.clientX,y:u.clientY}))},j.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()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(u){this._currentMarker===void 0||this.notesArea!==void 0||u.key!=="Delete"&&u.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(u,p){var I=this.markerImage.getBoundingClientRect();return{x:(u-I.left)/this.zoomLevel,y:(p-I.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.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()},j.prototype.addLicenseKey=function(u){ze.addKey(u)},j.prototype.addEventListener=function(u,p){this.eventListeners.addEventListener(u,p)},j.prototype.removeEventListener=function(u,p){this.eventListeners.removeEventListener(u,p)},j.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(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.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(p){return p(new Kt(u))}))},j.prototype.blur=function(){var u=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new Kt(u))}))},j.instanceCounter=0,j}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Zt=function(j,u){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var Z in I)Object.prototype.hasOwnProperty.call(I,Z)&&(p[Z]=I[Z])})(j,u)};function nr(j,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=j}Zt(j,u),j.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}function Ot(j,u,p,I){return new(p||(p=Promise))(function(Z,U){function be(It){try{gt(I.next(It))}catch(qe){U(qe)}}function Xe(It){try{gt(I.throw(It))}catch(qe){U(qe)}}function gt(It){var qe;It.done?Z(It.value):(qe=It.value,qe instanceof p?qe:new p(function(jt){jt(qe)})).then(be,Xe)}gt((I=I.apply(j,u||[])).next())})}function xr(j,u){var p,I,Z,U,be={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return U={next:Xe(0),throw:Xe(1),return:Xe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Xe(gt){return function(It){return function(qe){if(p)throw new TypeError("Generator is already executing.");for(;be;)try{if(p=1,I&&(Z=2&qe[0]?I.return:qe[0]?I.throw||((Z=I.return)&&Z.call(I),0):I.next)&&!(Z=Z.call(I,qe[1])).done)return Z;switch(I=0,Z&&(qe=[2&qe[0],Z.value]),qe[0]){case 0:case 1:Z=qe;break;case 4:return be.label++,{value:qe[1],done:!1};case 5:be.label++,I=qe[1],qe=[0];continue;case 7:qe=be.ops.pop(),be.trys.pop();continue;default:if(!(Z=be.trys,(Z=Z.length>0&&Z[Z.length-1])||qe[0]!==6&&qe[0]!==2)){be=0;continue}if(qe[0]===3&&(!Z||qe[1]>Z[0]&&qe[1]0&&p>0){var I=new Hn(u,p),Z=I.ratio>=1?20:I.getHorizontalLength(20),U=I.ratio<1?20:I.getVerticalLength(20),be=document.createElementNS("http://www.w3.org/2000/svg","svg");be.setAttribute("xmlns","http://www.w3.org/2000/svg"),be.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(be);var Xe=it.createDefs();be.appendChild(Xe);var gt=it.createElement("clipPath",[["id","text-bg-clip"]]);Xe.appendChild(gt);var It=it.createPath(it.getHollowRectanglePath((24-Z)/2,(24-U)/2,Z,U,(24-Z)/2+2,(24-U)/2+2,Z-4,U-4));be.appendChild(It);var qe=it.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);qe.appendChild(it.createTSpan(u+":"+p)),be.appendChild(qe);var jt=qe.getBBox();it.setAttributes(qe,[["x",((24-jt.width)/2).toString()],["y",((24-jt.height)/2-jt.y).toString()]]);var Cr=it.createPath(it.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(jt.width))/2,(24-Math.ceil(jt.height))/2,Math.ceil(jt.width),Math.ceil(jt.height)));return gt.appendChild(Cr),it.setAttributes(It,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(be),be.outerHTML}return''},j}(),ln=function(j){function u(p,I,Z){var U=j.call(this,p,I)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=Z,U}return nr(u,j),u.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(I){I.className=p.className,I.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(I.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}(br),ir=function(){function j(u,p){this.GRIP_SIZE=10,this.color=u,this.fillColor=p,this.visual=it.createGroup(),this.visual.appendChild(it.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(it.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},j.prototype.setCenter=function(u,p){this.visual.childNodes.forEach(function(I){return it.setAttributes(I,[["cx",u.toString()],["cy",p.toString()]])})},j}(),Un=function(){function j(u,p,I,Z){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=u,this.canvasHeight=p,this.margin=I,this.container=Z,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(j.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(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.gridContainer&&it.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(u){this._zoomFactor=u,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),j.prototype.open=function(){var u=this;this.cropShadeElement=it.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=it.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;pthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),it.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var I=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,be){var Xe=p.y+I*(be+1);it.setAttributes(U,[["x1",""+p.x],["y1",""+Xe],["x2",""+(p.x+p.width)],["y2",""+Xe]])});var Z=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,be){var Xe=p.x+Z*(be+1);it.setAttributes(U,[["x1",""+Xe],["y1",""+p.y],["x2",""+Xe],["y2",""+(p.y+p.height)]])}),it.setAttributes(this.cropShadeElement,[["d",it.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},j.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)},j.prototype.clientToLocalCoordinates=function(u,p){var I=this.container.getBoundingClientRect();return{x:u-I.left+this.margin,y:p-I.top+this.margin}},j.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)},j.prototype.onPointerMove=function(u){if(this.isMoving)this.move(this.clientToLocalCoordinates(u.clientX,u.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(u.clientX,u.clientY);this.resize(p)}u.preventDefault()},j.prototype.onPointerUp=function(u){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(u.pointerId)},j.prototype.move=function(u){var p=u.x-this.previousPoint.x,I=u.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,I=-I/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+I),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=u},j.prototype.resize=function(u){var p=Object.assign({},this.cropRect),I=u.x-this.previousPoint.x,Z=u.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+Ithis.canvasWidth*this.zoomFactor&&(I=this.canvasWidth*this.zoomFactor-p.width),p.width+=I}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(I),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=Z,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=Z}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=u,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},j.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,p=this.cropRect.y+this.cropRect.height/2,I=this.aspectRatio.getHorizontalLength(this.cropRect.height),Z=this.aspectRatio.getVerticalLength(this.cropRect.width);I/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=p-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)}},j.prototype.getRescaledRect=function(u,p,I,Z,U,be){var Xe=I/u,gt=Z/p;return{x:(U.x-be)*Xe+be,y:(U.y-be)*gt+be,width:U.width*Xe,height:U.height*gt}},j.prototype.scaleCanvas=function(u,p){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,u,p,this.cropRect,this.margin);this.canvasWidth=u,this.canvasHeight=p,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},j}(),Kn=function(){function j(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(j.prototype,"angle",{get:function(){return this._angle},set:function(u){this._angle=u,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),j.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},j.prototype.onPointerDown=function(u){this.controlContainer.setPointerCapture(u.pointerId),this.isDragging=!0,this.previousPoint={x:u.clientX,y:u.clientY}},j.prototype.onPointerMove=function(u){this.isDragging&&(this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.previousPoint.x=u.clientX)},j.prototype.onPointerUp=function(u){this.isDragging&&this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(u.pointerId)},j.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var u=this.angleLabelText.getBBox();it.setAttributes(this.angleLabelElement,[["x",((this.width-u.width)/2).toString()],["y",(this.height/2).toString()]])}},j.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)}},j.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 p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,I=1;I<=this.width/5+10;I++){var Z=I%5==0?this.height/3:this.height/6;p+="h4v"+-Z+"h1v"+Z}p+="v1H0Z",this.scaleShape=it.createPath(p);var U=it.createTransform();this.scaleShape.transform.baseVal.appendItem(U),u.appendChild(this.scaleShape),this.angleLabelElement=it.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=it.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var be=it.createTSpan("");return be.innerHTML="°",this.angleLabelElement.appendChild(be),u.appendChild(this.angleLabelElement),document.body.removeChild(u),u},j}(),ai=function(){function j(){this.naturalSize=!1,this.imageType="image/png"}return j.prototype.rasterize=function(u,p,I,Z,U,be,Xe){var gt=this;return new Promise(function(It){var qe=document.createElement("canvas");qe.width=u.width.baseVal.value-2*Z,qe.height=u.height.baseVal.value-2*Z;var jt=1,Cr=1;gt.naturalSize===!0?(jt=p.naturalWidth/(u.width.baseVal.value-2*Z)/be,Cr=p.naturalHeight/(u.height.baseVal.value-2*Z)/Xe,qe.width=p.naturalWidth/be,qe.height=p.naturalHeight/Xe):gt.width!==void 0&>.height!==void 0&&(jt=gt.width/I.width,Cr=gt.height/I.height,qe.width*=jt,qe.height*=Cr);var Nr=qe.getContext("2d");Nr.translate(qe.width/2,qe.height/2),Nr.rotate(U*Math.PI/180),Nr.scale(be,Xe),Nr.translate(-qe.width/2,-qe.height/2),Nr.drawImage(p,0,0,qe.width,qe.height);var Rn=document.createElement("canvas");Rn.width=I.width*jt,Rn.height=I.height*Cr,Rn.getContext("2d").putImageData(Nr.getImageData((I.x-Z)*jt,(I.y-Z)*Cr,I.width*jt,I.height*Cr),0,0),It(Rn.toDataURL(gt.imageType,gt.imageQuality))})},j}(),rt=function(){function j(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=j.instanceCounter++,this.styles=new lr(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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(u){this._zoomToCropEnabled=u,u?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(j.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(j.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(j.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(j.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.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}),j.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},j.prototype.show=function(){this.showUI(),this.open()},j.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(p){return p()}),this._isOpen=!1)},j.prototype.addRenderEventListener=function(u){this.renderEventListeners.push(u)},j.prototype.removeRenderEventListener=function(u){this.renderEventListeners.indexOf(u)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(u),1)},j.prototype.addCloseEventListener=function(u){this.closeEventListeners.push(u)},j.prototype.removeCloseEventListener=function(u){this.closeEventListeners.indexOf(u)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(u),1)},j.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))},j.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var u=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/u>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*u:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,I=p+2*this.CANVAS_MARGINu+this.CANVAS_MARGIN?this.target.offsetTop-(u+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"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},j.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},j.prototype.addTopToolbar=function(){var u=this;this.topToolbar=new Lr,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 p=new pn;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var I=[];this.aspectRatios.forEach(function(Cr){var Nr=new br(Zn.getIcon(Cr.horizontal,Cr.vertical),Cr.horizontal===0&&Cr.vertical===0?"FREE":Cr.horizontal+":"+Cr.vertical);Nr.onClick=function(){return u.ratioButtonClicked(Cr)},I.push(Nr)}),this.aspectRatioButton=new ln(Zn.getIcon(0,0),"Aspect ratio",I),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Z=new br('',"Toggle grid");Z.isActive=this.isGridVisible,Z.onClick=function(){u.isGridVisible=!u.isGridVisible,Z.isActive=u.isGridVisible},p.addButton(Z);var U=new br('',"Zoom to selection");if(U.isActive=this.zoomToCropEnabled,U.onClick=function(){u.zoomToCropEnabled=!u.zoomToCropEnabled,U.isActive=u.zoomToCropEnabled},p.addButton(U),!$t.isLicensed){var be=new Lt;this.topToolbar.addElementBlock(be);var Xe=document.createElement("div");Xe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var gt=document.createElement("a");gt.style.color="currentColor",gt.href="https://markerjs.com/products/cropro",gt.target="_blank",gt.innerHTML='',Xe.appendChild(gt),be.addElement(Xe)}var It=new pn;It.minWidth=3*this.toolbarHeight+"px",It.contentAlign="end",this.topToolbar.addButtonBlock(It);var qe=new br('',"OK");qe.onClick=this.startRenderAndClose,It.addButton(qe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(qe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var jt=new br('',"Close");jt.onClick=this.close,It.addButton(jt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(jt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},j.prototype.addBottomToolbar=function(){var u=this;this.bottomToolbar=new Lr,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 p=new pn;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var I=new br('',"Rotate left");I.onClick=this.rotateLeftButtonClicked,p.addButton(I);var Z=new br('',"Rotate right");Z.onClick=this.rotateRightButtonClicked,p.addButton(Z);var U=new Lt;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new Kn("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(It){u.rotateBy(It),u.straightener.angle=u.rotationAngle},U.addElement(this.straightener.getUI());var be=new pn;be.minWidth=2*this.toolbarHeight+"px",be.contentAlign="end",this.bottomToolbar.addButtonBlock(be);var Xe=new br('',"Flip horizontal");Xe.onClick=this.flipHorizontallyButtonClicked,be.addButton(Xe);var gt=new br('',"Flip vertical");gt.onClick=this.flipVerticallyButtonClicked,be.addButton(gt)},j.prototype.ratioButtonClicked=function(u){this.aspectRatio=u,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},j.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Zn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},j.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},j.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},j.prototype.restoreState=function(u){if(u){var p=this.cropLayer.getRescaledRect(u.width,u.height,this.imageWidth,this.imageHeight,u.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=u.flippedHorizontally,this.flippedVertically=u.flippedVertically,this.applyFlip(),this.rotationAngle=u.rotationAngle,this.applyRotation()}},j.prototype.clientToLocalCoordinates=function(u,p){var I=this.cropImage.getBoundingClientRect();return{x:u-I.left,y:p-I.top}},j.prototype.onWindowResize=function(){this.positionUI()},j.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()},j.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)},j.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)},j.prototype.rotateTo=function(u){u=(u=u>180?u-360:u)<=-180?u+360:u,this.rotationAngle=u,this.applyRotation()},j.prototype.rotateBy=function(u){this.rotateTo((this.rotationAngle+u)%360)},j.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 p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var I=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/I.width,this.imageHeight/I.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=u},j.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},j.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},j.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},j.prototype.startRenderAndClose=function(){return Ot(this,void 0,void 0,function(){var u,p;return xr(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return u=I.sent(),p=this.getState(),this.renderEventListeners.forEach(function(Z){return Z(u,p)}),this.close(!0),[2]}})})},j.prototype.render=function(){return Ot(this,void 0,void 0,function(){var u;return xr(this,function(p){switch(p.label){case 0:return(u=new ai).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.width=this.renderWidth,u.height=this.renderHeight,this.unzoomFromCrop(),it.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 p.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,p.sent()]}})})},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new yr("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 yr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new yr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var u=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new yr("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 yr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new yr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new yr("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 yr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new yr("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 yr("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 yr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},j.instanceCounter=0,j}(),Wt=Q("8hTe"),zn=Q.n(Wt),ci=/]*>/g;function bi(j){var u=document.createElement("div");return u.innerHTML=j,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var oi=Fe.a=function(j){var u=j.value,p=u===void 0?"":u,I=j.edit,Z=I===void 0?!1:I,U=j.className,be=j.showTextOnly,Xe=j.showLines,gt=j.replaces,It=j.zoomImg,qe=j.hasMask,jt=j.style,Cr=jt===void 0?{}:jt,Nr=j.stylesPrev,Rn=Nr===void 0?{}:Nr,bn=String(p),mn=Object(L.useRef)(),qn=Object(L.useRef)(),Rr=Object(L.useState)(""),Ft=Object(H.a)(Rr,2),Vt=Ft[0],er=Ft[1],wr=Object(L.useState)("office"),tr=Object(H.a)(wr,2),si=tr[0],nn=tr[1],Oi=function(){var Mr=new rt(qn.current);Mr.displayMode="popup",Mr.addRenderEventListener(function(){var an=Object(P.a)(_.a.mark(function cr(on){var Br;return _.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return mn.current.style.display="none",En.next=3,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on}});case 3:Br=En.sent,Br!=null&&Br.id&>(qn.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(Br==null?void 0:Br.id,"?type=").concat(Br.content_type));case 5:case"end":return En.stop()}},cr)}));return function(cr){return an.apply(this,arguments)}}()),Mr.show()},Fi=function(){var Mr=new Ut(qn.current);Mr.settings.displayMode="popup",Mr.addEventListener("render",function(){var an=Object(P.a)(_.a.mark(function cr(on){var Br;return _.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(mn.current.style.display="none",!qn.current){En.next=6;break}return En.next=4,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on.dataUrl}});case 4:Br=En.sent,Br!=null&&Br.id&>(qn.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(Br==null?void 0:Br.id,"?type=").concat(Br.content_type));case 6:case"end":return En.stop()}},cr)}));return function(cr){return an.apply(this,arguments)}}()),Mr.show(),window.markerArea=Mr},Pn=Object(L.useMemo)(function(){mn.current&&(mn.current.style.zIndex=-1);try{var $r=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Mr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,an=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;bn=bn.replace($r,"("+le.a.API_SERVER+"/api/attachments/").replace(Mr,'"'+le.a.API_SERVER+"/api/attachments/").replace(an,'"'+le.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(fi){}var cr=te(bn),on=S();if(bn.match(/\[TOC\]/)&&(cr=cr.replace("[TOC]
",R()),v()),cr=cr.replace(/(__special_katext_id_\d+__)/g,function(fi,En){var Mn=on[En],Xi=Mn.type,Ri=Mn.expression;return Object(Ee.renderToString)(bi(Ri)||"",{displayMode:Xi==="block",throwOnError:!1,output:"html"})}),cr=cr.replace(/▁/g,"\u2581\u2581\u2581"),b(),be){var Br=document.createElement("div");return Br.innerHTML=cr,Br.innerText}return setTimeout(function(){return Ei()},500),cr},[bn]),qr=Object(L.useRef)();c.WebkitLineClamp=Xe,Xe&&(Cr=Object(D.a)(Object(D.a)({},Cr),c));function un($r){var Mr=$r.target;if(Mr.tagName.toUpperCase()==="IMG"){if(It){var an=Mr.getAttribute("src");er(an),nn("image")}}else if(Mr.tagName.toUpperCase()==="A"){var cr=Mr.getAttribute("href");if(cr.indexOf("office")>-1)$r.preventDefault(),er(cr),nn("office");else if(cr.indexOf("application/pdf")>-1)$r.preventDefault(),er(cr),nn("pdf");else if(cr.indexOf("text/html")>-1)$r.preventDefault(),er(cr),nn("html");else if(cr.startsWith("#")){$r.preventDefault();var on=document.getElementById(cr.replace("#",""));on&&on.scrollIntoView(!0)}}}var Ei=function(){var Mr,an=(Mr=qr.current)===null||Mr===void 0?void 0:Mr.querySelectorAll("video");an==null||an.forEach(function(cr){if(cr.oncontextmenu=function(){return!1},cr.src.indexOf(".m3u8")>-1&&!cr.canPlayType("application/vnd.apple.mpegurl")){if(re.a.isSupported()){var on=new re.a;on.loadSource(cr.src),on.attachMedia(cr)}}})};Object(L.useEffect)(function(){if(qr.current&&Pn&&(Pn.match(ci)&&window.PR.prettyPrint()),qr.current)return qr.current.addEventListener("click",un),function(){qr.current.removeEventListener("click",un),b(),v()}},[Pn,qr.current,un]);var hi=function(Mr){if(!Z)return;Mr.target.nodeName==="IMG"?(mn.current.style.zIndex=1,mn.current.style.display="flex",mn.current.style.width=Mr.target.clientWidth+"px",mn.current.style.height=Mr.target.clientHeight+"px",mn.current.style.top=Mr.target.offsetTop+"px",mn.current.style.left=Mr.target.offsetLeft+"px",qn.current.src=Mr.target.getAttribute("src")):mn.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:qr,style:Object(D.a)({},Cr),className:"".concat(U||""," markdown-body ").concat(zn.a.mdBody),onMouseOver:hi,dangerouslySetInnerHTML:{__html:Pn}}),y.a.createElement("div",{ref:mn,className:zn.a.button},y.a.createElement(X.a,null,y.a.createElement(K.a,{onClick:function(){return Oi()}},"\u88C1\u526A"),y.a.createElement(K.a,{onClick:function(){return Fi()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:qn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(Oe.a,{close:!0,data:Vt,type:Vt!=null&&Vt.length?si:"",style:Object(D.a)({},Rn),onClose:function(){return er("")}}))}},"9VGf":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return M});var ae=Q("q1tI"),X=Q.n(ae);function M(K,D){var P=Object(ae.useRef)();Object(ae.useEffect)(function(){P.current=K}),Object(ae.useEffect)(function(){function H(){P.current()}if(D!==null){var W=setInterval(H,D);return function(){return clearInterval(W)}}},[D])}},"9ZNV":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return L});var ae=Q("0Owb"),X=Q("+L6B"),M=Q("2/Rp"),K=Q("q1tI"),D=Q.n(K),P=Q("UUDw"),H=Q.n(P),W=Q("TSYQ"),_=Q.n(W),L=function(C){var k=C.cancelText,O=k===void 0?"\u53D6\u6D88":k,A=C.okText,x=A===void 0?"\u786E\u5B9A":A,d=C.loading,a=d===void 0?!1:d,l=C.hasOkBtn,s=l===void 0?!0:l,v=C.okButtonProps,c=v===void 0?{}:v,m=C.onCancel,R=m===void 0?function(){}:m,E=C.onOk,f=E===void 0?function(){}:E,g=C.className,h=g===void 0?"":g;return D.a.createElement("div",{className:_()(H.a.buttonFixed,h)},D.a.createElement("div",{className:H.a.buttonWrap},D.a.createElement(M.a,{size:"large",className:"".concat(H.a.button," mr20"),onClick:R},O),s&&D.a.createElement(M.a,Object(ae.a)({size:"large",type:"primary",className:"".concat(H.a.button," mr20"),loading:a,onClick:f},c),x)))}},"A/g1":function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAAN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CWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"),Q("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(_,L,y){if(y!=ae.Init&&y&&_.removeKeyMap("autoCloseTags"),!L)return;var C={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(C["'/'"]=function(k){return P(k)}),(typeof L!="object"||L.whenOpening!==!1)&&(C["'>'"]=function(k){return K(k)}),_.addKeyMap(C)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 K(_){if(_.getOption("disableInput"))return ae.Pass;for(var L=_.listSelections(),y=[],C=_.getOption("autoCloseTags"),k=0;kO.ch&&(l=l.slice(0,l.length-A.end+O.ch));var m=l.toLowerCase();if(!l||A.type=="string"&&(A.end!=O.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&a.close||A.string.indexOf("/")==O.ch-A.start-1||v&&H(v,m)>-1||W(_,x.mode.xmlCurrentContext&&x.mode.xmlCurrentContext(d)||[],l,O,!0))return ae.Pass;var R=typeof C=="object"&&C.emptyTags;if(R&&H(R,l)>-1){y[k]={text:"/>",newPos:ae.Pos(O.line,O.ch+2)};continue}var E=c&&H(c,m)>-1;y[k]={indent:E,text:">"+(E?`
`:"")+""+l+">",newPos:E?ae.Pos(O.line+1,0):ae.Pos(O.line,O.ch+1)}}for(var f=typeof C=="object"&&C.dontIndentOnAutoClose,k=L.length-1;k>=0;k--){var g=y[k];_.replaceRange(g.text,L[k].head,L[k].anchor,"+insert");var h=_.listSelections().slice(0);h[k]={head:g.newPos,anchor:g.newPos},_.setSelections(h),!f&&g.indent&&(_.indentLine(g.newPos.line,null,!0),_.indentLine(g.newPos.line+1,null,!0))}}function D(_,L){for(var y=_.listSelections(),C=[],k=L?"/":"",O=_.getOption("autoCloseTags"),A=typeof O=="object"&&O.dontIndentOnSlash,x=0;x"&&(v+=">"),C[x]=v}if(_.replaceSelections(C),y=_.listSelections(),!A)for(var x=0;x=0&&L[d]==y;d--)++x;C=A.to;for(var d=1;d0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],y=0;ySe.length)&&(me=Se.length);for(var ve=0,ne=new Array(me);ve=Se.length?{done:!0}:{done:!1,value:Se[ne++]}}}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 ve=Se[Symbol.iterator](),ve.next.bind(ve)}function P(Se,me){return me={exports:{}},Se(me,me.exports),me.exports}var H=P(function(Se){function me(){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 ve(ne){Se.exports.defaults=ne}Se.exports={defaults:me(),getDefaults:me,changeDefaults:ve}}),W=H.defaults,_=H.getDefaults,L=H.changeDefaults,y=/[&<>"']/,C=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},x=function(me){return A[me]};function d(Se,me){if(me){if(y.test(Se))return Se.replace(C,x)}else if(k.test(Se))return Se.replace(O,x);return Se}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Se){return Se.replace(a,function(me,ve){return ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""})}var s=/(^|[^\[])\^/g;function v(Se,me){Se=Se.source||Se,me=me||"";var ve={replace:function(ie,de){return de=de.source||de,de=de.replace(s,"$1"),Se=Se.replace(ie,de),ve},getRegex:function(){return new RegExp(Se,me)}};return ve}var c=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Se,me,ve){if(Se){var ne;try{ne=decodeURIComponent(l(ve)).replace(c,"").toLowerCase()}catch(ie){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}me&&!m.test(ve)&&(ve=o(me,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(ie){return null}return ve}var E={},f=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(Se,me){E[" "+Se]||(f.test(Se)?E[" "+Se]=Se+"/":E[" "+Se]=N(Se,"/",!0)),Se=E[" "+Se];var ve=Se.indexOf(":")===-1;return me.substring(0,2)==="//"?ve?me:Se.replace(g,"$1")+me:me.charAt(0)==="/"?ve?me:Se.replace(h,"$1")+me:Se+me}var S={exec:function(){}};function b(Se){for(var me=1,ve,ne;me=0&&xe[je]==="\\";)Le=!Le;return Le?"|":" |"}),ne=ve.split(/ \|/),ie=0;if(ne.length>me)ne.splice(me);else for(;ne.length=ne.length?ie.slice(ne.length):ie}).join(`
`)}var Pe=function(){function Se(ve){this.options=ve||G}var me=Se.prototype;return me.space=function(ne){var ie=this.rules.block.newline.exec(ne);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},me.code=function(ne,ie){var de=this.rules.block.code.exec(ne);if(de){var pe=ie[ie.length-1];if(pe&&pe.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var xe=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:F(xe,`
`)}}},me.fences=function(ne){var ie=this.rules.block.fences.exec(ne);if(ie){var de=ie[0],pe=Ye(de,ie[3]||"");return{type:"code",raw:de,lang:ie[2]?ie[2].trim():ie[2],text:pe}}},me.heading=function(ne){var ie=this.rules.block.heading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},me.nptable=function(ne){var ie=this.rules.block.nptable.exec(ne);if(ie){var de={type:"table",header:re(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(de.header.length===de.align.length){var pe=de.align.length,xe;for(xe=0;xe ?/gm,"");return{type:"blockquote",raw:ie[0],text:de}}},me.list=function(ne){var ie=this.rules.block.list.exec(ne);if(ie){for(var de=ie[0],pe=ie[2],xe=pe.length>1,Le=pe[pe.length-1]===")",je={type:"list",raw:de,ordered:xe,start:xe?+pe.slice(0,-1):"",loose:!1,items:[]},mt=ie[0].match(this.rules.block.item),Mt=!1,Rt,Kt,_t,ot,Jt,Ut,Zt,nr=mt.length,Ot=0;Ot1||this.options.smartLists&&_t!==pe)&&(ot=mt.slice(Ot+1).join(`
`),je.raw=je.raw.substring(0,je.raw.length-ot.length),Ot=nr-1)),Jt=Mt||/\n\n(?!\s*$)/.test(Rt),Ot!==nr-1&&(Mt=Rt.charAt(Rt.length-1)===`
`,Jt||(Jt=Mt)),Jt&&(je.loose=!0),Ut=/^\[[ xX]\] /.test(Rt),Zt=void 0,Ut&&(Zt=Rt[1]!==" ",Rt=Rt.replace(/^\[[ xX]\] +/,"")),je.items.push({type:"list_item",raw:de,task:Ut,checked:Zt,loose:Jt,text:Rt});return je}},me.html=function(ne){var ie=this.rules.block.html.exec(ne);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):le(ie[0]):ie[0]}},me.def=function(ne){var ie=this.rules.block.def.exec(ne);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var de=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:ie[0],href:ie[2],title:ie[3]}}},me.table=function(ne){var ie=this.rules.block.table.exec(ne);if(ie){var de={type:"table",header:re(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=ie[0];var pe=de.align.length,xe;for(xe=0;xe/i.test(pe[0])&&(ie=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:ie,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):le(pe[0]):pe[0]}},me.link=function(ne){var ie=this.rules.inline.link.exec(ne);if(ie){var de=Ee(ie[2],"()");if(de>-1){var pe=ie[0].indexOf("!")===0?5:4,xe=pe+ie[1].length+de;ie[2]=ie[2].substring(0,de),ie[0]=ie[0].substring(0,xe).trim(),ie[3]=""}var Le=ie[2],je="";if(this.options.pedantic){var mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);mt?(Le=mt[1],je=mt[3]):je=""}else je=ie[3]?ie[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var Mt=Oe(ie,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},ie[0]);return Mt}},me.reflink=function(ne,ie){var de;if((de=this.rules.inline.reflink.exec(ne))||(de=this.rules.inline.nolink.exec(ne))){var pe=(de[2]||de[1]).replace(/\s+/g," ");if(pe=ie[pe.toLowerCase()],!pe||!pe.href){var xe=de[0].charAt(0);return{type:"text",raw:xe,text:xe}}var Le=Oe(de,pe,de[0]);return Le}},me.strong=function(ne,ie,de){de===void 0&&(de="");var pe=this.rules.inline.strong.start.exec(ne);if(pe&&(!pe[1]||pe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ie=ie.slice(-1*ne.length);var xe=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var Le;(pe=xe.exec(ie))!=null;)if(Le=this.rules.inline.strong.middle.exec(ie.slice(0,pe.index+3)),Le)return{type:"strong",raw:ne.slice(0,Le[0].length),text:ne.slice(2,Le[0].length-2)}}},me.em=function(ne,ie,de){de===void 0&&(de="");var pe=this.rules.inline.em.start.exec(ne);if(pe&&(!pe[1]||pe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ie=ie.slice(-1*ne.length);var xe=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var Le;(pe=xe.exec(ie))!=null;)if(Le=this.rules.inline.em.middle.exec(ie.slice(0,pe.index+2)),Le)return{type:"em",raw:ne.slice(0,Le[0].length),text:ne.slice(1,Le[0].length-1)}}},me.codespan=function(ne){var ie=this.rules.inline.code.exec(ne);if(ie){var de=ie[2].replace(/\n/g," "),pe=/[^ ]/.test(de),xe=de.startsWith(" ")&&de.endsWith(" ");return pe&&xe&&(de=de.substring(1,de.length-1)),de=le(de,!0),{type:"codespan",raw:ie[0],text:de}}},me.br=function(ne){var ie=this.rules.inline.br.exec(ne);if(ie)return{type:"br",raw:ie[0]}},me.del=function(ne){var ie=this.rules.inline.del.exec(ne);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},me.autolink=function(ne,ie){var de=this.rules.inline.autolink.exec(ne);if(de){var pe,xe;return de[2]==="@"?(pe=le(this.options.mangle?ie(de[1]):de[1]),xe="mailto:"+pe):(pe=le(de[1]),xe=pe),{type:"link",raw:de[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},me.url=function(ne,ie){var de;if(de=this.rules.inline.url.exec(ne)){var pe,xe;if(de[2]==="@")pe=le(this.options.mangle?ie(de[0]):de[0]),xe="mailto:"+pe;else{var Le;do Le=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Le!==de[0]);pe=le(de[0]),de[1]==="www."?xe="http://"+pe:xe=pe}return{type:"link",raw:de[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},me.inlineText=function(ne,ie,de){var pe=this.rules.inline.text.exec(ne);if(pe){var xe;return ie?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):le(pe[0]):pe[0]:xe=le(this.options.smartypants?de(pe[0]):pe[0]),{type:"text",raw:pe[0],text:xe}}},Se}(),Be=te.noopTest,Ue=te.edit,Ne=te.merge,Te={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:Be,table:Be,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Te.def=Ue(Te.def).replace("label",Te._label).replace("title",Te._title).getRegex(),Te.bullet=/(?:[*+-]|\d{1,9}[.)])/,Te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Te.item=Ue(Te.item,"gm").replace(/bull/g,Te.bullet).getRegex(),Te.list=Ue(Te.list).replace(/bull/g,Te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Te.def.source+")").getRegex(),Te._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",Te._comment=//,Te.html=Ue(Te.html,"i").replace("comment",Te._comment).replace("tag",Te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Te.paragraph=Ue(Te._paragraph).replace("hr",Te.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",Te._tag).getRegex(),Te.blockquote=Ue(Te.blockquote).replace("paragraph",Te.paragraph).getRegex(),Te.normal=Ne({},Te),Te.gfm=Ne({},Te.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*|$)"}),Te.gfm.nptable=Ue(Te.gfm.nptable).replace("hr",Te.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",Te._tag).getRegex(),Te.gfm.table=Ue(Te.gfm.table).replace("hr",Te.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",Te._tag).getRegex(),Te.pedantic=Ne({},Te.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Te._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:Be,paragraph:Ue(Te.normal._paragraph).replace("hr",Te.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Be,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:Be,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=Ue(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Ue(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Ue(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Ue(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Ue(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Ue(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Ue(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Ue(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Ue(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Ue(se._blockSkip,"g").getRegex(),se.overlapSkip=Ue(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=Ue(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=Ue(se.tag).replace("comment",Te._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Ue(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Ue(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Ue(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Ne({},se),se.pedantic=Ne({},se.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:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Ne({},se.normal,{escape:Ue(se.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&&(ne="x"+ne.toString(16)),me+=""+ne+";";return me}var Ke=function(){function Se(ve){this.tokens=[],this.tokens.links=Object.create(null),this.options=ve||xt,this.options.tokenizer=this.options.tokenizer||new Pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:ct.normal,inline:ft.normal};this.options.pedantic?(ne.block=ct.pedantic,ne.inline=ft.pedantic):this.options.gfm&&(ne.block=ct.gfm,this.options.breaks?ne.inline=ft.breaks:ne.inline=ft.gfm),this.tokenizer.rules=ne}Se.lex=function(ne,ie){var de=new Se(ie);return de.lex(ne)};var me=Se.prototype;return me.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ne,ie,de){ie===void 0&&(ie=[]),de===void 0&&(de=!0),ne=ne.replace(/^ +$/gm,"");for(var pe,xe,Le,je;ne;){if(pe=this.tokenizer.space(ne)){ne=ne.substring(pe.raw.length),pe.type&&ie.push(pe);continue}if(pe=this.tokenizer.code(ne,ie)){ne=ne.substring(pe.raw.length),pe.type?ie.push(pe):(je=ie[ie.length-1],je.raw+=`
`+pe.raw,je.text+=`
`+pe.text);continue}if(pe=this.tokenizer.fences(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.heading(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.nptable(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.hr(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.blockquote(ne)){ne=ne.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],de),ie.push(pe);continue}if(pe=this.tokenizer.list(ne)){for(ne=ne.substring(pe.raw.length),Le=pe.items.length,xe=0;xe0)for(;(mt=this.tokenizer.rules.inline.reflinkSearch.exec(je))!=null;)Mt.includes(mt[0].slice(mt[0].lastIndexOf("[")+1,-1))&&(je=je.slice(0,mt.index)+"["+"a".repeat(mt[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(mt=this.tokenizer.rules.inline.blockSkip.exec(je))!=null;)je=je.slice(0,mt.index)+"["+"a".repeat(mt[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Le=this.tokenizer.escape(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.tag(ne,de,pe)){ne=ne.substring(Le.raw.length),de=Le.inLink,pe=Le.inRawBlock,ie.push(Le);continue}if(Le=this.tokenizer.link(ne)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,pe)),ie.push(Le);continue}if(Le=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,pe)),ie.push(Le);continue}if(Le=this.tokenizer.strong(ne,je,xe)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],de,pe),ie.push(Le);continue}if(Le=this.tokenizer.em(ne,je,xe)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],de,pe),ie.push(Le);continue}if(Le=this.tokenizer.codespan(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.br(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.del(ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],de,pe),ie.push(Le);continue}if(Le=this.tokenizer.autolink(ne,He)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(!de&&(Le=this.tokenizer.url(ne,He))){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.inlineText(ne,pe,Ct)){ne=ne.substring(Le.raw.length),xe=Le.raw.slice(-1),ie.push(Le);continue}if(ne){var Rt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(Rt);break}else throw new Error(Rt)}}return ie},X(Se,null,[{key:"rules",get:function(){return{block:ct,inline:ft}}}]),Se}(),ut=H.defaults,vt=te.cleanUrl,ht=te.escape,et=function(){function Se(ve){this.options=ve||ut}var me=Se.prototype;return me.code=function(ne,ie,de){var pe=(ie||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(ne,pe);xe!=null&&xe!==ne&&(de=!0,ne=xe)}return pe?''+(de?ne:ht(ne,!0))+`
`:""+(de?ne:ht(ne,!0))+`
`},me.blockquote=function(ne){return`
`+ne+`
`},me.html=function(ne){return ne},me.heading=function(ne,ie,de,pe){return this.options.headerIds?"
`:""+ne+"
`},me.hr=function(){return this.options.xhtml?`
`:`
`},me.list=function(ne,ie,de){var pe=ie?"ol":"ul",xe=ie&&de!==1?' start="'+de+'"':"";return"<"+pe+xe+`>
`+ne+""+pe+`>
`},me.listitem=function(ne){return""+ne+`
`},me.checkbox=function(ne){return" "},me.paragraph=function(ne){return""+ne+`
`},me.table=function(ne,ie){return ie&&(ie=""+ie+""),`
`},me.tablerow=function(ne){return`
`+ne+`
`},me.tablecell=function(ne,ie){var de=ie.header?"th":"td",pe=ie.align?"<"+de+' align="'+ie.align+'">':"<"+de+">";return pe+ne+""+de+`>
`},me.strong=function(ne){return""+ne+""},me.em=function(ne){return""+ne+""},me.codespan=function(ne){return""+ne+""},me.br=function(){return this.options.xhtml?"
":"
"},me.del=function(ne){return""+ne+""},me.link=function(ne,ie,de){if(ne=vt(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var pe='"+de+"",pe},me.image=function(ne,ie,de){if(ne=vt(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var pe='
":">",pe},me.text=function(ne){return ne},Se}(),Ze=function(){function Se(){}var me=Se.prototype;return me.strong=function(ne){return ne},me.em=function(ne){return ne},me.codespan=function(ne){return ne},me.del=function(ne){return ne},me.html=function(ne){return ne},me.text=function(ne){return ne},me.link=function(ne,ie,de){return""+de},me.image=function(ne,ie,de){return""+de},me.br=function(){return""},Se}(),Tt=function(){function Se(){this.seen={}}var me=Se.prototype;return me.slug=function(ne){var ie=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var de=ie;do this.seen[de]++,ie=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},Se}(),bt=H.defaults,St=te.unescape,lt=function(){function Se(ve){this.options=ve||bt,this.options.renderer=this.options.renderer||new et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new Tt}Se.parse=function(ne,ie){var de=new Se(ie);return de.parse(ne)};var me=Se.prototype;return me.parse=function(ne,ie){ie===void 0&&(ie=!0);var de="",pe,xe,Le,je,mt,Mt,Rt,Kt,_t,ot,Jt,Ut,Zt,nr,Ot,xr,$t,it,lr=ne.length;for(pe=0;pe0&&Ot.tokens[0].type==="text"?(Ot.tokens[0].text=it+" "+Ot.tokens[0].text,Ot.tokens[0].tokens&&Ot.tokens[0].tokens.length>0&&Ot.tokens[0].tokens[0].type==="text"&&(Ot.tokens[0].tokens[0].text=it+" "+Ot.tokens[0].tokens[0].text)):Ot.tokens.unshift({type:"text",text:it}):nr+=it),nr+=this.parse(Ot.tokens,Zt),_t+=this.renderer.listitem(nr,$t,xr);de+=this.renderer.list(_t,Jt,Ut);continue}case"html":{de+=this.renderer.html(ot.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(_t=ot.tokens?this.parseInline(ot.tokens):ot.text;pe+1An error occurred:
"+Qe(Le.message+"",!0)+"
";throw Le}}_e.options=_e.setOptions=function(Se){return yt(_e.defaults,Se),Et(_e.defaults),_e},_e.getDefaults=Ie,_e.defaults=$e,_e.use=function(Se){var me=yt({},Se);if(Se.renderer&&function(){var ne=_e.defaults.renderer||new et,ie=function(xe){var Le=ne[xe];ne[xe]=function(){for(var je=arguments.length,mt=new Array(je),Mt=0;Mt`,triples:"",explode:"[]{}"},M=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(A,x,d){d&&d!=ae.Init&&(A.removeKeyMap(D),A.state.closeBrackets=null),x&&(P(K(x,"pairs")),A.state.closeBrackets=x,A.addKeyMap(D))});function K(A,x){return x=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[x]!=null?A[x]:X[x]}var D={Backspace:_,Enter:L};function P(A){for(var x=0;x=0;l--){var v=a[l].head;A.replaceRange("",M(v.line,v.ch-1),M(v.line,v.ch+1),"+delete")}}function L(A){var x=W(A),d=x&&K(x,"explode");if(!d||A.getOption("disableInput"))return ae.Pass;for(var a=A.listSelections(),l=0;l0;return{anchor:new M(A.anchor.line,A.anchor.ch+(x?-1:1)),head:new M(A.head.line,A.head.ch+(x?1:-1))}}function C(A,x){var d=W(A);if(!d||A.getOption("disableInput"))return ae.Pass;var a=K(d,"pairs"),l=a.indexOf(x);if(l==-1)return ae.Pass;for(var s=K(d,"closeBefore"),v=K(d,"triples"),c=a.charAt(l+1)==x,m=A.listSelections(),R=l%2==0,E,f=0;f=0&&A.getRange(h,M(h.line,h.ch+3))==x+x+x?o="skipThree":o="skip";else if(c&&h.ch>1&&v.indexOf(x)>=0&&A.getRange(M(h.line,h.ch-2),h)==x+x){if(h.ch>2&&/\bstring/.test(A.getTokenTypeAt(M(h.line,h.ch-2))))return ae.Pass;o="addFour"}else if(c){var b=h.ch==0?" ":A.getRange(M(h.line,h.ch-1),h);if(!ae.isWordChar(S)&&b!=x&&!ae.isWordChar(b))o="both";else return ae.Pass}else if(R&&(S.length===0||/\s/.test(S)||s.indexOf(S)>-1))o="both";else return ae.Pass;if(!E)E=o;else if(E!=o)return ae.Pass}var T=l%2?a.charAt(l-1):x,N=l%2?x:a.charAt(l+1);A.operation(function(){if(E=="skip")A.execCommand("goCharRight");else if(E=="skipThree")for(var z=0;z<3;z++)A.execCommand("goCharRight");else if(E=="surround"){for(var Y=A.getSelections(),z=0;z1&&arguments[1]!==void 0?arguments[1]:1,ve=Ze.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(F).map(function(le,Ee){if(!D.isValidElement(le)||!le.type)return null;var Oe=le.type.isSelectOptGroup,Ye=le.key,Pe=le.props,Be=Pe.children,Ue=Object(H.a)(Pe,["children"]);return re||!Oe?E(le):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Ye===null?Ee:Ye,"__"),label:Ye},Ue),{},{options:f(Be)})}).filter(function(le){return le})}var g=Q("2Qr1"),h=Q("qNPg"),o=Q("U8pU"),S=Q("Kwbf"),b=Q("WKfj");function T(F){var re=F.mode,le=F.options,Ee=F.children,Oe=F.backfill,Ye=F.allowClear,Pe=F.placeholder,Be=F.getInputElement,Ue=F.showSearch,Ne=F.onSearch,Te=F.defaultOpen,se=F.autoFocus,ze=F.labelInValue,xt=F.value,ct=F.inputValue,ft=F.optionLabelProp,Ct=re==="multiple"||re==="tags",He=Ue!==void 0?Ue:Ct||re==="combobox",Ke=le||f(Ee);if(Object(S.a)(re!=="tags"||Ke.every(function(et){return!et.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),re==="tags"||re==="combobox"){var ut=Ke.some(function(et){return et.options?et.options.some(function(Ze){return typeof("value"in Ze?Ze.value:Ze.key)=="number"}):typeof("value"in et?et.value:et.key)=="number"});Object(S.a)(!ut,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(re!=="combobox"||!ft,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(re==="combobox"||!Oe,"`backfill` only works with `combobox` mode."),Object(S.a)(re==="combobox"||!Be,"`getInputElement` only work with `combobox` mode."),Object(S.b)(re!=="combobox"||!Be||!Ye||!Pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ne&&!He&&re!=="combobox"&&re!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!Te||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),xt!=null){var vt=Object(b.d)(xt);Object(S.a)(!ze||vt.every(function(et){return Object(o.a)(et)==="object"&&("key"in et||"value"in et)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ct||Array.isArray(xt),"`value` should be array when `mode` is `multiple` or `tags`")}if(Ee){var ht=null;Object(R.a)(Ee).some(function(et){if(!D.isValidElement(et)||!et.type)return!1;var Ze=et.type;if(Ze.isSelectOption)return!1;if(Ze.isSelectOptGroup){var Tt=Object(R.a)(et.props.children).every(function(bt){return!D.isValidElement(bt)||!et.type||bt.type.isSelectOption?!0:(ht=bt.type,!1)});return!Tt}return ht=Ze,!0}),ht&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ht.displayName||ht.name||ht,"`.")),Object(S.a)(ct===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=T,z=Object(h.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:f,flattenOptions:g.d,getLabeledValue:g.e,filterOptions:g.b,isValueDisabled:g.g,findValueOption:g.c,warningProps:N,fillOptionsWithMissingValue:g.a}),Y=function(F){Object(M.a)(le,F);var re=Object(K.a)(le);function le(){var Ee;return Object(ae.a)(this,le),Ee=re.apply(this,arguments),Ee.selectRef=D.createRef(),Ee.focus=function(){Ee.selectRef.current.focus()},Ee.blur=function(){Ee.selectRef.current.blur()},Ee}return Object(X.a)(le,[{key:"render",value:function(){return D.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),le}(D.Component);Y.Option=s,Y.OptGroup=c;var te=Y,G=Fe.c=te},M8RZ:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return _});var ae=Q("fWQN"),X=Q("mtLc"),M=Q("yKVA"),K=Q("879j"),D=Q("q1tI"),P=Q.n(D),H=Q("i8i4"),W=Q.n(H),_=function(L){Object(M.a)(C,L);var y=Object(K.a)(C);function C(k){var O;Object(ae.a)(this,C),O=y.call(this,k);var A=window.document;return O.node=A.createElement("div"),A.body.appendChild(O.node),O}return Object(X.a)(C,[{key:"render",value:function(){var O=this.props.children;return Object(H.createPortal)(O,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(P.a.Component)},Nmxd:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0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XPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},O2Wb:function(Ge,Fe,Q){Ge.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(Ge,Fe,Q){"use strict";var ae=Q("U8pU"),X=Q("VTBJ"),M=Q("Ff2n"),K=Q("q1tI"),D=Q("uciX"),P=Q("7ixt"),H=function(k){var O=k.overlay,A=k.prefixCls,x=k.id,d=k.overlayInnerStyle;return K.createElement("div",{className:"".concat(A,"-inner"),id:x,role:"tooltip",style:d},typeof O=="function"?O():O)},W=H,_=function(k,O){var A=k.overlayClassName,x=k.trigger,d=x===void 0?["hover"]:x,a=k.mouseEnterDelay,l=a===void 0?0:a,s=k.mouseLeaveDelay,v=s===void 0?.1:s,c=k.overlayStyle,m=k.prefixCls,R=m===void 0?"rc-tooltip":m,E=k.children,f=k.onVisibleChange,g=k.afterVisibleChange,h=k.transitionName,o=k.animation,S=k.placement,b=S===void 0?"right":S,T=k.align,N=T===void 0?{}:T,z=k.destroyTooltipOnHide,Y=z===void 0?!1:z,te=k.defaultVisible,G=k.getTooltipContainer,F=k.overlayInnerStyle,re=Object(M.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),le=Object(K.useRef)(null);Object(K.useImperativeHandle)(O,function(){return le.current});var Ee=Object(X.a)({},re);"visible"in k&&(Ee.popupVisible=k.visible);var Oe=function(){var Ne=k.arrowContent,Te=Ne===void 0?null:Ne,se=k.overlay,ze=k.id;return[K.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},Te),K.createElement(W,{key:"content",prefixCls:R,id:ze,overlay:se,overlayInnerStyle:F})]},Ye=!1,Pe=!1;if(typeof Y=="boolean")Ye=Y;else if(Y&&Object(ae.a)(Y)==="object"){var Be=Y.keepParent;Ye=Be===!0,Pe=Be===!1}return K.createElement(D.a,Object.assign({popupClassName:A,prefixCls:R,popup:Oe,action:d,builtinPlacements:P.a,popupPlacement:b,ref:le,popupAlign:N,getPopupContainer:G,onPopupVisibleChange:f,afterPopupVisibleChange:g,popupTransitionName:h,popupAnimation:o,defaultPopupVisible:te,destroyPopupOnHide:Ye,autoDestroy:Pe,mouseLeaveDelay:v,popupStyle:c,mouseEnterDelay:l},Ee),E)},L=Object(K.forwardRef)(_),y=Fe.a=L},Ohmc:function(Ge,Fe,Q){Ge.exports=Q.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ge,Fe,Q){"use strict";var ae=Q("2qtc"),X=Q("kLXV"),M=Q("rAM+"),K=Q("miYZ"),D=Q("tsqr"),P=Q("9og8"),H=Q("tJVT"),W=Q("jrin"),_=Q("WmNS"),L=Q.n(_),y=Q("q1tI"),C=Q.n(y),k=Q("VrN/"),O=Q.n(k),A=Q("bdgK"),x=Q("p77/"),d=Q("Bd2K"),a=Q("ELLl"),l=Q("19Vz"),s=Q("lZu9"),v=Q("+NIl"),c=Q("kSUc"),m=Q("9Bee"),R=function(xe){var Le=xe.value,je=Le===void 0?"":Le,mt=xe.className,Mt=xe.showTextOnly,Rt=xe.showLines,Kt=xe.style,_t=Kt===void 0?{}:Kt,ot=Object(y.useMemo)(function(){return""},[je]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},E=Q("0Owb"),f=Q("dejd"),g=Q("C+DQ"),h=Q("1vsH"),o=Q("m3rI"),S=[{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 b(xe){var Le=xe.onActionCallback,je=xe.title,mt=xe.icon,Mt=xe.actionName,Rt=xe.className,Kt=Rt===void 0?"":Rt,_t=xe.children;function ot(){Le(Mt)}return C.a.createElement("a",{title:je,className:Kt,onClick:ot},C.a.createElement("i",{className:"md-iconfont ".concat(mt)}),_t)}var T=function(xe){var Le=xe.watch,je=xe.showNullButton,mt=xe.onActionCallback,Mt=xe.fullScreen,Rt=xe.insertTemp,Kt=xe.hidetoolBar,_t=xe.uuid,ot=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Jt=[].concat(S,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!Kt&&Jt.map(function(Ut,Zt){return C.a.createElement("li",{key:Zt},Ut.actionName?C.a.createElement(b,Object(E.a)({},Ut,{onActionCallback:mt})):C.a.createElement("span",{className:"v-line"}))}),je?C.a.createElement("li",null,C.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:mt},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Rt&&C.a.createElement("li",null,C.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Rt),onActionCallback:mt},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(b,{icon:"".concat(Mt?"icon-shrink":"icon-enlarge"),title:Mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:mt})))},N=Q("M8RZ"),z=Q("+L6B"),Y=Q("2/Rp"),te=Q("y8nQ"),G=Q("Vl3Y"),F=Q("5NDa"),re=Q("5rEg"),le={labelCol:{span:4},wrapperCol:{span:20}},Ee=function(xe){var Le=xe.callback,je=xe.onCancel;function mt(Mt){Le(Mt)}return C.a.createElement(G.a,Object(E.a)({},le,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:mt}),C.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(re.a,null)),C.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(re.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(Y.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},Oe=Q("7ahc"),Ye=Q("HmJG"),Pe=Q("BjJ7"),Be=G.a.useForm,Ue={width:280,marginRight:10},Ne={labelCol:{span:5},wrapperCol:{span:19}},Te=function(xe){var Le=xe.callback,je=xe.onCancel,mt=Be(),Mt=Object(H.a)(mt,1),Rt=Mt[0];function Kt(Jt){Le(Jt)}function _t(Jt,Ut){if(Jt.status===-1){D.b.error(Jt.message);return}Rt.setFieldsValue({src:"/api/attachments/".concat(Jt.id),type:Ut.type})}function ot(Jt){var Ut=Jt.target.files[0];ze(Ut,_t)}return C.a.createElement(G.a,Object(E.a)({form:Rt},Ne,{className:"upload-image-panel",onFinish:Kt}),C.a.createElement(G.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},C.a.createElement(re.a,{style:Ue})),C.a.createElement(se,{onFileChange:ot}))),C.a.createElement(G.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},C.a.createElement(re.a,{style:{width:264}})),C.a.createElement(G.a.Item,{style:{textAlign:"right"}},C.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(Y.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))};function se(xe){var Le=xe.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Le}))}function ze(xe,Le){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var je=new FormData;je.append("editormd-image-file",xe),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var mt=new window.XMLHttpRequest;mt.withCredentials=!0,mt.addEventListener("load",function(Mt){Le(JSON.parse(Mt.target.responseText),xe)},!1),mt.addEventListener("error",function(Mt){console.error(Mt)},!1),mt.open("POST","".concat(Pe.a,"/api/attachments.json")),mt.send(je)}var xt=Q("giR+"),ct=Q("fyUT"),ft=Q("7Kak"),Ct=Q("9yH6"),He=Ct.a.Group,Ke={margin:"0 8px"},ut=function(xe){var Le=xe.callback,je=xe.onCancel;function mt(Mt){Le(Mt)}return C.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:mt},C.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},C.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Ke},"\u884C\u6570"),C.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(ct.a,null)),C.a.createElement("span",{style:Ke},"\u5217\u6570"),C.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(ct.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},C.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(G.a.Item,{name:"align"},C.a.createElement(He,null,C.a.createElement(Ct.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(Ct.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(Ct.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(Ct.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(Y.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},vt=Q("ErOA"),ht=Q("7Cbv"),et="link",Ze="upload-image",Tt="code-block",bt="add-table",St="------------",lt={default:St,left:":".concat(St),center:":".concat(St,":"),right:"".concat(St,":")},yt=Q("9VGf"),dt,Qe;function Ie(){}var Et=0,$e=1e4,_e="\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 Se(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,ve=me?"Cmd":"Ctrl",ne=["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"],ie=(dt={},Object(W.a)(dt,ve+"-B","bold"),Object(W.a)(dt,ve+"-I","italic"),dt),de=(Qe={},Object(W.a)(Qe,et,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Qe,Tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Qe,Ze,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Qe,bt,"\u6DFB\u52A0\u8868\u683C"),Qe),pe=Fe.a=function(xe){var Le=xe.defaultValue,je=Le===void 0?"":Le,mt=xe.onChange,Mt=xe.width,Rt=Mt===void 0?"100%":Mt,Kt=xe.height,_t=Kt===void 0?400:Kt,ot=xe.miniToolbar,Jt=ot===void 0?!1:ot,Ut=xe.isFocus,Zt=Ut===void 0?!1:Ut,nr=xe.watch,Ot=xe.insertTemp,xr=xe.mode,$t=xr===void 0?"markdown":xr,it=xe.id,lr=it===void 0?"markdown-editor-id":it,nt=xe.showResizeBar,yr=nt===void 0?!1:nt,Lr=xe.noStorage,jr=Lr===void 0?!1:Lr,pn=xe.showNullButton,br=pn===void 0?!1:pn,Lt=xe.hidetoolBar,Hn=Lt===void 0?!1:Lt,Zn=xe.fullScreen,ln=Zn===void 0?!1:Zn,ir=xe.onBlur,Un=xe.onCMBeforeChange,Kn=xe.onFullScreen,ai=xe.className,rt=ai===void 0?"":ai,Wt=xe.disablePaste,zn=Wt===void 0?!1:Wt,ci=xe.placeholder,bi=ci===void 0?"":ci,oi=xe.values,j=oi===void 0?"":oi,u=Object(y.useState)(null),p=Object(H.a)(u,2),I=p[0],Z=p[1],U=Object(y.useState)(je),be=Object(H.a)(U,2),Xe=be[0],gt=be[1],It=Object(y.useState)(nr),qe=Object(H.a)(It,2),jt=qe[0],Cr=qe[1],Nr=Object(y.useState)(ln),Rn=Object(H.a)(Nr,2),bn=Rn[0],mn=Rn[1],qn=Object(y.useState)(""),Rr=Object(H.a)(qn,2),Ft=Rr[0],Vt=Rr[1],er=Object(y.useState)(0),wr=Object(H.a)(er,2),tr=wr[0],si=wr[1],nn=Object(y.useState)(_t),Oi=Object(H.a)(nn,2),Fi=Oi[0],Pn=Oi[1],qr=Object(y.useState)(!1),un=Object(H.a)(qr,2),Ei=un[0],hi=un[1],$r=Object(y.useRef)(Object(ht.a)()),Mr=Object(y.useRef)(!1),an=Object(y.useRef)(),cr=Object(y.useRef)(),on=Object(y.useRef)(),Br=Object(y.useRef)(),fi=Object(y.useRef)(),En=function(){var Bt=Object(P.a)(L.a.mark(function qt(){var Ht,hr;return L.a.wrap(function(Ur){for(;;)switch(Ur.prev=Ur.next){case 0:return Ur.next=2,Object(vt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:$r.current}});case 2:hr=Ur.sent,hr!=null&&(Ht=hr.attachments)!==null&&Ht!==void 0&&Ht.length&&(console.log("cm:",I,cr),hr.attachments.map(function(Sr){Sr.content_type.indexOf("image")>-1?I.replaceSelection(".concat(Sr.content_type,")")):Sr.content_type.indexOf("video")>-1?I.replaceSelection('')):Sr.content_type.indexOf("pdf")>-1?I.replaceSelection('').concat(Sr.name,"")):I.replaceSelection("[".concat(Sr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Sr.id,"?type=").concat(Sr.content_type,")"))}));case 4:case"end":return Ur.stop()}},qt)}));return function(){return Bt.apply(this,arguments)}}();Object(y.useEffect)(function(){gt(j),I==null||I.setValue(j)},[j]),Object(y.useEffect)(function(){Kn==null||Kn(bn)},[bn]),Object(y.useEffect)(function(){if(cr.current){var Bt=O.a.fromTextArea(cr.current,{mode:$t,lineNumbers:!Jt,lineWrapping:!0,value:je,autoCloseTags:!0,autoCloseBrackets:!0});Zt&&Bt.focus();function qt(Ht,hr){if(zn){hr.preventDefault();return}var Dr=hr.clipboardData;if(Dr){var Ur=Dr.types.toString(),Sr=Dr.items;if(Ur==="Files"||Dr.types.indexOf("Files")>-1){if(hr.preventDefault(),$t=="stex")return;try{var dn,Gn=Sr[1];((dn=Sr[0])===null||dn===void 0?void 0:dn.kind)==="file"&&(Gn=Sr[0]);var pr=Gn.getAsFile(),Ci=pr.name.split(".").pop();ze(pr,function(Ir){if(Ir.id){var _n,kn,ui;(pr==null||((_n=pr.type)===null||_n===void 0)?void 0:_n.indexOf("image"))>-1?Bt.replaceSelection(".concat(Ir.content_type,")")):(pr==null||((kn=pr.type)===null||kn===void 0)?void 0:kn.indexOf("video"))>-1?Bt.replaceSelection('')):(pr==null||((ui=pr.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Bt.replaceSelection('').concat(pr.name,"")):ne.includes(Ci)?Bt.replaceSelection('').concat(pr.name,"")):Bt.replaceSelection("[".concat(pr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,"?type=").concat(Ir.content_type,")"))}else(Ir==null?void 0:Ir.status)===401&&(document.location.href="/user/login")})}catch(Ir){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Bt.on("paste",qt),Bt.on("dragleave",function(Ht,hr){on.current.classList.remove("mouse-hover-md")}),Bt.on("dragover",function(Ht,hr){on.current.classList.add("mouse-hover-md")}),Bt.on("drop",function(Ht,hr){on.current.classList.add("mouse-hover-md");var Dr;if(Dr=hr.dataTransfer.files,Dr.length>0){hr.preventDefault(),hr.stopPropagation();for(var Ur=function(Gn){var pr=Dr[Gn],Ci=pr.name.split(".").pop();ze(pr,function(Ir){if(Ir.id){var _n,kn,ui;(pr==null||((_n=pr.type)===null||_n===void 0)?void 0:_n.indexOf("image"))>-1?Bt.replaceSelection(".concat(Ir.content_type,")")):(pr==null||((kn=pr.type)===null||kn===void 0)?void 0:kn.indexOf("video"))>-1?Bt.replaceSelection('')):(pr==null||((ui=pr.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Bt.replaceSelection('').concat(pr.name,"")):ne.includes(Ci)?Bt.replaceSelection('').concat(pr.name,"")):Bt.replaceSelection("[".concat(pr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,"?type=").concat(Ir.content_type,")"))}else(Ir==null?void 0:Ir.status)===401&&(document.location.href="/user/login")})},Sr=0;Sr0||Sr.target.offsetWidth>0)&&(Mn(),I.setSize("100%","100%"),I.refresh())}}catch(dn){Dr.e(dn)}finally{Dr.f()}});return Ht.observe(cr.current.parentElement),Ht}if(I){var qt=Bt();return function(){qt.unobserve(cr.current.parentElement)}}},[I,Mn]),Object(y.useEffect)(function(){if(I){for(var Bt=[],qt=function(){var Sr=hr[Ht];Dr=Object(H.a)(Sr,2);var dn=Dr[0],Gn=Dr[1],pr=Object(W.a)({},dn,function(){Xi(Gn)});Bt.push(pr),I.addKeyMap(pr)},Ht=0,hr=Object.entries(ie);Ht0){var Bt=new Date().getTime(),qt=window.sessionStorage.getItem(lr);Bt>=tr+$e&&(!qt||qt!==Xe)&&(window.sessionStorage.setItem(lr,Xe),hi(!0))}},$e),Object(y.useEffect)(function(){Cr(nr)},[I,nr]),Object(y.useEffect)(function(){I&&(Zt&&I.focus())},[I,Zt]),Object(y.useEffect)(function(){if(jt&&I){var Bt=I.getScrollerElement();function qt(Ht){var hr=Ht.target;if(fi.current){var Dr=hr.scrollTop/hr.scrollHeight;fi.current.scrollTop=fi.current.scrollHeight*Dr}}return Bt.addEventListener("scroll",qt),function(){Bt.removeEventListener("scroll",qt)}}},[I,jt]),Object(y.useEffect)(function(){if(I&&Un){function Bt(qt,Ht){Un(qt,Ht)}return I.on("beforeChange",Bt),function(){I.off("beforeChange",Bt)}}},[I,Un]),Object(y.useEffect)(function(){if(I&&ir){function Bt(){ir(I.getValue())}return I.on("blur",Bt),function(){I.off("blur",Bt)}}},[I,ir]),Object(y.useEffect)(function(){if(I){function Bt(qt){var Ht=qt.getValue();gt(Ht),si(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),mt&&mt(Ht)}return I.on("change",Bt),function(){I.off("change",Bt)}}},[I,mt]),Object(y.useEffect)(function(){I&&(je==null?(I.setValue(""),gt("")):je!==I.getValue()&&(I.setValue(je),gt(je),I.setCursor(I.lineCount(),0)))},[I,je]);var Xi=Object(y.useCallback)(function(Bt){var qt=I.getCursor(),Ht=I.getSelection(),hr=Ht.split(`
`);switch(Bt){case"bold":return I.replaceSelection("**"+Ht+"**"),Ht===""&&I.setCursor(qt.line,qt.ch+2),I.focus();case"italic":return I.replaceSelection("*"+Ht+"*"),Ht===""&&I.setCursor(qt.line,qt.ch+1),I.focus();case"code":return I.replaceSelection("`"+Ht+"`"),Ht===""&&I.setCursor(qt.line,qt.ch+1),I.focus();case"inline-latex":return I.replaceSelection("`$$"+Ht+"$$`"),Ht===""&&I.setCursor(qt.line,qt.ch+3),I.focus();case"latex":return I.replaceSelection("```latex\n"+Ht+"\n```"),I.setCursor(qt.line+1,Ht.length+1),I.focus();case"line-break":return I.replaceSelection(`
`),I.focus();case"list-ul":return Ht===""?I.replaceSelection("- "+Ht):I.replaceSelection(hr.map(function(Dr){return Dr===""?"":"- ".concat(Dr)}).join(`
`)),I.focus();case"list-ol":return Ht===""?I.replaceSelection("1. "+Ht):I.replaceSelection(hr.map(function(Dr,Ur){return Dr===""?"":"".concat(Ur+1,". ").concat(Dr)}).join(`
`)),I.focus();case"add-null-ch":return Ht===""&&I.setCursor(qt.line,qt.ch+1),I.replaceSelection(_e),I.focus();case"inster-template-1":return Ht===""&&I.setCursor(qt.line,qt.ch),I.replaceSelection(Je),I.focus();case"eraser":return I.setValue(""),I.focus();case"trigger-watch":return Cr(!jt),I.focus();case"trigger-full-screen":return mn(!bn),I.focus();case et:Vt(et);return;case Tt:Vt(Tt);return;case Ze:Vt(Ze);return;case bt:Vt(bt);return;default:throw new Error}},[I,jt,bn]),Ri=Object(y.useCallback)(function(Bt){Vt("");switch(Ft){case et:var qt=Bt.title,Ht=Bt.link;return I.replaceSelection("[".concat(qt,"](").concat(Ht,")")),I.focus();case Tt:var hr=Bt.language,Dr=Bt.content;return I.replaceSelection(["```"+hr,Dr,"```"].join(`
`)),I.focus();case Ze:var Ur=Bt.src,Sr=Bt.alt;return Sr?I.replaceSelection(".concat(Ur,' "').concat(Sr,'" )')):I.replaceSelection("")),I.focus();case bt:for(var dn=Bt.row,Gn=Bt.col,pr=Bt.align,Ci=`
`,Ir=0;Ir300&&(dn=300);var Gn=_t+dn+"px";Pn(Gn)}}return Bt.addEventListener("mousedown",hr),document.addEventListener("mousemove",Ur),document.addEventListener("mouseup",Dr),function(){Bt.removeEventListener("mousedown",hr),document.removeEventListener("mousemove",Ur),document.removeEventListener("mouseup",Dr)}}},[I,Br]),Object(y.useEffect)(function(){Pn(_t)},[_t]);var ei=Se(Rt),sa=Se(Fi),li={width:ei,height:sa},la=Object(y.useMemo)(function(){if(tr){var Bt=new Date(tr),qt=Bt.getHours(),Ht=Bt.getMinutes(),hr=Bt.getSeconds();return qt=qt<10?"0"+qt:qt,Ht=Ht<10?"0"+Ht:Ht,hr=hr<10?"0"+hr:hr,"".concat(qt,":").concat(Ht,":").concat(hr)}return 0},[tr]);function ua(){window.sessionStorage.removeItem(lr),hi(!1),si(0)}function ji(){hi(!1),si(0),I.setValue(window.sessionStorage.getItem(lr))}function Ua(Bt,qt){var Ht=I.getValue();Ht=Ht.replace(Bt,qt),gt(Ht),I==null||I.setValue(Ht)}return C.a.createElement(y.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:on},C.a.createElement("div",{className:"markdown-editor-container ".concat(rt," ").concat(jt?"on-preview":""," ").concat(Jt?"mini":""," ").concat(bn?"full-screen":""),style:li},C.a.createElement(T,{insertTemp:Ot,watch:jt,fullScreen:bn,showNullButton:br,onActionCallback:Xi,hidetoolBar:Hn,uuid:$r.current,setOpenPhones:function(){Mr.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:cr,placeholder:bi})),jt?C.a.createElement("div",{ref:fi,className:"preview-container"},$t==="stex"&&C.a.createElement(R,{value:Xe}),$t!=="stex"&&C.a.createElement(m.a,{edit:!0,value:Xe,replaces:Ua})):null))),yr?C.a.createElement("a",{ref:Br,className:"editor-resize"}):null,C.a.createElement(N.a,null,de[Ft]?C.a.createElement(X.a,{centered:!0,title:de[Ft],visible:!0,onCancel:$n,footer:null,className:"markdown-popup-form"},Mi):null))}},RMFE:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxN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AgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Ge,Fe){/**
* @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 Q,ae,X,M=!1,K,D;window.PR_SHOULD_USE_CONTINUATION=!0;var P,H;(function(){var W=window,_=["break,continue,do,else,for,if,return,while"],L=[_,"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"],y=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[y,"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=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],O=[y,"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",x=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="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",a=[_,"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"],l=[_,"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"],s=[_,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[C,O,k,x,d,a,l,s],c=/^(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",R="kwd",E="com",f="typ",g="lit",h="pun",o="pln",S="tag",b="dec",T="src",N="atn",z="atv",Y="nocode",te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(He){for(var Ke=0,ut=!1,vt=!1,ht=0,et=He.length;ht122||(ne<65||ve>90||Et.push([Math.max(65,ve)|32,Math.min(ne,90)|32]),ne<97||ve>122||Et.push([Math.max(97,ve)&~32,Math.min(ne,122)&~32]))}}Et.sort(function(xe,Le){return xe[0]-Le[0]||Le[1]-xe[1]});for(var ie=[],de=[],Je=0;Jepe[0]&&(pe[1]+1>pe[0]&&_e.push("-"),_e.push(St(pe[1])))}return _e.push("]"),_e.join("")}function yt(Qe){for(var Ie=Qe.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")),Et=Ie.length,$e=[],_e=0,Je=0;_e=2&&ve==="["?Ie[_e]=lt(Se):ve!=="\\"&&(Ie[_e]=Se.replace(/[a-zA-Z]/g,function(de){var pe=de.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Ie.join("")}for(var dt=[],ht=0,et=He.length;ht=0;)ut[dt.charAt(Qe)]=yt;var Ie=yt[1],Et=""+Ie;bt.hasOwnProperty(Et)||(Tt.push(Ie),bt[Et]=null)}Tt.push(/[\0-\uffff]/),vt=G(Tt)})();var ht=Ke.length,et=function(Ze){for(var Tt=Ze.sourceCode,bt=Ze.basePos,St=Ze.sourceNode,lt=[bt,o],yt=0,dt=Tt.match(vt)||[],Qe={},Ie=0,Et=dt.length;Ie=5&&_e.substring(0,5)==="lang-",Se&&!(Je&&typeof Je[1]=="string")&&(Se=!1,_e=T),Se||(Qe[$e]=_e)}var ne=yt;if(yt+=$e.length,!Se)lt.push(bt+ne,_e);else{var ie=Je[1],de=$e.indexOf(ie),pe=de+ie.length;Je[2]&&(pe=$e.length-Je[2].length,de=pe-ie.length);var xe=_e.substring(5);re(St,bt+ne,$e.substring(0,de),et,lt),re(St,bt+ne+de,ie,se(xe,ie),lt),re(St,bt+ne+pe,$e.substring(pe),et,lt)}}Ze.decorations=lt};return et}function Ye(He){var Ke=[],ut=[];He.tripleQuotedStrings?Ke.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):He.multiLineStrings?Ke.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),He.verbatimStrings&&ut.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var vt=He.hashComments;vt&&(He.cStyleComments?(vt>1?Ke.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ut.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([E,/^#[^\r\n]*/,null,"#"])),He.cStyleComments&&(ut.push([E,/^\/\/[^\r\n]*/,null]),ut.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ht=He.regexLiterals;if(ht){var et=ht>1?"":`
\r`,Ze=et?".":"[\\S\\s]",Tt="/(?=[^/*"+et+"])(?:[^/\\x5B\\x5C"+et+"]|\\x5C"+Ze+"|\\x5B(?:[^\\x5C\\x5D"+et+"]|\\x5C"+Ze+")*(?:\\x5D|$))+/";ut.push(["lang-regex",RegExp("^"+te+"("+Tt+")")])}var bt=He.types;bt&&ut.push([f,bt]);var St=(""+He.keywords).replace(/^ | $/g,"");St.length&&ut.push([R,new RegExp("^(?:"+St.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([o,/^\s+/,null,` \r
\xA0`]);var lt="^.[^\\s\\w.$@'\"`/\\\\]*";return He.regexLiterals&&(lt+="(?!s*/)"),ut.push([g,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[g,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[h,new RegExp(lt),null]),Oe(Ke,ut)}var Pe=Ye({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Be(He,Ke,ut){for(var vt=/(?:^|\s)nocode(?:\s|$)/,ht=/\r\n?|\n/,et=He.ownerDocument,Ze=et.createElement("li");He.firstChild;)Ze.appendChild(He.firstChild);var Tt=[Ze];function bt(Ie){var Et=Ie.nodeType;if(Et==1&&!vt.test(Ie.className))if(Ie.nodeName==="br")St(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var $e=Ie.firstChild;$e;$e=$e.nextSibling)bt($e);else if((Et==3||Et==4)&&ut){var _e=Ie.nodeValue,Je=_e.match(ht);if(Je){var Se=_e.substring(0,Je.index);Ie.nodeValue=Se;var me=_e.substring(Je.index+Je[0].length);if(me){var ve=Ie.parentNode;ve.insertBefore(et.createTextNode(me),Ie.nextSibling)}St(Ie),Se||Ie.parentNode.removeChild(Ie)}}}function St(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function Et(Je,Se){var me=Se?Je.cloneNode(!1):Je,ve=Je.parentNode;if(ve){var ne=Et(ve,1),ie=Je.nextSibling;ne.appendChild(me);for(var de=ie;de;de=ie)ie=de.nextSibling,ne.appendChild(de)}return me}for(var $e=Et(Ie.nextSibling,0),_e;(_e=$e.parentNode)&&_e.nodeType===1;)$e=_e;Tt.push($e)}for(var lt=0;lt=ve&&(bt+=2),et>=ne&&(yt+=2)}}finally{_e&&(_e.style.display=Je)}}var Ne={};function Te(He,Ke){for(var ut=Ke.length;--ut>=0;){var vt=Ke[ut];Ne.hasOwnProperty(vt)?W.console&&console.warn("cannot override language handler %s",vt):Ne[vt]=He}}function se(He,Ke){return He&&Ne.hasOwnProperty(He)||(He=/^\s*]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^