(window.webpackJsonp=window.webpackJsonp||[]).push([[205,6,7,20],{"+NIl":function(Et,tt,ie){(function(he){he(ie("VrN/"))})(function(he){"use strict";he.defineMode("stex",function(Y,O){"use strict";function Z(A,x){A.cmdState.push(x)}function U(A){return A.cmdState.length>0?A.cmdState[A.cmdState.length-1]:null}function I(A){var x=A.cmdState.pop();x&&x.closeBracket()}function K(A){for(var x=A.cmdState,y=x.length-1;y>=0;y--){var h=x[y];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function B(A,x,y){return function(){this.name=A,this.bracketNo=0,this.style=x,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var M={};M.importmodule=B("importmodule","tag",["string","builtin"]),M.documentclass=B("documentclass","tag",["","atom"]),M.usepackage=B("usepackage","tag",["atom"]),M.begin=B("begin","tag",["atom"]),M.end=B("end","tag",["atom"]),M.label=B("label","tag",["atom"]),M.ref=B("ref","tag",["atom"]),M.eqref=B("eqref","tag",["atom"]),M.cite=B("cite","tag",["atom"]),M.bibitem=B("bibitem","tag",["atom"]),M.Bibitem=B("Bibitem","tag",["atom"]),M.RBibitem=B("RBibitem","tag",["atom"]),M.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(A,x){A.f=x}function E(A,x){var y;if(A.match(/^\\[a-zA-Z@]+/)){var h=A.current().slice(1);return y=M.hasOwnProperty(h)?M[h]:M.DEFAULT,y=new y,Z(x,y),R(x,_),y.style}if(A.match(/^\\[$&%#{}_]/))return"tag";if(A.match(/^\\[,;!\/\\]/))return"tag";if(A.match("\\["))return R(x,function(l,d){return L(l,d,"\\]")}),"keyword";if(A.match("\\("))return R(x,function(l,d){return L(l,d,"\\)")}),"keyword";if(A.match("$$"))return R(x,function(l,d){return L(l,d,"$$")}),"keyword";if(A.match("$"))return R(x,function(l,d){return L(l,d,"$")}),"keyword";var o=A.next();if(o=="%")return A.skipToEnd(),"comment";if(o=="}"||o=="]"){if(y=U(x),y)y.closeBracket(o),R(x,_);else return"error";return"bracket"}else return o=="{"||o=="["?(y=M.DEFAULT,y=new y,Z(x,y),"bracket"):/\d/.test(o)?(A.eatWhile(/[\w.%]/),"atom"):(A.eatWhile(/[\w\-_]/),y=K(x),y.name=="begin"&&(y.argument=A.current()),y.styleIdentifier())}function L(A,x,y){if(A.eatSpace())return null;if(y&&A.match(y))return R(x,E),"keyword";if(A.match(/^\\[a-zA-Z@]+/))return"tag";if(A.match(/^[a-zA-Z]+/))return"variable-2";if(A.match(/^\\[$&%#{}_]/))return"tag";if(A.match(/^\\[,;!\/]/))return"tag";if(A.match(/^[\^_&]/))return"tag";if(A.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(A.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=A.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(A.skipToEnd(),"comment"):"error"}function _(A,x){var y=A.peek(),h;return y=="{"||y=="["?(h=U(x),h.openBracket(y),A.eat(y),R(x,E),"bracket"):/[ \t\r]/.test(y)?(A.eat(y),null):(R(x,E),I(x),E(A,x))}return{startState:function(){var A=O.inMathMode?function(x,y){return L(x,y)}:E;return{cmdState:[],f:A}},copyState:function(A){return{cmdState:A.cmdState.slice(),f:A.f}},token:function(A,x){return x.f(A,x)},blankLine:function(A){A.f=E,A.cmdState.length=0},lineComment:"%"}}),he.defineMIME("text/x-stex","stex"),he.defineMIME("text/x-latex","stex")})},"19Vz":function(Et,tt,ie){(function(he){he(ie("VrN/"))})(function(he){he.defineOption("placeholder","",function(B,M,R){var E=R&&R!=he.Init;if(M&&!E)B.on("blur",U),B.on("change",I),B.on("swapDoc",I),he.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){Z(B)}),I(B);else if(!M&&E){B.off("blur",U),B.off("change",I),B.off("swapDoc",I),he.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),Y(B);var L=B.getWrapperElement();L.className=L.className.replace(" CodeMirror-empty","")}M&&!B.hasFocus()&&U(B)});function Y(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function O(B){Y(B);var M=B.state.placeholder=document.createElement("pre");M.style.cssText="height: 0; overflow: visible",M.style.direction=B.getOption("direction"),M.className="CodeMirror-placeholder CodeMirror-line-like";var R=B.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),M.appendChild(R),B.display.lineSpace.insertBefore(M,B.display.lineSpace.firstChild)}function Z(B){setTimeout(function(){var M=!1,R=B.getInputField();R.nodeName=="TEXTAREA"?M=!R.value:B.lineCount()==1&&(M=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),M?O(B):Y(B)},20)}function U(B){K(B)&&O(B)}function I(B){var M=B.getWrapperElement(),R=K(B);M.className=M.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?O(B):Y(B)}function K(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(Et,tt,ie){(function(he){he(ie("VrN/"))})(function(he){"use strict";var Y={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},O={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};he.defineMode("xml",function(Z,U){var I=Z.indentUnit,K={},B=U.htmlMode?Y:O;for(var M in B)K[M]=B[M];for(var M in U)K[M]=U[M];var R,E;function L(a,T){function v(j){return T.tokenize=j,j(a,T)}var C=a.next();if(C=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?v(x("atom","]]>")):null:a.match("--")?v(x("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),v(y(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),T.tokenize=x("meta","?>"),"meta"):(R=a.eat("/")?"closeTag":"openTag",T.tokenize=_,"tag bracket");if(C=="&"){var D;return a.eat("#")?a.eat("x")?D=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):D=a.eatWhile(/[\d]/)&&a.eat(";"):D=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),D?"atom":"error"}else return a.eatWhile(/[^&<]/),null}L.isInText=!0;function _(a,T){var v=a.next();if(v==">"||v=="/"&&a.eat(">"))return T.tokenize=L,R=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return R="equals",null;if(v=="<"){T.tokenize=L,T.state=d,T.tagName=T.tagStart=null;var C=T.tokenize(a,T);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(v)?(T.tokenize=A(v),T.stringStartCol=a.column(),T.tokenize(a,T)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function A(a){var T=function(v,C){for(;!v.eol();)if(v.next()==a){C.tokenize=_;break}return"string"};return T.isInAttribute=!0,T}function x(a,T){return function(v,C){for(;!v.eol();){if(v.match(T)){C.tokenize=L;break}v.next()}return a}}function y(a){return function(T,v){for(var C;(C=T.next())!=null;){if(C=="<")return v.tokenize=y(a+1),v.tokenize(T,v);if(C==">")if(a==1){v.tokenize=L;break}else return v.tokenize=y(a-1),v.tokenize(T,v)}return"meta"}}function h(a,T,v){this.prev=a.context,this.tagName=T,this.indent=a.indented,this.startOfLine=v,(K.doNotIndent.hasOwnProperty(T)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,T){for(var v;;){if(!a.context)return;if(v=a.context.tagName,!K.contextGrabbers.hasOwnProperty(v)||!K.contextGrabbers[v].hasOwnProperty(T))return;o(a)}}function d(a,T,v){return a=="openTag"?(v.tagStart=T.column(),S):a=="closeTag"?g:d}function S(a,T,v){return a=="word"?(v.tagName=T.current(),E="tag",b):K.allowMissingTagName&&a=="endTag"?(E="tag bracket",b(a,T,v)):(E="error",S)}function g(a,T,v){if(a=="word"){var C=T.current();return v.context&&v.context.tagName!=C&&K.implicitlyClosed.hasOwnProperty(v.context.tagName)&&o(v),v.context&&v.context.tagName==C||K.matchClosing===!1?(E="tag",p):(E="tag error",w)}else return K.allowMissingTagName&&a=="endTag"?(E="tag bracket",p(a,T,v)):(E="error",w)}function p(a,T,v){return a!="endTag"?(E="error",p):(o(v),d)}function w(a,T,v){return E="error",p(a,T,v)}function b(a,T,v){if(a=="word")return E="attribute",u;if(a=="endTag"||a=="selfcloseTag"){var C=v.tagName,D=v.tagStart;return v.tagName=v.tagStart=null,a=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(C)?l(v,C):(l(v,C),v.context=new h(v,C,D==v.indented)),d}return E="error",b}function u(a,T,v){return a=="equals"?f:(K.allowMissing||(E="error"),b(a,T,v))}function f(a,T,v){return a=="string"?s:a=="word"&&K.allowUnquoted?(E="string",b):(E="error",b(a,T,v))}function s(a,T,v){return a=="string"?s:b(a,T,v)}return{startState:function(a){var T={tokenize:L,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(T.baseIndent=a),T},token:function(a,T){if(!T.tagName&&a.sol()&&(T.indented=a.indentation()),a.eatSpace())return null;R=null;var v=T.tokenize(a,T);return(v||R)&&v!="comment"&&(E=null,T.state=T.state(R||v,a,T),E&&(v=E=="error"?v+" error":E)),v},indent:function(a,T,v){var C=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+I;if(C&&C.noIndent)return he.Pass;if(a.tokenize!=_&&a.tokenize!=L)return v?v.match(/^(\s*)/)[0].length:0;if(a.tagName)return K.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+I*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(a){a.state==f&&(a.state=b)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var T=[],v=a.context;v;v=v.prev)v.tagName&&T.push(v.tagName);return T.reverse()}}}),he.defineMIME("text/xml","xml"),he.defineMIME("application/xml","xml"),he.mimeModes.hasOwnProperty("text/html")||he.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(Et,tt,ie){"use strict";var he=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function O(){if(!he)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return he(Y)}var Z=/^(?:[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 U(_){return typeof _=="string"&&Z.test(_)}for(var I=U,K=[],B=0;B<256;++B)K.push((B+256).toString(16).substr(1));function M(_){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,x=(K[_[A+0]]+K[_[A+1]]+K[_[A+2]]+K[_[A+3]]+"-"+K[_[A+4]]+K[_[A+5]]+"-"+K[_[A+6]]+K[_[A+7]]+"-"+K[_[A+8]]+K[_[A+9]]+"-"+K[_[A+10]]+K[_[A+11]]+K[_[A+12]]+K[_[A+13]]+K[_[A+14]]+K[_[A+15]]).toLowerCase();if(!I(x))throw TypeError("Stringified UUID is invalid");return x}var R=M;function E(_,A,x){_=_||{};var y=_.random||(_.rng||O)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,A){x=x||0;for(var h=0;h<16;++h)A[x+h]=y[h];return A}return R(y)}var L=tt.a=E},"7ahc":function(Et,tt,ie){"use strict";ie.d(tt,"a",function(){return S});var he=ie("k1fw"),Y=ie("0Owb"),O=ie("+L6B"),Z=ie("2/Rp"),U=ie("y8nQ"),I=ie("Vl3Y"),K=ie("tJVT"),B=ie("OaEy"),M=ie("2fM7"),R=ie("q1tI"),E=ie.n(R),L=ie("VrN/"),_=ie.n(L),A=ie("p77/"),x=ie.n(A),y=ie("c5Ni"),h=ie.n(y),o=M.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};tt.b=function(g){var p=g.callback,w=g.onCancel,b=Object(R.useState)("python"),u=Object(K.a)(b,2),f=u[0],s=u[1];function a(v){s(d[v][1])}function T(v){p(v)}return E.a.createElement(I.a,Object(Y.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:T}),E.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(M.a,{onChange:a},Object.keys(d).map(function(v){return E.a.createElement(o,{key:v,value:v},d[v][0])}))),E.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(S,{mode:f})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(Z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Z.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function S(g){var p=g.value,w=g.onChange,b=g.mode,u=g.options,f=u===void 0?{}:u,s=Object(R.useRef)(),a=Object(R.useState)(),T=Object(K.a)(a,2),v=T[0],C=T[1];return Object(R.useEffect)(function(){if(v){function D(j){var z=j.getValue();w&&w(z)}return v.on("change",D),function(){v.off("change",D)}}},[v,w]),Object(R.useEffect)(function(){v&&v.setOption("mode",b)},[v,b]),Object(R.useEffect)(function(){v&&((p!==v.getValue()||p==="")&&setTimeout(function(){v.setValue(p||" ")},300))},[v,p]),Object(R.useEffect)(function(){if(s.current&&!v){var D=_.a.fromTextArea(s.current,Object(he.a)({mode:b,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},f));C(D)}},[s.current,v]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:s}))}},"7ixt":function(Et,tt,ie){"use strict";ie.d(tt,"a",function(){return O});var he={adjustX:1,adjustY:1},Y=[0,0],O={left:{points:["cr","cl"],overflow:he,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:he,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:he,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:he,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:he,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:he,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:he,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:he,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:he,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:he,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:he,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:he,offset:[-4,0],targetOffset:Y}},Z=O},"815F":function(Et,tt,ie){"use strict";ie.d(tt,"e",function(){return K}),ie.d(tt,"c",function(){return M}),ie.d(tt,"d",function(){return R}),ie.d(tt,"a",function(){return L}),ie.d(tt,"f",function(){return _}),ie.d(tt,"b",function(){return A});var he=ie("KQm4"),Y=ie("VTBJ"),O=ie("Ff2n"),Z=ie("Zm9Q"),U=ie("Kwbf"),I=ie("OZM5");function K(x,y){return x!=null?x:y}function B(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function h(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(o||[]).forEach(function(d){var S=d.key,g=d.children;Object(U.a)(S!=null,"Tree node must have a certain key: [".concat(l).concat(S,"]"));var p=String(S);Object(U.a)(!y.has(p)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(p)),y.set(p,!0),h(g,"".concat(l).concat(p," > "))})}h(x)}function M(x){function y(h){var o=Object(Z.a)(h);return o.map(function(l){if(!Object(I.i)(l))return Object(U.a)(!l,"Tree/TreeNode can only accept TreeNode as children."),null;var d=l.key,S=l.props,g=S.children,p=Object(O.a)(S,["children"]),w=Object(Y.a)({key:d},p),b=y(g);return b.length&&(w.children=b),w}).filter(function(l){return l})}return y(x)}function R(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],h=new Set(y===!0?[]:y),o=[];function l(d){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(g,p){var w=Object(I.h)(S?S.pos:"0",p),b=K(g.key,w),u=Object(Y.a)(Object(Y.a)({},g),{},{parent:S,pos:w,children:null,data:g,isStart:[].concat(Object(he.a)(S?S.isStart:[]),[p===0]),isEnd:[].concat(Object(he.a)(S?S.isEnd:[]),[p===d.length-1])});return o.push(u),y===!0||h.has(b)?u.children=l(g.children||[],u):u.children=[],u})}return l(x),o}function E(x,y,h){var o;h?typeof h=="string"?o=function(S){return S[h]}:typeof h=="function"&&(o=function(S){return h(S)}):o=function(S,g){return K(S.key,g)};function l(d,S,g){var p=d?d.children:x,w=d?Object(I.h)(g.pos,S):"0";if(d){var b=o(d,w),u={node:d,index:S,pos:w,key:b,parentPos:g.node?g.pos:null,level:g.level+1};y(u)}p&&p.forEach(function(f,s){l(f,s,{node:d,pos:w,level:g?g.level+1:-1})})}l(null)}function L(x){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=y.initWrapper,o=y.processEntity,l=y.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,S={},g={},p={posEntities:S,keyEntities:g};return h&&(p=h(p)||p),E(x,function(w){var b=w.node,u=w.index,f=w.pos,s=w.key,a=w.parentPos,T=w.level,v={node:b,index:u,key:s,pos:f,level:T},C=K(s,f);S[f]=v,g[C]=v,v.parent=S[a],v.parent&&(v.parent.children=v.parent.children||[],v.parent.children.push(v)),o&&o(v,p)},d),l&&l(p),p}function _(x,y){var h=y.expandedKeys,o=y.selectedKeys,l=y.loadedKeys,d=y.loadingKeys,S=y.checkedKeys,g=y.halfCheckedKeys,p=y.dragOverNodeKey,w=y.dropPosition,b=y.keyEntities,u=b[x],f={eventKey:x,expanded:h.indexOf(x)!==-1,selected:o.indexOf(x)!==-1,loaded:l.indexOf(x)!==-1,loading:d.indexOf(x)!==-1,checked:S.indexOf(x)!==-1,halfChecked:g.indexOf(x)!==-1,pos:String(u?u.pos:""),dragOver:p===x&&w===0,dragOverGapTop:p===x&&w===-1,dragOverGapBottom:p===x&&w===1};return f}function A(x){var y=x.data,h=x.expanded,o=x.selected,l=x.checked,d=x.loaded,S=x.loading,g=x.halfChecked,p=x.dragOver,w=x.dragOverGapTop,b=x.dragOverGapBottom,u=x.pos,f=x.active,s=Object(Y.a)(Object(Y.a)({},y),{},{expanded:h,selected:o,checked:l,loaded:d,loading:S,halfChecked:g,dragOver:p,dragOverGapTop:w,dragOverGapBottom:b,pos:u,active:f});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(U.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),x}}),s}},"8EBN":function(Et,tt,ie){(function(he){he(ie("VrN/"))})(function(he){"use strict";he.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 Y=0;Y-1&&Z.substring(K+1,Z.length);if(B)return he.findModeByExtension(B)},he.findModeByName=function(Z){Z=Z.toLowerCase();for(var U=0;U1&&arguments[1]!==void 0?arguments[1]:"select",Re=arguments.length>2?arguments[2]:void 0,Qe=Oe.get(Ve);return!Re&&S(Qe,ze)?null:Qe},[Oe]),Ge=M.useCallback(function(Ve){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",Re=arguments.length>2?arguments[2]:void 0,Qe=Fe.get(Ve);return!Re&&S(Qe,ze)?null:Qe},[Fe]);return[je,Ge]}function p(Oe){return M.useMemo(function(){var Fe=new Map,je=new Map;return Oe.forEach(function(Ge){Fe.set(Ge.key,Ge),je.set(Ge.data.value,Ge)}),[Fe,je]},[Oe])}var w={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},b=function(Fe,je){var Ge=Fe.prefixCls,Ve=Fe.height,ze=Fe.itemHeight,Re=Fe.virtual,Qe=Fe.options,Ye=Fe.flattenOptions,Pe=Fe.multiple,We=Fe.searchValue,Se=Fe.onSelect,ye=Fe.onToggleOpen,xe=Fe.open,le=Fe.notFoundContent,ue=Fe.onMouseEnter,me=M.useContext(d),Ee=me.checkable,we=me.checkedKeys,Ie=me.halfCheckedKeys,$e=me.treeExpandedKeys,at=me.treeDefaultExpandAll,ht=me.treeDefaultExpandedKeys,ut=me.onTreeExpand,xt=me.treeIcon,Ct=me.showTreeIcon,st=me.switcherIcon,Mt=me.treeLine,Lt=me.treeNodeFilterProp,kt=me.loadData,Dt=me.treeLoadedKeys,Tt=me.treeMotion,Ut=me.onTreeLoad,Qt=M.useRef(),yt=Object(o.a)(function(){return Qe},[xe,Qe],function(lt,Xe){return Xe[0]&<[1]!==Xe[1]}),pr=p(Ye),Bt=Object(K.a)(pr,2),tr=Bt[0],ur=Bt[1],nr=g(tr,ur),vr=Object(K.a)(nr,2),Nt=vr[0],ft=vr[1],sr=M.useMemo(function(){return we.map(function(lt){var Xe=ft(lt);return Xe?Xe.key:null})},[we]),Tr=M.useMemo(function(){return Ee?{checked:sr,halfChecked:Ie}:null},[sr,Ie,Ee]);M.useEffect(function(){if(xe&&!Pe&&sr.length){var lt;(lt=Qt.current)===null||lt===void 0||lt.scrollTo({key:sr[0]})}},[xe]);var gr=String(We).toLowerCase(),Pt=function(Xe){return gr?String(Xe[Lt]).toLowerCase().includes(gr):!1},yr=M.useState(ht),dr=Object(K.a)(yr,2),qr=dr[0],qe=dr[1],wt=M.useState(null),zr=Object(K.a)(wt,2),Ir=zr[0],Zr=zr[1],Wr=M.useMemo(function(){return $e?Object(U.a)($e):We?Ir:qr},[qr,Ir,gr,$e]);M.useEffect(function(){We&&Zr(Ye.map(function(lt){return lt.key}))},[We]);var G=function(Xe){qe(Xe),Zr(Xe),ut&&ut(Xe)},c=function(Xe){Xe.preventDefault()},m=function(Xe,pt){var mt=pt.node.key,It=Nt(mt,Ee?"checkbox":"select");It!==null&&Se(It.data.value,{selected:!we.includes(It.data.value)}),Pe||ye(!1)},F=M.useState(null),q=Object(K.a)(F,2),H=q[0],Ce=q[1],Ze=Nt(H);if(M.useImperativeHandle(je,function(){return{onKeyDown:function(Xe){var pt,mt=Xe.which;switch(mt){case h.a.UP:case h.a.DOWN:case h.a.LEFT:case h.a.RIGHT:(pt=Qt.current)===null||pt===void 0||pt.onKeyDown(Xe);break;case h.a.ENTER:{Ze!==null&&m(null,{node:{key:H},selected:!we.includes(Ze.data.value)});break}case h.a.ESC:ye(!1)}},onKeyUp:function(){}}}),yt.length===0)return M.createElement("div",{role:"listbox",className:"".concat(Ge,"-empty"),onMouseDown:c},le);var nt={};return Dt&&(nt.loadedKeys=Dt),Wr&&(nt.expandedKeys=Wr),M.createElement("div",{onMouseDown:c,onMouseEnter:ue},Ze&&xe&&M.createElement("span",{style:w,"aria-live":"assertive"},Ze.data.value),M.createElement(l.b,Object.assign({ref:Qt,focusable:!1,prefixCls:"".concat(Ge,"-tree"),treeData:yt,height:Ve,itemHeight:ze,virtual:Re,multiple:Pe,icon:xt,showIcon:Ct,switcherIcon:st,showLine:Mt,loadData:We?null:kt,motion:Tt,checkable:Ee,checkStrictly:!0,checkedKeys:Tr,selectedKeys:Ee?[]:sr,defaultExpandAll:at},nt,{onActiveChange:Ce,onSelect:m,onCheck:m,onExpand:G,onLoad:Ut,filterTreeNode:Pt})))},u=M.forwardRef(b);u.displayName="OptionList";var f=u,s=function(){return null},a=s,T=ie("Ff2n"),v=ie("Zm9Q");function C(Oe){return Object(v.a)(Oe).map(function(Fe){if(!M.isValidElement(Fe)||!Fe.type)return null;var je=Fe.key,Ge=Fe.props,Ve=Ge.children,ze=Ge.value,Re=Object(T.a)(Ge,["children","value"]),Qe=Object(B.a)({key:je,value:ze},Re),Ye=C(Ve);return Ye.length&&(Qe.children=Ye),Qe}).filter(function(Fe){return Fe})}function D(Oe){if(!Oe)return Oe;var Fe=Object(B.a)({},Oe);return"props"in Fe||Object.defineProperty(Fe,"props",{get:function(){return Object(y.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),Fe}}),Fe}function j(Oe,Fe,je,Ge,Ve){var ze=null,Re=null;function Qe(){function Ye(Pe){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Pe.map(function(ye,xe){var le="".concat(We,"-").concat(xe),ue=je.includes(ye.value),me=Ye(ye.children||[],le,ue),Ee=M.createElement(a,Object.assign({},ye),me.map(function(Ie){return Ie.node}));if(Fe===ye.value&&(ze=Ee),ue){var we={pos:le,node:Ee,children:me};return Se||Re.push(we),we}return null}).filter(function(ye){return ye})}Re||(Re=[],Ye(Ge),Re.sort(function(Pe,We){var Se=Pe.node.props.value,ye=We.node.props.value,xe=je.indexOf(Se),le=je.indexOf(ye);return xe-le}))}Object.defineProperty(Oe,"triggerNode",{get:function(){return Object(y.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Qe(),ze}}),Object.defineProperty(Oe,"allCheckedNodes",{get:function(){return Object(y.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Qe(),Ve?Re:Re.map(function(Pe){var We=Pe.node;return We})}})}function z(Oe){return Array.isArray(Oe)?Oe:Oe!==void 0?[Oe]:[]}function V(Oe,Fe){var je=new Map;return Fe.forEach(function(Ge){var Ve=Ge.data;je.set(Ve.value,Ve)}),Oe.map(function(Ge){return D(je.get(Ge))})}function P(Oe,Fe){var je=V([Oe],Fe)[0];return je?je.disabled:!1}function N(Oe){return Oe.disabled||Oe.disableCheckbox||Oe.checkable===!1}function $(Oe){for(var Fe=Oe.parent,je=0,Ge=Fe;Ge;)Ge=Ge.parent,je+=1;return je}function re(Oe){function Fe(Ge){return(Ge||[]).map(function(Ve){var ze=Ve.value,Re=Ve.key,Qe=Ve.children,Ye=Object(B.a)(Object(B.a)({},Ve),{},{key:"key"in Ve?Re:ze});return Qe&&(Ye.children=Fe(Qe)),Ye})}var je=Object(L.d)(Fe(Oe),!0);return je.map(function(Ge){return{key:Ge.data.key,data:Ge.data,level:$(Ge)}})}function pe(Oe){return function(Fe,je){var Ge=je[Oe];return String(Ge).toLowerCase().includes(String(Fe).toLowerCase())}}function ve(Oe,Fe,je){var Ge=je.optionFilterProp,Ve=je.filterOption;if(Ve===!1)return Fe;var ze;typeof Ve=="function"?ze=Ve:ze=pe(Ge);function Re(Qe){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qe.map(function(Pe){var We=Pe.children,Se=Ye||ze(Oe,D(Pe)),ye=Re(We||[],Se);return Se||ye.length?Object(B.a)(Object(B.a)({},Pe),{},{children:ye}):null}).filter(function(Pe){return Pe})}return Re(Fe)}function Ae(Oe,Fe,je,Ge){var Ve=new Map;return z(Fe).forEach(function(ze){ze&&Object(I.a)(ze)==="object"&&"value"in ze&&Ve.set(ze.value,ze)}),Oe.map(function(ze){var Re={value:ze},Qe=je(ze,"select",!0),Ye=Qe?Ge(Qe.data):ze;if(Ve.has(ze)){var Pe=Ve.get(ze);Re.label="label"in Pe?Pe.label:Ye,"halfChecked"in Pe&&(Re.halfChecked=Pe.halfChecked)}else Re.label=Ye;return Re})}function Le(Oe,Fe){var je=new Set(Oe);return je.add(Fe),Array.from(je)}function ce(Oe,Fe){var je=new Set(Oe);return je.delete(Fe),Array.from(je)}function ae(Oe){var Fe=Oe.searchPlaceholder,je=Oe.treeCheckStrictly,Ge=Oe.treeCheckable,Ve=Oe.labelInValue,ze=Oe.value,Re=Oe.multiple;Object(y.a)(!Fe,"`searchPlaceholder` has been removed."),je&&Ve===!1&&Object(y.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Ve||je)&&Object(y.a)(z(ze).every(function(Qe){return Qe&&Object(I.a)(Qe)==="object"&&"value"in Qe}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),je||Re||Ge?Object(y.a)(!ze||Array.isArray(ze),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(y.a)(!Array.isArray(ze),"`value` should not be array when `TreeSelect` is single mode.")}var de=ae,ne=10;function se(Oe,Fe){var je=Fe.id,Ge=Fe.pId,Ve=Fe.rootPId,ze={},Re=[],Qe=Oe.map(function(Ye){var Pe=Object(B.a)({},Ye),We=Pe[je];return ze[We]=Pe,Pe.key=Pe.key||We,Pe});return Qe.forEach(function(Ye){var Pe=Ye[Ge],We=ze[Pe];We&&(We.children=We.children||[],We.children.push(Ye)),(Pe===Ve||!We&&Ve===null)&&Re.push(Ye)}),Re}function J(Oe,Fe){var je=0,Ge=new Set;function Ve(ze){return(ze||[]).map(function(Re){var Qe=Re.key,Ye=Re.value,Pe=Re.children,We=Object(T.a)(Re,["key","value","children"]),Se="value"in Re?Ye:Qe,ye=Object(B.a)(Object(B.a)({},We),{},{key:Qe!=null?Qe:Se,value:Se,title:Fe(Re)});return"children"in Re&&(ye.children=Ve(Pe)),ye})}return Ve(Oe)}function ee(Oe,Fe,je){var Ge=je.getLabelProp,Ve=je.simpleMode,ze=M.useRef({});return Oe?(ze.current.formatTreeData=ze.current.treeData===Oe?ze.current.formatTreeData:J(Ve?se(Oe,Object(B.a)({id:"id",pId:"pId",rootPId:null},Ve!==!0?Ve:{})):Oe,Ge),ze.current.treeData=Oe):ze.current.formatTreeData=ze.current.children===Fe?ze.current.formatTreeData:J(C(Fe),Ge),ze.current.formatTreeData}var oe="SHOW_ALL",fe="SHOW_PARENT",ke="SHOW_CHILD";function ge(Oe,Fe,je){var Ge=new Set(Oe);return Fe===ke?Oe.filter(function(Ve){var ze=je[Ve];return!(ze&&ze.children&&ze.children.every(function(Re){var Qe=Re.node;return N(Qe)||Ge.has(Qe.key)}))}):Fe===fe?Oe.filter(function(Ve){var ze=je[Ve],Re=ze?ze.parent:null;return!(Re&&!N(Re.node)&&Ge.has(Re.node.key))}):Oe}function De(Oe,Fe){var je=Fe.value,Ge=Fe.getEntityByValue,Ve=Fe.getEntityByKey,ze=Fe.treeConduction,Re=Fe.showCheckedStrategy,Qe=Fe.conductKeyEntities,Ye=Fe.getLabelProp;return M.useMemo(function(){var Pe=Oe;if(ze){var We=ge(Oe.map(function(Se){var ye=Ge(Se);return ye?ye.key:Se}),Re,Qe);Pe=We.map(function(Se){var ye=Ve(Se);return ye?ye.data.value:Se})}return Ae(Pe,je,Ge,Ye)},[Oe,je,ze,Re,Ge])}var Me=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Ue=Object(R.a)({prefixCls:"rc-tree-select",components:{optionList:f},convertChildrenToData:function(){return null},flattenOptions:re,getLabeledValue:E.e,filterOptions:ve,isValueDisabled:P,findValueOption:V,omitDOMProps:function(Fe){var je=Object(B.a)({},Fe);return Me.forEach(function(Ge){delete je[Ge]}),je}});Ue.displayName="Select";var Ke=M.forwardRef(function(Oe,Fe){var je=Oe.multiple,Ge=Oe.treeCheckable,Ve=Oe.treeCheckStrictly,ze=Oe.showCheckedStrategy,Re=ze===void 0?"SHOW_CHILD":ze,Qe=Oe.labelInValue,Ye=Oe.loadData,Pe=Oe.treeLoadedKeys,We=Oe.treeNodeFilterProp,Se=We===void 0?"value":We,ye=Oe.treeNodeLabelProp,xe=Oe.treeDataSimpleMode,le=Oe.treeData,ue=Oe.treeExpandedKeys,me=Oe.treeDefaultExpandedKeys,Ee=Oe.treeDefaultExpandAll,we=Oe.children,Ie=Oe.treeIcon,$e=Oe.showTreeIcon,at=Oe.switcherIcon,ht=Oe.treeLine,ut=Oe.treeMotion,xt=Oe.filterTreeNode,Ct=Oe.dropdownPopupAlign,st=Oe.onChange,Mt=Oe.onTreeExpand,Lt=Oe.onTreeLoad,kt=Oe.onDropdownVisibleChange,Dt=Oe.onSelect,Tt=Oe.onDeselect,Ut=Ge||Ve,Qt=je||Ut,yt=Ge&&!Ve,pr=Ve||Qe,Bt=M.useRef(null);M.useImperativeHandle(Fe,function(){return{focus:Bt.current.focus,blur:Bt.current.blur}});var tr=function(mt){return le&&mt.label||mt.title},ur=function(mt){return ye?mt[ye]:tr(mt)},nr=ee(le,we,{getLabelProp:tr,simpleMode:xe}),vr=Object(M.useMemo)(function(){return re(nr)},[nr]),Nt=p(vr),ft=Object(K.a)(Nt,2),sr=ft[0],Tr=ft[1],gr=g(sr,Tr),Pt=Object(K.a)(gr,2),yr=Pt[0],dr=Pt[1],qr=Object(M.useMemo)(function(){return yt?Object(L.a)(nr):{keyEntities:null}},[nr,Ge,Ve]),qe=qr.keyEntities,wt=Object(x.a)(Oe.defaultValue,{value:Oe.value}),zr=Object(K.a)(wt,2),Ir=zr[0],Zr=zr[1],Wr=function(mt){var It=[],lr=[];return mt.forEach(function($t){dr($t)?lr.push($t):It.push($t)}),{missingRawValues:It,existRawValues:lr}},G=Object(M.useMemo)(function(){var pt=[],mt=[];if(z(Ir).forEach(function(Xt){if(Xt&&Object(I.a)(Xt)==="object"&&"value"in Xt)if(Xt.halfChecked&&Ve){var wr=dr(Xt.value);pt.push(wr?wr.key:Xt.value)}else mt.push(Xt.value);else mt.push(Xt)}),yt){var It=Wr(mt),lr=It.missingRawValues,$t=It.existRawValues,rr=$t.map(function(Xt){return dr(Xt).key}),xr=Object(_.a)(rr,!0,qe),Nr=xr.checkedKeys,ir=xr.halfCheckedKeys;return[[].concat(Object(U.a)(lr),Object(U.a)(Nr.map(function(Xt){return yr(Xt).data.value}))),ir]}return[mt,pt]},[Ir,Qt,pr,Ge,Ve]),c=Object(K.a)(G,2),m=c[0],F=c[1],q=De(m,{treeConduction:yt,value:Ir,showCheckedStrategy:Re,conductKeyEntities:qe,getEntityByValue:dr,getEntityByKey:yr,getLabelProp:ur}),H=function(mt,It,lr){if(Zr(Qt?mt:mt[0]),st){var $t=mt;if(yt&&Re!=="SHOW_ALL"){var rr=mt.map(function(Ar){var _r=dr(Ar);return _r?_r.key:Ar}),xr=ge(rr,Re,qe);$t=xr.map(function(Ar){var _r=yr(Ar);return _r?_r.data.value:Ar})}var Nr=It||{triggerValue:void 0,selected:void 0},ir=Nr.triggerValue,Xt=Nr.selected,wr=pr?Ae($t,Ir,dr,ur):$t;if(Ve){var Hr=F.map(function(Ar){var _r=yr(Ar);return _r?_r.data.value:Ar}).filter(function(Ar){return!$t.includes(Ar)});wr=[].concat(Object(U.a)(wr),Object(U.a)(Ae(Hr,Ir,dr,ur)))}var ar={preValue:q,triggerValue:ir},yn=!0;(Ve||lr==="selection"&&!Xt)&&(yn=!1),j(ar,ir,mt,nr,yn),Ut?ar.checked=Xt:ar.selected=Xt,st(Qt?wr:wr[0],pr?null:$t.map(function(Ar){var _r=dr(Ar);return _r?ur(_r.data):null}),ar)}},Ce=function(mt,It,lr){var $t=mt;if(!Qt)H([mt],{selected:!0,triggerValue:mt},lr);else{var rr=Le(m,mt);if(yt){var xr=Wr(rr),Nr=xr.missingRawValues,ir=xr.existRawValues,Xt=ir.map(function(ar){return dr(ar).key}),wr=Object(_.a)(Xt,!0,qe),Hr=wr.checkedKeys;rr=[].concat(Object(U.a)(Nr),Object(U.a)(Hr.map(function(ar){return yr(ar).data.value})))}H(rr,{selected:!0,triggerValue:mt},lr)}Dt&&Dt($t,It)},Ze=function(mt,It,lr){var $t=mt,rr=ce(m,mt);if(yt){var xr=Wr(rr),Nr=xr.missingRawValues,ir=xr.existRawValues,Xt=ir.map(function(ar){return dr(ar).key}),wr=Object(_.a)(Xt,{checked:!1,halfCheckedKeys:F},qe),Hr=wr.checkedKeys;rr=[].concat(Object(U.a)(Nr),Object(U.a)(Hr.map(function(ar){return yr(ar).data.value})))}H(rr,{selected:!1,triggerValue:mt},lr),Tt&&Tt($t,It)},nt=function(){H([],null,"clear")},lt=M.useCallback(function(pt){if(kt){var mt={};Object.defineProperty(mt,"documentClickClose",{get:function(){return Object(y.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),kt(pt,mt)}},[kt]),Xe={optionLabelProp:null,optionFilterProp:Se,dropdownAlign:Ct,internalProps:{mark:A.a,onClear:nt,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:Ce,onRawDeselect:Ze}};return"filterTreeNode"in Oe&&(Xe.filterOption=xt),M.createElement(d.Provider,{value:{checkable:Ut,loadData:Ye,treeLoadedKeys:Pe,onTreeLoad:Lt,checkedKeys:m,halfCheckedKeys:F,treeDefaultExpandAll:Ee,treeExpandedKeys:ue,treeDefaultExpandedKeys:me,onTreeExpand:Mt,treeIcon:Ie,treeMotion:ut,showTreeIcon:$e,switcherIcon:at,treeLine:ht,treeNodeFilterProp:Se}},M.createElement(Ue,Object.assign({ref:Bt,mode:Qt?"multiple":null},Oe,Xe,{value:q,labelInValue:!0,options:nr,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:lt})))}),He=function(Oe){Object(O.a)(je,Oe);var Fe=Object(Z.a)(je);function je(){var Ge;return Object(he.a)(this,je),Ge=Fe.apply(this,arguments),Ge.selectRef=M.createRef(),Ge.focus=function(){Ge.selectRef.current.focus()},Ge.blur=function(){Ge.selectRef.current.blur()},Ge}return Object(Y.a)(je,[{key:"render",value:function(){return M.createElement(Ke,Object.assign({ref:this.selectRef},this.props))}}]),je}(M.Component);He.TreeNode=a,He.SHOW_ALL=oe,He.SHOW_PARENT=fe,He.SHOW_CHILD=ke;var Be=He,rt=tt.e=Be},"8hTe":function(Et,tt,ie){Et.exports={button:"button___1wy9m"}},"8pgt":function(Et,tt,ie){Et.exports={flexRow:"flexRow___2kcn2",flexColumn:"flexColumn___2bS_0",formWrap:"formWrap___3t-wi",example:"example___2J2YZ",footerWrap:"footerWrap___3u6gg"}},"9Bee":function(Et,tt,ie){"use strict";var he=ie("DYRE"),Y=ie("zeV3"),O=ie("+L6B"),Z=ie("2/Rp"),U=ie("k1fw"),I=ie("9og8"),K=ie("tJVT"),B=ie("WmNS"),M=ie.n(B),R=ie("q1tI"),E=ie.n(R),L=ie("vg9a"),_=ie("DlQD"),A=ie.n(_),x=ie("rUJ1");function y(G,c){var m=G.match(/^(\s+)(?:```)/);if(m===null)return c;var F=m[1];return c.split(`
`).map(function(q){var H=q.match(/^\s+/);if(H===null)return q;var Ce=Object(K.a)(H,1),Ze=Ce[0];return Ze.length>=F.length?q.slice(F.length):q}).join(`
`)}var h=[],o=[""],l=new A.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){h.length=0,o=[""]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(G,c,m,F){if(c>=G.length||G[c].level<=m)return c;var q=G[c];F.push("- "+q.text+""),c++;var H=[];return c=p(G,c,q.level,H),H.length>0&&(F.push("
"),H.forEach(function(Ce){F.push(Ce)}),F.push("
")),F.push(" "),c=p(G,c,m,F),c}function w(){return p(h,0,0,o),o.push("
"),o.join("")}var b={heading:function(c){var m=d.exec(c);if(m)return{type:"heading",raw:m[0],depth:m[1].length,text:m[2]}},fences:function(c){var m=this.rules.block.fences.exec(c);if(m){var F=m[0],q=y(F,m[3]||""),H=m[2]?m[2].trim():m[2];if(["latex","katex","math"].indexOf(H)>=0){var Ce=s(),Ze=q;q=Ce,a[Ce]={type:"block",expression:Ze}}return{type:"code",raw:F,lang:H,text:q}}}},u=/(?:\${2})([^\n`]+?)(?:\${2})/gi,f=0,s=function(){return"__special_katext_id_".concat(f++,"__")},a={};function T(){return a}function v(){f=0,a={}}function C(G){return G=G.replace(u,function(c,m){var F=s();return a[F]={type:"inline",expression:m},F}),G}var D=l.listitem;l.listitem=function(G){return D(C(G))};var j=l.paragraph;l.paragraph=function(G){return j(C(G))};var z=l.tablecell;l.tablecell=function(G,c){return z(C(G),c)},l.code=function(G,c,m){var F=(c||"").match(/\S*/)[0];return F?["latex","katex","math"].indexOf(F)>=0?"".concat(G,"
"):'
').concat(m?G:Object(x.escape)(G,!0),`
`):''+(m?G:Object(x.escape)(G,!0))+"
"},l.heading=function(G,c,m){var F=this.options.headerPrefix+m.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:F,level:c,text:G}),"'+G+""},A.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),A.a.use({tokenizer:b,renderer:l});var V=A.a,P=ie("SJMd"),N=ie("ulZh"),$=ie.n(N),re=ie("m3rI"),pe=ie("Oy/b"),ve=ie("p5ED"),Ae=ie("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 Le=function(G,c){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,F){m.__proto__=F}||function(m,F){for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(m[q]=F[q])})(G,c)};function ce(G,c){function m(){this.constructor=G}Le(G,c),G.prototype=c===null?Object.create(c):(m.prototype=c.prototype,new m)}function ae(G,c,m,F){return new(m||(m=Promise))(function(q,H){function Ce(lt){try{nt(F.next(lt))}catch(Xe){H(Xe)}}function Ze(lt){try{nt(F.throw(lt))}catch(Xe){H(Xe)}}function nt(lt){var Xe;lt.done?q(lt.value):(Xe=lt.value,Xe instanceof m?Xe:new m(function(pt){pt(Xe)})).then(Ce,Ze)}nt((F=F.apply(G,c||[])).next())})}function de(G,c){var m,F,q,H,Ce={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return H={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function Ze(nt){return function(lt){return function(Xe){if(m)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(m=1,F&&(q=2&Xe[0]?F.return:Xe[0]?F.throw||((q=F.return)&&q.call(F),0):F.next)&&!(q=q.call(F,Xe[1])).done)return q;switch(F=0,q&&(Xe=[2&Xe[0],q.value]),Xe[0]){case 0:case 1:q=Xe;break;case 4:return Ce.label++,{value:Xe[1],done:!1};case 5:Ce.label++,F=Xe[1],Xe=[0];continue;case 7:Xe=Ce.ops.pop(),Ce.trys.pop();continue;default:if(!(q=Ce.trys,(q=q.length>0&&q[q.length-1])||Xe[0]!==6&&Xe[0]!==2)){Ce=0;continue}if(Xe[0]===3&&(!q||Xe[1]>q[0]&&Xe[1]',"select"),this.addActionButton(F,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(F,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(F,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(F,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(F,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(F,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(F,'',"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(H){var Ce=document.createElement("div");Ce.className=""+m.toolbarButtonStyleClass.name,Ce.setAttribute("data-type-name",H.typeName),Ce.innerHTML=H.icon,Ce.addEventListener("click",function(){m.markerToolbarButtonClicked(Ce,H)}),m.buttons.push(Ce),m.markerButtons.push(Ce)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'',"render"),this.addActionButton(q,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},G.prototype.addButtonClickListener=function(c){this.buttonClickListeners.push(c)},G.prototype.removeButtonClickListener=function(c){this.buttonClickListeners.indexOf(c)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(c),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var c=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var m=0;m0&&this.buttonClickListeners.forEach(function(F){return F("marker",m)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(c,m){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("action",m)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.prototype.setActiveButton=function(c){this.resetButtonStyles(),c.className=c.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),c.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},G.prototype.setActiveMarkerButton=function(c){var m=this.markerButtons.find(function(F){return F.getAttribute("data-type-name")===c});m&&this.setActiveButton(m)},G.prototype.setCurrentMarker=function(c){var m=this;this.currentMarker=c,this.buttons.filter(function(F){return/delete|notes/.test(F.getAttribute("data-action"))}).forEach(function(F){m.currentMarker===void 0?(F.style.fillOpacity="0.4",F.style.pointerEvents="none"):(F.style.fillOpacity="1",F.style.pointerEvents="all")})},G}(),Me=function(){function G(c,m,F,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=c,this.displayMode=m,this.uiStyleSettings=F,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var c;this.toolboxStyleClass=this.styles.addClass(new ge("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ge("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var m=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ge("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ge("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ge("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ge("toolbox-panel-row_colors",`
background-color: `+((c=this.uiStyleSettings.toolboxBackgroundColor)!==null&&c!==void 0?c:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ge("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*m)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*m)+`px;
padding: `+m+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ge("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ge("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ke("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ke("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},G.prototype.show=function(c){var m;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=c,this.uiContainer.className=this.toolboxStyleClass.name+" "+((m=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&m!==void 0?m:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(c){var m,F,q=this;this.panels=c,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((m=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&m!==void 0?m:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(H){var Ce;H.uiStyleSettings=q.uiStyleSettings;var Ze=document.createElement("div");Ze.className=q.toolboxButtonStyleClass.name+" "+((Ce=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:q.toolboxButtonStyleColorsClass.name),Ze.innerHTML=H.icon,Ze.title=H.title,Ze.addEventListener("click",function(){q.panelButtonClick(H)}),q.panelButtons.push(Ze),q.buttonRow.appendChild(Ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(c){var m=this,F=-1;if(c!==this.activePanel){F=this.panels.indexOf(c),this.panelRow.innerHTML="";var q=c.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=c}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){m.displayMode==="inline"?m.panelRow.style.display="none":m.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(H,Ce){var Ze,nt;H.className=m.toolboxButtonStyleClass.name+" "+(Ce===F?""+((Ze=m.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:m.toolboxActiveButtonStyleColorsClass.name):""+((nt=m.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&nt!==void 0?nt:m.toolboxButtonStyleColorsClass.name))})},G}(),Ue=function(G,c){this.title=G,this.icon=c},Ke=function(G){function c(m,F,q,H){var Ce=G.call(this,m,H||'')||this;return Ce.colors=[],Ce.addTransparent=!1,Ce.colorBoxes=[],Ce.colors=F,Ce.currentColor=q,Ce.setCurrentColor=Ce.setCurrentColor.bind(Ce),Ce.getColorBox=Ce.getColorBox.bind(Ce),Ce}return ce(c,G),c.prototype.getUi=function(){var m=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.whiteSpace="nowrap",this.colors.forEach(function(q){var H=m.getColorBox(q);F.appendChild(H),m.colorBoxes.push(H)}),F},c.prototype.getColorBox=function(m){var F=this,q=this.uiStyleSettings.toolbarHeight/4,H=this.uiStyleSettings.toolbarHeight-q,Ce=document.createElement("div");Ce.style.display="inline-block",Ce.style.boxSizing="content-box",Ce.style.width=H-2+"px",Ce.style.height=H-2+"px",Ce.style.padding="1px",Ce.style.marginRight="2px",Ce.style.marginBottom="2px",Ce.style.borderWidth="2px",Ce.style.borderStyle="solid",Ce.style.borderRadius=(H+2)/2+"px",Ce.style.borderColor=m===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ce.addEventListener("click",function(){F.setCurrentColor(m,Ce)});var Ze=document.createElement("div");return Ze.style.display="inline-block",Ze.style.width=H-2+"px",Ze.style.height=H-2+"px",Ze.style.backgroundColor=m,Ze.style.borderRadius=H/2+"px",m==="transparent"&&(Ze.style.fill=this.uiStyleSettings.toolboxAccentColor,Ze.innerHTML=``),Ce.appendChild(Ze),Ce},c.prototype.setCurrentColor=function(m,F){var q=this;this.currentColor=m,this.colorBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(m)},c}(Ue),He=function(){function G(c,m,F){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=m,this.globalSettings=F,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(c){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(c,m){},G.prototype.dblClick=function(c,m){},G.prototype.manipulate=function(c){},G.prototype.pointerUp=function(c){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},G.prototype.scale=function(c,m){},G.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},G.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},G.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},G.typeName="MarkerBase",G}(),Be=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},G}(),rt=function(){function G(){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 G.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},G}(),Oe=function(){function G(){}return G.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},G.toSVGMatrix=function(c,m){return c.a=m.a,c.b=m.b,c.c=m.c,c.d=m.d,c.e=m.e,c.f=m.f,c},G}(),Fe=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.left=0,H.top=0,H.width=0,H.height=0,H.defaultSize={x:50,y:20},H.offsetX=0,H.offsetY=0,H.rotationAngle=0,H.CB_DISTANCE=10,H._suppressMarkerCreateEvent=!1,H.container.transform.baseVal.appendItem(se.createTransform()),H.setupControlBox(),H}return ce(c,G),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(m){this._visual=m;var F=se.createTransform();this._visual.transform.baseVal.appendItem(F)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(m){return!!G.prototype.ownsTarget.call(this,m)||!!(this.controlGrips.findGripByVisual(m)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(m))},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.state==="new"&&(this.left=m.x,this.top=m.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(m);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(F),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F)){this.activeGrip=this.rotatorGrip;var H=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=H.x-this.width/2,this.top=H.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ce=this.container.transform.baseVal.getItem(0);Ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(m){var F=this.state;G.prototype.pointerUp.call(this,m),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(m),this._state="select",F==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(m){this.visual.style.transform="translate("+m.x+"px, "+m.y+"px)"},c.prototype.manipulate=function(m){var F=this.unrotatePoint(m);this.state==="creating"?this.resize(m):this.state==="move"?(this.left=this.manipulationStartLeft+(F.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(F.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(F):this.state==="rotate"&&this.rotate(m)},c.prototype.resize=function(m){var F=this.manipulationStartLeft,q=this.manipulationStartWidth,H=this.manipulationStartTop,Ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:F=this.manipulationStartLeft+m.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-F;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+m.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:H=this.manipulationStartTop+m.y-this.manipulationStartY,Ce=this.manipulationStartHeight+this.manipulationStartTop-H;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ce=this.manipulationStartHeight+m.y-this.manipulationStartY}q>=0?(this.left=F,this.width=q):(this.left=F+q,this.width=-q),Ce>=0?(this.top=H,this.height=Ce):(this.top=H+Ce,this.height=-Ce),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(m){if(Math.abs(m.x-this.centerX)>.1){var F=Math.sign(m.x-this.centerX);this.rotationAngle=180*Math.atan((m.y-this.centerY)/(m.x-this.centerX))/Math.PI+90*F,this.applyRotation()}},c.prototype.applyRotation=function(){var m=this.container.transform.baseVal.getItem(0);m.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(m,0)},c.prototype.rotatePoint=function(m){if(this.rotationAngle===0)return m;var F=this.container.getCTM(),q=se.createPoint(m.x,m.y);return{x:(q=q.matrixTransform(F)).x,y:q.y}},c.prototype.unrotatePoint=function(m){if(this.rotationAngle===0)return m;var F=this.container.getCTM();F=F.inverse();var q=se.createPoint(m.x,m.y);return{x:(q=q.matrixTransform(F)).x,y:q.y}},c.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var m=se.createTransform();m.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(m),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 Be,this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){var m=this.controlBox.transform.baseVal.getItem(0);m.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(m,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()},c.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()},c.prototype.createGrip=function(){var m=new rt;return m.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(m.visual),m},c.prototype.positionGrips=function(){var m=this.controlGrips.topLeft.GRIP_SIZE,F=-m/2,q=F,H=(this.width+this.CB_DISTANCE)/2-m/2,Ce=(this.height+this.CB_DISTANCE)/2-m/2,Ze=this.height+this.CB_DISTANCE-m/2,nt=this.width+this.CB_DISTANCE-m/2;this.positionGrip(this.controlGrips.topLeft.visual,F,q),this.positionGrip(this.controlGrips.topCenter.visual,H,q),this.positionGrip(this.controlGrips.topRight.visual,nt,q),this.positionGrip(this.controlGrips.centerLeft.visual,F,Ce),this.positionGrip(this.controlGrips.centerRight.visual,nt,Ce),this.positionGrip(this.controlGrips.bottomLeft.visual,F,Ze),this.positionGrip(this.controlGrips.bottomCenter.visual,H,Ze),this.positionGrip(this.controlGrips.bottomRight.visual,nt,Ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,H,q-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(m,F,q){var H=m.transform.baseVal.getItem(0);H.setTranslate(F,q),m.transform.baseVal.replaceItem(H,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Oe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Oe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},c.prototype.restoreState=function(m){G.prototype.restoreState.call(this,m);var F=m;this.left=F.left,this.top=F.top,this.width=F.width,this.height=F.height,this.rotationAngle=F.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Oe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,F.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Oe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,F.containerTransformMatrix))},c.prototype.scale=function(m,F){G.prototype.scale.call(this,m,F);var q=this.rotatePoint({x:this.left,y:this.top}),H=this.unrotatePoint({x:q.x*m,y:q.y*F});this.left=H.x,this.top=H.y,this.width=this.width*m,this.height=this.height*F,this.adjustControlBox()},c}(He),je=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.createVisual=H.createVisual.bind(H),H}return ce(c,G),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.visual)},c.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)},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.state==="new"&&(this.createVisual(),this.moveVisual(m),this._state="creating")},c.prototype.manipulate=function(m){G.prototype.manipulate.call(this,m)},c.prototype.resize=function(m){G.prototype.resize.call(this,m),this.setSize()},c.prototype.setSize=function(){G.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(m){G.prototype.pointerUp.call(this,m),this.setSize()},c.prototype.setStrokeColor=function(m){this.strokeColor=m,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(m),this.stateChanged()},c.prototype.setFillColor=function(m){this.fillColor=m,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(m){this.strokeWidth=m,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(m){this.strokeDasharray=m,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this))},c.prototype.restoreState=function(m){var F=m;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),G.prototype.restoreState.call(this,m),this.setSize()},c.prototype.scale=function(m,F){G.prototype.scale.call(this,m,F),this.setSize()},c.title="Rectangle marker",c}(Fe),Ge=function(G){function c(m,F,q,H){var Ce=G.call(this,m,H||'')||this;return Ce.widths=[],Ce.widthBoxes=[],Ce.widths=F,Ce.currentWidth=q,Ce.setCurrentWidth=Ce.setCurrentWidth.bind(Ce),Ce}return ce(c,G),c.prototype.getUi=function(){var m=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.widths.forEach(function(q){var H=document.createElement("div");H.style.display="flex",H.style.flexGrow="2",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.borderColor=q===m.currentWidth?m.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){m.setCurrentWidth(q,H)}),F.appendChild(H);var Ce=document.createElement("div");Ce.innerText=q.toString(),Ce.style.marginRight="5px",H.appendChild(Ce);var Ze=document.createElement("div");Ze.style.minHeight="20px",Ze.style.flexGrow="2",Ze.style.display="flex",Ze.style.alignItems="center";var nt=document.createElement("hr");nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop=q+"px solid "+m.uiStyleSettings.toolboxColor,nt.style.flexGrow="2",Ze.appendChild(nt),H.appendChild(Ze),m.widthBoxes.push(H)}),F},c.prototype.setCurrentWidth=function(m,F){var q=this;this.currentWidth=m,this.widthBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(Ue),Ve=function(G){function c(m,F,q,H){var Ce=G.call(this,m,H||'')||this;return Ce.styles=[],Ce.styleBoxes=[],Ce.styles=F,Ce.currentStyle=q,Ce.setCurrentStyle=Ce.setCurrentStyle.bind(Ce),Ce}return ce(c,G),c.prototype.getUi=function(){var m=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.styles.forEach(function(q){var H=document.createElement("div");H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.overflow="hidden",H.style.maxWidth=100/m.styles.length-5+"%",H.style.borderColor=q===m.currentStyle?m.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){m.setCurrentStyle(q,H)}),F.appendChild(H);var Ce=document.createElement("div");Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.overflow="hidden";var Ze=``;Ce.innerHTML=Ze,H.appendChild(Ce),m.styleBoxes.push(H)}),F},c.prototype.setCurrentStyle=function(m,F){var q=this;this.currentStyle=m,this.styleBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(Ue),ze=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.strokePanel=new Ke("Line color",q.defaultColorSet,q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new Ge("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return ce(c,G),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=G.prototype.getState.call(this);return m.typeName=c.typeName,m},c.typeName="FrameMarker",c.title="Frame marker",c.icon='',c}(je),Re=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},Qe=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.x1=0,H.y1=0,H.x2=0,H.y2=0,H.defaultLength=50,H.manipulationStartX=0,H.manipulationStartY=0,H.manipulationStartX1=0,H.manipulationStartY1=0,H.manipulationStartX2=0,H.manipulationStartY2=0,H.setupControlBox(),H}return ce(c,G),c.prototype.ownsTarget=function(m){return!!G.prototype.ownsTarget.call(this,m)||!(!this.grip1.ownsTarget(m)&&!this.grip2.ownsTarget(m))},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.manipulationStartX=m.x,this.manipulationStartY=m.y,this.state==="new"&&(this.x1=m.x,this.y1=m.y,this.x2=m.x,this.y2=m.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(F)?this.activeGrip=this.grip1:this.grip2.ownsTarget(F)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},c.prototype.pointerUp=function(m){var F=this.state;G.prototype.pointerUp.call(this,m),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(m),this._state="select",F==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(m){this.state==="creating"?this.resize(m):this.state==="move"?(this.x1=this.manipulationStartX1+m.x-this.manipulationStartX,this.y1=this.manipulationStartY1+m.y-this.manipulationStartY,this.x2=this.manipulationStartX2+m.x-this.manipulationStartX,this.y2=this.manipulationStartY2+m.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(m)},c.prototype.resize=function(m){switch(this.activeGrip){case this.grip1:this.x1=m.x,this.y1=m.y;break;case this.grip2:case void 0:this.x2=m.x,this.y2=m.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var m=new rt;return m.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(m.visual),m},c.prototype.positionGrips=function(){var m=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-m/2,this.y1-m/2),this.positionGrip(this.grip2.visual,this.x2-m/2,this.y2-m/2)},c.prototype.positionGrip=function(m,F,q){var H=m.transform.baseVal.getItem(0);H.setTranslate(F,q),m.transform.baseVal.replaceItem(H,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},c.prototype.restoreState=function(m){G.prototype.restoreState.call(this,m);var F=m;this.x1=F.x1,this.y1=F.y1,this.x2=F.x2,this.y2=F.y2},c.prototype.scale=function(m,F){G.prototype.scale.call(this,m,F),this.x1=this.x1*m,this.y1=this.y1*F,this.x2=this.x2*m,this.y2=this.y2*F,this.adjustVisual(),this.adjustControlBox()},c}(He),Ye=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.setStrokeColor=H.setStrokeColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.strokePanel=new Ke("Line color",q.defaultColorSet,q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new Ge("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return ce(c,G),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.visual&&m!==this.selectorLine&&m!==this.visibleLine)},c.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)},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.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()]]))},c.prototype.setStrokeColor=function(m){this.strokeColor=m,this.adjustVisual(),this.colorChanged(m)},c.prototype.setStrokeWidth=function(m){this.strokeWidth=m,this.adjustVisual()},c.prototype.setStrokeDasharray=function(m){this.strokeDasharray=m,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){G.prototype.restoreState.call(this,m);var F=m;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='',c}(Qe),Pe=function(G){function c(m,F,q,H){var Ce=G.call(this,m,H||'')||this;return Ce.fonts=[],Ce.fontBoxes=[],Ce.fonts=F,Ce.currentFont=q,Ce.setCurrentFont=Ce.setCurrentFont.bind(Ce),Ce}return ce(c,G),c.prototype.getUi=function(){var m=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.flexGrow="2",this.fonts.forEach(function(q){var H=document.createElement("div");H.style.display="inline-block",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.overflow="hidden",H.style.maxWidth=100/m.fonts.length-5+"%",H.style.borderColor=q===m.currentFont?m.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){m.setCurrentFont(q,H)}),F.appendChild(H);var Ce=document.createElement("div");Ce.style.display="flex",Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.fontFamily=q,Ce.style.overflow="hidden";var Ze=document.createElement("div");Ze.style.whiteSpace="nowrap",Ze.style.overflow="hidden",Ze.style.textOverflow="ellipsis",Ze.innerHTML="The quick brown fox jumps over the lazy dog",Ce.appendChild(Ze),H.appendChild(Ce),m.fontBoxes.push(H)}),F},c.prototype.setCurrentFont=function(m,F){var q=this;this.currentFont=m,this.fontBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(Ue),We=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.color="transparent",H.padding=5,H.DEFAULT_TEXT="your text here",H.text=H.DEFAULT_TEXT,H.isMoved=!1,H.color=q.defaultColor,H.fontFamily=q.defaultFontFamily,H.defaultSize={x:100,y:30},H.setColor=H.setColor.bind(H),H.setFont=H.setFont.bind(H),H.renderText=H.renderText.bind(H),H.sizeText=H.sizeText.bind(H),H.textEditDivClicked=H.textEditDivClicked.bind(H),H.showTextEditor=H.showTextEditor.bind(H),H.setSize=H.setSize.bind(H),H.positionTextEditor=H.positionTextEditor.bind(H),H.colorPanel=new Ke("Color",q.defaultColorSet,q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.fontFamilyPanel=new Pe("Font",q.defaultFontFamilies,q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H}return ce(c,G),c.prototype.ownsTarget=function(m){if(G.prototype.ownsTarget.call(this,m)||m===this.visual||m===this.textElement||m===this.bgRectangle)return!0;var F=!1;return this.textElement.childNodes.forEach(function(q){q===m&&(F=!0)}),F},c.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()},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.isMoved=!1,this.pointerDownPoint=m,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(m),this._state="creating")},c.prototype.renderText=function(){var m=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(F){m.textElement.appendChild(se.createTSpan(F.trim()===""?" ":F.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var m=this.textElement.getBBox(),F=1;if(m.width>0&&m.height>0){var q=(1*this.width-this.width*this.padding*2/100)/m.width,H=(1*this.height-this.height*this.padding*2/100)/m.height;F=Math.min(q,H)}return F},c.prototype.getTextPosition=function(m){var F=this.textElement.getBBox(),q=0,H=0;return F.width>0&&F.height>0&&(q=(this.width-F.width*m)/2,H=this.height/2-F.height*m/2),{x:q,y:H}},c.prototype.sizeText=function(){var m=this.textElement.getBBox(),F=this.getTextScale(),q=this.getTextPosition(F);q.y-=m.y*F,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+F+", "+F+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(F,F))},c.prototype.manipulate=function(m){G.prototype.manipulate.call(this,m),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(m.x-this.pointerDownPoint.x)>5||Math.abs(m.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(m){G.prototype.resize.call(this,m),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){G.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()]]))},c.prototype.pointerUp=function(m){var F=this.state;F==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,m),this.setSize(),(F==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var m=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(F){F.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var F=Number.parseFloat(m.textEditor.style.fontSize);m.textEditor.clientWidth>=Number.parseInt(m.textEditor.style.maxWidth)&&F>.9;)F-=.1,m.textEditor.style.fontSize=Math.max(F,.9)+"em"}),this.textEditor.addEventListener("keyup",function(F){F.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(F){if(F.clipboardData){var q=F.clipboardData.getData("text"),H=window.getSelection();if(!H.rangeCount)return!1;H.deleteFromDocument(),H.getRangeAt(0).insertNode(document.createTextNode(q)),F.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){m.textEditDivClicked(m.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var m=this.getTextScale(),F=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),H={x:q.width*m,y:q.height*m};F.x-=H.x/2,F.y-=H.y/2,this.textEditor.style.top=F.y+"px",this.textEditor.style.left=F.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-F.x+"px",this.textEditor.style.fontSize=Math.max(16*m,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(m){this.text=m.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},c.prototype.dblClick=function(m,F){G.prototype.dblClick.call(this,m,F),this.showTextEditor()},c.prototype.setColor=function(m){this.textElement&&se.setAttributes(this.textElement,[["fill",m]]),this.color=m,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(m)},c.prototype.setFont=function(m){this.textElement&&se.setAttributes(this.textElement,[["font-family",m]]),this.fontFamily=m,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){var F=m;this.color=F.color,this.fontFamily=F.fontFamily,this.padding=F.padding,this.text=F.text,this.createVisual(),G.prototype.restoreState.call(this,m),this.setSize()},c.prototype.scale=function(m,F){G.prototype.scale.call(this,m,F),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='',c}(Fe),Se=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.color="transparent",H.lineWidth=3,H.drawing=!1,H.pixelRatio=1,H.color=q.defaultColor,H.lineWidth=q.defaultStrokeWidth,H.pixelRatio=q.freehandPixelRatio,H.setColor=H.setColor.bind(H),H.addCanvas=H.addCanvas.bind(H),H.finishCreation=H.finishCreation.bind(H),H.setLineWidth=H.setLineWidth.bind(H),H.colorPanel=new Ke("Color",q.defaultColorSet,q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.lineWidthPanel=new Ge("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.lineWidthPanel.onWidthChanged=H.setLineWidth,H}return ce(c,G),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.visual&&m!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var m=se.createTransform();this.visual.transform.baseVal.appendItem(m),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(m,F){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(m.x,m.y),this.drawing=!0):G.prototype.pointerDown.call(this,m,F)},c.prototype.manipulate=function(m){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(m.x,m.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,m)},c.prototype.resize=function(m){G.prototype.resize.call(this,m),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(m){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,m)},c.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)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),G.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var m=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),F=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=F[0],H=F[1],Ce=F[2],Ze=F[3],nt=!1,lt=0;lt0&&(nt=!0,ltZe&&(Ze=lt),Xe>Ce&&(Ce=Xe));if(nt){this.left=q/this.pixelRatio,this.top=H/this.pixelRatio,this.width=(Ce-q)/this.pixelRatio,this.height=(Ze-H)/this.pixelRatio;var pt=document.createElement("canvas");pt.width=Ce-q,pt.height=Ze-H,pt.getContext("2d").putImageData(this.canvasContext.getImageData(q,H,Ce-q,Ze-H),0,0),this.drawingImgUrl=pt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.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})},c.prototype.setColor=function(m){this.color=m,this.colorChanged(m)},c.prototype.setLineWidth=function(m){this.lineWidth=m},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){this.createVisual(),G.prototype.restoreState.call(this,m),this.drawingImgUrl=m.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(m,F){G.prototype.scale.call(this,m,F),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='',c}(Fe),ye=function(G){function c(m,F,q){var H=G.call(this,m,q||'')||this;return H.typeBoxes=[],H.currentType=F,H.setCurrentType=H.setCurrentType.bind(H),H}return ce(c,G),c.prototype.getUi=function(){var m=this,F=document.createElement("div");F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2";for(var q=function(Ze){var nt="both";switch(Ze){case 0:nt="both";break;case 1:nt="start";break;case 2:nt="end";break;case 3:nt="none"}var lt=document.createElement("div");if(lt.style.display="flex",lt.style.flexGrow="2",lt.style.alignItems="center",lt.style.justifyContent="space-between",lt.style.padding="5px",lt.style.borderWidth="2px",lt.style.borderStyle="solid",lt.style.borderColor=nt===H.currentType?H.uiStyleSettings.toolboxAccentColor:"transparent",lt.addEventListener("click",function(){m.setCurrentType(nt,lt)}),F.appendChild(lt),nt==="both"||nt==="start"){var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.innerHTML=``,Xe.style.marginLeft="5px",lt.appendChild(Xe)}var pt=document.createElement("div");pt.style.display="flex",pt.style.alignItems="center",pt.style.minHeight="20px",pt.style.flexGrow="2";var mt=document.createElement("hr");if(mt.style.minWidth="20px",mt.style.border="0px",mt.style.borderTop="3px solid "+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee"),mt.style.flexGrow="2",pt.appendChild(mt),lt.appendChild(pt),nt==="both"||nt==="end"){var It=document.createElement("div");It.style.display="flex",It.style.alignItems="center",It.style.minHeight="20px",It.innerHTML=``,It.style.marginRight="5px",lt.appendChild(It)}H.typeBoxes.push(lt)},H=this,Ce=0;Ce<4;Ce++)q(Ce);return F},c.prototype.setCurrentType=function(m,F){var q=this;this.currentType=m,this.typeBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(Ue),xe=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.arrowType="end",H.arrowBaseHeight=10,H.arrowBaseWidth=10,H.getArrowPoints=H.getArrowPoints.bind(H),H.setArrowType=H.setArrowType.bind(H),H.arrowTypePanel=new ye("Arrow type","end"),H.arrowTypePanel.onArrowTypeChanged=H.setArrowType,H}return ce(c,G),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.arrow1&&m!==this.arrow2)},c.prototype.getArrowPoints=function(m,F){var q=this.arrowBaseWidth+2*this.strokeWidth,H=this.arrowBaseHeight+2*this.strokeWidth;return m-q/2+","+(F+H/2)+" "+m+","+(F-H/2)+" "+(m+q/2)+","+(F+H/2)},c.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)},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(G.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 m=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.arrow1.transform.baseVal.getItem(0);F.setRotate(m,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(F,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(m+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},c.prototype.setArrowType=function(m){this.arrowType=m,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){G.prototype.restoreState.call(this,m);var F=m;this.arrowType=F.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='',c}(Ye),le=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.fillColor=q.defaultFillColor,H.strokeWidth=0,H.fillPanel=new Ke("Color",q.defaultColorSet,q.defaultFillColor),H.fillPanel.onColorChanged=H.setFillColor,H}return ce(c,G),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=G.prototype.getState.call(this);return m.typeName=c.typeName,m},c.typeName="CoverMarker",c.title="Cover marker",c.icon='',c}(je),ue=function(G){function c(m,F,q,H){var Ce=G.call(this,m,H||'')||this;return Ce.opacities=[],Ce.opacityBoxes=[],Ce.opacities=F,Ce.currentOpacity=q,Ce.setCurrentOpacity=Ce.setCurrentOpacity.bind(Ce),Ce}return ce(c,G),c.prototype.getUi=function(){var m=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",F.style.justifyContent="space-between",this.opacities.forEach(function(q){var H=document.createElement("div");H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.borderColor=q===m.currentOpacity?m.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){m.setCurrentOpacity(q,H)}),F.appendChild(H);var Ce=document.createElement("div");Ce.innerText=100*q+"%",H.appendChild(Ce),m.opacityBoxes.push(H)}),F},c.prototype.setCurrentOpacity=function(m,F){var q=this;this.currentOpacity=m,this.opacityBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(Ue),me=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.setOpacity=H.setOpacity.bind(H),H.fillColor=q.defaultHighlightColor,H.strokeWidth=0,H.opacity=q.defaultHighlightOpacity,H.fillPanel=new Ke("Color",q.defaultColorSet,H.fillColor),H.fillPanel.onColorChanged=H.setFillColor,H.opacityPanel=new ue("Opacity",q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return ce(c,G),c.prototype.setOpacity=function(m){this.opacity=m,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=G.prototype.getState.call(this);return m.typeName=c.typeName,m},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='',c}(le),Ee='',we=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.bgColor="transparent",H.tipPosition={x:0,y:0},H.tipBase1Position={x:0,y:0},H.tipBase2Position={x:0,y:0},H.tipMoving=!1,H.color=q.defaultStrokeColor,H.bgColor=q.defaultFillColor,H.fontFamily=q.defaultFontFamily,H.defaultSize={x:100,y:30},H.setBgColor=H.setBgColor.bind(H),H.getTipPoints=H.getTipPoints.bind(H),H.positionTip=H.positionTip.bind(H),H.setTipPoints=H.setTipPoints.bind(H),H.colorPanel=new Ke("Text color",q.defaultColorSet,H.color,''),H.colorPanel.onColorChanged=H.setColor,H.bgColorPanel=new Ke("Fill color",q.defaultColorSet,H.bgColor,Ee),H.bgColorPanel.onColorChanged=H.setBgColor,H.fontFamilyPanel=new Pe("Font",q.defaultFontFamilies,q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H.tipGrip=new rt,H.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),H.controlBox.appendChild(H.tipGrip.visual),H}return ce(c,G),c.prototype.ownsTarget=function(m){return G.prototype.ownsTarget.call(this,m)||this.tipGrip.ownsTarget(m)||this.tip===m},c.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)},c.prototype.pointerDown=function(m,F){this.state==="new"&&G.prototype.pointerDown.call(this,m,F),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(F)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,m,F)},c.prototype.pointerUp=function(m){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,m);else{var F=this.state==="creating";G.prototype.pointerUp.call(this,m),this.setTipPoints(F),this.positionTip()}},c.prototype.manipulate=function(m){if(this.tipMoving){var F=this.unrotatePoint(m);this.tipPosition={x:F.x-this.manipulationStartLeft,y:F.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,m)},c.prototype.setBgColor=function(m){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",m]]),se.setAttributes(this.tip,[["fill",m]])),this.bgColor=m,this.fillColorChanged(m)},c.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},c.prototype.setTipPoints=function(m){m===void 0&&(m=!1);var F=Math.min(this.height/2,15),q=this.height/5;m&&(this.tipPosition={x:F+q/2,y:this.height+20});var H=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?H',c}(We),Ie=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.fillColor=q.defaultFillColor,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.setOpacity=H.setOpacity.bind(H),H.createVisual=H.createVisual.bind(H),H.strokePanel=new Ke("Line color",ne(q.defaultColorSet,["transparent"]),q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.fillPanel=new Ke("Fill color",ne(q.defaultColorSet,["transparent"]),H.fillColor,Ee),H.fillPanel.onColorChanged=H.setFillColor,H.strokeWidthPanel=new Ge("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H.opacityPanel=new ue("Opacity",q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return ce(c,G),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.visual)},c.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)},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.state==="new"&&(this.createVisual(),this.moveVisual(m),this._state="creating")},c.prototype.manipulate=function(m){G.prototype.manipulate.call(this,m)},c.prototype.resize=function(m){G.prototype.resize.call(this,m),this.setSize()},c.prototype.setSize=function(){G.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()]])},c.prototype.pointerUp=function(m){G.prototype.pointerUp.call(this,m),this.setSize()},c.prototype.setStrokeColor=function(m){this.strokeColor=m,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(m),this.stateChanged()},c.prototype.setFillColor=function(m){this.fillColor=m,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(m),this.stateChanged()},c.prototype.setStrokeWidth=function(m){this.strokeWidth=m,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(m){this.strokeDasharray=m,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.setOpacity=function(m){this.opacity=m,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){var F=m;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),G.prototype.restoreState.call(this,m),this.setSize()},c.prototype.scale=function(m,F){G.prototype.scale.call(this,m,F),this.setSize()},c.typeName="EllipseMarker",c.title="Ellipse marker",c.icon='',c}(Fe),$e=function(G){function c(m,F,q){return G.call(this,m,F,q)||this}return ce(c,G),Object.defineProperty(c.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.tip1&&m!==this.tip2)},c.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)},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(G.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 m=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.tip1.transform.baseVal.getItem(0);F.setRotate(m,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(F,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(m+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=G.prototype.getState.call(this);return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){G.prototype.restoreState.call(this,m),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='',c}(Ye),at=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.strokePanel.colors=q.defaultColorSet,H.fillColor="transparent",H}return ce(c,G),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=G.prototype.getState.call(this);return m.typeName=c.typeName,m},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='',c}(Ie),ht=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.prototype.addUndoStep=function(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},G.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.prototype.undo=function(){if(this.undoStack.length>1){var c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),ut=function(G){function c(m,F,q){var H=G.call(this,m,F,q)||this;return H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.curveX=0,H.curveY=0,H.manipulationStartCurveX=0,H.manipulationStartCurveY=0,H.setStrokeColor=H.setStrokeColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.positionGrips=H.positionGrips.bind(H),H.addControlGrips=H.addControlGrips.bind(H),H.adjustVisual=H.adjustVisual.bind(H),H.setupControlBox=H.setupControlBox.bind(H),H.resize=H.resize.bind(H),H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.strokePanel=new Ke("Line color",q.defaultColorSet,q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new Ge("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return ce(c,G),c.prototype.ownsTarget=function(m){return!(!G.prototype.ownsTarget.call(this,m)&&m!==this.visual&&m!==this.selectorCurve&&m!==this.visibleCurve&&!this.curveGrip.ownsTarget(m))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.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)},c.prototype.pointerDown=function(m,F){G.prototype.pointerDown.call(this,m,F),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=m.x,this.curveY=m.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(F)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.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()]]))},c.prototype.setupControlBox=function(){G.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)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,G.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var m=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-m/2,this.curveY-m/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()))},c.prototype.manipulate=function(m){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+m.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+m.y-this.manipulationStartY),G.prototype.manipulate.call(this,m)},c.prototype.resize=function(m){this.activeGrip===this.curveGrip&&(this.curveX=m.x,this.curveY=m.y),G.prototype.resize.call(this,m),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(m){this.strokeColor=m,this.adjustVisual(),this.colorChanged(m)},c.prototype.setStrokeWidth=function(m){this.strokeWidth=m,this.adjustVisual()},c.prototype.setStrokeDasharray=function(m){this.strokeDasharray=m,this.adjustVisual()},c.prototype.scale=function(m,F){this.curveX=this.curveX*m,this.curveY=this.curveY*F,G.prototype.scale.call(this,m,F)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var m=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return m.typeName=c.typeName,m},c.prototype.restoreState=function(m){G.prototype.restoreState.call(this,m);var F=m;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.curveX=F.curveX,this.curveY=F.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='',c}(Qe),xt=function(){function G(c,m){m===void 0&&(m=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=m}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),Ct=function(G){function c(m,F,q){var H=G.call(this,m,!1)||this;return H.dataUrl=F,H.state=q,H}return ce(c,G),c}(xt),st=function(G){function c(m,F,q){q===void 0&&(q=!1);var H=G.call(this,m,q)||this;return H.marker=F,H}return ce(c,G),c}(xt),Mt=function(){function G(){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 G.prototype.addEventListener=function(c,m){this[c].push(m)},G.prototype.removeEventListener=function(c,m){var F=this[c].indexOf(m);F>-1&&this[c].splice(F,1)},G}(),Lt=function(){function G(c){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Re,this._isOpen=!1,this.undoRedoManager=new ht,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Mt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new fe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.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(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[ze,Se,xe,We,at,Ie,me,we,$e,le,Ye,ut]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ze,Se,xe,We,Ie,me,we]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ze,Se,xe,We,me]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var m=this;this._availableMarkerTypes.splice(0),c.forEach(function(F){if(typeof F=="string"){var q=m.ALL_MARKER_TYPES.find(function(H){return H.typeName===F});q!==void 0&&m._availableMarkerTypes.push(q)}else m._availableMarkerTypes.push(F)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(c){this._zoomLevel=c,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),J.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&oe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=oe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(m){return m(new xt(c))})},G.prototype.render=function(){return ae(this,void 0,void 0,function(){var c;return de(this,function(m){switch(m.label){case 0:return this.setCurrentMarker(),(c=new ee).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return m.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,m.sent()]}})})},G.prototype.close=function(c){var m=this;if(c===void 0&&(c=!1),this.isOpen){var F=!1;c||this.eventListeners.beforeclose.forEach(function(q){var H=new xt(m,!0);q(H),H.defaultPrevented&&(F=!0)}),F||(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(q){return q(new xt(m))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var c,m=[],F=0;Fthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,F=m',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},G.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")},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new De(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(c),1),c.dispose()},G.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())},G.prototype.toolbarButtonClicked=function(c,m){if(c==="marker"&&m!==void 0)this.createNewMarker(m);else if(c==="action")switch(m){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()}},G.prototype.deleteSelectedMarker=function(){var c=this;if(this._currentMarker!==void 0){var m=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var H=new st(c,c._currentMarker,!0);q(H),H.defaultPrevented&&(m=!0)}),!m){var F=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(q){return q(new st(c,F))})}}},G.prototype.clear=function(){var c=this,m=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ce){var Ze=new st(c,void 0,!0);Ce(Ze),Ze.defaultPrevented&&(m=!0)}),!m)){this.setCurrentMarker();for(var F=function(Ce){var Ze=q.markers[Ce];q.setCurrentMarker(q.markers[Ce]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(nt){return nt(new st(c,Ze))})},q=this,H=this.markers.length-1;H>=0;H--)F(H);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.prototype.showNotesEditor=function(){var c;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=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",this.overlayContainer.appendChild(this.notesArea))},G.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)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var m=this.getState(),F=this.undoRedoManager.getLastUndoStep();if(!F||F.width===m.width&&F.height===m.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(m),q1&&this.panTo({x:c.clientX,y:c.clientY}))},G.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(c,m){var F=this.markerImage.getBoundingClientRect();return{x:(c-F.left)/this.zoomLevel,y:(m-F.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"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()},G.prototype.addLicenseKey=function(c){J.addKey(c)},G.prototype.addEventListener=function(c,m){this.eventListeners.addEventListener(c,m)},G.prototype.removeEventListener=function(c,m){this.eventListeners.removeEventListener(c,m)},G.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(m){return m(new xt(c))}))},G.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(m){return m(new xt(c))}))},G.instanceCounter=0,G}();/* **********************************
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 kt=function(G,c){return(kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,F){m.__proto__=F}||function(m,F){for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(m[q]=F[q])})(G,c)};function Dt(G,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function m(){this.constructor=G}kt(G,c),G.prototype=c===null?Object.create(c):(m.prototype=c.prototype,new m)}function Tt(G,c,m,F){return new(m||(m=Promise))(function(q,H){function Ce(lt){try{nt(F.next(lt))}catch(Xe){H(Xe)}}function Ze(lt){try{nt(F.throw(lt))}catch(Xe){H(Xe)}}function nt(lt){var Xe;lt.done?q(lt.value):(Xe=lt.value,Xe instanceof m?Xe:new m(function(pt){pt(Xe)})).then(Ce,Ze)}nt((F=F.apply(G,c||[])).next())})}function Ut(G,c){var m,F,q,H,Ce={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return H={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function Ze(nt){return function(lt){return function(Xe){if(m)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(m=1,F&&(q=2&Xe[0]?F.return:Xe[0]?F.throw||((q=F.return)&&q.call(F),0):F.next)&&!(q=q.call(F,Xe[1])).done)return q;switch(F=0,q&&(Xe=[2&Xe[0],q.value]),Xe[0]){case 0:case 1:q=Xe;break;case 4:return Ce.label++,{value:Xe[1],done:!1};case 5:Ce.label++,F=Xe[1],Xe=[0];continue;case 7:Xe=Ce.ops.pop(),Ce.trys.pop();continue;default:if(!(q=Ce.trys,(q=q.length>0&&q[q.length-1])||Xe[0]!==6&&Xe[0]!==2)){Ce=0;continue}if(Xe[0]===3&&(!q||Xe[1]>q[0]&&Xe[1]0&&m>0){var F=new sr(c,m),q=F.ratio>=1?20:F.getHorizontalLength(20),H=F.ratio<1?20:F.getVerticalLength(20),Ce=document.createElementNS("http://www.w3.org/2000/svg","svg");Ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ce);var Ze=yt.createDefs();Ce.appendChild(Ze);var nt=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ze.appendChild(nt);var lt=yt.createPath(yt.getHollowRectanglePath((24-q)/2,(24-H)/2,q,H,(24-q)/2+2,(24-H)/2+2,q-4,H-4));Ce.appendChild(lt);var Xe=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Xe.appendChild(yt.createTSpan(c+":"+m)),Ce.appendChild(Xe);var pt=Xe.getBBox();yt.setAttributes(Xe,[["x",((24-pt.width)/2).toString()],["y",((24-pt.height)/2-pt.y).toString()]]);var mt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(pt.width))/2,(24-Math.ceil(pt.height))/2,Math.ceil(pt.width),Math.ceil(pt.height)));return nt.appendChild(mt),yt.setAttributes(lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ce),Ce.outerHTML}return''},G}(),gr=function(G){function c(m,F,q){var H=G.call(this,m,F)||this;return H.isDropdownOpen=!1,H.onClick=H.dropdownButtonClicked,H.dropdownButtons=q,H}return Dt(c,G),c.prototype.setupDropdown=function(){var m=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(F){F.className=m.className,F.colorsClassName=m.colorsClassName,m.dropdownBlock.appendChild(F.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},c.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},c.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},c.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},c.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},c.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},c}(Nt),Pt=function(){function G(c,m){this.GRIP_SIZE=10,this.color=c,this.fillColor=m,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},G.prototype.setCenter=function(c,m){this.visual.childNodes.forEach(function(F){return yt.setAttributes(F,[["cx",c.toString()],["cy",m.toString()]])})},G}(),yr=function(){function G(c,m,F,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=c,this.canvasHeight=m,this.margin=F,this.container=q,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(G.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(c){this._aspectRatio=c,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(c){this._zoomFactor=c,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var c=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var m=0;mthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-m.height/2),yt.setAttributes(this.cropRectElement,[["x",m.x.toString()],["y",m.y.toString()],["width",m.width.toString()],["height",m.height.toString()]]);var F=m.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(H,Ce){var Ze=m.y+F*(Ce+1);yt.setAttributes(H,[["x1",""+m.x],["y1",""+Ze],["x2",""+(m.x+m.width)],["y2",""+Ze]])});var q=m.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(H,Ce){var Ze=m.x+q*(Ce+1);yt.setAttributes(H,[["x1",""+Ze],["y1",""+m.y],["x2",""+Ze],["y2",""+(m.y+m.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,m.x,m.y,m.width,m.height)]]),this.topLeftGrip.setCenter(m.x,m.y),this.topRightGrip.setCenter(m.x+m.width,m.y),this.bottomLeftGrip.setCenter(m.x,m.y+m.height),this.bottomRightGrip.setCenter(m.x+m.width,m.y+m.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.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)},G.prototype.clientToLocalCoordinates=function(c,m){var F=this.container.getBoundingClientRect();return{x:c-F.left+this.margin,y:m-F.top+this.margin}},G.prototype.onPointerDown=function(c){this.container.setPointerCapture(c.pointerId),this.previousPoint=this.clientToLocalCoordinates(c.clientX,c.clientY),this.cropRectElement===c.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(c.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(c.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(c.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(c.target)&&(this.activeGrip=this.bottomRightGrip)},G.prototype.onPointerMove=function(c){if(this.isMoving)this.move(this.clientToLocalCoordinates(c.clientX,c.clientY));else if(this.activeGrip){var m=this.clientToLocalCoordinates(c.clientX,c.clientY);this.resize(m)}c.preventDefault()},G.prototype.onPointerUp=function(c){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(c.pointerId)},G.prototype.move=function(c){var m=c.x-this.previousPoint.x,F=c.y-this.previousPoint.y;this.zoomFactor!==1&&(m=-m/this.zoomFactor,F=-F/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+m),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+F),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=c},G.prototype.resize=function(c){var m=Object.assign({},this.cropRect),F=c.x-this.previousPoint.x,q=c.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:m.x+Fthis.canvasWidth*this.zoomFactor&&(F=this.canvasWidth*this.zoomFactor-m.width),m.width+=F}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(m.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(F),m.height=this.aspectRatio.getVerticalLength(m.width)):(m.y+=q,m.height=this.cropRect.y+this.cropRect.height-m.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?m.height=this.aspectRatio.getVerticalLength(m.width):m.height+=q}m.width<10&&(m.x=this.cropRect.x,m.width=10),m.height<10&&(m.y=this.cropRect.y,m.height=10),this.previousPoint=c,m.x>=this.margin&&m.y>=this.margin&&m.x-this.margin+m.width<=this.canvasWidth&&m.y-this.margin+m.height<=this.canvasHeight&&(this.cropRect=m,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var c=this.cropRect.x+this.cropRect.width/2,m=this.cropRect.y+this.cropRect.height/2,F=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);F/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=c-this.cropRect.width/2,this.cropRect.y=m-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)}},G.prototype.getRescaledRect=function(c,m,F,q,H,Ce){var Ze=F/c,nt=q/m;return{x:(H.x-Ce)*Ze+Ce,y:(H.y-Ce)*nt+Ce,width:H.width*Ze,height:H.height*nt}},G.prototype.scaleCanvas=function(c,m){var F=this.getRescaledRect(this.canvasWidth,this.canvasHeight,c,m,this.cropRect,this.margin);this.canvasWidth=c,this.canvasHeight=m,this.onCropChange&&this.onCropChange(F),this.setCropRectangle(F)},G}(),dr=function(){function G(c){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=c,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(G.prototype,"angle",{get:function(){return this._angle},set:function(c){this._angle=c,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.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},G.prototype.onPointerDown=function(c){this.controlContainer.setPointerCapture(c.pointerId),this.isDragging=!0,this.previousPoint={x:c.clientX,y:c.clientY}},G.prototype.onPointerMove=function(c){this.isDragging&&(this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.previousPoint.x=c.clientX)},G.prototype.onPointerUp=function(c){this.isDragging&&this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(c.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var c=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-c.width)/2).toString()],["y",(this.height/2).toString()]])}},G.prototype.positionScaleShape=function(){if(this.scaleShape){var c=this.scaleShape.transform.baseVal.getItem(0);c.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(c,0)}},G.prototype.getVisual=function(){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("width",this.width+"px"),c.setAttribute("height",this.height+"px"),c.setAttribute("viewBox","0 0 "+this.width+" "+this.height),c.style.flexShrink="0",document.body.appendChild(c);for(var m="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,F=1;F<=this.width/5+10;F++){var q=F%5==0?this.height/3:this.height/6;m+="h4v"+-q+"h1v"+q}m+="v1H0Z",this.scaleShape=yt.createPath(m);var H=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(H),c.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ce=yt.createTSpan("");return Ce.innerHTML="°",this.angleLabelElement.appendChild(Ce),c.appendChild(this.angleLabelElement),document.body.removeChild(c),c},G}(),qr=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(c,m,F,q,H,Ce,Ze){var nt=this;return new Promise(function(lt){var Xe=document.createElement("canvas");Xe.width=c.width.baseVal.value-2*q,Xe.height=c.height.baseVal.value-2*q;var pt=1,mt=1;nt.naturalSize===!0?(pt=m.naturalWidth/(c.width.baseVal.value-2*q)/Ce,mt=m.naturalHeight/(c.height.baseVal.value-2*q)/Ze,Xe.width=m.naturalWidth/Ce,Xe.height=m.naturalHeight/Ze):nt.width!==void 0&&nt.height!==void 0&&(pt=nt.width/F.width,mt=nt.height/F.height,Xe.width*=pt,Xe.height*=mt);var It=Xe.getContext("2d");It.translate(Xe.width/2,Xe.height/2),It.rotate(H*Math.PI/180),It.scale(Ce,Ze),It.translate(-Xe.width/2,-Xe.height/2),It.drawImage(m,0,0,Xe.width,Xe.height);var lr=document.createElement("canvas");lr.width=F.width*pt,lr.height=F.height*mt,lr.getContext("2d").putImageData(It.getImageData((F.x-q)*pt,(F.y-q)*mt,F.width*pt,F.height*mt),0,0),lt(lr.toDataURL(nt.imageType,nt.imageQuality))})},G}(),qe=function(){function G(c){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=G.instanceCounter++,this.styles=new pr(this.instanceNo),this.target=c,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(c){this._zoomToCropEnabled=c,c?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gridLines",{get:function(){return this._gridLines},set:function(c){this._gridLines=c,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(c){this._rotationAngle=c,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"aspectRatio",{get:function(){var c;return(c=this._aspectRatio)!==null&&c!==void 0?c:this.aspectRatios[0]},set:function(c){this._aspectRatio=c},enumerable:!1,configurable:!0}),G.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},G.prototype.show=function(){this.showUI(),this.open()},G.prototype.close=function(c){c===void 0&&(c=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),c||this.closeEventListeners.forEach(function(m){return m()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(c){this.renderEventListeners.push(c)},G.prototype.removeRenderEventListener=function(c){this.renderEventListeners.indexOf(c)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(c),1)},G.prototype.addCloseEventListener=function(c){this.closeEventListeners.push(c)},G.prototype.removeCloseEventListener=function(c){this.closeEventListeners.indexOf(c)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(c),1)},G.prototype.setupResizeObserver=function(){var c=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){c.resize(c.target.clientWidth,c.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))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var c=1*this.target.clientWidth/this.target.clientHeight,m=this.contentDiv.clientWidth/c>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*c:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,F=m+2*this.CANVAS_MARGINc+this.CANVAS_MARGIN?this.target.offsetTop-(c+this.CANVAS_MARGIN):0;this.coverDiv.style.top=m+"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},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var c=this;this.topToolbar=new ur,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 m=new vr;m.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(m);var F=[];this.aspectRatios.forEach(function(mt){var It=new Nt(Tr.getIcon(mt.horizontal,mt.vertical),mt.horizontal===0&&mt.vertical===0?"FREE":mt.horizontal+":"+mt.vertical);It.onClick=function(){return c.ratioButtonClicked(mt)},F.push(It)}),this.aspectRatioButton=new gr(Tr.getIcon(0,0),"Aspect ratio",F),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,m.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new Nt('',"Toggle grid");q.isActive=this.isGridVisible,q.onClick=function(){c.isGridVisible=!c.isGridVisible,q.isActive=c.isGridVisible},m.addButton(q);var H=new Nt('',"Zoom to selection");if(H.isActive=this.zoomToCropEnabled,H.onClick=function(){c.zoomToCropEnabled=!c.zoomToCropEnabled,H.isActive=c.zoomToCropEnabled},m.addButton(H),!Qt.isLicensed){var Ce=new ft;this.topToolbar.addElementBlock(Ce);var Ze=document.createElement("div");Ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var nt=document.createElement("a");nt.style.color="currentColor",nt.href="https://markerjs.com/products/cropro",nt.target="_blank",nt.innerHTML='',Ze.appendChild(nt),Ce.addElement(Ze)}var lt=new vr;lt.minWidth=3*this.toolbarHeight+"px",lt.contentAlign="end",this.topToolbar.addButtonBlock(lt);var Xe=new Nt('',"OK");Xe.onClick=this.startRenderAndClose,lt.addButton(Xe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Xe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var pt=new Nt('',"Close");pt.onClick=this.close,lt.addButton(pt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(pt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var c=this;this.bottomToolbar=new ur,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 m=new vr;m.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(m);var F=new Nt('',"Rotate left");F.onClick=this.rotateLeftButtonClicked,m.addButton(F);var q=new Nt('',"Rotate right");q.onClick=this.rotateRightButtonClicked,m.addButton(q);var H=new ft;H.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(H),this.straightener=new dr("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(lt){c.rotateBy(lt),c.straightener.angle=c.rotationAngle},H.addElement(this.straightener.getUI());var Ce=new vr;Ce.minWidth=2*this.toolbarHeight+"px",Ce.contentAlign="end",this.bottomToolbar.addButtonBlock(Ce);var Ze=new Nt('',"Flip horizontal");Ze.onClick=this.flipHorizontallyButtonClicked,Ce.addButton(Ze);var nt=new Nt('',"Flip vertical");nt.onClick=this.flipVerticallyButtonClicked,Ce.addButton(nt)},G.prototype.ratioButtonClicked=function(c){this.aspectRatio=c,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Tr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new sr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(c){if(c){var m=this.cropLayer.getRescaledRect(c.width,c.height,this.imageWidth,this.imageHeight,c.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(m),this.cropRectChanged(m),this.flippedHorizontally=c.flippedHorizontally,this.flippedVertically=c.flippedVertically,this.applyFlip(),this.rotationAngle=c.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(c,m){var F=this.cropImage.getBoundingClientRect();return{x:c-F.left,y:m-F.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var c=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=c+"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()},G.prototype.rotateLeftButtonClicked=function(){var c=this.rotationAngle-90;this.rotationAngle%90!=0&&(c+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(c)},G.prototype.rotateRightButtonClicked=function(){var c=this.rotationAngle+90;this.rotationAngle%90!=0&&(c-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(c)},G.prototype.rotateTo=function(c){c=(c=c>180?c-360:c)<=-180?c+360:c,this.rotationAngle=c,this.applyRotation()},G.prototype.rotateBy=function(c){this.rotateTo((this.rotationAngle+c)%360)},G.prototype.applyRotation=function(){var c=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var m=this.editingTargetRotationContainer.transform.baseVal.getItem(0);m.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(m,0);var F=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/F.width,this.imageHeight/F.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=c},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return Tt(this,void 0,void 0,function(){var c,m;return Ut(this,function(F){switch(F.label){case 0:return[4,this.render()];case 1:return c=F.sent(),m=this.getState(),this.renderEventListeners.forEach(function(q){return q(c,m)}),this.close(!0),[2]}})})},G.prototype.render=function(){return Tt(this,void 0,void 0,function(){var c;return Ut(this,function(m){switch(m.label){case 0:return(c=new qr).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.width=this.renderWidth,c.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,c.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 m.sent(),[4,c.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,m.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new tr("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 tr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new tr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var c=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new tr("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*c)+`px;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new tr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new tr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Bt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new tr("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 tr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new tr("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 tr("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new tr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},G.instanceCounter=0,G}(),wt=ie("8hTe"),zr=ie.n(wt),Ir=/]*>/g;function Zr(G){var c=document.createElement("div");return c.innerHTML=G,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var Wr=tt.a=function(G){var c=G.value,m=c===void 0?"":c,F=G.edit,q=F===void 0?!1:F,H=G.className,Ce=G.showTextOnly,Ze=G.showLines,nt=G.replaces,lt=G.zoomImg,Xe=G.hasMask,pt=G.style,mt=pt===void 0?{}:pt,It=G.stylesPrev,lr=It===void 0?{}:It,$t=String(m),rr=Object(R.useRef)(),xr=Object(R.useRef)(),Nr=Object(R.useState)(""),ir=Object(K.a)(Nr,2),Xt=ir[0],wr=ir[1],Hr=Object(R.useState)("office"),ar=Object(K.a)(Hr,2),yn=ar[0],Ar=ar[1],_r=function(){var Ht=new qe(xr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var br=Object(I.a)(M.a.mark(function Ft(cr){var zt;return M.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return rr.current.style.display="none",mr.next=3,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cr}});case 3:zt=mr.sent,zt!=null&&zt.id&&nt(xr.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 5:case"end":return mr.stop()}},Ft)}));return function(Ft){return br.apply(this,arguments)}}()),Ht.show()},Rn=function(){var Ht=new Lt(xr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var br=Object(I.a)(M.a.mark(function Ft(cr){var zt;return M.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(rr.current.style.display="none",!xr.current){mr.next=6;break}return mr.next=4,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cr.dataUrl}});case 4:zt=mr.sent,zt!=null&&zt.id&&nt(xr.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 6:case"end":return mr.stop()}},Ft)}));return function(Ft){return br.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},jt=Object(R.useMemo)(function(){rr.current&&(rr.current.style.zIndex=-1);try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,br=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;$t=$t.replace(Zt,"("+re.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+re.a.API_SERVER+"/api/attachments/").replace(br,'"'+re.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(Vr){}var Ft=V($t),cr=T();if($t.match(/\[TOC\]/)&&(Ft=Ft.replace("[TOC]
",w()),S()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,function(Vr,mr){var Lr=cr[mr],ln=Lr.type,pn=Lr.expression;return Object(pe.renderToString)(Zr(pn)||"",{displayMode:ln==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581"),v(),Ce){var zt=document.createElement("div");return zt.innerHTML=Ft,zt.innerText}return setTimeout(function(){return Cr()},500),Ft},[$t]),vt=Object(R.useRef)();g.WebkitLineClamp=Ze,Ze&&(mt=Object(U.a)(Object(U.a)({},mt),g));function ot(Zt){var Ht=Zt.target;if(Ht.tagName.toUpperCase()==="IMG"){if(lt){var br=Ht.getAttribute("src");wr(br),Ar("image")}}else if(Ht.tagName.toUpperCase()==="A"){var Ft=Ht.getAttribute("href");if(Ft.indexOf("office")>-1)Zt.preventDefault(),wr(Ft),Ar("office");else if(Ft.indexOf("application/pdf")>-1)Zt.preventDefault(),wr(Ft),Ar("pdf");else if(Ft.indexOf("text/html")>-1)Zt.preventDefault(),wr(Ft),Ar("html");else if(Ft.startsWith("#")){Zt.preventDefault();var cr=document.getElementById(Ft.replace("#",""));cr&&cr.scrollIntoView(!0)}}}var Cr=function(){var Ht,br=(Ht=vt.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");br==null||br.forEach(function(Ft){if(Ft.oncontextmenu=function(){return!1},Ft.src.indexOf(".m3u8")>-1&&!Ft.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var cr=new $.a;cr.loadSource(Ft.src),cr.attachMedia(Ft)}}})};Object(R.useEffect)(function(){if(vt.current&&jt&&(jt.match(Ir)&&window.PR.prettyPrint()),vt.current)return vt.current.addEventListener("click",ot),function(){vt.current.removeEventListener("click",ot),v(),S()}},[jt,vt.current,ot]);var Yt=function(Ht){if(!q)return;Ht.target.nodeName==="IMG"?(rr.current.style.zIndex=1,rr.current.style.display="flex",rr.current.style.width=Ht.target.clientWidth+"px",rr.current.style.height=Ht.target.clientHeight+"px",rr.current.style.top=Ht.target.offsetTop+"px",rr.current.style.left=Ht.target.offsetLeft+"px",xr.current.src=Ht.target.getAttribute("src")):rr.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:vt,style:Object(U.a)({},mt),className:"".concat(H||""," markdown-body ").concat(zr.a.mdBody),onMouseOver:Yt,dangerouslySetInnerHTML:{__html:jt}}),E.a.createElement("div",{ref:rr,className:zr.a.button},E.a.createElement(Y.a,null,E.a.createElement(Z.a,{onClick:function(){return _r()}},"\u88C1\u526A"),E.a.createElement(Z.a,{onClick:function(){return Rn()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:xr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(ve.a,{close:!0,data:Xt,type:Xt!=null&&Xt.length?yn:"",style:Object(U.a)({},lr),onClose:function(){return wr("")}}))}},"9VGf":function(Et,tt,ie){"use strict";ie.d(tt,"a",function(){return O});var he=ie("q1tI"),Y=ie.n(he);function O(Z,U){var I=Object(he.useRef)();Object(he.useEffect)(function(){I.current=Z}),Object(he.useEffect)(function(){function K(){I.current()}if(U!==null){var B=setInterval(K,U);return function(){return clearInterval(B)}}},[U])}},Bd2K:function(Et,tt,ie){(function(he){he(ie("VrN/"),ie("osHv"))})(function(he){he.defineOption("autoCloseTags",!1,function(M,R,E){if(E!=he.Init&&E&&M.removeKeyMap("autoCloseTags"),!R)return;var L={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(L["'/'"]=function(_){return I(_)}),(typeof R!="object"||R.whenOpening!==!1)&&(L["'>'"]=function(_){return Z(_)}),M.addKeyMap(L)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],O=["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 Z(M){if(M.getOption("disableInput"))return he.Pass;for(var R=M.listSelections(),E=[],L=M.getOption("autoCloseTags"),_=0;_A.ch&&(l=l.slice(0,l.length-x.end+A.ch));var p=l.toLowerCase();if(!l||x.type=="string"&&(x.end!=A.ch||!/[\"\']/.test(x.string.charAt(x.string.length-1))||x.string.length==1)||x.type=="tag"&&o.close||x.string.indexOf("/")==A.ch-x.start-1||S&&K(S,p)>-1||B(M,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(h)||[],l,A,!0))return he.Pass;var w=typeof L=="object"&&L.emptyTags;if(w&&K(w,l)>-1){E[_]={text:"/>",newPos:he.Pos(A.line,A.ch+2)};continue}var b=g&&K(g,p)>-1;E[_]={indent:b,text:">"+(b?`
`:"")+""+l+">",newPos:b?he.Pos(A.line+1,0):he.Pos(A.line,A.ch+1)}}for(var u=typeof L=="object"&&L.dontIndentOnAutoClose,_=R.length-1;_>=0;_--){var f=E[_];M.replaceRange(f.text,R[_].head,R[_].anchor,"+insert");var s=M.listSelections().slice(0);s[_]={head:f.newPos,anchor:f.newPos},M.setSelections(s),!u&&f.indent&&(M.indentLine(f.newPos.line,null,!0),M.indentLine(f.newPos.line+1,null,!0))}}function U(M,R){for(var E=M.listSelections(),L=[],_=R?"/":"",A=M.getOption("autoCloseTags"),x=typeof A=="object"&&A.dontIndentOnSlash,y=0;y"&&(S+=">"),L[y]=S}if(M.replaceSelections(L),E=M.listSelections(),!x)for(var y=0;y=0&&R[h]==E;h--)++y;L=x.to;for(var h=1;h0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],E=0;ESe.length)&&(ye=Se.length);for(var xe=0,le=new Array(ye);xe=Se.length?{done:!0}:{done:!1,value:Se[le++]}}}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 xe=Se[Symbol.iterator](),xe.next.bind(xe)}function I(Se,ye){return ye={exports:{}},Se(ye,ye.exports),ye.exports}var K=I(function(Se){function ye(){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 xe(le){Se.exports.defaults=le}Se.exports={defaults:ye(),getDefaults:ye,changeDefaults:xe}}),B=K.defaults,M=K.getDefaults,R=K.changeDefaults,E=/[&<>"']/,L=/[&<>"']/g,_=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,x={"&":"&","<":"<",">":">",'"':""","'":"'"},y=function(ye){return x[ye]};function h(Se,ye){if(ye){if(E.test(Se))return Se.replace(L,y)}else if(_.test(Se))return Se.replace(A,y);return Se}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Se){return Se.replace(o,function(ye,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var d=/(^|[^\[])\^/g;function S(Se,ye){Se=Se.source||Se,ye=ye||"";var xe={replace:function(ue,me){return me=me.source||me,me=me.replace(d,"$1"),Se=Se.replace(ue,me),xe},getRegex:function(){return new RegExp(Se,ye)}};return xe}var g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(Se,ye,xe){if(Se){var le;try{le=decodeURIComponent(l(xe)).replace(g,"").toLowerCase()}catch(ue){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}ye&&!p.test(xe)&&(xe=a(ye,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(ue){return null}return xe}var b={},u=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(Se,ye){b[" "+Se]||(u.test(Se)?b[" "+Se]=Se+"/":b[" "+Se]=D(Se,"/",!0)),Se=b[" "+Se];var xe=Se.indexOf(":")===-1;return ye.substring(0,2)==="//"?xe?ye:Se.replace(f,"$1")+ye:ye.charAt(0)==="/"?xe?ye:Se.replace(s,"$1")+ye:Se+ye}var T={exec:function(){}};function v(Se){for(var ye=1,xe,le;ye=0&&we[$e]==="\\";)Ie=!Ie;return Ie?"|":" |"}),le=xe.split(/ \|/),ue=0;if(le.length>ye)le.splice(ye);else for(;le.length=le.length?ue.slice(le.length):ue}).join(`
`)}var Le=function(){function Se(xe){this.options=xe||P}var ye=Se.prototype;return ye.space=function(le){var ue=this.rules.block.newline.exec(le);if(ue)return ue[0].length>1?{type:"space",raw:ue[0]}:{raw:`
`}},ye.code=function(le,ue){var me=this.rules.block.code.exec(le);if(me){var Ee=ue[ue.length-1];if(Ee&&Ee.type==="paragraph")return{raw:me[0],text:me[0].trimRight()};var we=me[0].replace(/^ {4}/gm,"");return{type:"code",raw:me[0],codeBlockStyle:"indented",text:this.options.pedantic?we:N(we,`
`)}}},ye.fences=function(le){var ue=this.rules.block.fences.exec(le);if(ue){var me=ue[0],Ee=Ae(me,ue[3]||"");return{type:"code",raw:me,lang:ue[2]?ue[2].trim():ue[2],text:Ee}}},ye.heading=function(le){var ue=this.rules.block.heading.exec(le);if(ue)return{type:"heading",raw:ue[0],depth:ue[1].length,text:ue[2]}},ye.nptable=function(le){var ue=this.rules.block.nptable.exec(le);if(ue){var me={type:"table",header:$(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
`):[],raw:ue[0]};if(me.header.length===me.align.length){var Ee=me.align.length,we;for(we=0;we ?/gm,"");return{type:"blockquote",raw:ue[0],text:me}}},ye.list=function(le){var ue=this.rules.block.list.exec(le);if(ue){for(var me=ue[0],Ee=ue[2],we=Ee.length>1,Ie=Ee[Ee.length-1]===")",$e={type:"list",raw:me,ordered:we,start:we?+Ee.slice(0,-1):"",loose:!1,items:[]},at=ue[0].match(this.rules.block.item),ht=!1,ut,xt,Ct,st,Mt,Lt,kt,Dt=at.length,Tt=0;Tt1||this.options.smartLists&&Ct!==Ee)&&(st=at.slice(Tt+1).join(`
`),$e.raw=$e.raw.substring(0,$e.raw.length-st.length),Tt=Dt-1)),Mt=ht||/\n\n(?!\s*$)/.test(ut),Tt!==Dt-1&&(ht=ut.charAt(ut.length-1)===`
`,Mt||(Mt=ht)),Mt&&($e.loose=!0),Lt=/^\[[ xX]\] /.test(ut),kt=void 0,Lt&&(kt=ut[1]!==" ",ut=ut.replace(/^\[[ xX]\] +/,"")),$e.items.push({type:"list_item",raw:me,task:Lt,checked:kt,loose:Mt,text:ut});return $e}},ye.html=function(le){var ue=this.rules.block.html.exec(le);if(ue)return{type:this.options.sanitize?"paragraph":"html",raw:ue[0],pre:!this.options.sanitizer&&(ue[1]==="pre"||ue[1]==="script"||ue[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):re(ue[0]):ue[0]}},ye.def=function(le){var ue=this.rules.block.def.exec(le);if(ue){ue[3]&&(ue[3]=ue[3].substring(1,ue[3].length-1));var me=ue[1].toLowerCase().replace(/\s+/g," ");return{tag:me,raw:ue[0],href:ue[2],title:ue[3]}}},ye.table=function(le){var ue=this.rules.block.table.exec(le);if(ue){var me={type:"table",header:$(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
`):[]};if(me.header.length===me.align.length){me.raw=ue[0];var Ee=me.align.length,we;for(we=0;we/i.test(Ee[0])&&(ue=!1),!me&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ee[0])?me=!0:me&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ee[0])&&(me=!1),{type:this.options.sanitize?"text":"html",raw:Ee[0],inLink:ue,inRawBlock:me,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):re(Ee[0]):Ee[0]}},ye.link=function(le){var ue=this.rules.inline.link.exec(le);if(ue){var me=pe(ue[2],"()");if(me>-1){var Ee=ue[0].indexOf("!")===0?5:4,we=Ee+ue[1].length+me;ue[2]=ue[2].substring(0,me),ue[0]=ue[0].substring(0,we).trim(),ue[3]=""}var Ie=ue[2],$e="";if(this.options.pedantic){var at=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);at?(Ie=at[1],$e=at[3]):$e=""}else $e=ue[3]?ue[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var ht=ve(ue,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:$e&&$e.replace(this.rules.inline._escapes,"$1")},ue[0]);return ht}},ye.reflink=function(le,ue){var me;if((me=this.rules.inline.reflink.exec(le))||(me=this.rules.inline.nolink.exec(le))){var Ee=(me[2]||me[1]).replace(/\s+/g," ");if(Ee=ue[Ee.toLowerCase()],!Ee||!Ee.href){var we=me[0].charAt(0);return{type:"text",raw:we,text:we}}var Ie=ve(me,Ee,me[0]);return Ie}},ye.strong=function(le,ue,me){me===void 0&&(me="");var Ee=this.rules.inline.strong.start.exec(le);if(Ee&&(!Ee[1]||Ee[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ue=ue.slice(-1*le.length);var we=Ee[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;we.lastIndex=0;for(var Ie;(Ee=we.exec(ue))!=null;)if(Ie=this.rules.inline.strong.middle.exec(ue.slice(0,Ee.index+3)),Ie)return{type:"strong",raw:le.slice(0,Ie[0].length),text:le.slice(2,Ie[0].length-2)}}},ye.em=function(le,ue,me){me===void 0&&(me="");var Ee=this.rules.inline.em.start.exec(le);if(Ee&&(!Ee[1]||Ee[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ue=ue.slice(-1*le.length);var we=Ee[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;we.lastIndex=0;for(var Ie;(Ee=we.exec(ue))!=null;)if(Ie=this.rules.inline.em.middle.exec(ue.slice(0,Ee.index+2)),Ie)return{type:"em",raw:le.slice(0,Ie[0].length),text:le.slice(1,Ie[0].length-1)}}},ye.codespan=function(le){var ue=this.rules.inline.code.exec(le);if(ue){var me=ue[2].replace(/\n/g," "),Ee=/[^ ]/.test(me),we=me.startsWith(" ")&&me.endsWith(" ");return Ee&&we&&(me=me.substring(1,me.length-1)),me=re(me,!0),{type:"codespan",raw:ue[0],text:me}}},ye.br=function(le){var ue=this.rules.inline.br.exec(le);if(ue)return{type:"br",raw:ue[0]}},ye.del=function(le){var ue=this.rules.inline.del.exec(le);if(ue)return{type:"del",raw:ue[0],text:ue[1]}},ye.autolink=function(le,ue){var me=this.rules.inline.autolink.exec(le);if(me){var Ee,we;return me[2]==="@"?(Ee=re(this.options.mangle?ue(me[1]):me[1]),we="mailto:"+Ee):(Ee=re(me[1]),we=Ee),{type:"link",raw:me[0],text:Ee,href:we,tokens:[{type:"text",raw:Ee,text:Ee}]}}},ye.url=function(le,ue){var me;if(me=this.rules.inline.url.exec(le)){var Ee,we;if(me[2]==="@")Ee=re(this.options.mangle?ue(me[0]):me[0]),we="mailto:"+Ee;else{var Ie;do Ie=me[0],me[0]=this.rules.inline._backpedal.exec(me[0])[0];while(Ie!==me[0]);Ee=re(me[0]),me[1]==="www."?we="http://"+Ee:we=Ee}return{type:"link",raw:me[0],text:Ee,href:we,tokens:[{type:"text",raw:Ee,text:Ee}]}}},ye.inlineText=function(le,ue,me){var Ee=this.rules.inline.text.exec(le);if(Ee){var we;return ue?we=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):re(Ee[0]):Ee[0]:we=re(this.options.smartypants?me(Ee[0]):Ee[0]),{type:"text",raw:Ee[0],text:we}}},Se}(),ce=V.noopTest,ae=V.edit,de=V.merge,ne={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:ce,table:ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ne._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ne._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ne.def=ae(ne.def).replace("label",ne._label).replace("title",ne._title).getRegex(),ne.bullet=/(?:[*+-]|\d{1,9}[.)])/,ne.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ne.item=ae(ne.item,"gm").replace(/bull/g,ne.bullet).getRegex(),ne.list=ae(ne.list).replace(/bull/g,ne.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ne.def.source+")").getRegex(),ne._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",ne._comment=//,ne.html=ae(ne.html,"i").replace("comment",ne._comment).replace("tag",ne._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ne.paragraph=ae(ne._paragraph).replace("hr",ne.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",ne._tag).getRegex(),ne.blockquote=ae(ne.blockquote).replace("paragraph",ne.paragraph).getRegex(),ne.normal=de({},ne),ne.gfm=de({},ne.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*|$)"}),ne.gfm.nptable=ae(ne.gfm.nptable).replace("hr",ne.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",ne._tag).getRegex(),ne.gfm.table=ae(ne.gfm.table).replace("hr",ne.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",ne._tag).getRegex(),ne.pedantic=de({},ne.normal,{html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ne._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:ce,paragraph:ae(ne.normal._paragraph).replace("hr",ne.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ce,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:ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=ae(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=ae(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=ae(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=ae(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=ae(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=ae(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=ae(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=ae(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=ae(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=ae(se._blockSkip,"g").getRegex(),se.overlapSkip=ae(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=ae(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=ae(se.tag).replace("comment",ne._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=ae(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=ae(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=ae(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=de({},se),se.pedantic=de({},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:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=de({},se.normal,{escape:ae(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&&(le="x"+le.toString(16)),ye+=""+le+";";return ye}var De=function(){function Se(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||ee,this.options.tokenizer=this.options.tokenizer||new Le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:oe.normal,inline:fe.normal};this.options.pedantic?(le.block=oe.pedantic,le.inline=fe.pedantic):this.options.gfm&&(le.block=oe.gfm,this.options.breaks?le.inline=fe.breaks:le.inline=fe.gfm),this.tokenizer.rules=le}Se.lex=function(le,ue){var me=new Se(ue);return me.lex(le)};var ye=Se.prototype;return ye.lex=function(le){return le=le.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(le,ue,me){ue===void 0&&(ue=[]),me===void 0&&(me=!0),le=le.replace(/^ +$/gm,"");for(var Ee,we,Ie,$e;le;){if(Ee=this.tokenizer.space(le)){le=le.substring(Ee.raw.length),Ee.type&&ue.push(Ee);continue}if(Ee=this.tokenizer.code(le,ue)){le=le.substring(Ee.raw.length),Ee.type?ue.push(Ee):($e=ue[ue.length-1],$e.raw+=`
`+Ee.raw,$e.text+=`
`+Ee.text);continue}if(Ee=this.tokenizer.fences(le)){le=le.substring(Ee.raw.length),ue.push(Ee);continue}if(Ee=this.tokenizer.heading(le)){le=le.substring(Ee.raw.length),ue.push(Ee);continue}if(Ee=this.tokenizer.nptable(le)){le=le.substring(Ee.raw.length),ue.push(Ee);continue}if(Ee=this.tokenizer.hr(le)){le=le.substring(Ee.raw.length),ue.push(Ee);continue}if(Ee=this.tokenizer.blockquote(le)){le=le.substring(Ee.raw.length),Ee.tokens=this.blockTokens(Ee.text,[],me),ue.push(Ee);continue}if(Ee=this.tokenizer.list(le)){for(le=le.substring(Ee.raw.length),Ie=Ee.items.length,we=0;we0)for(;(at=this.tokenizer.rules.inline.reflinkSearch.exec($e))!=null;)ht.includes(at[0].slice(at[0].lastIndexOf("[")+1,-1))&&($e=$e.slice(0,at.index)+"["+"a".repeat(at[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(at=this.tokenizer.rules.inline.blockSkip.exec($e))!=null;)$e=$e.slice(0,at.index)+"["+"a".repeat(at[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if(Ie=this.tokenizer.escape(le)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.tag(le,me,Ee)){le=le.substring(Ie.raw.length),me=Ie.inLink,Ee=Ie.inRawBlock,ue.push(Ie);continue}if(Ie=this.tokenizer.link(le)){le=le.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,Ee)),ue.push(Ie);continue}if(Ie=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,Ee)),ue.push(Ie);continue}if(Ie=this.tokenizer.strong(le,$e,we)){le=le.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],me,Ee),ue.push(Ie);continue}if(Ie=this.tokenizer.em(le,$e,we)){le=le.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],me,Ee),ue.push(Ie);continue}if(Ie=this.tokenizer.codespan(le)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.br(le)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.del(le)){le=le.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],me,Ee),ue.push(Ie);continue}if(Ie=this.tokenizer.autolink(le,ge)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(!me&&(Ie=this.tokenizer.url(le,ge))){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.inlineText(le,Ee,ke)){le=le.substring(Ie.raw.length),we=Ie.raw.slice(-1),ue.push(Ie);continue}if(le){var ut="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(ut);break}else throw new Error(ut)}}return ue},Y(Se,null,[{key:"rules",get:function(){return{block:oe,inline:fe}}}]),Se}(),Me=K.defaults,Ue=V.cleanUrl,Ke=V.escape,He=function(){function Se(xe){this.options=xe||Me}var ye=Se.prototype;return ye.code=function(le,ue,me){var Ee=(ue||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(le,Ee);we!=null&&we!==le&&(me=!0,le=we)}return Ee?''+(me?le:Ke(le,!0))+`
`:""+(me?le:Ke(le,!0))+`
`},ye.blockquote=function(le){return`
`+le+`
`},ye.html=function(le){return le},ye.heading=function(le,ue,me,Ee){return this.options.headerIds?"
`:""+le+"
`},ye.hr=function(){return this.options.xhtml?`
`:`
`},ye.list=function(le,ue,me){var Ee=ue?"ol":"ul",we=ue&&me!==1?' start="'+me+'"':"";return"<"+Ee+we+`>
`+le+""+Ee+`>
`},ye.listitem=function(le){return""+le+`
`},ye.checkbox=function(le){return" "},ye.paragraph=function(le){return""+le+`
`},ye.table=function(le,ue){return ue&&(ue=""+ue+""),`
`},ye.tablerow=function(le){return`
`+le+`
`},ye.tablecell=function(le,ue){var me=ue.header?"th":"td",Ee=ue.align?"<"+me+' align="'+ue.align+'">':"<"+me+">";return Ee+le+""+me+`>
`},ye.strong=function(le){return""+le+""},ye.em=function(le){return""+le+""},ye.codespan=function(le){return""+le+""},ye.br=function(){return this.options.xhtml?"
":"
"},ye.del=function(le){return""+le+""},ye.link=function(le,ue,me){if(le=Ue(this.options.sanitize,this.options.baseUrl,le),le===null)return me;var Ee='"+me+"",Ee},ye.image=function(le,ue,me){if(le=Ue(this.options.sanitize,this.options.baseUrl,le),le===null)return me;var Ee='
":">",Ee},ye.text=function(le){return le},Se}(),Be=function(){function Se(){}var ye=Se.prototype;return ye.strong=function(le){return le},ye.em=function(le){return le},ye.codespan=function(le){return le},ye.del=function(le){return le},ye.html=function(le){return le},ye.text=function(le){return le},ye.link=function(le,ue,me){return""+me},ye.image=function(le,ue,me){return""+me},ye.br=function(){return""},Se}(),rt=function(){function Se(){this.seen={}}var ye=Se.prototype;return ye.slug=function(le){var ue=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ue)){var me=ue;do this.seen[me]++,ue=me+"-"+this.seen[me];while(this.seen.hasOwnProperty(ue))}return this.seen[ue]=0,ue},Se}(),Oe=K.defaults,Fe=V.unescape,je=function(){function Se(xe){this.options=xe||Oe,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new rt}Se.parse=function(le,ue){var me=new Se(ue);return me.parse(le)};var ye=Se.prototype;return ye.parse=function(le,ue){ue===void 0&&(ue=!0);var me="",Ee,we,Ie,$e,at,ht,ut,xt,Ct,st,Mt,Lt,kt,Dt,Tt,Ut,Qt,yt,pr=le.length;for(Ee=0;Ee0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=yt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=yt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:yt}):Dt+=yt),Dt+=this.parse(Tt.tokens,kt),Ct+=this.renderer.listitem(Dt,Qt,Ut);me+=this.renderer.list(Ct,Mt,Lt);continue}case"html":{me+=this.renderer.html(st.text);continue}case"paragraph":{me+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(Ct=st.tokens?this.parseInline(st.tokens):st.text;Ee+1An error occurred:
"+ze(Ie.message+"",!0)+"
";throw Ie}}Pe.options=Pe.setOptions=function(Se){return Ge(Pe.defaults,Se),Qe(Pe.defaults),Pe},Pe.getDefaults=Re,Pe.defaults=Ye,Pe.use=function(Se){var ye=Ge({},Se);if(Se.renderer&&function(){var le=Pe.defaults.renderer||new He,ue=function(we){var Ie=le[we];le[we]=function(){for(var $e=arguments.length,at=new Array($e),ht=0;ht<$e;ht++)at[ht]=arguments[ht];var ut=Se.renderer[we].apply(le,at);return ut===!1&&(ut=Ie.apply(le,at)),ut}};for(var me in Se.renderer)ue(me);ye.renderer=le}(),Se.tokenizer&&function(){var le=Pe.defaults.tokenizer||new Le,ue=function(we){var Ie=le[we];le[we]=function(){for(var $e=arguments.length,at=new Array($e),ht=0;ht<$e;ht++)at[ht]=arguments[ht];var ut=Se.tokenizer[we].apply(le,at);return ut===!1&&(ut=Ie.apply(le,at)),ut}};for(var me in Se.tokenizer)ue(me);ye.tokenizer=le}(),Se.walkTokens){var xe=Pe.defaults.walkTokens;ye.walkTokens=function(le){Se.walkTokens(le),xe&&xe(le)}}Pe.setOptions(ye)},Pe.walkTokens=function(Se,ye){for(var xe=U(Se),le;!(le=xe()).done;){var ue=le.value;ye(ue);switch(ue.type){case"table":{for(var me=U(ue.tokens.header),Ee;!(Ee=me()).done;){var we=Ee.value;Pe.walkTokens(we,ye)}for(var Ie=U(ue.tokens.cells),$e;!($e=Ie()).done;)for(var at=$e.value,ht=U(at),ut;!(ut=ht()).done;){var xt=ut.value;Pe.walkTokens(xt,ye)}break}case"list":{Pe.walkTokens(ue.items,ye);break}default:ue.tokens&&Pe.walkTokens(ue.tokens,ye)}}},Pe.Parser=je,Pe.parser=je.parse,Pe.Renderer=He,Pe.TextRenderer=Be,Pe.Lexer=De,Pe.lexer=De.lex,Pe.Tokenizer=Le,Pe.Slugger=rt,Pe.parse=Pe;var We=Pe;return We})},ELLl:function(Et,tt,ie){(function(he){he(ie("VrN/"))})(function(he){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},O=he.Pos;he.defineOption("autoCloseBrackets",!1,function(x,y,h){h&&h!=he.Init&&(x.removeKeyMap(U),x.state.closeBrackets=null),y&&(I(Z(y,"pairs")),x.state.closeBrackets=y,x.addKeyMap(U))});function Z(x,y){return y=="pairs"&&typeof x=="string"?x:typeof x=="object"&&x[y]!=null?x[y]:Y[y]}var U={Backspace:M,Enter:R};function I(x){for(var y=0;y=0;l--){var S=o[l].head;x.replaceRange("",O(S.line,S.ch-1),O(S.line,S.ch+1),"+delete")}}function R(x){var y=B(x),h=y&&Z(y,"explode");if(!h||x.getOption("disableInput"))return he.Pass;for(var o=x.listSelections(),l=0;l0;return{anchor:new O(x.anchor.line,x.anchor.ch+(y?-1:1)),head:new O(x.head.line,x.head.ch+(y?1:-1))}}function L(x,y){var h=B(x);if(!h||x.getOption("disableInput"))return he.Pass;var o=Z(h,"pairs"),l=o.indexOf(y);if(l==-1)return he.Pass;for(var d=Z(h,"closeBefore"),S=Z(h,"triples"),g=o.charAt(l+1)==y,p=x.listSelections(),w=l%2==0,b,u=0;u=0&&x.getRange(s,O(s.line,s.ch+3))==y+y+y?a="skipThree":a="skip";else if(g&&s.ch>1&&S.indexOf(y)>=0&&x.getRange(O(s.line,s.ch-2),s)==y+y){if(s.ch>2&&/\bstring/.test(x.getTokenTypeAt(O(s.line,s.ch-2))))return he.Pass;a="addFour"}else if(g){var v=s.ch==0?" ":x.getRange(O(s.line,s.ch-1),s);if(!he.isWordChar(T)&&v!=y&&!he.isWordChar(v))a="both";else return he.Pass}else if(w&&(T.length===0||/\s/.test(T)||d.indexOf(T)>-1))a="both";else return he.Pass;if(!b)b=a;else if(b!=a)return he.Pass}var C=l%2?o.charAt(l-1):y,D=l%2?y:o.charAt(l+1);x.operation(function(){if(b=="skip")x.execCommand("goCharRight");else if(b=="skipThree")for(var j=0;j<3;j++)x.execCommand("goCharRight");else if(b=="surround"){for(var z=x.getSelections(),j=0;j0&&(pe.percent=pe.loaded/pe.total*100),V.onProgress(pe)});var N=new FormData;V.data&&Object.keys(V.data).forEach(function(re){var pe=V.data[re];if(Array.isArray(pe)){pe.forEach(function(ve){N.append(re+"[]",ve)});return}N.append(re,V.data[re])}),V.file instanceof Blob?N.append(V.filename,V.file,V.file.name):N.append(V.filename,V.file),P.onerror=function(pe){V.onError(pe)},P.onload=function(){return P.status<200||P.status>=300?V.onError(U(V,P),I(P)):V.onSuccess(I(P),P)},P.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in P&&(P.withCredentials=!0);var $=V.headers||{};return $["X-Requested-With"]!==null&&P.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys($).forEach(function(re){$[re]!==null&&P.setRequestHeader(re,$[re])}),P.send(N),{abort:function(){P.abort()}}}var B=+new Date,M=0;function R(){return"rc-upload-"+B+"-"+ ++M}function E(V,P){return V.indexOf(P,V.length-P.length)!==-1}var L=function(V,P){if(V&&P){var N=Array.isArray(P)?P:P.split(","),$=V.name||"",re=V.type||"",pe=re.replace(/\/.*$/,"");return N.some(function(ve){var Ae=ve.trim();return Ae.charAt(0)==="."?E($.toLowerCase(),Ae.toLowerCase()):/\/\*$/.test(Ae)?pe===Ae.replace(/\/.*$/,""):re===Ae})}return!0};function _(V,P){var N=V.createReader(),$=[];function re(){N.readEntries(function(pe){var ve=Array.prototype.slice.apply(pe);$=$.concat(ve);var Ae=!ve.length;Ae?P($):re()})}re()}var A=function(P,N,$){var re=function pe(ve,Ae){Ae=Ae||"",ve.isFile?ve.file(function(Le){$(Le)&&(ve.fullPath&&!Le.webkitRelativePath&&(Object.defineProperties(Le,{webkitRelativePath:{writable:!0}}),Le.webkitRelativePath=ve.fullPath.replace(/^\//,""),Object.defineProperties(Le,{webkitRelativePath:{writable:!1}})),N([Le]))}):ve.isDirectory&&_(ve,function(Le){Le.forEach(function(ce){pe(ce,""+Ae+ve.name+"/")})})};P.forEach(function(pe){re(pe.webkitGetAsEntry())})},x=A,y=Object.assign||function(V){for(var P=1;P=0)continue;if(!Object.prototype.hasOwnProperty.call(V,$))continue;N[$]=V[$]}return N}function S(V,P){if(!(V instanceof P))throw new TypeError("Cannot call a class as a function")}function g(V,P){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:V}function p(V,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);V.prototype=Object.create(P&&P.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(V,P):V.__proto__=P)}var w=function(P){return Object.keys(P).reduce(function(N,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(N[$]=P[$]),N},{})},b=function(V){p(P,V);function P(){var N,$,re,pe;S(this,P);for(var ve=arguments.length,Ae=Array(ve),Le=0;Le1&&arguments[1]!==void 0?arguments[1]:1,xe=Be.length,le=0;le1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(N).map(function(re,pe){if(!U.isValidElement(re)||!re.type)return null;var ve=re.type.isSelectOptGroup,Ae=re.key,Le=re.props,ce=Le.children,ae=Object(K.a)(Le,["children"]);return $||!ve?b(re):Object(p.a)(Object(p.a)({key:"__RC_SELECT_GRP__".concat(Ae===null?pe:Ae,"__"),label:Ae},ae),{},{options:u(ce)})}).filter(function(re){return re})}var f=ie("2Qr1"),s=ie("qNPg"),a=ie("U8pU"),T=ie("Kwbf"),v=ie("WKfj");function C(N){var $=N.mode,re=N.options,pe=N.children,ve=N.backfill,Ae=N.allowClear,Le=N.placeholder,ce=N.getInputElement,ae=N.showSearch,de=N.onSearch,ne=N.defaultOpen,se=N.autoFocus,J=N.labelInValue,ee=N.value,oe=N.inputValue,fe=N.optionLabelProp,ke=$==="multiple"||$==="tags",ge=ae!==void 0?ae:ke||$==="combobox",De=re||u(pe);if(Object(T.a)($!=="tags"||De.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var Me=De.some(function(He){return He.options?He.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(T.a)(!Me,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)($!=="combobox"||!fe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)($==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(T.a)($==="combobox"||!ce,"`getInputElement` only work with `combobox` mode."),Object(T.b)($!=="combobox"||!ce||!Ae||!Le,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),de&&!ge&&$!=="combobox"&&$!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!ne||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ee!=null){var Ue=Object(v.d)(ee);Object(T.a)(!J||Ue.every(function(He){return Object(a.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!ke||Array.isArray(ee),"`value` should be array when `mode` is `multiple` or `tags`")}if(pe){var Ke=null;Object(w.a)(pe).some(function(He){if(!U.isValidElement(He)||!He.type)return!1;var Be=He.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var rt=Object(w.a)(He.props.children).every(function(Oe){return!U.isValidElement(Oe)||!He.type||Oe.type.isSelectOption?!0:(Ke=Oe.type,!1)});return!rt}return Ke=Be,!0}),Ke&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(T.a)(oe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=C,j=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:u,flattenOptions:f.d,getLabeledValue:f.e,filterOptions:f.b,isValueDisabled:f.g,findValueOption:f.c,warningProps:D,fillOptionsWithMissingValue:f.a}),z=function(N){Object(O.a)(re,N);var $=Object(Z.a)(re);function re(){var pe;return Object(he.a)(this,re),pe=$.apply(this,arguments),pe.selectRef=U.createRef(),pe.focus=function(){pe.selectRef.current.focus()},pe.blur=function(){pe.selectRef.current.blur()},pe}return Object(Y.a)(re,[{key:"render",value:function(){return U.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),re}(U.Component);z.Option=d,z.OptGroup=g;var V=z,P=tt.c=V},M8RZ:function(Et,tt,ie){"use strict";ie.d(tt,"a",function(){return M});var he=ie("fWQN"),Y=ie("mtLc"),O=ie("yKVA"),Z=ie("879j"),U=ie("q1tI"),I=ie.n(U),K=ie("i8i4"),B=ie.n(K),M=function(R){Object(O.a)(L,R);var E=Object(Z.a)(L);function L(_){var A;Object(he.a)(this,L),A=E.call(this,_);var x=window.document;return A.node=x.createElement("div"),x.body.appendChild(A.node),A}return Object(Y.a)(L,[{key:"render",value:function(){var A=this.props.children;return Object(K.createPortal)(A,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),L}(I.a.Component)},NvD2:function(Et,tt,ie){"use strict";ie.d(tt,"a",function(){return I});var he=ie("Kwbf");function Y(K,B){var M=new Set;return K.forEach(function(R){B.has(R)||M.add(R)}),M}function O(K){var B=K||{},M=B.disabled,R=B.disableCheckbox,E=B.checkable;return!!(M||R)||E===!1}function Z(K,B,M,R){for(var E=new Set(K),L=new Set,_=0;_<=M;_+=1){var A=B.get(_)||new Set;A.forEach(function(o){var l=o.key,d=o.node,S=o.children,g=S===void 0?[]:S;E.has(l)&&!R(d)&&g.filter(function(p){return!R(p.node)}).forEach(function(p){E.add(p.key)})})}for(var x=new Set,y=M;y>=0;y-=1){var h=B.get(y)||new Set;h.forEach(function(o){var l=o.parent,d=o.node;if(R(d)||!o.parent||x.has(o.parent.key))return;if(R(o.parent.node)){x.add(l.key);return}var S=!0,g=!1;(l.children||[]).filter(function(p){return!R(p.node)}).forEach(function(p){var w=p.key,b=E.has(w);S&&!b&&(S=!1),!g&&(b||L.has(w))&&(g=!0)}),S&&E.add(l.key),g&&L.add(l.key),x.add(l.key)})}return{checkedKeys:Array.from(E),halfCheckedKeys:Array.from(Y(L,E))}}function U(K,B,M,R,E){for(var L=new Set(K),_=new Set(B),A=0;A<=R;A+=1){var x=M.get(A)||new Set;x.forEach(function(l){var d=l.key,S=l.node,g=l.children,p=g===void 0?[]:g;!L.has(d)&&!_.has(d)&&!E(S)&&p.filter(function(w){return!E(w.node)}).forEach(function(w){L.delete(w.key)})})}_=new Set;for(var y=new Set,h=R;h>=0;h-=1){var o=M.get(h)||new Set;o.forEach(function(l){var d=l.parent,S=l.node;if(E(S)||!l.parent||y.has(l.parent.key))return;if(E(l.parent.node)){y.add(d.key);return}var g=!0,p=!1;(d.children||[]).filter(function(w){return!E(w.node)}).forEach(function(w){var b=w.key,u=L.has(b);g&&!u&&(g=!1),!p&&(u||_.has(b))&&(p=!0)}),g||L.delete(d.key),p&&_.add(d.key),y.add(d.key)})}return{checkedKeys:Array.from(L),halfCheckedKeys:Array.from(Y(_,L))}}function I(K,B,M,R){var E=[],L;R?L=R:L=O;var _=new Set(K.filter(function(h){var o=!!M[h];return o||E.push(h),o})),A=new Map,x=0;Object.keys(M).forEach(function(h){var o=M[h],l=o.level,d=A.get(l);d||(d=new Set,A.set(l,d)),d.add(o),x=Math.max(x,l)}),Object(he.a)(!E.length,"Tree missing follow keys: ".concat(E.slice(0,100).map(function(h){return"'".concat(h,"'")}).join(", ")));var y;return B===!0?y=Z(_,A,x,L):y=U(_,B.halfCheckedKeys,A,x,L),y}},OLES:function(Et,tt,ie){"use strict";var he=ie("U8pU"),Y=ie("VTBJ"),O=ie("Ff2n"),Z=ie("q1tI"),U=ie("uciX"),I=ie("7ixt"),K=function(_){var A=_.overlay,x=_.prefixCls,y=_.id,h=_.overlayInnerStyle;return Z.createElement("div",{className:"".concat(x,"-inner"),id:y,role:"tooltip",style:h},typeof A=="function"?A():A)},B=K,M=function(_,A){var x=_.overlayClassName,y=_.trigger,h=y===void 0?["hover"]:y,o=_.mouseEnterDelay,l=o===void 0?0:o,d=_.mouseLeaveDelay,S=d===void 0?.1:d,g=_.overlayStyle,p=_.prefixCls,w=p===void 0?"rc-tooltip":p,b=_.children,u=_.onVisibleChange,f=_.afterVisibleChange,s=_.transitionName,a=_.animation,T=_.placement,v=T===void 0?"right":T,C=_.align,D=C===void 0?{}:C,j=_.destroyTooltipOnHide,z=j===void 0?!1:j,V=_.defaultVisible,P=_.getTooltipContainer,N=_.overlayInnerStyle,$=Object(O.a)(_,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),re=Object(Z.useRef)(null);Object(Z.useImperativeHandle)(A,function(){return re.current});var pe=Object(Y.a)({},$);"visible"in _&&(pe.popupVisible=_.visible);var ve=function(){var de=_.arrowContent,ne=de===void 0?null:de,se=_.overlay,J=_.id;return[Z.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},ne),Z.createElement(B,{key:"content",prefixCls:w,id:J,overlay:se,overlayInnerStyle:N})]},Ae=!1,Le=!1;if(typeof z=="boolean")Ae=z;else if(z&&Object(he.a)(z)==="object"){var ce=z.keepParent;Ae=ce===!0,Le=ce===!1}return Z.createElement(U.a,Object.assign({popupClassName:x,prefixCls:w,popup:ve,action:h,builtinPlacements:I.a,popupPlacement:v,ref:re,popupAlign:D,getPopupContainer:P,onPopupVisibleChange:u,afterPopupVisibleChange:f,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:V,destroyPopupOnHide:Ae,autoDestroy:Le,mouseLeaveDelay:S,popupStyle:g,mouseEnterDelay:l},pe),b)},R=Object(Z.forwardRef)(M),E=tt.a=R},OZM5:function(Et,tt,ie){"use strict";ie.d(tt,"b",function(){return R}),ie.d(tt,"a",function(){return E}),ie.d(tt,"k",function(){return L}),ie.d(tt,"h",function(){return _}),ie.d(tt,"i",function(){return A}),ie.d(tt,"g",function(){return x}),ie.d(tt,"c",function(){return y}),ie.d(tt,"d",function(){return h}),ie.d(tt,"j",function(){return d}),ie.d(tt,"e",function(){return S}),ie.d(tt,"f",function(){return g});var he=ie("KQm4"),Y=ie("U8pU"),O=ie("Ff2n"),Z=ie("q1tI"),U=ie.n(Z),I=ie("Kwbf"),K=ie("WaYH"),B=.25,M=2;function R(p,w){var b=p.slice(),u=b.indexOf(w);return u>=0&&b.splice(u,1),b}function E(p,w){var b=p.slice();return b.indexOf(w)===-1&&b.push(w),b}function L(p){return p.split("-")}function _(p,w){return"".concat(p,"-").concat(w)}function A(p){return p&&p.type&&p.type.isTreeNode}function x(p,w){var b=[p],u=w[p];function f(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(a){var T=a.key,v=a.children;b.push(T),f(v)})}return f(u.children),b}function y(p,w){var b=p.clientY,u=w.selectHandle.getBoundingClientRect(),f=u.top,s=u.bottom,a=u.height,T=Math.max(a*B,M);return b<=f+T?-1:b>=s-T?1:0}function h(p,w){if(!p)return;var b=w.multiple;return b?p.slice():p.length?[p[0]]:p}var o=function(w){return w};function l(p,w){if(!p)return[];var b=w||{},u=b.processProps,f=u===void 0?o:u,s=Array.isArray(p)?p:[p];return s.map(function(a){var T=a.children,v=Object(O.a)(a,["children"]),C=l(T,w);return U.a.createElement(K.a,Object.assign({},f(v)),C)})}function d(p){if(!p)return null;var w;if(Array.isArray(p))w={checkedKeys:p,halfCheckedKeys:void 0};else if(Object(Y.a)(p)==="object")w={checkedKeys:p.checked||void 0,halfCheckedKeys:p.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function S(p,w){var b=new Set;function u(f){if(b.has(f))return;var s=w[f];if(!s)return;b.add(f);var a=s.parent,T=s.node;if(T.disabled)return;a&&u(a.key)}return(p||[]).forEach(function(f){u(f)}),Object(he.a)(b)}function g(p){var w={};return Object.keys(p).forEach(function(b){(b.startsWith("data-")||b.startsWith("aria-"))&&(w[b]=p[b])}),w}},Ot1p:function(Et,tt,ie){"use strict";var he=ie("2qtc"),Y=ie("kLXV"),O=ie("rAM+"),Z=ie("miYZ"),U=ie("tsqr"),I=ie("9og8"),K=ie("tJVT"),B=ie("jrin"),M=ie("WmNS"),R=ie.n(M),E=ie("q1tI"),L=ie.n(E),_=ie("VrN/"),A=ie.n(_),x=ie("bdgK"),y=ie("p77/"),h=ie("Bd2K"),o=ie("ELLl"),l=ie("19Vz"),d=ie("lZu9"),S=ie("+NIl"),g=ie("kSUc"),p=ie("9Bee"),w=function(we){var Ie=we.value,$e=Ie===void 0?"":Ie,at=we.className,ht=we.showTextOnly,ut=we.showLines,xt=we.style,Ct=xt===void 0?{}:xt,st=Object(E.useMemo)(function(){return""},[$e]);return L.a.createElement(L.a.Fragment,null,L.a.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},b=ie("0Owb"),u=ie("dejd"),f=ie("C+DQ"),s=ie("1vsH"),a=ie("m3rI"),T=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function v(we){var Ie=we.onActionCallback,$e=we.title,at=we.icon,ht=we.actionName,ut=we.className,xt=ut===void 0?"":ut,Ct=we.children;function st(){Ie(ht)}return L.a.createElement("a",{title:$e,className:xt,onClick:st},L.a.createElement("i",{className:"md-iconfont ".concat(at)}),Ct)}var C=function(we){var Ie=we.watch,$e=we.showNullButton,at=we.onActionCallback,ht=we.fullScreen,ut=we.insertTemp,xt=we.hidetoolBar,Ct=we.uuid,st=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(Ct,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Mt=[].concat(T,[{title:"".concat(Ie?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ie?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return L.a.createElement("ul",{className:"markdown-toolbar-container"},!xt&&Mt.map(function(Lt,kt){return L.a.createElement("li",{key:kt},Lt.actionName?L.a.createElement(v,Object(b.a)({},Lt,{onActionCallback:at})):L.a.createElement("span",{className:"v-line"}))}),$e?L.a.createElement("li",null,L.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:at},L.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ut&&L.a.createElement("li",null,L.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ut),onActionCallback:at},L.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),L.a.createElement("li",{className:"btn-full-screen"},L.a.createElement(v,{icon:"".concat(ht?"icon-shrink":"icon-enlarge"),title:ht?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:at})))},D=ie("M8RZ"),j=ie("+L6B"),z=ie("2/Rp"),V=ie("y8nQ"),P=ie("Vl3Y"),N=ie("5NDa"),$=ie("5rEg"),re={labelCol:{span:4},wrapperCol:{span:20}},pe=function(we){var Ie=we.callback,$e=we.onCancel;function at(ht){Ie(ht)}return L.a.createElement(P.a,Object(b.a)({},re,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:at}),L.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},L.a.createElement($.a,null)),L.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},L.a.createElement($.a,null)),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(z.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))},ve=ie("7ahc"),Ae=ie("HmJG"),Le=ie("BjJ7"),ce=P.a.useForm,ae={width:280,marginRight:10},de={labelCol:{span:5},wrapperCol:{span:19}},ne=function(we){var Ie=we.callback,$e=we.onCancel,at=ce(),ht=Object(K.a)(at,1),ut=ht[0];function xt(Mt){Ie(Mt)}function Ct(Mt,Lt){if(Mt.status===-1){U.b.error(Mt.message);return}ut.setFieldsValue({src:"/api/attachments/".concat(Mt.id),type:Lt.type})}function st(Mt){var Lt=Mt.target.files[0];J(Lt,Ct)}return L.a.createElement(P.a,Object(b.a)({form:ut},de,{className:"upload-image-panel",onFinish:xt}),L.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},L.a.createElement("div",{className:"flex-container"},L.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},L.a.createElement($.a,{style:ae})),L.a.createElement(se,{onFileChange:st}))),L.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},L.a.createElement($.a,{style:{width:264}})),L.a.createElement(P.a.Item,{style:{textAlign:"right"}},L.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(z.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))};function se(we){var Ie=we.onFileChange;return L.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",L.a.createElement("input",{type:"file",onChange:Ie}))}function J(we,Ie){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var $e=new FormData;$e.append("editormd-image-file",we),$e.append("file_param_name","editormd-image-file"),$e.append("byxhr","true");var at=new window.XMLHttpRequest;at.withCredentials=!0,at.addEventListener("load",function(ht){Ie(JSON.parse(ht.target.responseText),we)},!1),at.addEventListener("error",function(ht){console.error(ht)},!1),at.open("POST","".concat(Le.a,"/api/attachments.json")),at.send($e)}var ee=ie("giR+"),oe=ie("fyUT"),fe=ie("7Kak"),ke=ie("9yH6"),ge=ke.a.Group,De={margin:"0 8px"},Me=function(we){var Ie=we.callback,$e=we.onCancel;function at(ht){Ie(ht)}return L.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:at},L.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},L.a.createElement("span",{style:De},"\u5355\u5143\u683C\u6570\uFF1A"),L.a.createElement("span",{style:De},"\u884C\u6570"),L.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},L.a.createElement(oe.a,null)),L.a.createElement("span",{style:De},"\u5217\u6570"),L.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},L.a.createElement(oe.a,null))),L.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},L.a.createElement("span",{style:De},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),L.a.createElement(P.a.Item,{name:"align"},L.a.createElement(ge,null,L.a.createElement(ke.a,{value:"default"},L.a.createElement("i",{className:"fa fa-align-justify"})),L.a.createElement(ke.a,{value:"left"},L.a.createElement("i",{className:"fa fa-align-left"})),L.a.createElement(ke.a,{value:"center"},L.a.createElement("i",{className:"fa fa-align-center"})),L.a.createElement(ke.a,{value:"right"},L.a.createElement("i",{className:"fa fa-align-right"}))))),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(z.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))},Ue=ie("ErOA"),Ke=ie("7Cbv"),He="link",Be="upload-image",rt="code-block",Oe="add-table",Fe="------------",je={default:Fe,left:":".concat(Fe),center:":".concat(Fe,":"),right:"".concat(Fe,":")},Ge=ie("9VGf"),Ve,ze;function Re(){}var Qe=0,Ye=1e4,Pe="\u2581",We=`
**\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(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=ye?"Cmd":"Ctrl",le=["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"],ue=(Ve={},Object(B.a)(Ve,xe+"-B","bold"),Object(B.a)(Ve,xe+"-I","italic"),Ve),me=(ze={},Object(B.a)(ze,He,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(ze,rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(ze,Be,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(ze,Oe,"\u6DFB\u52A0\u8868\u683C"),ze),Ee=tt.a=function(we){var Ie=we.defaultValue,$e=Ie===void 0?"":Ie,at=we.onChange,ht=we.width,ut=ht===void 0?"100%":ht,xt=we.height,Ct=xt===void 0?400:xt,st=we.miniToolbar,Mt=st===void 0?!1:st,Lt=we.isFocus,kt=Lt===void 0?!1:Lt,Dt=we.watch,Tt=we.insertTemp,Ut=we.mode,Qt=Ut===void 0?"markdown":Ut,yt=we.id,pr=yt===void 0?"markdown-editor-id":yt,Bt=we.showResizeBar,tr=Bt===void 0?!1:Bt,ur=we.noStorage,nr=ur===void 0?!1:ur,vr=we.showNullButton,Nt=vr===void 0?!1:vr,ft=we.hidetoolBar,sr=ft===void 0?!1:ft,Tr=we.fullScreen,gr=Tr===void 0?!1:Tr,Pt=we.onBlur,yr=we.onCMBeforeChange,dr=we.onFullScreen,qr=we.className,qe=qr===void 0?"":qr,wt=we.disablePaste,zr=wt===void 0?!1:wt,Ir=we.placeholder,Zr=Ir===void 0?"":Ir,Wr=we.values,G=Wr===void 0?"":Wr,c=Object(E.useState)(null),m=Object(K.a)(c,2),F=m[0],q=m[1],H=Object(E.useState)($e),Ce=Object(K.a)(H,2),Ze=Ce[0],nt=Ce[1],lt=Object(E.useState)(Dt),Xe=Object(K.a)(lt,2),pt=Xe[0],mt=Xe[1],It=Object(E.useState)(gr),lr=Object(K.a)(It,2),$t=lr[0],rr=lr[1],xr=Object(E.useState)(""),Nr=Object(K.a)(xr,2),ir=Nr[0],Xt=Nr[1],wr=Object(E.useState)(0),Hr=Object(K.a)(wr,2),ar=Hr[0],yn=Hr[1],Ar=Object(E.useState)(Ct),_r=Object(K.a)(Ar,2),Rn=_r[0],jt=_r[1],vt=Object(E.useState)(!1),ot=Object(K.a)(vt,2),Cr=ot[0],Yt=ot[1],Zt=Object(E.useRef)(Object(Ke.a)()),Ht=Object(E.useRef)(!1),br=Object(E.useRef)(),Ft=Object(E.useRef)(),cr=Object(E.useRef)(),zt=Object(E.useRef)(),Vr=Object(E.useRef)(),mr=function(){var St=Object(I.a)(R.a.mark(function _t(){var Ot,Kt;return R.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:return hr.next=2,Object(Ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Zt.current}});case 2:Kt=hr.sent,Kt!=null&&(Ot=Kt.attachments)!==null&&Ot!==void 0&&Ot.length&&(console.log("cm:",F,Ft),Kt.attachments.map(function(Vt){Vt.content_type.indexOf("image")>-1?F.replaceSelection(".concat(Vt.content_type,")")):Vt.content_type.indexOf("video")>-1?F.replaceSelection('')):Vt.content_type.indexOf("pdf")>-1?F.replaceSelection('').concat(Vt.name,"")):F.replaceSelection("[".concat(Vt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}));case 4:case"end":return hr.stop()}},_t)}));return function(){return St.apply(this,arguments)}}();Object(E.useEffect)(function(){nt(G),F==null||F.setValue(G)},[G]),Object(E.useEffect)(function(){dr==null||dr($t)},[$t]),Object(E.useEffect)(function(){if(Ft.current){var St=A.a.fromTextArea(Ft.current,{mode:Qt,lineNumbers:!Mt,lineWrapping:!0,value:$e,autoCloseTags:!0,autoCloseBrackets:!0});kt&&St.focus();function _t(Ot,Kt){if(zr){Kt.preventDefault();return}var Jt=Kt.clipboardData;if(Jt){var hr=Jt.types.toString(),Vt=Jt.items;if(hr==="Files"||Jt.types.indexOf("Files")>-1){if(Kt.preventDefault(),Qt=="stex")return;try{var Pr,en=Vt[1];((Pr=Vt[0])===null||Pr===void 0?void 0:Pr.kind)==="file"&&(en=Vt[0]);var Gt=en.getAsFile(),Ln=Gt.name.split(".").pop();J(Gt,function(qt){if(qt.id){var tn,Xr,bn;(Gt==null||((tn=Gt.type)===null||tn===void 0)?void 0:tn.indexOf("image"))>-1?St.replaceSelection(".concat(qt.content_type,")")):(Gt==null||((Xr=Gt.type)===null||Xr===void 0)?void 0:Xr.indexOf("video"))>-1?St.replaceSelection('')):(Gt==null||((bn=Gt.type)===null||bn===void 0)?void 0:bn.indexOf("pdf"))>-1?St.replaceSelection('').concat(Gt.name,"")):le.includes(Ln)?St.replaceSelection('').concat(Gt.name,"")):St.replaceSelection("[".concat(Gt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(qt.id,"?type=").concat(qt.content_type,")"))}else(qt==null?void 0:qt.status)===401&&(document.location.href="/user/login")})}catch(qt){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return St.on("paste",_t),St.on("dragleave",function(Ot,Kt){cr.current.classList.remove("mouse-hover-md")}),St.on("dragover",function(Ot,Kt){cr.current.classList.add("mouse-hover-md")}),St.on("drop",function(Ot,Kt){cr.current.classList.add("mouse-hover-md");var Jt;if(Jt=Kt.dataTransfer.files,Jt.length>0){Kt.preventDefault(),Kt.stopPropagation();for(var hr=function(en){var Gt=Jt[en],Ln=Gt.name.split(".").pop();J(Gt,function(qt){if(qt.id){var tn,Xr,bn;(Gt==null||((tn=Gt.type)===null||tn===void 0)?void 0:tn.indexOf("image"))>-1?St.replaceSelection(".concat(qt.content_type,")")):(Gt==null||((Xr=Gt.type)===null||Xr===void 0)?void 0:Xr.indexOf("video"))>-1?St.replaceSelection('')):(Gt==null||((bn=Gt.type)===null||bn===void 0)?void 0:bn.indexOf("pdf"))>-1?St.replaceSelection('').concat(Gt.name,"")):le.includes(Ln)?St.replaceSelection('').concat(Gt.name,"")):St.replaceSelection("[".concat(Gt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(qt.id,"?type=").concat(qt.content_type,")"))}else(qt==null?void 0:qt.status)===401&&(document.location.href="/user/login")})},Vt=0;Vt0||Vt.target.offsetWidth>0)&&(Lr(),F.setSize("100%","100%"),F.refresh())}}catch(Pr){Jt.e(Pr)}finally{Jt.f()}});return Ot.observe(Ft.current.parentElement),Ot}if(F){var _t=St();return function(){_t.unobserve(Ft.current.parentElement)}}},[F,Lr]),Object(E.useEffect)(function(){if(F){for(var St=[],_t=function(){var Vt=Kt[Ot];Jt=Object(K.a)(Vt,2);var Pr=Jt[0],en=Jt[1],Gt=Object(B.a)({},Pr,function(){ln(en)});St.push(Gt),F.addKeyMap(Gt)},Ot=0,Kt=Object.entries(ue);Ot0){var St=new Date().getTime(),_t=window.sessionStorage.getItem(pr);St>=ar+Ye&&(!_t||_t!==Ze)&&(window.sessionStorage.setItem(pr,Ze),Yt(!0))}},Ye),Object(E.useEffect)(function(){mt(Dt)},[F,Dt]),Object(E.useEffect)(function(){F&&(kt&&F.focus())},[F,kt]),Object(E.useEffect)(function(){if(pt&&F){var St=F.getScrollerElement();function _t(Ot){var Kt=Ot.target;if(Vr.current){var Jt=Kt.scrollTop/Kt.scrollHeight;Vr.current.scrollTop=Vr.current.scrollHeight*Jt}}return St.addEventListener("scroll",_t),function(){St.removeEventListener("scroll",_t)}}},[F,pt]),Object(E.useEffect)(function(){if(F&&yr){function St(_t,Ot){yr(_t,Ot)}return F.on("beforeChange",St),function(){F.off("beforeChange",St)}}},[F,yr]),Object(E.useEffect)(function(){if(F&&Pt){function St(){Pt(F.getValue())}return F.on("blur",St),function(){F.off("blur",St)}}},[F,Pt]),Object(E.useEffect)(function(){if(F){function St(_t){var Ot=_t.getValue();nt(Ot),yn(new Date().getTime()),_t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),at&&at(Ot)}return F.on("change",St),function(){F.off("change",St)}}},[F,at]),Object(E.useEffect)(function(){F&&($e==null?(F.setValue(""),nt("")):$e!==F.getValue()&&(F.setValue($e),nt($e),F.setCursor(F.lineCount(),0)))},[F,$e]);var ln=Object(E.useCallback)(function(St){var _t=F.getCursor(),Ot=F.getSelection(),Kt=Ot.split(`
`);switch(St){case"bold":return F.replaceSelection("**"+Ot+"**"),Ot===""&&F.setCursor(_t.line,_t.ch+2),F.focus();case"italic":return F.replaceSelection("*"+Ot+"*"),Ot===""&&F.setCursor(_t.line,_t.ch+1),F.focus();case"code":return F.replaceSelection("`"+Ot+"`"),Ot===""&&F.setCursor(_t.line,_t.ch+1),F.focus();case"inline-latex":return F.replaceSelection("`$$"+Ot+"$$`"),Ot===""&&F.setCursor(_t.line,_t.ch+3),F.focus();case"latex":return F.replaceSelection("```latex\n"+Ot+"\n```"),F.setCursor(_t.line+1,Ot.length+1),F.focus();case"line-break":return F.replaceSelection(`
`),F.focus();case"list-ul":return Ot===""?F.replaceSelection("- "+Ot):F.replaceSelection(Kt.map(function(Jt){return Jt===""?"":"- ".concat(Jt)}).join(`
`)),F.focus();case"list-ol":return Ot===""?F.replaceSelection("1. "+Ot):F.replaceSelection(Kt.map(function(Jt,hr){return Jt===""?"":"".concat(hr+1,". ").concat(Jt)}).join(`
`)),F.focus();case"add-null-ch":return Ot===""&&F.setCursor(_t.line,_t.ch+1),F.replaceSelection(Pe),F.focus();case"inster-template-1":return Ot===""&&F.setCursor(_t.line,_t.ch),F.replaceSelection(We),F.focus();case"eraser":return F.setValue(""),F.focus();case"trigger-watch":return mt(!pt),F.focus();case"trigger-full-screen":return rr(!$t),F.focus();case He:Xt(He);return;case rt:Xt(rt);return;case Be:Xt(Be);return;case Oe:Xt(Oe);return;default:throw new Error}},[F,pt,$t]),pn=Object(E.useCallback)(function(St){Xt("");switch(ir){case He:var _t=St.title,Ot=St.link;return F.replaceSelection("[".concat(_t,"](").concat(Ot,")")),F.focus();case rt:var Kt=St.language,Jt=St.content;return F.replaceSelection(["```"+Kt,Jt,"```"].join(`
`)),F.focus();case Be:var hr=St.src,Vt=St.alt;return Vt?F.replaceSelection(".concat(hr,' "').concat(Vt,'" )')):F.replaceSelection("")),F.focus();case Oe:for(var Pr=St.row,en=St.col,Gt=St.align,Ln=`
`,qt=0;qt300&&(Pr=300);var en=Ct+Pr+"px";jt(en)}}return St.addEventListener("mousedown",Kt),document.addEventListener("mousemove",hr),document.addEventListener("mouseup",Jt),function(){St.removeEventListener("mousedown",Kt),document.removeEventListener("mousemove",hr),document.removeEventListener("mouseup",Jt)}}},[F,zt]),Object(E.useEffect)(function(){jt(Ct)},[Ct]);var En=Se(ut),mn=Se(Rn),cn={width:En,height:mn},pi=Object(E.useMemo)(function(){if(ar){var St=new Date(ar),_t=St.getHours(),Ot=St.getMinutes(),Kt=St.getSeconds();return _t=_t<10?"0"+_t:_t,Ot=Ot<10?"0"+Ot:Ot,Kt=Kt<10?"0"+Kt:Kt,"".concat(_t,":").concat(Ot,":").concat(Kt)}return 0},[ar]);function ji(){window.sessionStorage.removeItem(pr),Yt(!1),yn(0)}function jn(){Yt(!1),yn(0),F.setValue(window.sessionStorage.getItem(pr))}function ua(St,_t){var Ot=F.getValue();Ot=Ot.replace(St,_t),nt(Ot),F==null||F.setValue(Ot)}return L.a.createElement(E.Fragment,null,L.a.createElement("div",{className:"markdown-editor-wrapper",ref:cr},L.a.createElement("div",{className:"markdown-editor-container ".concat(qe," ").concat(pt?"on-preview":""," ").concat(Mt?"mini":""," ").concat($t?"full-screen":""),style:cn},L.a.createElement(C,{insertTemp:Tt,watch:pt,fullScreen:$t,showNullButton:Nt,onActionCallback:ln,hidetoolBar:sr,uuid:Zt.current,setOpenPhones:function(){Ht.current=!0}}),L.a.createElement("div",{className:"markdown-editor-body"},L.a.createElement("div",{className:"codemirror-container"},L.a.createElement("textarea",{ref:Ft,placeholder:Zr})),pt?L.a.createElement("div",{ref:Vr,className:"preview-container"},Qt==="stex"&&L.a.createElement(w,{value:Ze}),Qt!=="stex"&&L.a.createElement(p.a,{edit:!0,value:Ze,replaces:ua})):null))),tr?L.a.createElement("a",{ref:zt,className:"editor-resize"}):null,L.a.createElement(D.a,null,me[ir]?L.a.createElement(Y.a,{centered:!0,title:me[ir],visible:!0,onCancel:dn,footer:null,className:"markdown-popup-form"},un):null))}},RxwV:function(Et,tt,ie){"use strict";var he=ie("q1tI"),Y=ie("uciX"),O=ie("2W6z"),Z=ie.n(O),U=ie("4IlW"),I=ie("uK0f"),K=ie.n(I);function B(ae,de){if(ae===de)return!0;if(!ae||!de)return!1;var ne=ae.length;if(de.length!==ne)return!1;for(var se=0;se0;(Oe||ee.isLeaf===!1)&&(Be+=" ".concat(ke,"-menu-item-expand"),ee.loading||(rt=he.createElement("span",{className:"".concat(ke,"-menu-item-expand-icon")},De))),ge==="hover"&&(Oe||ee.isLeaf===!1)&&(He={onMouseEnter:this.delayOnSelect.bind(this,Ue),onMouseLeave:this.delayOnSelect.bind(this),onClick:Ue}),this.isActiveOption(ee,oe)&&(Be+=" ".concat(ke,"-menu-item-active"),He.ref=this.saveMenuItem(oe)),ee.disabled&&(Be+=" ".concat(ke,"-menu-item-disabled"));var Fe=null;ee.loading&&(Be+=" ".concat(ke,"-menu-item-loading"),Fe=Me||null);var je="";return"title"in ee?je=ee.title:typeof ee[this.getFieldName("label")]=="string"&&(je=ee[this.getFieldName("label")]),he.createElement("li",Object.assign({key:ee[this.getFieldName("value")],className:Be,title:je},He,{role:"menuitem",onMouseDown:function(Ve){return Ve.preventDefault()}}),ee[this.getFieldName("label")],rt,Fe)}},{key:"getActiveOptions",value:function(ee){var oe=this,fe=this.props.options,ke=ee||this.props.activeValue;return K()(fe,function(ge,De){return ge[oe.getFieldName("value")]===ke[De]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var ee=this,oe=this.props.options,fe=this.getActiveOptions().map(function(ke){return ke[ee.getFieldName("children")]}).filter(function(ke){return!!ke});return fe.unshift(oe),fe}},{key:"delayOnSelect",value:function(ee){for(var oe=this,fe=arguments.length,ke=new Array(fe>1?fe-1:0),ge=1;ge=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ae,se))continue;ne[se]=ae[se]}}return ne}function u(ae,de){if(ae==null)return{};var ne={},se=Object.keys(ae),J,ee;for(ee=0;ee=0)continue;ne[J]=ae[J]}return ne}function f(ae){return v(ae)||T(ae)||a(ae)||s()}function s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(ae,de){if(!ae)return;if(typeof ae=="string")return C(ae,de);var ne=Object.prototype.toString.call(ae).slice(8,-1);if(ne==="Object"&&ae.constructor&&(ne=ae.constructor.name),ne==="Map"||ne==="Set")return Array.from(ae);if(ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne))return C(ae,de)}function T(ae){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(ae))return Array.from(ae)}function v(ae){if(Array.isArray(ae))return C(ae)}function C(ae,de){(de==null||de>ae.length)&&(de=ae.length);for(var ne=0,se=new Array(de);ne=Me.length?0:Ke):(Ke-=1,Ke=Ke<0?Me.length-1:Ke):Ke=0,ge[De]=Me[Ke][ee.getFieldName("value")]}else if(fe.keyCode===U.a.LEFT||fe.keyCode===U.a.BACKSPACE)fe.preventDefault(),ge.splice(ge.length-1,1);else if(fe.keyCode===U.a.RIGHT)fe.preventDefault(),Me[Ue]&&Me[Ue][ee.getFieldName("children")]&&ge.push(Me[Ue][ee.getFieldName("children")][0][ee.getFieldName("value")]);else if(fe.keyCode===U.a.ESC||fe.keyCode===U.a.TAB){ee.setPopupVisible(!1);return}(!ge||ge.length===0)&&ee.setPopupVisible(!1);var He=ee.getActiveOptions(ge),Be=He[He.length-1];ee.handleMenuSelect(Be,He.length-1,fe),ee.props.onKeyDown&&ee.props.onKeyDown(fe)},ee.saveTrigger=function(fe){ee.trigger=fe};var oe=[];return"value"in J?oe=J.value||[]:"defaultValue"in J&&(oe=J.defaultValue||[]),Z()(!("filedNames"in J),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),ee.state={popupVisible:J.popupVisible,activeValue:oe,value:oe,prevProps:J},ee.defaultFieldNames={label:"label",value:"value",children:"children"},ee}return z(se,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(ee){var oe=this.defaultFieldNames,fe=this.props,ke=fe.fieldNames,ge=fe.filedNames;return"filedNames"in this.props?ge[ee]||oe[ee]:ke[ee]||oe[ee]}},{key:"getFieldNames",value:function(){var ee=this.props,oe=ee.fieldNames,fe=ee.filedNames;return"filedNames"in this.props?fe:oe}},{key:"getCurrentLevelOptions",value:function(){var ee=this,oe=this.props.options,fe=oe===void 0?[]:oe,ke=this.state.activeValue,ge=ke===void 0?[]:ke,De=K()(fe,function(Me,Ue){return Me[ee.getFieldName("value")]===ge[Ue]},{childrenKeyName:this.getFieldName("children")});return De[De.length-2]?De[De.length-2][this.getFieldName("children")]:f(fe).filter(function(Me){return!Me.disabled})}},{key:"getActiveOptions",value:function(ee){var oe=this;return K()(this.props.options||[],function(fe,ke){return fe[oe.getFieldName("value")]===ee[ke]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var ee=this.props,oe=ee.prefixCls,fe=ee.transitionName,ke=ee.popupClassName,ge=ee.options,De=ge===void 0?[]:ge,Me=ee.disabled,Ue=ee.builtinPlacements,Ke=ee.popupPlacement,He=ee.children,Be=ee.dropdownRender,rt=b(ee,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Oe=he.createElement("div",null),Fe="";De&&De.length>0?Oe=he.createElement(S,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Fe=" ".concat(oe,"-menus-empty");var je=Oe;return Be&&(je=Be(Oe)),he.createElement(Y.a,Object.assign({ref:this.saveTrigger},rt,{popupPlacement:Ke,builtinPlacements:Ue,popupTransitionName:fe,action:Me?[]:["click"],popupVisible:Me?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(oe,"-menus"),popupClassName:ke+Fe,popup:je}),he.cloneElement(He,{onKeyDown:this.handleKeyDown,tabIndex:Me?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(ee,oe){var fe=oe.prevProps,ke=fe===void 0?{}:fe,ge={prevProps:ee};return"value"in ee&&!B(ke.value,ee.value)&&(ge.value=ee.value||[],"loadData"in ee||(ge.activeValue=ee.value||[])),"popupVisible"in ee&&(ge.popupVisible=ee.popupVisible),ge}}]),se}(he.Component);return ae.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:p,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},ae}(),Le=Ae,ce=tt.a=Le},SJMd:function(Et,tt){/**
* @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 ie,he,Y,O=!1,Z,U;window.PR_SHOULD_USE_CONTINUATION=!0;var I,K;(function(){var B=window,M=["break,continue,do,else,for,if,return,while"],R=[M,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],E=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],L=[E,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],_=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],A=[E,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],x="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",y=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[M,"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=[M,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[M,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[L,A,_,y,h,o,l,d],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",w="kwd",b="com",u="typ",f="lit",s="pun",a="pln",T="tag",v="dec",C="src",D="atn",j="atv",z="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(ge){for(var De=0,Me=!1,Ue=!1,Ke=0,He=ge.length;Ke122||(le<65||xe>90||Qe.push([Math.max(65,xe)|32,Math.min(le,90)|32]),le<97||xe>122||Qe.push([Math.max(97,xe)&~32,Math.min(le,122)&~32]))}}Qe.sort(function(we,Ie){return we[0]-Ie[0]||Ie[1]-we[1]});for(var ue=[],me=[],We=0;WeEe[0]&&(Ee[1]+1>Ee[0]&&Pe.push("-"),Pe.push(Fe(Ee[1])))}return Pe.push("]"),Pe.join("")}function Ge(ze){for(var Re=ze.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")),Qe=Re.length,Ye=[],Pe=0,We=0;Pe=2&&xe==="["?Re[Pe]=je(Se):xe!=="\\"&&(Re[Pe]=Se.replace(/[a-zA-Z]/g,function(me){var Ee=me.charCodeAt(0);return"["+String.fromCharCode(Ee&~32,Ee|32)+"]"}))}return Re.join("")}for(var Ve=[],Ke=0,He=ge.length;Ke=0;)Me[Ve.charAt(ze)]=Ge;var Re=Ge[1],Qe=""+Re;Oe.hasOwnProperty(Qe)||(rt.push(Re),Oe[Qe]=null)}rt.push(/[\0-\uffff]/),Ue=P(rt)})();var Ke=De.length,He=function(Be){for(var rt=Be.sourceCode,Oe=Be.basePos,Fe=Be.sourceNode,je=[Oe,a],Ge=0,Ve=rt.match(Ue)||[],ze={},Re=0,Qe=Ve.length;Re=5&&Pe.substring(0,5)==="lang-",Se&&!(We&&typeof We[1]=="string")&&(Se=!1,Pe=C),Se||(ze[Ye]=Pe)}var le=Ge;if(Ge+=Ye.length,!Se)je.push(Oe+le,Pe);else{var ue=We[1],me=Ye.indexOf(ue),Ee=me+ue.length;We[2]&&(Ee=Ye.length-We[2].length,me=Ee-ue.length);var we=Pe.substring(5);$(Fe,Oe+le,Ye.substring(0,me),He,je),$(Fe,Oe+le+me,ue,se(we,ue),je),$(Fe,Oe+le+Ee,Ye.substring(Ee),He,je)}}Be.decorations=je};return He}function Ae(ge){var De=[],Me=[];ge.tripleQuotedStrings?De.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ge.multiLineStrings?De.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ge.verbatimStrings&&Me.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ue=ge.hashComments;Ue&&(ge.cStyleComments?(Ue>1?De.push([b,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.push([b,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Me.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):De.push([b,/^#[^\r\n]*/,null,"#"])),ge.cStyleComments&&(Me.push([b,/^\/\/[^\r\n]*/,null]),Me.push([b,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=ge.regexLiterals;if(Ke){var He=Ke>1?"":`
\r`,Be=He?".":"[\\S\\s]",rt="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";Me.push(["lang-regex",RegExp("^"+V+"("+rt+")")])}var Oe=ge.types;Oe&&Me.push([u,Oe]);var Fe=(""+ge.keywords).replace(/^ | $/g,"");Fe.length&&Me.push([w,new RegExp("^(?:"+Fe.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([a,/^\s+/,null,` \r
\xA0`]);var je="^.[^\\s\\w.$@'\"`/\\\\]*";return ge.regexLiterals&&(je+="(?!s*/)"),Me.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[u,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(je),null]),ve(De,Me)}var Le=Ae({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ce(ge,De,Me){for(var Ue=/(?:^|\s)nocode(?:\s|$)/,Ke=/\r\n?|\n/,He=ge.ownerDocument,Be=He.createElement("li");ge.firstChild;)Be.appendChild(ge.firstChild);var rt=[Be];function Oe(Re){var Qe=Re.nodeType;if(Qe==1&&!Ue.test(Re.className))if(Re.nodeName==="br")Fe(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var Ye=Re.firstChild;Ye;Ye=Ye.nextSibling)Oe(Ye);else if((Qe==3||Qe==4)&&Me){var Pe=Re.nodeValue,We=Pe.match(Ke);if(We){var Se=Pe.substring(0,We.index);Re.nodeValue=Se;var ye=Pe.substring(We.index+We[0].length);if(ye){var xe=Re.parentNode;xe.insertBefore(He.createTextNode(ye),Re.nextSibling)}Fe(Re),Se||Re.parentNode.removeChild(Re)}}}function Fe(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function Qe(We,Se){var ye=Se?We.cloneNode(!1):We,xe=We.parentNode;if(xe){var le=Qe(xe,1),ue=We.nextSibling;le.appendChild(ye);for(var me=ue;me;me=ue)ue=me.nextSibling,le.appendChild(me)}return ye}for(var Ye=Qe(Re.nextSibling,0),Pe;(Pe=Ye.parentNode)&&Pe.nodeType===1;)Ye=Pe;rt.push(Ye)}for(var je=0;je=xe&&(Oe+=2),He>=le&&(Ge+=2)}}finally{Pe&&(Pe.style.display=We)}}var de={};function ne(ge,De){for(var Me=De.length;--Me>=0;){var Ue=De[Me];de.hasOwnProperty(Ue)?B.console&&console.warn("cannot override language handler %s",Ue):de[Ue]=ge}}function se(ge,De){return ge&&de.hasOwnProperty(ge)||(ge=/^\s*]*(?:>|$)/],[b,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^