(window.webpackJsonp=window.webpackJsonp||[]).push([[233,5,6,7],{"+NIl":function(Tt,dt,le){(function(he){he(le("VrN/"))})(function(he){"use strict";he.defineMode("stex",function(J,D){"use strict";function Q(L,w){L.cmdState.push(w)}function B(L){return L.cmdState.length>0?L.cmdState[L.cmdState.length-1]:null}function _(L){var w=L.cmdState.pop();w&&w.closeBracket()}function G(L){for(var w=L.cmdState,y=w.length-1;y>=0;y--){var u=w[y];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function j(L,w,y){return function(){this.name=L,this.bracketNo=0,this.style=w,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 I={};I.importmodule=j("importmodule","tag",["string","builtin"]),I.documentclass=j("documentclass","tag",["","atom"]),I.usepackage=j("usepackage","tag",["atom"]),I.begin=j("begin","tag",["atom"]),I.end=j("end","tag",["atom"]),I.label=j("label","tag",["atom"]),I.ref=j("ref","tag",["atom"]),I.eqref=j("eqref","tag",["atom"]),I.cite=j("cite","tag",["atom"]),I.bibitem=j("bibitem","tag",["atom"]),I.Bibitem=j("Bibitem","tag",["atom"]),I.RBibitem=j("RBibitem","tag",["atom"]),I.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(L,w){L.f=w}function v(L,w){var y;if(L.match(/^\\[a-zA-Z@]+/)){var u=L.current().slice(1);return y=I.hasOwnProperty(u)?I[u]:I.DEFAULT,y=new y,Q(w,y),R(w,M),y.style}if(L.match(/^\\[$&%#{}_]/))return"tag";if(L.match(/^\\[,;!\/\\]/))return"tag";if(L.match("\\["))return R(w,function(l,d){return A(l,d,"\\]")}),"keyword";if(L.match("\\("))return R(w,function(l,d){return A(l,d,"\\)")}),"keyword";if(L.match("$$"))return R(w,function(l,d){return A(l,d,"$$")}),"keyword";if(L.match("$"))return R(w,function(l,d){return A(l,d,"$")}),"keyword";var o=L.next();if(o=="%")return L.skipToEnd(),"comment";if(o=="}"||o=="]"){if(y=B(w),y)y.closeBracket(o),R(w,M);else return"error";return"bracket"}else return o=="{"||o=="["?(y=I.DEFAULT,y=new y,Q(w,y),"bracket"):/\d/.test(o)?(L.eatWhile(/[\w.%]/),"atom"):(L.eatWhile(/[\w\-_]/),y=G(w),y.name=="begin"&&(y.argument=L.current()),y.styleIdentifier())}function A(L,w,y){if(L.eatSpace())return null;if(y&&L.match(y))return R(w,v),"keyword";if(L.match(/^\\[a-zA-Z@]+/))return"tag";if(L.match(/^[a-zA-Z]+/))return"variable-2";if(L.match(/^\\[$&%#{}_]/))return"tag";if(L.match(/^\\[,;!\/]/))return"tag";if(L.match(/^[\^_&]/))return"tag";if(L.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(L.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=L.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(L.skipToEnd(),"comment"):"error"}function M(L,w){var y=L.peek(),u;return y=="{"||y=="["?(u=B(w),u.openBracket(y),L.eat(y),R(w,v),"bracket"):/[ \t\r]/.test(y)?(L.eat(y),null):(R(w,v),_(w),v(L,w))}return{startState:function(){var L=D.inMathMode?function(w,y){return A(w,y)}:v;return{cmdState:[],f:L}},copyState:function(L){return{cmdState:L.cmdState.slice(),f:L.f}},token:function(L,w){return w.f(L,w)},blankLine:function(L){L.f=v,L.cmdState.length=0},lineComment:"%"}}),he.defineMIME("text/x-stex","stex"),he.defineMIME("text/x-latex","stex")})},"19Vz":function(Tt,dt,le){(function(he){he(le("VrN/"))})(function(he){he.defineOption("placeholder","",function(j,I,R){var v=R&&R!=he.Init;if(I&&!v)j.on("blur",B),j.on("change",_),j.on("swapDoc",_),he.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){Q(j)}),_(j);else if(!I&&v){j.off("blur",B),j.off("change",_),j.off("swapDoc",_),he.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),J(j);var A=j.getWrapperElement();A.className=A.className.replace(" CodeMirror-empty","")}I&&!j.hasFocus()&&B(j)});function J(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function D(j){J(j);var I=j.state.placeholder=document.createElement("pre");I.style.cssText="height: 0; overflow: visible",I.style.direction=j.getOption("direction"),I.className="CodeMirror-placeholder CodeMirror-line-like";var R=j.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),I.appendChild(R),j.display.lineSpace.insertBefore(I,j.display.lineSpace.firstChild)}function Q(j){setTimeout(function(){var I=!1,R=j.getInputField();R.nodeName=="TEXTAREA"?I=!R.value:j.lineCount()==1&&(I=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),I?D(j):J(j)},20)}function B(j){G(j)&&D(j)}function _(j){var I=j.getWrapperElement(),R=G(j);I.className=I.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?D(j):J(j)}function G(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(Tt,dt,le){(function(he){he(le("VrN/"))})(function(he){"use strict";var J={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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};he.defineMode("xml",function(Q,B){var _=Q.indentUnit,G={},j=B.htmlMode?J:D;for(var I in j)G[I]=j[I];for(var I in B)G[I]=B[I];var R,v;function A(a,E){function b(U){return E.tokenize=U,U(a,E)}var S=a.next();if(S=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?b(w("atom","]]>")):null:a.match("--")?b(w("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),b(y(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),E.tokenize=w("meta","?>"),"meta"):(R=a.eat("/")?"closeTag":"openTag",E.tokenize=M,"tag bracket");if(S=="&"){var N;return a.eat("#")?a.eat("x")?N=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):N=a.eatWhile(/[\d]/)&&a.eat(";"):N=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),N?"atom":"error"}else return a.eatWhile(/[^&<]/),null}A.isInText=!0;function M(a,E){var b=a.next();if(b==">"||b=="/"&&a.eat(">"))return E.tokenize=A,R=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return R="equals",null;if(b=="<"){E.tokenize=A,E.state=d,E.tagName=E.tagStart=null;var S=E.tokenize(a,E);return S?S+" tag error":"tag error"}else return/[\'\"]/.test(b)?(E.tokenize=L(b),E.stringStartCol=a.column(),E.tokenize(a,E)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function L(a){var E=function(b,S){for(;!b.eol();)if(b.next()==a){S.tokenize=M;break}return"string"};return E.isInAttribute=!0,E}function w(a,E){return function(b,S){for(;!b.eol();){if(b.match(E)){S.tokenize=A;break}b.next()}return a}}function y(a){return function(E,b){for(var S;(S=E.next())!=null;){if(S=="<")return b.tokenize=y(a+1),b.tokenize(E,b);if(S==">")if(a==1){b.tokenize=A;break}else return b.tokenize=y(a-1),b.tokenize(E,b)}return"meta"}}function u(a,E,b){this.prev=a.context,this.tagName=E,this.indent=a.indented,this.startOfLine=b,(G.doNotIndent.hasOwnProperty(E)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,E){for(var b;;){if(!a.context)return;if(b=a.context.tagName,!G.contextGrabbers.hasOwnProperty(b)||!G.contextGrabbers[b].hasOwnProperty(E))return;o(a)}}function d(a,E,b){return a=="openTag"?(b.tagStart=E.column(),T):a=="closeTag"?c:d}function T(a,E,b){return a=="word"?(b.tagName=E.current(),v="tag",x):G.allowMissingTagName&&a=="endTag"?(v="tag bracket",x(a,E,b)):(v="error",T)}function c(a,E,b){if(a=="word"){var S=E.current();return b.context&&b.context.tagName!=S&&G.implicitlyClosed.hasOwnProperty(b.context.tagName)&&o(b),b.context&&b.context.tagName==S||G.matchClosing===!1?(v="tag",f):(v="tag error",k)}else return G.allowMissingTagName&&a=="endTag"?(v="tag bracket",f(a,E,b)):(v="error",k)}function f(a,E,b){return a!="endTag"?(v="error",f):(o(b),d)}function k(a,E,b){return v="error",f(a,E,b)}function x(a,E,b){if(a=="word")return v="attribute",m;if(a=="endTag"||a=="selfcloseTag"){var S=b.tagName,N=b.tagStart;return b.tagName=b.tagStart=null,a=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(S)?l(b,S):(l(b,S),b.context=new u(b,S,N==b.indented)),d}return v="error",x}function m(a,E,b){return a=="equals"?g:(G.allowMissing||(v="error"),x(a,E,b))}function g(a,E,b){return a=="string"?h:a=="word"&&G.allowUnquoted?(v="string",x):(v="error",x(a,E,b))}function h(a,E,b){return a=="string"?h:x(a,E,b)}return{startState:function(a){var E={tokenize:A,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(E.baseIndent=a),E},token:function(a,E){if(!E.tagName&&a.sol()&&(E.indented=a.indentation()),a.eatSpace())return null;R=null;var b=E.tokenize(a,E);return(b||R)&&b!="comment"&&(v=null,E.state=E.state(R||b,a,E),v&&(b=v=="error"?b+" error":v)),b},indent:function(a,E,b){var S=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(S&&S.noIndent)return he.Pass;if(a.tokenize!=M&&a.tokenize!=A)return b?b.match(/^(\s*)/)[0].length:0;if(a.tagName)return G.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/$/,blockCommentStart:"",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(a){a.state==g&&(a.state=x)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var E=[],b=a.context;b;b=b.prev)b.tagName&&E.push(b.tagName);return E.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(Tt,dt,le){"use strict";var he=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function D(){if(!he)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return he(J)}var Q=/^(?:[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 B(M){return typeof M=="string"&&Q.test(M)}for(var _=B,G=[],j=0;j<256;++j)G.push((j+256).toString(16).substr(1));function I(M){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=(G[M[L+0]]+G[M[L+1]]+G[M[L+2]]+G[M[L+3]]+"-"+G[M[L+4]]+G[M[L+5]]+"-"+G[M[L+6]]+G[M[L+7]]+"-"+G[M[L+8]]+G[M[L+9]]+"-"+G[M[L+10]]+G[M[L+11]]+G[M[L+12]]+G[M[L+13]]+G[M[L+14]]+G[M[L+15]]).toLowerCase();if(!_(w))throw TypeError("Stringified UUID is invalid");return w}var R=I;function v(M,L,w){M=M||{};var y=M.random||(M.rng||D)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,L){w=w||0;for(var u=0;u<16;++u)L[w+u]=y[u];return L}return R(y)}var A=dt.a=v},"7ahc":function(Tt,dt,le){"use strict";le.d(dt,"a",function(){return T});var he=le("k1fw"),J=le("0Owb"),D=le("+L6B"),Q=le("2/Rp"),B=le("y8nQ"),_=le("Vl3Y"),G=le("tJVT"),j=le("OaEy"),I=le("2fM7"),R=le("q1tI"),v=le.n(R),A=le("VrN/"),M=le.n(A),L=le("p77/"),w=le.n(L),y=le("c5Ni"),u=le.n(y),o=I.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"]};dt.b=function(c){var f=c.callback,k=c.onCancel,x=Object(R.useState)("python"),m=Object(G.a)(x,2),g=m[0],h=m[1];function a(b){h(d[b][1])}function E(b){f(b)}return v.a.createElement(_.a,Object(J.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),v.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(I.a,{onChange:a},Object.keys(d).map(function(b){return v.a.createElement(o,{key:b,value:b},d[b][0])}))),v.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(T,{mode:g})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(Q.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function T(c){var f=c.value,k=c.onChange,x=c.mode,m=c.options,g=m===void 0?{}:m,h=Object(R.useRef)(),a=Object(R.useState)(),E=Object(G.a)(a,2),b=E[0],S=E[1];return Object(R.useEffect)(function(){if(b){function N(U){var K=U.getValue();k&&k(K)}return b.on("change",N),function(){b.off("change",N)}}},[b,k]),Object(R.useEffect)(function(){b&&b.setOption("mode",x)},[b,x]),Object(R.useEffect)(function(){b&&((f!==b.getValue()||f==="")&&setTimeout(function(){b.setValue(f||" ")},300))},[b,f]),Object(R.useEffect)(function(){if(h.current&&!b){var N=M.a.fromTextArea(h.current,Object(he.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},g));S(N)}},[h.current,b]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:h}))}},"8EBN":function(Tt,dt,le){(function(he){he(le("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 J=0;J-1&&Q.substring(G+1,Q.length);if(j)return he.findModeByExtension(j)},he.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B=W.length?X.slice(W.length):X}).join(`
`)}var u=[],o=[""],l=new L.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){u.length=0,o=[""]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(z,s,p,W){if(s>=z.length||z[s].level<=p)return s;var X=z[s];W.push("- "+X.text+""),s++;var H=[];return s=f(z,s,X.level,H),H.length>0&&(W.push("
"),H.forEach(function(ve){W.push(ve)}),W.push("
")),W.push(" "),s=f(z,s,p,W),s}function k(){return f(u,0,0,o),o.push("
"),o.join("")}var x={heading:function(s){var p=d.exec(s);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(s){var p=this.rules.block.fences.exec(s);if(p){var W=p[0],X=y(W,p[3]||""),H=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(H)>=0){var ve=h(),He=X;X=ve,a[ve]={type:"block",expression:He}}return{type:"code",raw:W,lang:H,text:X}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,h=function(){return"__special_katext_id_".concat(g++,"__")},a={};function E(){return a}function b(){g=0,a={}}function S(z){return z=z.replace(m,function(s,p){var W=h();return a[W]={type:"inline",expression:p},W}),z}var N=l.listitem;l.listitem=function(z){return N(S(z))};var U=l.paragraph;l.paragraph=function(z){return U(S(z))};var K=l.tablecell;l.tablecell=function(z,s){return K(S(z),s)},l.code=function(z,s,p){var W=(s||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"".concat(z,"
"):'
').concat(p?z:Object(w.escape)(z,!0),`
`):''+(p?z:Object(w.escape)(z,!0))+"
"},l.heading=function(z,s,p){var W=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:W,level:s,text:z}),"'+z+""},L.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),L.a.use({tokenizer:x,renderer:l});var V=L.a,O=le("SJMd"),P=le("ulZh"),$=le.n(P),ee=le("m3rI"),oe=le("Oy/b"),fe=le("p5ED"),Oe=le("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 Ce=function(z,s){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,W){p.__proto__=W}||function(p,W){for(var X in W)Object.prototype.hasOwnProperty.call(W,X)&&(p[X]=W[X])})(z,s)};function Ae(z,s){function p(){this.constructor=z}Ce(z,s),z.prototype=s===null?Object.create(s):(p.prototype=s.prototype,new p)}function Le(z,s,p,W){return new(p||(p=Promise))(function(X,H){function ve(ft){try{qe(W.next(ft))}catch(Ge){H(Ge)}}function He(ft){try{qe(W.throw(ft))}catch(Ge){H(Ge)}}function qe(ft){var Ge;ft.done?X(ft.value):(Ge=ft.value,Ge instanceof p?Ge:new p(function(Ct){Ct(Ge)})).then(ve,He)}qe((W=W.apply(z,s||[])).next())})}function be(z,s){var p,W,X,H,ve={label:0,sent:function(){if(1&X[0])throw X[1];return X[1]},trys:[],ops:[]};return H={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function He(qe){return function(ft){return function(Ge){if(p)throw new TypeError("Generator is already executing.");for(;ve;)try{if(p=1,W&&(X=2&Ge[0]?W.return:Ge[0]?W.throw||((X=W.return)&&X.call(W),0):W.next)&&!(X=X.call(W,Ge[1])).done)return X;switch(W=0,X&&(Ge=[2&Ge[0],X.value]),Ge[0]){case 0:case 1:X=Ge;break;case 4:return ve.label++,{value:Ge[1],done:!1};case 5:ve.label++,W=Ge[1],Ge=[0];continue;case 7:Ge=ve.ops.pop(),ve.trys.pop();continue;default:if(!(X=ve.trys,(X=X.length>0&&X[X.length-1])||Ge[0]!==6&&Ge[0]!==2)){ve=0;continue}if(Ge[0]===3&&(!X||Ge[1]>X[0]&&Ge[1]',"select"),this.addActionButton(W,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(W,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(W,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(W,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(W,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(W,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(W,'',"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 ve=document.createElement("div");ve.className=""+p.toolbarButtonStyleClass.name,ve.setAttribute("data-type-name",H.typeName),ve.innerHTML=H.icon,ve.addEventListener("click",function(){p.markerToolbarButtonClicked(ve,H)}),p.buttons.push(ve),p.markerButtons.push(ve)}),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 X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",X.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(X),this.addActionButton(X,'',"render"),this.addActionButton(X,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},z.prototype.addButtonClickListener=function(s){this.buttonClickListeners.push(s)},z.prototype.removeButtonClickListener=function(s){this.buttonClickListeners.indexOf(s)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(s),1)},z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var s=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var p=0;p0&&this.buttonClickListeners.forEach(function(W){return W("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(s,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},z.prototype.setActiveButton=function(s){this.resetButtonStyles(),s.className=s.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),s.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},z.prototype.setActiveMarkerButton=function(s){var p=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===s});p&&this.setActiveButton(p)},z.prototype.setCurrentMarker=function(s){var p=this;this.currentMarker=s,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){p.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},z}(),Pe=function(){function z(s,p,W,X){this.panels=[],this.panelButtons=[],this.markerjsContainer=s,this.displayMode=p,this.uiStyleSettings=W,this.styles=X,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return z.prototype.addStyles=function(){var s;this.toolboxStyleClass=this.styles.addClass(new xe("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 xe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new xe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new xe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new xe("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 xe("toolbox-panel-row_colors",`
background-color: `+((s=this.uiStyleSettings.toolboxBackgroundColor)!==null&&s!==void 0?s:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new xe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
padding: `+p+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new xe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new xe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Re("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Re("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},z.prototype.show=function(s){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(s){var p,W,X=this;this.panels=s,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(H){var ve;H.uiStyleSettings=X.uiStyleSettings;var He=document.createElement("div");He.className=X.toolboxButtonStyleClass.name+" "+((ve=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ve!==void 0?ve:X.toolboxButtonStyleColorsClass.name),He.innerHTML=H.icon,He.title=H.title,He.addEventListener("click",function(){X.panelButtonClick(H)}),X.panelButtons.push(He),X.buttonRow.appendChild(He)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(s){var p=this,W=-1;if(s!==this.activePanel){W=this.panels.indexOf(s),this.panelRow.innerHTML="";var X=s.getUi();X.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(X),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=s}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(H,ve){var He,qe;H.className=p.toolboxButtonStyleClass.name+" "+(ve===W?""+((He=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:p.toolboxActiveButtonStyleColorsClass.name):""+((qe=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:p.toolboxButtonStyleColorsClass.name))})},z}(),je=function(z,s){this.title=z,this.icon=s},Ue=function(z){function s(p,W,X,H){var ve=z.call(this,p,H||'')||this;return ve.colors=[],ve.addTransparent=!1,ve.colorBoxes=[],ve.colors=W,ve.currentColor=X,ve.setCurrentColor=ve.setCurrentColor.bind(ve),ve.getColorBox=ve.getColorBox.bind(ve),ve}return Ae(s,z),s.prototype.getUi=function(){var p=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(X){var H=p.getColorBox(X);W.appendChild(H),p.colorBoxes.push(H)}),W},s.prototype.getColorBox=function(p){var W=this,X=this.uiStyleSettings.toolbarHeight/4,H=this.uiStyleSettings.toolbarHeight-X,ve=document.createElement("div");ve.style.display="inline-block",ve.style.boxSizing="content-box",ve.style.width=H-2+"px",ve.style.height=H-2+"px",ve.style.padding="1px",ve.style.marginRight="2px",ve.style.marginBottom="2px",ve.style.borderWidth="2px",ve.style.borderStyle="solid",ve.style.borderRadius=(H+2)/2+"px",ve.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ve.addEventListener("click",function(){W.setCurrentColor(p,ve)});var He=document.createElement("div");return He.style.display="inline-block",He.style.width=H-2+"px",He.style.height=H-2+"px",He.style.backgroundColor=p,He.style.borderRadius=H/2+"px",p==="transparent"&&(He.style.fill=this.uiStyleSettings.toolboxAccentColor,He.innerHTML=``),ve.appendChild(He),ve},s.prototype.setCurrentColor=function(p,W){var X=this;this.currentColor=p,this.colorBoxes.forEach(function(H){H.style.borderColor=H===W?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},s}(je),Ne=function(){function z(s,p,W){this._state="new",this._isSelected=!1,this._container=s,this._overlayContainer=p,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(s){return!1},Object.defineProperty(z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},z.prototype.pointerDown=function(s,p){},z.prototype.dblClick=function(s,p){},z.prototype.manipulate=function(s){},z.prototype.pointerUp=function(s){this.stateChanged()},z.prototype.dispose=function(){},z.prototype.addMarkerVisualToContainer=function(s){this.container.childNodes.length>0?this.container.insertBefore(s,this.container.childNodes[0]):this.container.appendChild(s)},z.prototype.getState=function(){return{typeName:z.typeName,state:this.state,notes:this.notes}},z.prototype.restoreState=function(s){this._state=s.state,this.notes=s.notes},z.prototype.scale=function(s,p){},z.prototype.colorChanged=function(s){this.onColorChanged&&this.onColorChanged(s),this.stateChanged()},z.prototype.fillColorChanged=function(s){this.onFillColorChanged&&this.onFillColorChanged(s),this.stateChanged()},z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var s=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),s.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(s)&&this.onStateChanged(this)}},z.typeName="MarkerBase",z}(),Ie=function(){function z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return z.prototype.findGripByVisual=function(s){return this.topLeft.ownsTarget(s)?this.topLeft:this.topCenter.ownsTarget(s)?this.topCenter:this.topRight.ownsTarget(s)?this.topRight:this.centerLeft.ownsTarget(s)?this.centerLeft:this.centerRight.ownsTarget(s)?this.centerRight:this.bottomLeft.ownsTarget(s)?this.bottomLeft:this.bottomCenter.ownsTarget(s)?this.bottomCenter:this.bottomRight.ownsTarget(s)?this.bottomRight:void 0},z}(),Qe=function(){function z(){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 z.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},z}(),rt=function(){function z(){}return z.toITransformMatrix=function(s){return{a:s.a,b:s.b,c:s.c,d:s.d,e:s.e,f:s.f}},z.toSVGMatrix=function(s,p){return s.a=p.a,s.b=p.b,s.c=p.c,s.d=p.d,s.e=p.e,s.f=p.f,s},z}(),et=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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 Ae(s,z),Object.defineProperty(s.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visual",{get:function(){return this._visual},set:function(p){this._visual=p;var W=se.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(p){return!!z.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var X=this.unrotatePoint(p);if(this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.offsetX=X.x-this.left,this.offsetY=X.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){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 ve=this.container.transform.baseVal.getItem(0);ve.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ve,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},s.prototype.pointerUp=function(p){var W=this.state;z.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},s.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},s.prototype.manipulate=function(p){var W=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(p)},s.prototype.resize=function(p){var W=this.manipulationStartLeft,X=this.manipulationStartWidth,H=this.manipulationStartTop,ve=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+p.x-this.manipulationStartX,X=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:X=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:H=this.manipulationStartTop+p.y-this.manipulationStartY,ve=this.manipulationStartHeight+this.manipulationStartTop-H;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ve=this.manipulationStartHeight+p.y-this.manipulationStartY}X>=0?(this.left=W,this.width=X):(this.left=W+X,this.width=-X),ve>=0?(this.top=H,this.height=ve):(this.top=H+ve,this.height=-ve),this.setSize()},s.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},s.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var W=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},s.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},s.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var W=this.container.getCTM(),X=se.createPoint(p.x,p.y);return{x:(X=X.matrixTransform(W)).x,y:X.y}},s.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var W=this.container.getCTM();W=W.inverse();var X=se.createPoint(p.x,p.y);return{x:(X=X.matrixTransform(W)).x,y:X.y}},s.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var p=se.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=se.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=se.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ie,this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},s.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()},s.prototype.createGrip=function(){var p=new Qe;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},s.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,W=-p/2,X=W,H=(this.width+this.CB_DISTANCE)/2-p/2,ve=(this.height+this.CB_DISTANCE)/2-p/2,He=this.height+this.CB_DISTANCE-p/2,qe=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,W,X),this.positionGrip(this.controlGrips.topCenter.visual,H,X),this.positionGrip(this.controlGrips.topRight.visual,qe,X),this.positionGrip(this.controlGrips.centerLeft.visual,W,ve),this.positionGrip(this.controlGrips.centerRight.visual,qe,ve),this.positionGrip(this.controlGrips.bottomLeft.visual,W,He),this.positionGrip(this.controlGrips.bottomCenter.visual,H,He),this.positionGrip(this.controlGrips.bottomRight.visual,qe,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,H,X-3*this.CB_DISTANCE)},s.prototype.positionGrip=function(p,W,X){var H=p.transform.baseVal.getItem(0);H.setTranslate(W,X),p.transform.baseVal.replaceItem(H,0)},s.prototype.hideControlBox=function(){this.controlBox.style.display="none"},s.prototype.showControlBox=function(){this.controlBox.style.display=""},s.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},s.prototype.restoreState=function(p){z.prototype.restoreState.call(this,p);var W=p;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},s.prototype.scale=function(p,W){z.prototype.scale.call(this,p,W);var X=this.rotatePoint({x:this.left,y:this.top}),H=this.unrotatePoint({x:X.x*p,y:X.y*W});this.left=H.x,this.top=H.y,this.width=this.width*p,this.height=this.height*W,this.adjustControlBox()},s}(Ne),Je=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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 Ae(s,z),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.visual)},s.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)},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},s.prototype.manipulate=function(p){z.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){z.prototype.resize.call(this,p),this.setSize()},s.prototype.setSize=function(){z.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(p){z.prototype.pointerUp.call(this,p),this.setSize()},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},s.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this))},s.prototype.restoreState=function(p){var W=p;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),z.prototype.restoreState.call(this,p),this.setSize()},s.prototype.scale=function(p,W){z.prototype.scale.call(this,p,W),this.setSize()},s.title="Rectangle marker",s}(et),st=function(z){function s(p,W,X,H){var ve=z.call(this,p,H||'')||this;return ve.widths=[],ve.widthBoxes=[],ve.widths=W,ve.currentWidth=X,ve.setCurrentWidth=ve.setCurrentWidth.bind(ve),ve}return Ae(s,z),s.prototype.getUi=function(){var p=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(X){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=X===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){p.setCurrentWidth(X,H)}),W.appendChild(H);var ve=document.createElement("div");ve.innerText=X.toString(),ve.style.marginRight="5px",H.appendChild(ve);var He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.display="flex",He.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=X+"px solid "+p.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",He.appendChild(qe),H.appendChild(He),p.widthBoxes.push(H)}),W},s.prototype.setCurrentWidth=function(p,W){var X=this;this.currentWidth=p,this.widthBoxes.forEach(function(H){H.style.borderColor=H===W?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},s}(je),Ye=function(z){function s(p,W,X,H){var ve=z.call(this,p,H||'')||this;return ve.styles=[],ve.styleBoxes=[],ve.styles=W,ve.currentStyle=X,ve.setCurrentStyle=ve.setCurrentStyle.bind(ve),ve}return Ae(s,z),s.prototype.getUi=function(){var p=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(X){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/p.styles.length-5+"%",H.style.borderColor=X===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){p.setCurrentStyle(X,H)}),W.appendChild(H);var ve=document.createElement("div");ve.style.minHeight="20px",ve.style.flexGrow="2",ve.style.overflow="hidden";var He=``;ve.innerHTML=He,H.appendChild(ve),p.styleBoxes.push(H)}),W},s.prototype.setCurrentStyle=function(p,W){var X=this;this.currentStyle=p,this.styleBoxes.forEach(function(H){H.style.borderColor=H===W?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},s}(je),Xe=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.strokeColor=X.defaultColor,H.strokeWidth=X.defaultStrokeWidth,H.strokeDasharray=X.defaultStrokeDasharray,H.strokePanel=new Ue("Line color",X.defaultColorSet,X.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ye("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Ae(s,z),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=z.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="FrameMarker",s.title="Frame marker",s.icon='',s}(Je),_e=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},ot=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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 Ae(s,z),s.prototype.ownsTarget=function(p){return!!z.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},s.prototype.pointerUp=function(p){var W=this.state;z.prototype.pointerUp.call(this,p),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(p),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},s.prototype.adjustVisual=function(){},s.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},s.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},s.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){this.positionGrips()},s.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},s.prototype.createGrip=function(){var p=new Qe;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},s.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},s.prototype.positionGrip=function(p,W,X){var H=p.transform.baseVal.getItem(0);H.setTranslate(W,X),p.transform.baseVal.replaceItem(H,0)},s.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},z.prototype.getState.call(this))},s.prototype.restoreState=function(p){z.prototype.restoreState.call(this,p);var W=p;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},s.prototype.scale=function(p,W){z.prototype.scale.call(this,p,W),this.x1=this.x1*p,this.y1=this.y1*W,this.x2=this.x2*p,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},s}(Ne),at=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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=X.defaultColor,H.strokeWidth=X.defaultStrokeWidth,H.strokeDasharray=X.defaultStrokeDasharray,H.strokePanel=new Ue("Line color",X.defaultColorSet,X.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ye("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Ae(s,z),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},s.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)},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},s.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()]]))},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){z.prototype.restoreState.call(this,p);var W=p;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},s.typeName="LineMarker",s.title="Line marker",s.icon='',s}(ot),Be=function(z){function s(p,W,X,H){var ve=z.call(this,p,H||'')||this;return ve.fonts=[],ve.fontBoxes=[],ve.fonts=W,ve.currentFont=X,ve.setCurrentFont=ve.setCurrentFont.bind(ve),ve}return Ae(s,z),s.prototype.getUi=function(){var p=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(X){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/p.fonts.length-5+"%",H.style.borderColor=X===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){p.setCurrentFont(X,H)}),W.appendChild(H);var ve=document.createElement("div");ve.style.display="flex",ve.style.minHeight="20px",ve.style.flexGrow="2",ve.style.fontFamily=X,ve.style.overflow="hidden";var He=document.createElement("div");He.style.whiteSpace="nowrap",He.style.overflow="hidden",He.style.textOverflow="ellipsis",He.innerHTML="The quick brown fox jumps over the lazy dog",ve.appendChild(He),H.appendChild(ve),p.fontBoxes.push(H)}),W},s.prototype.setCurrentFont=function(p,W){var X=this;this.currentFont=p,this.fontBoxes.forEach(function(H){H.style.borderColor=H===W?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},s}(je),Ke=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.color="transparent",H.padding=5,H.DEFAULT_TEXT="your text here",H.text=H.DEFAULT_TEXT,H.isMoved=!1,H.color=X.defaultColor,H.fontFamily=X.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 Ue("Color",X.defaultColorSet,X.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.fontFamilyPanel=new Be("Font",X.defaultFontFamilies,X.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H}return Ae(s,z),s.prototype.ownsTarget=function(p){if(z.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(X){X===p&&(W=!0)}),W},s.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()},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},s.prototype.renderText=function(){var p=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(W){p.textElement.appendChild(se.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},s.prototype.getTextScale=function(){var p=this.textElement.getBBox(),W=1;if(p.width>0&&p.height>0){var X=(1*this.width-this.width*this.padding*2/100)/p.width,H=(1*this.height-this.height*this.padding*2/100)/p.height;W=Math.min(X,H)}return W},s.prototype.getTextPosition=function(p){var W=this.textElement.getBBox(),X=0,H=0;return W.width>0&&W.height>0&&(X=(this.width-W.width*p)/2,H=this.height/2-W.height*p/2),{x:X,y:H}},s.prototype.sizeText=function(){var p=this.textElement.getBBox(),W=this.getTextScale(),X=this.getTextPosition(W);X.y-=p.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+X.x+"px, "+X.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(X.x,X.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},s.prototype.manipulate=function(p){z.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},s.prototype.resize=function(p){z.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},s.prototype.setSize=function(){z.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()]]))},s.prototype.pointerUp=function(p){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,p),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},s.prototype.showTextEditor=function(){var p=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&W>.9;)W-=.1,p.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var X=W.clipboardData.getData("text"),H=window.getSelection();if(!H.rangeCount)return!1;H.deleteFromDocument(),H.getRangeAt(0).insertNode(document.createTextNode(X)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},s.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var p=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),X=this.textElement.getBBox(),H={x:X.width*p,y:X.height*p};W.x-=H.x/2,W.y-=H.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},s.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},s.prototype.select=function(){z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},s.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),z.prototype.deselect.call(this)},s.prototype.dblClick=function(p,W){z.prototype.dblClick.call(this,p,W),this.showTextEditor()},s.prototype.setColor=function(p){this.textElement&&se.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},s.prototype.setFont=function(p){this.textElement&&se.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},s.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},s.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){var W=p;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),z.prototype.restoreState.call(this,p),this.setSize()},s.prototype.scale=function(p,W){z.prototype.scale.call(this,p,W),this.setSize(),this.sizeText(),this.positionTextEditor()},s.typeName="TextMarker",s.title="Text marker",s.icon='',s}(et),Ee=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.color="transparent",H.lineWidth=3,H.drawing=!1,H.pixelRatio=1,H.color=X.defaultColor,H.lineWidth=X.defaultStrokeWidth,H.pixelRatio=X.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 Ue("Color",X.defaultColorSet,X.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.lineWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),H.lineWidthPanel.onWidthChanged=H.setLineWidth,H}return Ae(s,z),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var p=se.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(p,W){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(p.x,p.y),this.drawing=!0):z.prototype.pointerDown.call(this,p,W)},s.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){z.prototype.resize.call(this,p),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,p)},s.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)},s.prototype.select=function(){this.state==="creating"&&this.finishCreation(),z.prototype.select.call(this)},s.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),z.prototype.deselect.call(this)},s.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],X=W[0],H=W[1],ve=W[2],He=W[3],qe=!1,ft=0;ft0&&(qe=!0,ftHe&&(He=ft),Ge>ve&&(ve=Ge));if(qe){this.left=X/this.pixelRatio,this.top=H/this.pixelRatio,this.width=(ve-X)/this.pixelRatio,this.height=(He-H)/this.pixelRatio;var Ct=document.createElement("canvas");Ct.width=ve-X,Ct.height=He-H,Ct.getContext("2d").putImageData(this.canvasContext.getImageData(X,H,ve-X,He-H),0,0),this.drawingImgUrl=Ct.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},s.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})},s.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},s.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){this.createVisual(),z.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},s.prototype.scale=function(p,W){z.prototype.scale.call(this,p,W),this.setDrawingImage()},s.typeName="FreehandMarker",s.title="Freehand marker",s.icon='',s}(et),ge=function(z){function s(p,W,X){var H=z.call(this,p,X||'')||this;return H.typeBoxes=[],H.currentType=W,H.setCurrentType=H.setCurrentType.bind(H),H}return Ae(s,z),s.prototype.getUi=function(){var p=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var X=function(He){var qe="both";switch(He){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="none"}var ft=document.createElement("div");if(ft.style.display="flex",ft.style.flexGrow="2",ft.style.alignItems="center",ft.style.justifyContent="space-between",ft.style.padding="5px",ft.style.borderWidth="2px",ft.style.borderStyle="solid",ft.style.borderColor=qe===H.currentType?H.uiStyleSettings.toolboxAccentColor:"transparent",ft.addEventListener("click",function(){p.setCurrentType(qe,ft)}),W.appendChild(ft),qe==="both"||qe==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=``,Ge.style.marginLeft="5px",ft.appendChild(Ge)}var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.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",Ct.appendChild(Mt),ft.appendChild(Ct),qe==="both"||qe==="end"){var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.innerHTML=``,Vt.style.marginRight="5px",ft.appendChild(Vt)}H.typeBoxes.push(ft)},H=this,ve=0;ve<4;ve++)X(ve);return W},s.prototype.setCurrentType=function(p,W){var X=this;this.currentType=p,this.typeBoxes.forEach(function(H){H.style.borderColor=H===W?X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},s}(je),ye=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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 ge("Arrow type","end"),H.arrowTypePanel.onArrowTypeChanged=H.setArrowType,H}return Ae(s,z),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},s.prototype.getArrowPoints=function(p,W){var X=this.arrowBaseWidth+2*this.strokeWidth,H=this.arrowBaseHeight+2*this.strokeWidth;return p-X/2+","+(W+H/2)+" "+p+","+(W-H/2)+" "+(p+X/2)+","+(W+H/2)},s.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)},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var X=this.arrow2.transform.baseVal.getItem(0);X.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(X,0)}},s.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){z.prototype.restoreState.call(this,p);var W=p;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},s.typeName="ArrowMarker",s.title="Arrow marker",s.icon='',s}(at),re=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.fillColor=X.defaultFillColor,H.strokeWidth=0,H.fillPanel=new Ue("Color",X.defaultColorSet,X.defaultFillColor),H.fillPanel.onColorChanged=H.setFillColor,H}return Ae(s,z),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=z.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="CoverMarker",s.title="Cover marker",s.icon='',s}(Je),ie=function(z){function s(p,W,X,H){var ve=z.call(this,p,H||'')||this;return ve.opacities=[],ve.opacityBoxes=[],ve.opacities=W,ve.currentOpacity=X,ve.setCurrentOpacity=ve.setCurrentOpacity.bind(ve),ve}return Ae(s,z),s.prototype.getUi=function(){var p=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(X){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=X===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){p.setCurrentOpacity(X,H)}),W.appendChild(H);var ve=document.createElement("div");ve.innerText=100*X+"%",H.appendChild(ve),p.opacityBoxes.push(H)}),W},s.prototype.setCurrentOpacity=function(p,W){var X=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(H){H.style.borderColor=H===W?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},s}(je),ae=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.setOpacity=H.setOpacity.bind(H),H.fillColor=X.defaultHighlightColor,H.strokeWidth=0,H.opacity=X.defaultHighlightOpacity,H.fillPanel=new Ue("Color",X.defaultColorSet,H.fillColor),H.fillPanel.onColorChanged=H.setFillColor,H.opacityPanel=new ie("Opacity",X.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return Ae(s,z),s.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=z.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="HighlightMarker",s.title="Highlight marker",s.icon='',s}(re),de='',ke=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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=X.defaultStrokeColor,H.bgColor=X.defaultFillColor,H.fontFamily=X.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 Ue("Text color",X.defaultColorSet,H.color,''),H.colorPanel.onColorChanged=H.setColor,H.bgColorPanel=new Ue("Fill color",X.defaultColorSet,H.bgColor,de),H.bgColorPanel.onColorChanged=H.setBgColor,H.fontFamilyPanel=new Be("Font",X.defaultFontFamilies,X.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H.tipGrip=new Qe,H.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),H.controlBox.appendChild(H.tipGrip.visual),H}return Ae(s,z),s.prototype.ownsTarget=function(p){return z.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},s.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)},s.prototype.pointerDown=function(p,W){this.state==="new"&&z.prototype.pointerDown.call(this,p,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,p,W)},s.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,p);else{var W=this.state==="creating";z.prototype.pointerUp.call(this,p),this.setTipPoints(W),this.positionTip()}},s.prototype.manipulate=function(p){if(this.tipMoving){var W=this.unrotatePoint(p);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,p)},s.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",p]]),se.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},s.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},s.prototype.setTipPoints=function(p){p===void 0&&(p=!1);var W=Math.min(this.height/2,15),X=this.height/5;p&&(this.tipPosition={x:W+X/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',s}(Ke),Se=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.strokeColor=X.defaultColor,H.strokeWidth=X.defaultStrokeWidth,H.strokeDasharray=X.defaultStrokeDasharray,H.fillColor=X.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 Ue("Line color",pe(X.defaultColorSet,["transparent"]),X.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.fillPanel=new Ue("Fill color",pe(X.defaultColorSet,["transparent"]),H.fillColor,de),H.fillPanel.onColorChanged=H.setFillColor,H.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ye("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H.opacityPanel=new ie("Opacity",X.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return Ae(s,z),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.visual)},s.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)},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},s.prototype.manipulate=function(p){z.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){z.prototype.resize.call(this,p),this.setSize()},s.prototype.setSize=function(){z.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()]])},s.prototype.pointerUp=function(p){z.prototype.pointerUp.call(this,p),this.setSize()},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},s.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){var W=p;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),z.prototype.restoreState.call(this,p),this.setSize()},s.prototype.scale=function(p,W){z.prototype.scale.call(this,p,W),this.setSize()},s.typeName="EllipseMarker",s.title="Ellipse marker",s.icon='',s}(et),We=function(z){function s(p,W,X){return z.call(this,p,W,X)||this}return Ae(s,z),Object.defineProperty(s.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},s.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)},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var X=this.tip2.transform.baseVal.getItem(0);X.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(X,0)}},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=z.prototype.getState.call(this);return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){z.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},s.typeName="MeasurementMarker",s.title="Measurement marker",s.icon='',s}(at),tt=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||this;return H.strokePanel.colors=X.defaultColorSet,H.fillColor="transparent",H}return Ae(s,z),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=z.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="EllipseFrameMarker",s.title="Ellipse frame marker",s.icon='',s}(Se),ct=function(){function z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),z.prototype.addUndoStep=function(s){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(s)||(this.undoStack.push(s),JSON.stringify(this.lastRedoStep)!==JSON.stringify(s)&&this.redoStack.splice(0,this.redoStack.length))},z.prototype.replaceLastUndoStep=function(s){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=s)},z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},z.prototype.undo=function(){if(this.undoStack.length>1){var s=this.undoStack.pop();return s!==void 0&&this.redoStack.push(s),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},z}(),lt=function(z){function s(p,W,X){var H=z.call(this,p,W,X)||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=X.defaultColor,H.strokeWidth=X.defaultStrokeWidth,H.strokeDasharray=X.defaultStrokeDasharray,H.strokePanel=new Ue("Line color",X.defaultColorSet,X.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ye("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Ae(s,z),s.prototype.ownsTarget=function(p){return!(!z.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},s.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},s.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)},s.prototype.pointerDown=function(p,W){z.prototype.pointerDown.call(this,p,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},s.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()]]))},s.prototype.setupControlBox=function(){z.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)},s.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,z.prototype.addControlGrips.call(this)},s.prototype.positionGrips=function(){z.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},s.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),z.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),z.prototype.resize.call(this,p),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},s.prototype.scale=function(p,W){this.curveX=this.curveX*p,this.curveY=this.curveY*W,z.prototype.scale.call(this,p,W)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){z.prototype.restoreState.call(this,p);var W=p;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},s.typeName="CurveMarker",s.title="Curve marker",s.icon='',s}(ot),kt=function(){function z(s,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=s,this.cancelable=p}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),Et=function(z){function s(p,W,X){var H=z.call(this,p,!1)||this;return H.dataUrl=W,H.state=X,H}return Ae(s,z),s}(kt),ht=function(z){function s(p,W,X){X===void 0&&(X=!1);var H=z.call(this,p,X)||this;return H.marker=W,H}return Ae(s,z),s}(kt),jt=function(){function z(){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 z.prototype.addEventListener=function(s,p){this[s].push(p)},z.prototype.removeEventListener=function(s,p){var W=this[s].indexOf(p);W>-1&&this[s].splice(W,1)},z}(),vt=function(){function z(s){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new _e,this._isOpen=!1,this.undoRedoManager=new ct,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new jt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=z.instanceCounter++,this.styles=new Te(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=s,this.targetRoot=document.body,this.width=s.clientWidth,this.height=s.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(z.prototype,"ALL_MARKER_TYPES",{get:function(){return[Xe,Ee,ye,Ke,tt,Se,ae,ke,We,re,at,lt]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Xe,Ee,ye,Ke,Se,ae,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Xe,Ee,ye,Ke,ae]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(s){var p=this;this._availableMarkerTypes.splice(0),s.forEach(function(W){if(typeof W=="string"){var X=p.ALL_MARKER_TYPES.find(function(H){return H.typeName===W});X!==void 0&&p._availableMarkerTypes.push(X)}else p._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(s){this._zoomLevel=s,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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},z.prototype.show=function(){var s=this;this.styles.styleSheetRoot===void 0&&ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new kt(s))})},z.prototype.render=function(){return Le(this,void 0,void 0,function(){var s;return be(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(s=new ue).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.markersOnly=this.renderMarkersOnly,s.width=this.renderWidth,s.height=this.renderHeight,[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},z.prototype.close=function(s){var p=this;if(s===void 0&&(s=!1),this.isOpen){var W=!1;s||this.eventListeners.beforeclose.forEach(function(X){var H=new kt(p,!0);X(H),H.defaultPrevented&&(W=!0)}),W||(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(X){return X(new kt(p))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var s,p=[],W=0;Wthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*s:this.editorCanvas.clientWidth,W=p',s.title="Powered by marker.js",s.style.display="grid",s.style.alignItems="center",s.style.justifyItems="center",s.style.padding="3px",s.style.width="20px",s.style.height="20px",this.logoUI.appendChild(s),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},z.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")},z.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"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.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 s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(s),1),s.dispose()},z.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())},z.prototype.toolbarButtonClicked=function(s,p){if(s==="marker"&&p!==void 0)this.createNewMarker(p);else if(s==="action")switch(p){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},z.prototype.deleteSelectedMarker=function(){var s=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(X){var H=new ht(s,s._currentMarker,!0);X(H),H.defaultPrevented&&(p=!0)}),!p){var W=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(X){return X(new ht(s,W))})}}},z.prototype.clear=function(){var s=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ve){var He=new ht(s,void 0,!0);ve(He),He.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var W=function(ve){var He=X.markers[ve];X.setCurrentMarker(X.markers[ve]),X._currentMarker.dispose(),X.markerImage.removeChild(X._currentMarker.container),X.markers.splice(X.markers.indexOf(X._currentMarker),1),X.eventListeners.markerdelete.forEach(function(qe){return qe(new ht(s,He))})},X=this,H=this.markers.length-1;H>=0;H--)W(H);this.addUndoStep()}},Object.defineProperty(z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),z.prototype.showNotesEditor=function(){var s;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=(s=this._currentMarker.notes)!==null&&s!==void 0?s:"",this.overlayContainer.appendChild(this.notesArea))},z.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)},z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},z.prototype.addUndoStep=function(){var s=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===p.width&&W.height===p.height){var X=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),X1&&this.panTo({x:s.clientX,y:s.clientY}))},z.prototype.onPointerUp=function(s){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(s.clientX,s.clientY)),this.isDragging=!1,this.addUndoStep()},z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},z.prototype.onKeyUp=function(s){this._currentMarker===void 0||this.notesArea!==void 0||s.key!=="Delete"&&s.key!=="Backspace"||this.deleteSelectedMarker()},z.prototype.clientToLocalCoordinates=function(s,p){var W=this.markerImage.getBoundingClientRect();return{x:(s-W.left)/this.zoomLevel,y:(p-W.top)/this.zoomLevel}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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()},z.prototype.addLicenseKey=function(s){te.addKey(s)},z.prototype.addEventListener=function(s,p){this.eventListeners.addEventListener(s,p)},z.prototype.removeEventListener=function(s,p){this.eventListeners.removeEventListener(s,p)},z.prototype.renderState=function(s){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(s),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),z.prototype.focus=function(){var s=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(p){return p(new kt(s))}))},z.prototype.blur=function(){var s=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new kt(s))}))},z.instanceCounter=0,z}();/* **********************************
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 At=function(z,s){return(At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,W){p.__proto__=W}||function(p,W){for(var X in W)Object.prototype.hasOwnProperty.call(W,X)&&(p[X]=W[X])})(z,s)};function Dt(z,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function p(){this.constructor=z}At(z,s),z.prototype=s===null?Object.create(s):(p.prototype=s.prototype,new p)}function Ze(z,s,p,W){return new(p||(p=Promise))(function(X,H){function ve(ft){try{qe(W.next(ft))}catch(Ge){H(Ge)}}function He(ft){try{qe(W.throw(ft))}catch(Ge){H(Ge)}}function qe(ft){var Ge;ft.done?X(ft.value):(Ge=ft.value,Ge instanceof p?Ge:new p(function(Ct){Ct(Ge)})).then(ve,He)}qe((W=W.apply(z,s||[])).next())})}function Er(z,s){var p,W,X,H,ve={label:0,sent:function(){if(1&X[0])throw X[1];return X[1]},trys:[],ops:[]};return H={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function He(qe){return function(ft){return function(Ge){if(p)throw new TypeError("Generator is already executing.");for(;ve;)try{if(p=1,W&&(X=2&Ge[0]?W.return:Ge[0]?W.throw||((X=W.return)&&X.call(W),0):W.next)&&!(X=X.call(W,Ge[1])).done)return X;switch(W=0,X&&(Ge=[2&Ge[0],X.value]),Ge[0]){case 0:case 1:X=Ge;break;case 4:return ve.label++,{value:Ge[1],done:!1};case 5:ve.label++,W=Ge[1],Ge=[0];continue;case 7:Ge=ve.ops.pop(),ve.trys.pop();continue;default:if(!(X=ve.trys,(X=X.length>0&&X[X.length-1])||Ge[0]!==6&&Ge[0]!==2)){ve=0;continue}if(Ge[0]===3&&(!X||Ge[1]>X[0]&&Ge[1]0&&p>0){var W=new Ur(s,p),X=W.ratio>=1?20:W.getHorizontalLength(20),H=W.ratio<1?20:W.getVerticalLength(20),ve=document.createElementNS("http://www.w3.org/2000/svg","svg");ve.setAttribute("xmlns","http://www.w3.org/2000/svg"),ve.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ve);var He=bt.createDefs();ve.appendChild(He);var qe=bt.createElement("clipPath",[["id","text-bg-clip"]]);He.appendChild(qe);var ft=bt.createPath(bt.getHollowRectanglePath((24-X)/2,(24-H)/2,X,H,(24-X)/2+2,(24-H)/2+2,X-4,H-4));ve.appendChild(ft);var Ge=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(bt.createTSpan(s+":"+p)),ve.appendChild(Ge);var Ct=Ge.getBBox();bt.setAttributes(Ge,[["x",((24-Ct.width)/2).toString()],["y",((24-Ct.height)/2-Ct.y).toString()]]);var Mt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ct.width))/2,(24-Math.ceil(Ct.height))/2,Math.ceil(Ct.width),Math.ceil(Ct.height)));return qe.appendChild(Mt),bt.setAttributes(ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ve),ve.outerHTML}return''},z}(),Cr=function(z){function s(p,W,X){var H=z.call(this,p,W)||this;return H.isDropdownOpen=!1,H.onClick=H.dropdownButtonClicked,H.dropdownButtons=X,H}return Dt(s,z),s.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=p.className,W.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},s.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},s.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},s.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},s.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},s.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},s}(Nt),Ot=function(){function z(s,p){this.GRIP_SIZE=10,this.color=s,this.fillColor=p,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},z.prototype.setCenter=function(s,p){this.visual.childNodes.forEach(function(W){return bt.setAttributes(W,[["cx",s.toString()],["cy",p.toString()]])})},z}(),Fr=function(){function z(s,p,W,X){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=s,this.canvasHeight=p,this.margin=W,this.container=X,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(z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(s){this._aspectRatio=s,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(s){this._zoomFactor=s,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),z.prototype.open=function(){var s=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;pthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),bt.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var W=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(H,ve){var He=p.y+W*(ve+1);bt.setAttributes(H,[["x1",""+p.x],["y1",""+He],["x2",""+(p.x+p.width)],["y2",""+He]])});var X=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(H,ve){var He=p.x+X*(ve+1);bt.setAttributes(H,[["x1",""+He],["y1",""+p.y],["x2",""+He],["y2",""+(p.y+p.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},z.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)},z.prototype.clientToLocalCoordinates=function(s,p){var W=this.container.getBoundingClientRect();return{x:s-W.left+this.margin,y:p-W.top+this.margin}},z.prototype.onPointerDown=function(s){this.container.setPointerCapture(s.pointerId),this.previousPoint=this.clientToLocalCoordinates(s.clientX,s.clientY),this.cropRectElement===s.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(s.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(s.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(s.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(s.target)&&(this.activeGrip=this.bottomRightGrip)},z.prototype.onPointerMove=function(s){if(this.isMoving)this.move(this.clientToLocalCoordinates(s.clientX,s.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(s.clientX,s.clientY);this.resize(p)}s.preventDefault()},z.prototype.onPointerUp=function(s){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(s.pointerId)},z.prototype.move=function(s){var p=s.x-this.previousPoint.x,W=s.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=s},z.prototype.resize=function(s){var p=Object.assign({},this.cropRect),W=s.x-this.previousPoint.x,X=s.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+Wthis.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-p.width),p.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=X,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=X}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=s,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var s=this.cropRect.x+this.cropRect.width/2,p=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),X=this.aspectRatio.getVerticalLength(this.cropRect.width);W/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=s-this.cropRect.width/2,this.cropRect.y=p-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},z.prototype.getRescaledRect=function(s,p,W,X,H,ve){var He=W/s,qe=X/p;return{x:(H.x-ve)*He+ve,y:(H.y-ve)*qe+ve,width:H.width*He,height:H.height*qe}},z.prototype.scaleCanvas=function(s,p){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,s,p,this.cropRect,this.margin);this.canvasWidth=s,this.canvasHeight=p,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},z}(),$r=function(){function z(s){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=s,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(z.prototype,"angle",{get:function(){return this._angle},set:function(s){this._angle=s,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),z.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},z.prototype.onPointerDown=function(s){this.controlContainer.setPointerCapture(s.pointerId),this.isDragging=!0,this.previousPoint={x:s.clientX,y:s.clientY}},z.prototype.onPointerMove=function(s){this.isDragging&&(this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.previousPoint.x=s.clientX)},z.prototype.onPointerUp=function(s){this.isDragging&&this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(s.pointerId)},z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var s=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-s.width)/2).toString()],["y",(this.height/2).toString()]])}},z.prototype.positionScaleShape=function(){if(this.scaleShape){var s=this.scaleShape.transform.baseVal.getItem(0);s.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(s,0)}},z.prototype.getVisual=function(){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",this.width+"px"),s.setAttribute("height",this.height+"px"),s.setAttribute("viewBox","0 0 "+this.width+" "+this.height),s.style.flexShrink="0",document.body.appendChild(s);for(var p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var X=W%5==0?this.height/3:this.height/6;p+="h4v"+-X+"h1v"+X}p+="v1H0Z",this.scaleShape=bt.createPath(p);var H=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(H),s.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ve=bt.createTSpan("");return ve.innerHTML="°",this.angleLabelElement.appendChild(ve),s.appendChild(this.angleLabelElement),document.body.removeChild(s),s},z}(),ui=function(){function z(){this.naturalSize=!1,this.imageType="image/png"}return z.prototype.rasterize=function(s,p,W,X,H,ve,He){var qe=this;return new Promise(function(ft){var Ge=document.createElement("canvas");Ge.width=s.width.baseVal.value-2*X,Ge.height=s.height.baseVal.value-2*X;var Ct=1,Mt=1;qe.naturalSize===!0?(Ct=p.naturalWidth/(s.width.baseVal.value-2*X)/ve,Mt=p.naturalHeight/(s.height.baseVal.value-2*X)/He,Ge.width=p.naturalWidth/ve,Ge.height=p.naturalHeight/He):qe.width!==void 0&&qe.height!==void 0&&(Ct=qe.width/W.width,Mt=qe.height/W.height,Ge.width*=Ct,Ge.height*=Mt);var Vt=Ge.getContext("2d");Vt.translate(Ge.width/2,Ge.height/2),Vt.rotate(H*Math.PI/180),Vt.scale(ve,He),Vt.translate(-Ge.width/2,-Ge.height/2),Vt.drawImage(p,0,0,Ge.width,Ge.height);var jr=document.createElement("canvas");jr.width=W.width*Ct,jr.height=W.height*Mt,jr.getContext("2d").putImageData(Vt.getImageData((W.x-X)*Ct,(W.y-X)*Mt,W.width*Ct,W.height*Mt),0,0),ft(jr.toDataURL(qe.imageType,qe.imageQuality))})},z}(),Ve=function(){function z(s){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=z.instanceCounter++,this.styles=new Yt(this.instanceNo),this.target=s,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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(s){this._zoomToCropEnabled=s,s?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(s){this._gridLines=s,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(s){this._rotationAngle=s,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"aspectRatio",{get:function(){var s;return(s=this._aspectRatio)!==null&&s!==void 0?s:this.aspectRatios[0]},set:function(s){this._aspectRatio=s},enumerable:!1,configurable:!0}),z.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},z.prototype.show=function(){this.showUI(),this.open()},z.prototype.close=function(s){s===void 0&&(s=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),s||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},z.prototype.addRenderEventListener=function(s){this.renderEventListeners.push(s)},z.prototype.removeRenderEventListener=function(s){this.renderEventListeners.indexOf(s)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(s),1)},z.prototype.addCloseEventListener=function(s){this.closeEventListeners.push(s)},z.prototype.removeCloseEventListener=function(s){this.closeEventListeners.indexOf(s)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(s),1)},z.prototype.setupResizeObserver=function(){var s=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.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))},z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var s=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/s>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*s:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=p+2*this.CANVAS_MARGINs+this.CANVAS_MARGIN?this.target.offsetTop-(s+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},z.prototype.addTopToolbar=function(){var s=this;this.topToolbar=new Br,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var p=new si;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var W=[];this.aspectRatios.forEach(function(Mt){var Vt=new Nt(li.getIcon(Mt.horizontal,Mt.vertical),Mt.horizontal===0&&Mt.vertical===0?"FREE":Mt.horizontal+":"+Mt.vertical);Vt.onClick=function(){return s.ratioButtonClicked(Mt)},W.push(Vt)}),this.aspectRatioButton=new Cr(li.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var X=new Nt('',"Toggle grid");X.isActive=this.isGridVisible,X.onClick=function(){s.isGridVisible=!s.isGridVisible,X.isActive=s.isGridVisible},p.addButton(X);var H=new Nt('',"Zoom to selection");if(H.isActive=this.zoomToCropEnabled,H.onClick=function(){s.zoomToCropEnabled=!s.zoomToCropEnabled,H.isActive=s.zoomToCropEnabled},p.addButton(H),!_r.isLicensed){var ve=new mt;this.topToolbar.addElementBlock(ve);var He=document.createElement("div");He.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var qe=document.createElement("a");qe.style.color="currentColor",qe.href="https://markerjs.com/products/cropro",qe.target="_blank",qe.innerHTML='',He.appendChild(qe),ve.addElement(He)}var ft=new si;ft.minWidth=3*this.toolbarHeight+"px",ft.contentAlign="end",this.topToolbar.addButtonBlock(ft);var Ge=new Nt('',"OK");Ge.onClick=this.startRenderAndClose,ft.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ct=new Nt('',"Close");Ct.onClick=this.close,ft.addButton(Ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},z.prototype.addBottomToolbar=function(){var s=this;this.bottomToolbar=new Br,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var p=new si;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var W=new Nt('',"Rotate left");W.onClick=this.rotateLeftButtonClicked,p.addButton(W);var X=new Nt('',"Rotate right");X.onClick=this.rotateRightButtonClicked,p.addButton(X);var H=new mt;H.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(H),this.straightener=new $r("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(ft){s.rotateBy(ft),s.straightener.angle=s.rotationAngle},H.addElement(this.straightener.getUI());var ve=new si;ve.minWidth=2*this.toolbarHeight+"px",ve.contentAlign="end",this.bottomToolbar.addButtonBlock(ve);var He=new Nt('',"Flip horizontal");He.onClick=this.flipHorizontallyButtonClicked,ve.addButton(He);var qe=new Nt('',"Flip vertical");qe.onClick=this.flipVerticallyButtonClicked,ve.addButton(qe)},z.prototype.ratioButtonClicked=function(s){this.aspectRatio=s,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=li.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ur(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},z.prototype.restoreState=function(s){if(s){var p=this.cropLayer.getRescaledRect(s.width,s.height,this.imageWidth,this.imageHeight,s.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=s.flippedHorizontally,this.flippedVertically=s.flippedVertically,this.applyFlip(),this.rotationAngle=s.rotationAngle,this.applyRotation()}},z.prototype.clientToLocalCoordinates=function(s,p){var W=this.cropImage.getBoundingClientRect();return{x:s-W.left,y:p-W.top}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var s=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=s+"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()},z.prototype.rotateLeftButtonClicked=function(){var s=this.rotationAngle-90;this.rotationAngle%90!=0&&(s+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(s)},z.prototype.rotateRightButtonClicked=function(){var s=this.rotationAngle+90;this.rotationAngle%90!=0&&(s-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(s)},z.prototype.rotateTo=function(s){s=(s=s>180?s-360:s)<=-180?s+360:s,this.rotationAngle=s,this.applyRotation()},z.prototype.rotateBy=function(s){this.rotateTo((this.rotationAngle+s)%360)},z.prototype.applyRotation=function(){var s=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=s},z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},z.prototype.startRenderAndClose=function(){return Ze(this,void 0,void 0,function(){var s,p;return Er(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return s=W.sent(),p=this.getState(),this.renderEventListeners.forEach(function(X){return X(s,p)}),this.close(!0),[2]}})})},z.prototype.render=function(){return Ze(this,void 0,void 0,function(){var s;return Er(this,function(p){switch(p.label){case 0:return(s=new ui).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.width=this.renderWidth,s.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,s.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return p.sent(),[4,s.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,p.sent()]}})})},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new rr("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 rr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new rr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var s=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new rr("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*s)+`px;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new rr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new rr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new qt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new qt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new rr("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 rr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new rr("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 rr("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new rr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},z.instanceCounter=0,z}(),wt=le("8hTe"),di=le.n(wt),Li=/]*>/g;function hi(z){var s=document.createElement("div");return s.innerHTML=z,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var ki=dt.a=function(z){var s=z.value,p=s===void 0?"":s,W=z.edit,X=W===void 0?!1:W,H=z.className,ve=z.showTextOnly,He=z.showLines,qe=z.replaces,ft=z.zoomImg,Ge=z.hasMask,Ct=z.style,Mt=Ct===void 0?{}:Ct,Vt=z.stylesPrev,jr=Vt===void 0?{}:Vt,Wr=String(p),sr=Object(R.useRef)(),Vr=Object(R.useRef)(),Hi=Object(R.useState)(""),Tr=Object(G.a)(Hi,2),Hr=Tr[0],Mr=Tr[1],gi=Object(R.useState)("office"),Zr=Object(G.a)(gi,2),ci=Zr[0],ri=Zr[1],hn=function(){var Ut=new Ve(Vr.current);Ut.displayMode="popup",Ut.addRenderEventListener(function(){var pr=Object(_.a)(I.a.mark(function Bt(ir){var Ht;return I.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return sr.current.style.display="none",er.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ir}});case 3:Ht=er.sent,Ht!=null&&Ht.id&&qe(Vr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Ht==null?void 0:Ht.id,"?type=").concat(Ht.content_type));case 5:case"end":return er.stop()}},Bt)}));return function(Bt){return pr.apply(this,arguments)}}()),Ut.show()},Gi=function(){var Ut=new vt(Vr.current);Ut.settings.displayMode="popup",Ut.addEventListener("render",function(){var pr=Object(_.a)(I.a.mark(function Bt(ir){var Ht;return I.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:if(sr.current.style.display="none",!Vr.current){er.next=6;break}return er.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ir.dataUrl}});case 4:Ht=er.sent,Ht!=null&&Ht.id&&qe(Vr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Ht==null?void 0:Ht.id,"?type=").concat(Ht.content_type));case 6:case"end":return er.stop()}},Bt)}));return function(Bt){return pr.apply(this,arguments)}}()),Ut.show(),window.markerArea=Ut},Qr=Object(R.useMemo)(function(){try{var Qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Wr=Wr.replace(Qt,"("+ee.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+ee.a.API_SERVER+"/api/attachments/").replace(pr,'"'+ee.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,`
`),Wr=Wr.replace(new RegExp("(?[TOC]
",k()),T()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(ii,er){var wr=ir[er],zi=wr.type,Ki=wr.expression;return Object(oe.renderToString)(hi(Ki)||"",{displayMode:zi==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),b(),ve){var Ht=document.createElement("div");return Ht.innerHTML=Bt,Ht.innerText}return setTimeout(function(){return Ri()},500),Bt},[Wr]),Gr=Object(R.useRef)();c.WebkitLineClamp=He,He&&(Mt=Object(B.a)(Object(B.a)({},Mt),c));function Di(Qt){var Ut=Qt.target;if(Ut.tagName.toUpperCase()==="IMG"){if(ft){var pr=Ut.getAttribute("src");Mr(pr),ri("image")}}else if(Ut.tagName.toUpperCase()==="A"){var Bt=Ut.getAttribute("href");if(Bt.indexOf("office")>-1)Qt.preventDefault(),Mr(Bt),ri("office");else if(Bt.indexOf("application/pdf")>-1)Qt.preventDefault(),Mr(Bt),ri("pdf");else if(Bt.indexOf("type=text")>-1)Qt.preventDefault(),Mr(Bt),ri("html");else if(Bt.startsWith("#")){Qt.preventDefault();var ir=document.getElementById(Bt.replace("#",""));ir&&ir.scrollIntoView(!0)}}}var Ri=function(){var Ut,pr=(Ut=Gr.current)===null||Ut===void 0?void 0:Ut.querySelectorAll("video");pr==null||pr.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var ir=new $.a;ir.loadSource(Bt.src),ir.attachMedia(Bt)}}})};Object(R.useEffect)(function(){if(Gr.current&&Qr&&(Qr.match(Li)&&window.PR.prettyPrint()),Gr.current)return Gr.current.addEventListener("click",Di),function(){Gr.current.removeEventListener("click",Di),b(),T()}},[Qr,Gr.current,Di]);var cn=function(Ut){if(!X)return;Ut.target.nodeName==="IMG"?(sr.current.style.display="flex",sr.current.style.width=Ut.target.clientWidth+"px",sr.current.style.height=Ut.target.clientHeight+"px",sr.current.style.top=Ut.target.offsetTop+"px",sr.current.style.left=Ut.target.offsetLeft+"px",Vr.current.src=Ut.target.getAttribute("src")):sr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Gr,style:Object(B.a)({},Mt),className:"".concat(H||""," markdown-body ").concat(di.a.mdBody),onMouseOver:cn,dangerouslySetInnerHTML:{__html:Qr}}),v.a.createElement("div",{ref:sr,className:di.a.button},v.a.createElement(J.a,null,v.a.createElement(Q.a,{onClick:function(){return hn()}},"\u88C1\u526A"),v.a.createElement(Q.a,{onClick:function(){return Gi()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Vr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(fe.a,{close:!0,data:Hr,hasMask:Ge,type:Hr!=null&&Hr.length?ci:"",style:Object(B.a)({},jr),onClose:function(){return Mr("")}}))}},"9VGf":function(Tt,dt,le){"use strict";le.d(dt,"a",function(){return D});var he=le("q1tI"),J=le.n(he);function D(Q,B){var _=Object(he.useRef)();Object(he.useEffect)(function(){_.current=Q}),Object(he.useEffect)(function(){function G(){_.current()}if(B!==null){var j=setInterval(G,B);return function(){return clearInterval(j)}}},[B])}},BU3w:function(Tt,dt,le){"use strict";le.d(dt,"a",function(){return _});var he=le("MNnm"),J="rc-util-key";function D(G){if(G.attachTo)return G.attachTo;var j=document.querySelector("head");return j||document.body}function Q(G){var j,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(he.a)())return null;var R=document.createElement("style");if((j=I.csp)===null||j===void 0?void 0:j.nonce){var v;R.nonce=(v=I.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=G;var A=D(I),M=A.firstChild;return I.prepend&&A.prepend?A.prepend(R):I.prepend&&M?A.insertBefore(R,M):A.appendChild(R),R}var B=new Map;function _(G,j){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=D(I);if(!B.has(R)){var v=Q("",I),A=v.parentNode;B.set(R,A),A.removeChild(v)}var M=Array.from(B.get(R).children).find(function(o){return o.tagName==="STYLE"&&o[J]===j});if(M){var L,w;if(((L=I.csp)===null||L===void 0?void 0:L.nonce)&&M.nonce!==((w=I.csp)===null||w===void 0?void 0:w.nonce)){var y;M.nonce=(y=I.csp)===null||y===void 0?void 0:y.nonce}return M.innerHTML!==G&&(M.innerHTML=G),M}var u=Q(G,I);return u[J]=j,u}},Bd2K:function(Tt,dt,le){(function(he){he(le("VrN/"),le("osHv"))})(function(he){he.defineOption("autoCloseTags",!1,function(I,R,v){if(v!=he.Init&&v&&I.removeKeyMap("autoCloseTags"),!R)return;var A={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(A["'/'"]=function(M){return _(M)}),(typeof R!="object"||R.whenOpening!==!1)&&(A["'>'"]=function(M){return Q(M)}),I.addKeyMap(A)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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 Q(I){if(I.getOption("disableInput"))return he.Pass;for(var R=I.listSelections(),v=[],A=I.getOption("autoCloseTags"),M=0;ML.ch&&(l=l.slice(0,l.length-w.end+L.ch));var f=l.toLowerCase();if(!l||w.type=="string"&&(w.end!=L.ch||!/[\"\']/.test(w.string.charAt(w.string.length-1))||w.string.length==1)||w.type=="tag"&&o.close||w.string.indexOf("/")==L.ch-w.start-1||T&&G(T,f)>-1||j(I,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(u)||[],l,L,!0))return he.Pass;var k=typeof A=="object"&&A.emptyTags;if(k&&G(k,l)>-1){v[M]={text:"/>",newPos:he.Pos(L.line,L.ch+2)};continue}var x=c&&G(c,f)>-1;v[M]={indent:x,text:">"+(x?`
`:"")+""+l+">",newPos:x?he.Pos(L.line+1,0):he.Pos(L.line,L.ch+1)}}for(var m=typeof A=="object"&&A.dontIndentOnAutoClose,M=R.length-1;M>=0;M--){var g=v[M];I.replaceRange(g.text,R[M].head,R[M].anchor,"+insert");var h=I.listSelections().slice(0);h[M]={head:g.newPos,anchor:g.newPos},I.setSelections(h),!m&&g.indent&&(I.indentLine(g.newPos.line,null,!0),I.indentLine(g.newPos.line+1,null,!0))}}function B(I,R){for(var v=I.listSelections(),A=[],M=R?"/":"",L=I.getOption("autoCloseTags"),w=typeof L=="object"&&L.dontIndentOnSlash,y=0;y"&&(T+=">"),A[y]=T}if(I.replaceSelections(A),v=I.listSelections(),!w)for(var y=0;y=0&&R[u]==v;u--)++y;A=w.to;for(var u=1;u0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;vEe.length)&&(ge=Ee.length);for(var ye=0,re=new Array(ge);ye=Ee.length?{done:!0}:{done:!1,value:Ee[re++]}}}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 ye=Ee[Symbol.iterator](),ye.next.bind(ye)}function _(Ee,ge){return ge={exports:{}},Ee(ge,ge.exports),ge.exports}var G=_(function(Ee){function ge(){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 ye(re){Ee.exports.defaults=re}Ee.exports={defaults:ge(),getDefaults:ge,changeDefaults:ye}}),j=G.defaults,I=G.getDefaults,R=G.changeDefaults,v=/[&<>"']/,A=/[&<>"']/g,M=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},y=function(ge){return w[ge]};function u(Ee,ge){if(ge){if(v.test(Ee))return Ee.replace(A,y)}else if(M.test(Ee))return Ee.replace(L,y);return Ee}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Ee){return Ee.replace(o,function(ge,ye){return ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""})}var d=/(^|[^\[])\^/g;function T(Ee,ge){Ee=Ee.source||Ee,ge=ge||"";var ye={replace:function(ie,ae){return ae=ae.source||ae,ae=ae.replace(d,"$1"),Ee=Ee.replace(ie,ae),ye},getRegex:function(){return new RegExp(Ee,ge)}};return ye}var c=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(Ee,ge,ye){if(Ee){var re;try{re=decodeURIComponent(l(ye)).replace(c,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ge&&!f.test(ye)&&(ye=a(ge,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(ie){return null}return ye}var x={},m=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(Ee,ge){x[" "+Ee]||(m.test(Ee)?x[" "+Ee]=Ee+"/":x[" "+Ee]=N(Ee,"/",!0)),Ee=x[" "+Ee];var ye=Ee.indexOf(":")===-1;return ge.substring(0,2)==="//"?ye?ge:Ee.replace(g,"$1")+ge:ge.charAt(0)==="/"?ye?ge:Ee.replace(h,"$1")+ge:Ee+ge}var E={exec:function(){}};function b(Ee){for(var ge=1,ye,re;ge=0&&ke[We]==="\\";)Se=!Se;return Se?"|":" |"}),re=ye.split(/ \|/),ie=0;if(re.length>ge)re.splice(ge);else for(;re.length=re.length?ie.slice(re.length):ie}).join(`
`)}var Ce=function(){function Ee(ye){this.options=ye||O}var ge=Ee.prototype;return ge.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ge.code=function(re,ie){var ae=this.rules.block.code.exec(re);if(ae){var de=ie[ie.length-1];if(de&&de.type==="paragraph")return{raw:ae[0],text:ae[0].trimRight()};var ke=ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:ae[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:P(ke,`
`)}}},ge.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var ae=ie[0],de=Oe(ae,ie[3]||"");return{type:"code",raw:ae,lang:ie[2]?ie[2].trim():ie[2],text:de}}},ge.heading=function(re){var ie=this.rules.block.heading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ge.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var ae={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(ae.header.length===ae.align.length){var de=ae.align.length,ke;for(ke=0;ke ?/gm,"");return{type:"blockquote",raw:ie[0],text:ae}}},ge.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var ae=ie[0],de=ie[2],ke=de.length>1,Se=de[de.length-1]===")",We={type:"list",raw:ae,ordered:ke,start:ke?+de.slice(0,-1):"",loose:!1,items:[]},tt=ie[0].match(this.rules.block.item),ct=!1,lt,kt,Et,ht,jt,vt,At,Dt=tt.length,Ze=0;Ze1||this.options.smartLists&&Et!==de)&&(ht=tt.slice(Ze+1).join(`
`),We.raw=We.raw.substring(0,We.raw.length-ht.length),Ze=Dt-1)),jt=ct||/\n\n(?!\s*$)/.test(lt),Ze!==Dt-1&&(ct=lt.charAt(lt.length-1)===`
`,jt||(jt=ct)),jt&&(We.loose=!0),vt=/^\[[ xX]\] /.test(lt),At=void 0,vt&&(At=lt[1]!==" ",lt=lt.replace(/^\[[ xX]\] +/,"")),We.items.push({type:"list_item",raw:ae,task:vt,checked:At,loose:jt,text:lt});return We}},ge.html=function(re){var ie=this.rules.block.html.exec(re);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},ge.def=function(re){var ie=this.rules.block.def.exec(re);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var ae=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:ae,raw:ie[0],href:ie[2],title:ie[3]}}},ge.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var ae={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(ae.header.length===ae.align.length){ae.raw=ie[0];var de=ae.align.length,ke;for(ke=0;ke/i.test(de[0])&&(ie=!1),!ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(de[0])?ae=!0:ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(de[0])&&(ae=!1),{type:this.options.sanitize?"text":"html",raw:de[0],inLink:ie,inRawBlock:ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ee(de[0]):de[0]}},ge.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var ae=oe(ie[2],"()");if(ae>-1){var de=ie[0].indexOf("!")===0?5:4,ke=de+ie[1].length+ae;ie[2]=ie[2].substring(0,ae),ie[0]=ie[0].substring(0,ke).trim(),ie[3]=""}var Se=ie[2],We="";if(this.options.pedantic){var tt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Se);tt?(Se=tt[1],We=tt[3]):We=""}else We=ie[3]?ie[3].slice(1,-1):"";Se=Se.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=fe(ie,{href:Se&&Se.replace(this.rules.inline._escapes,"$1"),title:We&&We.replace(this.rules.inline._escapes,"$1")},ie[0]);return ct}},ge.reflink=function(re,ie){var ae;if((ae=this.rules.inline.reflink.exec(re))||(ae=this.rules.inline.nolink.exec(re))){var de=(ae[2]||ae[1]).replace(/\s+/g," ");if(de=ie[de.toLowerCase()],!de||!de.href){var ke=ae[0].charAt(0);return{type:"text",raw:ke,text:ke}}var Se=fe(ae,de,ae[0]);return Se}},ge.strong=function(re,ie,ae){ae===void 0&&(ae="");var de=this.rules.inline.strong.start.exec(re);if(de&&(!de[1]||de[1]&&(ae===""||this.rules.inline.punctuation.exec(ae)))){ie=ie.slice(-1*re.length);var ke=de[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ke.lastIndex=0;for(var Se;(de=ke.exec(ie))!=null;)if(Se=this.rules.inline.strong.middle.exec(ie.slice(0,de.index+3)),Se)return{type:"strong",raw:re.slice(0,Se[0].length),text:re.slice(2,Se[0].length-2)}}},ge.em=function(re,ie,ae){ae===void 0&&(ae="");var de=this.rules.inline.em.start.exec(re);if(de&&(!de[1]||de[1]&&(ae===""||this.rules.inline.punctuation.exec(ae)))){ie=ie.slice(-1*re.length);var ke=de[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ke.lastIndex=0;for(var Se;(de=ke.exec(ie))!=null;)if(Se=this.rules.inline.em.middle.exec(ie.slice(0,de.index+2)),Se)return{type:"em",raw:re.slice(0,Se[0].length),text:re.slice(1,Se[0].length-1)}}},ge.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var ae=ie[2].replace(/\n/g," "),de=/[^ ]/.test(ae),ke=ae.startsWith(" ")&&ae.endsWith(" ");return de&&ke&&(ae=ae.substring(1,ae.length-1)),ae=ee(ae,!0),{type:"codespan",raw:ie[0],text:ae}}},ge.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},ge.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ge.autolink=function(re,ie){var ae=this.rules.inline.autolink.exec(re);if(ae){var de,ke;return ae[2]==="@"?(de=ee(this.options.mangle?ie(ae[1]):ae[1]),ke="mailto:"+de):(de=ee(ae[1]),ke=de),{type:"link",raw:ae[0],text:de,href:ke,tokens:[{type:"text",raw:de,text:de}]}}},ge.url=function(re,ie){var ae;if(ae=this.rules.inline.url.exec(re)){var de,ke;if(ae[2]==="@")de=ee(this.options.mangle?ie(ae[0]):ae[0]),ke="mailto:"+de;else{var Se;do Se=ae[0],ae[0]=this.rules.inline._backpedal.exec(ae[0])[0];while(Se!==ae[0]);de=ee(ae[0]),ae[1]==="www."?ke="http://"+de:ke=de}return{type:"link",raw:ae[0],text:de,href:ke,tokens:[{type:"text",raw:de,text:de}]}}},ge.inlineText=function(re,ie,ae){var de=this.rules.inline.text.exec(re);if(de){var ke;return ie?ke=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ee(de[0]):de[0]:ke=ee(this.options.smartypants?ae(de[0]):de[0]),{type:"text",raw:de[0],text:ke}}},Ee}(),Ae=V.noopTest,Le=V.edit,be=V.merge,pe={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:Ae,table:Ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Le(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Le(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Le(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=//,pe.html=Le(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Le(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Le(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=be({},pe),pe.gfm=be({},pe.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*|$)"}),pe.gfm.nptable=Le(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Le(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=be({},pe.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Ae,paragraph:Le(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ae,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:Ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=Le(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Le(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Le(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Le(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Le(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Le(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Le(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Le(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Le(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Le(se._blockSkip,"g").getRegex(),se.overlapSkip=Le(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=Le(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=Le(se.tag).replace("comment",pe._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Le(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Le(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Le(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=be({},se),se.pedantic=be({},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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=be({},se.normal,{escape:Le(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&&(re="x"+re.toString(16)),ge+=""+re+";";return ge}var Me=function(){function Ee(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||ue,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:ne.normal,inline:Te.normal};this.options.pedantic?(re.block=ne.pedantic,re.inline=Te.pedantic):this.options.gfm&&(re.block=ne.gfm,this.options.breaks?re.inline=Te.breaks:re.inline=Te.gfm),this.tokenizer.rules=re}Ee.lex=function(re,ie){var ae=new Ee(ie);return ae.lex(re)};var ge=Ee.prototype;return ge.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(re,ie,ae){ie===void 0&&(ie=[]),ae===void 0&&(ae=!0),re=re.replace(/^ +$/gm,"");for(var de,ke,Se,We;re;){if(de=this.tokenizer.space(re)){re=re.substring(de.raw.length),de.type&&ie.push(de);continue}if(de=this.tokenizer.code(re,ie)){re=re.substring(de.raw.length),de.type?ie.push(de):(We=ie[ie.length-1],We.raw+=`
`+de.raw,We.text+=`
`+de.text);continue}if(de=this.tokenizer.fences(re)){re=re.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.heading(re)){re=re.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.nptable(re)){re=re.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.hr(re)){re=re.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.blockquote(re)){re=re.substring(de.raw.length),de.tokens=this.blockTokens(de.text,[],ae),ie.push(de);continue}if(de=this.tokenizer.list(re)){for(re=re.substring(de.raw.length),Se=de.items.length,ke=0;ke0)for(;(tt=this.tokenizer.rules.inline.reflinkSearch.exec(We))!=null;)ct.includes(tt[0].slice(tt[0].lastIndexOf("[")+1,-1))&&(We=We.slice(0,tt.index)+"["+"a".repeat(tt[0].length-2)+"]"+We.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(tt=this.tokenizer.rules.inline.blockSkip.exec(We))!=null;)We=We.slice(0,tt.index)+"["+"a".repeat(tt[0].length-2)+"]"+We.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Se=this.tokenizer.escape(re)){re=re.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.tag(re,ae,de)){re=re.substring(Se.raw.length),ae=Se.inLink,de=Se.inRawBlock,ie.push(Se);continue}if(Se=this.tokenizer.link(re)){re=re.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,de)),ie.push(Se);continue}if(Se=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,de)),ie.push(Se);continue}if(Se=this.tokenizer.strong(re,We,ke)){re=re.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ae,de),ie.push(Se);continue}if(Se=this.tokenizer.em(re,We,ke)){re=re.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ae,de),ie.push(Se);continue}if(Se=this.tokenizer.codespan(re)){re=re.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.br(re)){re=re.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.del(re)){re=re.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ae,de),ie.push(Se);continue}if(Se=this.tokenizer.autolink(re,xe)){re=re.substring(Se.raw.length),ie.push(Se);continue}if(!ae&&(Se=this.tokenizer.url(re,xe))){re=re.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.inlineText(re,de,Re)){re=re.substring(Se.raw.length),ke=Se.raw.slice(-1),ie.push(Se);continue}if(re){var lt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return ie},J(Ee,null,[{key:"rules",get:function(){return{block:ne,inline:Te}}}]),Ee}(),Pe=G.defaults,je=V.cleanUrl,Ue=V.escape,Ne=function(){function Ee(ye){this.options=ye||Pe}var ge=Ee.prototype;return ge.code=function(re,ie,ae){var de=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ke=this.options.highlight(re,de);ke!=null&&ke!==re&&(ae=!0,re=ke)}return de?''+(ae?re:Ue(re,!0))+`
`:""+(ae?re:Ue(re,!0))+`
`},ge.blockquote=function(re){return`
`+re+`
`},ge.html=function(re){return re},ge.heading=function(re,ie,ae,de){return this.options.headerIds?"
`:""+re+"
`},ge.hr=function(){return this.options.xhtml?`
`:`
`},ge.list=function(re,ie,ae){var de=ie?"ol":"ul",ke=ie&&ae!==1?' start="'+ae+'"':"";return"<"+de+ke+`>
`+re+""+de+`>
`},ge.listitem=function(re){return""+re+`
`},ge.checkbox=function(re){return" "},ge.paragraph=function(re){return""+re+`
`},ge.table=function(re,ie){return ie&&(ie=""+ie+""),`
`},ge.tablerow=function(re){return`
`+re+`
`},ge.tablecell=function(re,ie){var ae=ie.header?"th":"td",de=ie.align?"<"+ae+' align="'+ie.align+'">':"<"+ae+">";return de+re+""+ae+`>
`},ge.strong=function(re){return""+re+""},ge.em=function(re){return""+re+""},ge.codespan=function(re){return""+re+""},ge.br=function(){return this.options.xhtml?"
":"
"},ge.del=function(re){return""+re+""},ge.link=function(re,ie,ae){if(re=je(this.options.sanitize,this.options.baseUrl,re),re===null)return ae;var de='"+ae+"",de},ge.image=function(re,ie,ae){if(re=je(this.options.sanitize,this.options.baseUrl,re),re===null)return ae;var de='
":">",de},ge.text=function(re){return re},Ee}(),Ie=function(){function Ee(){}var ge=Ee.prototype;return ge.strong=function(re){return re},ge.em=function(re){return re},ge.codespan=function(re){return re},ge.del=function(re){return re},ge.html=function(re){return re},ge.text=function(re){return re},ge.link=function(re,ie,ae){return""+ae},ge.image=function(re,ie,ae){return""+ae},ge.br=function(){return""},Ee}(),Qe=function(){function Ee(){this.seen={}}var ge=Ee.prototype;return ge.slug=function(re){var ie=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var ae=ie;do this.seen[ae]++,ie=ae+"-"+this.seen[ae];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},Ee}(),rt=G.defaults,et=V.unescape,Je=function(){function Ee(ye){this.options=ye||rt,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new Qe}Ee.parse=function(re,ie){var ae=new Ee(ie);return ae.parse(re)};var ge=Ee.prototype;return ge.parse=function(re,ie){ie===void 0&&(ie=!0);var ae="",de,ke,Se,We,tt,ct,lt,kt,Et,ht,jt,vt,At,Dt,Ze,Er,_r,bt,Yt=re.length;for(de=0;de0&&Ze.tokens[0].type==="text"?(Ze.tokens[0].text=bt+" "+Ze.tokens[0].text,Ze.tokens[0].tokens&&Ze.tokens[0].tokens.length>0&&Ze.tokens[0].tokens[0].type==="text"&&(Ze.tokens[0].tokens[0].text=bt+" "+Ze.tokens[0].tokens[0].text)):Ze.tokens.unshift({type:"text",text:bt}):Dt+=bt),Dt+=this.parse(Ze.tokens,At),Et+=this.renderer.listitem(Dt,_r,Er);ae+=this.renderer.list(Et,jt,vt);continue}case"html":{ae+=this.renderer.html(ht.text);continue}case"paragraph":{ae+=this.renderer.paragraph(this.parseInline(ht.tokens));continue}case"text":{for(Et=ht.tokens?this.parseInline(ht.tokens):ht.text;de+1An error occurred:"+Xe(Se.message+"",!0)+"
";throw Se}}Be.options=Be.setOptions=function(Ee){return st(Be.defaults,Ee),ot(Be.defaults),Be},Be.getDefaults=_e,Be.defaults=at,Be.use=function(Ee){var ge=st({},Ee);if(Ee.renderer&&function(){var re=Be.defaults.renderer||new Ne,ie=function(ke){var Se=re[ke];re[ke]=function(){for(var We=arguments.length,tt=new Array(We),ct=0;ct`,triples:"",explode:"[]{}"},D=he.Pos;he.defineOption("autoCloseBrackets",!1,function(w,y,u){u&&u!=he.Init&&(w.removeKeyMap(B),w.state.closeBrackets=null),y&&(_(Q(y,"pairs")),w.state.closeBrackets=y,w.addKeyMap(B))});function Q(w,y){return y=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[y]!=null?w[y]:J[y]}var B={Backspace:I,Enter:R};function _(w){for(var y=0;y=0;l--){var T=o[l].head;w.replaceRange("",D(T.line,T.ch-1),D(T.line,T.ch+1),"+delete")}}function R(w){var y=j(w),u=y&&Q(y,"explode");if(!u||w.getOption("disableInput"))return he.Pass;for(var o=w.listSelections(),l=0;l0;return{anchor:new D(w.anchor.line,w.anchor.ch+(y?-1:1)),head:new D(w.head.line,w.head.ch+(y?1:-1))}}function A(w,y){var u=j(w);if(!u||w.getOption("disableInput"))return he.Pass;var o=Q(u,"pairs"),l=o.indexOf(y);if(l==-1)return he.Pass;for(var d=Q(u,"closeBefore"),T=Q(u,"triples"),c=o.charAt(l+1)==y,f=w.listSelections(),k=l%2==0,x,m=0;m=0&&w.getRange(h,D(h.line,h.ch+3))==y+y+y?a="skipThree":a="skip";else if(c&&h.ch>1&&T.indexOf(y)>=0&&w.getRange(D(h.line,h.ch-2),h)==y+y){if(h.ch>2&&/\bstring/.test(w.getTokenTypeAt(D(h.line,h.ch-2))))return he.Pass;a="addFour"}else if(c){var b=h.ch==0?" ":w.getRange(D(h.line,h.ch-1),h);if(!he.isWordChar(E)&&b!=y&&!he.isWordChar(b))a="both";else return he.Pass}else if(k&&(E.length===0||/\s/.test(E)||d.indexOf(E)>-1))a="both";else return he.Pass;if(!x)x=a;else if(x!=a)return he.Pass}var S=l%2?o.charAt(l-1):y,N=l%2?y:o.charAt(l+1);w.operation(function(){if(x=="skip")w.execCommand("goCharRight");else if(x=="skipThree")for(var U=0;U<3;U++)w.execCommand("goCharRight");else if(x=="surround"){for(var K=w.getSelections(),U=0;U0&&(oe.percent=oe.loaded/oe.total*100),V.onProgress(oe)});var P=new FormData;V.data&&Object.keys(V.data).forEach(function(ee){var oe=V.data[ee];if(Array.isArray(oe)){oe.forEach(function(fe){P.append(ee+"[]",fe)});return}P.append(ee,V.data[ee])}),V.file instanceof Blob?P.append(V.filename,V.file,V.file.name):P.append(V.filename,V.file),O.onerror=function(oe){V.onError(oe)},O.onload=function(){return O.status<200||O.status>=300?V.onError(B(V,O),_(O)):V.onSuccess(_(O),O)},O.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in O&&(O.withCredentials=!0);var $=V.headers||{};return $["X-Requested-With"]!==null&&O.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys($).forEach(function(ee){$[ee]!==null&&O.setRequestHeader(ee,$[ee])}),O.send(P),{abort:function(){O.abort()}}}var j=+new Date,I=0;function R(){return"rc-upload-"+j+"-"+ ++I}function v(V,O){return V.indexOf(O,V.length-O.length)!==-1}var A=function(V,O){if(V&&O){var P=Array.isArray(O)?O:O.split(","),$=V.name||"",ee=V.type||"",oe=ee.replace(/\/.*$/,"");return P.some(function(fe){var Oe=fe.trim();return Oe.charAt(0)==="."?v($.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?oe===Oe.replace(/\/.*$/,""):ee===Oe})}return!0};function M(V,O){var P=V.createReader(),$=[];function ee(){P.readEntries(function(oe){var fe=Array.prototype.slice.apply(oe);$=$.concat(fe);var Oe=!fe.length;Oe?O($):ee()})}ee()}var L=function(O,P,$){var ee=function oe(fe,Oe){Oe=Oe||"",fe.isFile?fe.file(function(Ce){$(Ce)&&(fe.fullPath&&!Ce.webkitRelativePath&&(Object.defineProperties(Ce,{webkitRelativePath:{writable:!0}}),Ce.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Ce,{webkitRelativePath:{writable:!1}})),P([Ce]))}):fe.isDirectory&&M(fe,function(Ce){Ce.forEach(function(Ae){oe(Ae,""+Oe+fe.name+"/")})})};O.forEach(function(oe){ee(oe.webkitGetAsEntry())})},w=L,y=Object.assign||function(V){for(var O=1;O=0)continue;if(!Object.prototype.hasOwnProperty.call(V,$))continue;P[$]=V[$]}return P}function T(V,O){if(!(V instanceof O))throw new TypeError("Cannot call a class as a function")}function c(V,O){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:V}function f(V,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);V.prototype=Object.create(O&&O.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(V,O):V.__proto__=O)}var k=function(O){return Object.keys(O).reduce(function(P,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(P[$]=O[$]),P},{})},x=function(V){f(O,V);function O(){var P,$,ee,oe;T(this,O);for(var fe=arguments.length,Oe=Array(fe),Ce=0;Ce1&&arguments[1]!==void 0?arguments[1]:1,ye=Ie.length,re=0;re1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(P).map(function(ee,oe){if(!B.isValidElement(ee)||!ee.type)return null;var fe=ee.type.isSelectOptGroup,Oe=ee.key,Ce=ee.props,Ae=Ce.children,Le=Object(G.a)(Ce,["children"]);return $||!fe?x(ee):Object(f.a)(Object(f.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?oe:Oe,"__"),label:Oe},Le),{},{options:m(Ae)})}).filter(function(ee){return ee})}var g=le("2Qr1"),h=le("qNPg"),a=le("U8pU"),E=le("Kwbf"),b=le("WKfj");function S(P){var $=P.mode,ee=P.options,oe=P.children,fe=P.backfill,Oe=P.allowClear,Ce=P.placeholder,Ae=P.getInputElement,Le=P.showSearch,be=P.onSearch,pe=P.defaultOpen,se=P.autoFocus,te=P.labelInValue,ue=P.value,ne=P.inputValue,Te=P.optionLabelProp,Re=$==="multiple"||$==="tags",xe=Le!==void 0?Le:Re||$==="combobox",Me=ee||m(oe);if(Object(E.a)($!=="tags"||Me.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var Pe=Me.some(function(Ne){return Ne.options?Ne.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(E.a)(!Pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)($!=="combobox"||!Te,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)($==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(E.a)($==="combobox"||!Ae,"`getInputElement` only work with `combobox` mode."),Object(E.b)($!=="combobox"||!Ae||!Oe||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),be&&!xe&&$!=="combobox"&&$!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!pe||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ue!=null){var je=Object(b.d)(ue);Object(E.a)(!te||je.every(function(Ne){return Object(a.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!Re||Array.isArray(ue),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Ue=null;Object(k.a)(oe).some(function(Ne){if(!B.isValidElement(Ne)||!Ne.type)return!1;var Ie=Ne.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var Qe=Object(k.a)(Ne.props.children).every(function(rt){return!B.isValidElement(rt)||!Ne.type||rt.type.isSelectOption?!0:(Ue=rt.type,!1)});return!Qe}return Ue=Ie,!0}),Ue&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ue.displayName||Ue.name||Ue,"`.")),Object(E.a)(ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=S,U=Object(h.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:m,flattenOptions:g.d,getLabeledValue:g.e,filterOptions:g.b,isValueDisabled:g.g,findValueOption:g.c,warningProps:N,fillOptionsWithMissingValue:g.a}),K=function(P){Object(D.a)(ee,P);var $=Object(Q.a)(ee);function ee(){var oe;return Object(he.a)(this,ee),oe=$.apply(this,arguments),oe.selectRef=B.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(J.a)(ee,[{key:"render",value:function(){return B.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),ee}(B.Component);K.Option=d,K.OptGroup=c;var V=K,O=dt.c=V},M8RZ:function(Tt,dt,le){"use strict";le.d(dt,"a",function(){return I});var he=le("fWQN"),J=le("mtLc"),D=le("yKVA"),Q=le("879j"),B=le("q1tI"),_=le.n(B),G=le("i8i4"),j=le.n(G),I=function(R){Object(D.a)(A,R);var v=Object(Q.a)(A);function A(M){var L;Object(he.a)(this,A),L=v.call(this,M);var w=window.document;return L.node=w.createElement("div"),w.body.appendChild(L.node),L}return Object(J.a)(A,[{key:"render",value:function(){var L=this.props.children;return Object(G.createPortal)(L,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),A}(_.a.Component)},Ot1p:function(Tt,dt,le){"use strict";var he=le("2qtc"),J=le("kLXV"),D=le("rAM+"),Q=le("miYZ"),B=le("tsqr"),_=le("9og8"),G=le("tJVT"),j=le("jrin"),I=le("WmNS"),R=le.n(I),v=le("q1tI"),A=le.n(v),M=le("VrN/"),L=le.n(M),w=le("bdgK"),y=le("p77/"),u=le("Bd2K"),o=le("ELLl"),l=le("19Vz"),d=le("lZu9"),T=le("+NIl"),c=le("kSUc"),f=le("9Bee"),k=function(Se){var We=Se.value,tt=We===void 0?"":We,ct=Se.className,lt=Se.showTextOnly,kt=Se.showLines,Et=Se.style,ht=Et===void 0?{}:Et,jt=Object(v.useMemo)(function(){return""},[tt]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:jt}}))},x=le("0Owb"),m=le("dejd"),g=le("C+DQ"),h=le("1vsH"),a=le("m3rI"),E=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(Se){var We=Se.onActionCallback,tt=Se.title,ct=Se.icon,lt=Se.actionName,kt=Se.className,Et=kt===void 0?"":kt,ht=Se.children;function jt(){We(lt)}return A.a.createElement("a",{title:tt,className:Et,onClick:jt},A.a.createElement("i",{className:"md-iconfont ".concat(ct)}),ht)}var S=function(Se){var We=Se.watch,tt=Se.showNullButton,ct=Se.onActionCallback,lt=Se.fullScreen,kt=Se.insertTemp,Et=Se.hidetoolBar,ht=Se.uuid,jt=Se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.E)("_educoder_session"),"&key=").concat(ht,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var vt=[].concat(E,[{title:"".concat(We?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(We?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!Et&&vt.map(function(At,Dt){return A.a.createElement("li",{key:Dt},At.actionName?A.a.createElement(b,Object(x.a)({},At,{onActionCallback:ct})):A.a.createElement("span",{className:"v-line"}))}),tt?A.a.createElement("li",null,A.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ct},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&A.a.createElement("li",null,A.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:ct},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(b,{icon:"".concat(lt?"icon-shrink":"icon-enlarge"),title:lt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ct})))},N=le("M8RZ"),U=le("+L6B"),K=le("2/Rp"),V=le("y8nQ"),O=le("Vl3Y"),P=le("5NDa"),$=le("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},oe=function(Se){var We=Se.callback,tt=Se.onCancel;function ct(lt){We(lt)}return A.a.createElement(O.a,Object(x.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ct}),A.a.createElement(O.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement($.a,null)),A.a.createElement(O.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement($.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(K.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))},fe=le("7ahc"),Oe=le("k1fw"),Ce=le("HmJG"),Ae=le("BjJ7"),Le=O.a.useForm,be={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},se=function(Se){var We=Se.callback,tt=Se.onCancel,ct=Le(),lt=Object(G.a)(ct,1),kt=lt[0],Et=Object(v.useRef)();function ht(At){We(Object(Oe.a)(Object(Oe.a)({},At),{},{name:Et.current}))}function jt(At,Dt){kt.setFieldsValue({src:"/api/attachments/".concat(At.id,"?type=").concat(At.content_type),type:Dt.type})}function vt(At){var Dt=At.target.files[0];Et.current=Dt.name,ue(Dt,jt)}return A.a.createElement(O.a,Object(x.a)({form:kt},pe,{className:"upload-image-panel",onFinish:ht}),A.a.createElement(O.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement(O.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},A.a.createElement($.a,{style:be})),A.a.createElement(te,{onFileChange:vt}))),A.a.createElement(O.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},A.a.createElement($.a,{style:{width:264}})),A.a.createElement(O.a.Item,{style:{textAlign:"right"}},A.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(K.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))};function te(Se){var We=Se.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:We}))}function ue(Se,We){if(!Se)throw new String("\u6CA1\u6709\u6587\u4EF6");var tt=new FormData;tt.append("editormd-image-file",Se),tt.append("file_param_name","editormd-image-file"),tt.append("byxhr","true");var ct=new window.XMLHttpRequest;ct.withCredentials=!0,ct.addEventListener("load",function(lt){We(JSON.parse(lt.target.responseText),Se)},!1),ct.addEventListener("error",function(lt){console.error(lt)},!1),ct.open("POST","".concat(Ae.a,"/api/attachments.json")),ct.send(tt)}var ne=le("giR+"),Te=le("fyUT"),Re=le("7Kak"),xe=le("9yH6"),Me=xe.a.Group,Pe={margin:"0 8px"},je=function(Se){var We=Se.callback,tt=Se.onCancel;function ct(lt){We(lt)}return A.a.createElement(O.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ct},A.a.createElement("div",{className:"flex-container"},A.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:Pe},"\u884C\u6570"),A.a.createElement(O.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(Te.a,null)),A.a.createElement("span",{style:Pe},"\u5217\u6570"),A.a.createElement(O.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(Te.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12}},A.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(O.a.Item,{name:"align"},A.a.createElement(Me,null,A.a.createElement(xe.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(xe.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(xe.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(xe.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(K.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))},Ue=le("ErOA"),Ne=le("7Cbv"),Ie="link",Qe="upload-image",rt="code-block",et="add-table",Je="------------",st={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},Ye=le("9VGf"),Xe,_e;function ot(){}var at=0,Be=1e4,Ke="\u2581",Ee=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ge(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,re=ye?"Cmd":"Ctrl",ie=["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"],ae=(Xe={},Object(j.a)(Xe,re+"-B","bold"),Object(j.a)(Xe,re+"-I","italic"),Xe),de=(_e={},Object(j.a)(_e,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(_e,rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(_e,Qe,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(_e,et,"\u6DFB\u52A0\u8868\u683C"),_e),ke=dt.a=function(Se){var We=Se.defaultValue,tt=We===void 0?"":We,ct=Se.onChange,lt=Se.width,kt=lt===void 0?"100%":lt,Et=Se.height,ht=Et===void 0?400:Et,jt=Se.miniToolbar,vt=jt===void 0?!1:jt,At=Se.isFocus,Dt=At===void 0?!1:At,Ze=Se.watch,Er=Se.insertTemp,_r=Se.mode,bt=_r===void 0?"markdown":_r,Yt=Se.id,qt=Yt===void 0?"markdown-editor-id":Yt,rr=Se.showResizeBar,Br=rr===void 0?!1:rr,Sr=Se.noStorage,si=Sr===void 0?!1:Sr,Nt=Se.showNullButton,mt=Nt===void 0?!1:Nt,Ur=Se.hidetoolBar,li=Ur===void 0?!1:Ur,Cr=Se.fullScreen,Ot=Cr===void 0?!1:Cr,Fr=Se.onBlur,$r=Se.onCMBeforeChange,ui=Se.onFullScreen,Ve=Se.className,wt=Ve===void 0?"":Ve,di=Se.disablePaste,Li=di===void 0?!1:di,hi=Se.placeholder,ki=hi===void 0?"":hi,z=Se.values,s=z===void 0?"":z,p=Object(v.useState)(null),W=Object(G.a)(p,2),X=W[0],H=W[1],ve=Object(v.useState)(tt),He=Object(G.a)(ve,2),qe=He[0],ft=He[1],Ge=Object(v.useState)(Ze),Ct=Object(G.a)(Ge,2),Mt=Ct[0],Vt=Ct[1],jr=Object(v.useState)(Ot),Wr=Object(G.a)(jr,2),sr=Wr[0],Vr=Wr[1],Hi=Object(v.useState)(""),Tr=Object(G.a)(Hi,2),Hr=Tr[0],Mr=Tr[1],gi=Object(v.useState)(0),Zr=Object(G.a)(gi,2),ci=Zr[0],ri=Zr[1],hn=Object(v.useState)(ht),Gi=Object(G.a)(hn,2),Qr=Gi[0],Gr=Gi[1],Di=Object(v.useState)(!1),Ri=Object(G.a)(Di,2),cn=Ri[0],Qt=Ri[1],Ut=Object(v.useRef)(Object(Ne.a)()),pr=Object(v.useRef)(!1),Bt=Object(v.useRef)(),ir=Object(v.useRef)(),Ht=Object(v.useRef)(),ii=Object(v.useRef)(),er=Object(v.useRef)(),wr=function(){var gt=Object(_.a)(R.a.mark(function Lt(){var xt,_t;return R.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(Ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ut.current}});case 2:_t=zt.sent,_t!=null&&(xt=_t.attachments)!==null&&xt!==void 0&&xt.length&&(console.log("cm:",X,ir),_t.attachments.map(function(It){It.content_type.indexOf("image")>-1?X.replaceSelection(".concat(It.content_type,")")):It.content_type.indexOf("video")>-1?X.replaceSelection('')):It.content_type.indexOf("pdf")>-1?X.replaceSelection('').concat(It.name,"")):X.replaceSelection("[".concat(It.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}));case 4:case"end":return zt.stop()}},Lt)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){ft(s),X==null||X.setValue(s)},[s]),Object(v.useEffect)(function(){ui==null||ui(sr)},[sr]),Object(v.useEffect)(function(){if(ir.current){var gt=L.a.fromTextArea(ir.current,{mode:bt,lineNumbers:!vt,lineWrapping:!0,value:tt,autoCloseTags:!0,autoCloseBrackets:!0});Dt&>.focus();function Lt(xt,_t){if(Li){_t.preventDefault();return}var Ft=_t.clipboardData;if(Ft){var zt=Ft.types.toString(),It=Ft.items;if(zt==="Files"||Ft.types.indexOf("Files")>-1){if(_t.preventDefault(),bt=="stex")return;try{var nr,Ar=It[1];((nr=It[0])===null||nr===void 0?void 0:nr.kind)==="file"&&(Ar=It[0]);var Pt=Ar.getAsFile(),yi=Pt.name.split(".").pop();ue(Pt,function(Wt){if(Wt.id){var ur,Xr,Yr;(Pt==null||((ur=Pt.type)===null||ur===void 0)?void 0:ur.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Pt==null||((Xr=Pt.type)===null||Xr===void 0)?void 0:Xr.indexOf("video"))>-1?gt.replaceSelection('')):(Pt==null||((Yr=Pt.type)===null||Yr===void 0)?void 0:Yr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Pt.name,"")):ie.includes(yi)?gt.replaceSelection('').concat(Pt.name,"")):gt.replaceSelection("[".concat(Pt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",Lt),gt.on("dragleave",function(xt,_t){Ht.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(xt,_t){Ht.current.classList.add("mouse-hover-md")}),gt.on("drop",function(xt,_t){Ht.current.classList.add("mouse-hover-md");var Ft;if(Ft=_t.dataTransfer.files,Ft.length>0){_t.preventDefault(),_t.stopPropagation();for(var zt=function(Ar){var Pt=Ft[Ar],yi=Pt.name.split(".").pop();ue(Pt,function(Wt){if(Wt.id){var ur,Xr,Yr;(Pt==null||((ur=Pt.type)===null||ur===void 0)?void 0:ur.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Pt==null||((Xr=Pt.type)===null||Xr===void 0)?void 0:Xr.indexOf("video"))>-1?gt.replaceSelection('')):(Pt==null||((Yr=Pt.type)===null||Yr===void 0)?void 0:Yr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Pt.name,"")):ie.includes(yi)?gt.replaceSelection('').concat(Pt.name,"")):gt.replaceSelection("[".concat(Pt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},It=0;It0||It.target.offsetWidth>0)&&(zi(),X.setSize("100%","100%"),X.refresh())}}catch(nr){Ft.e(nr)}finally{Ft.f()}});return xt.observe(ir.current.parentElement),xt}if(X){var Lt=gt();return function(){Lt.unobserve(ir.current.parentElement)}}},[X,zi]),Object(v.useEffect)(function(){if(X){for(var gt=[],Lt=function(){var It=_t[xt];Ft=Object(G.a)(It,2);var nr=Ft[0],Ar=Ft[1],Pt=Object(j.a)({},nr,function(){Ki(Ar)});gt.push(Pt),X.addKeyMap(Pt)},xt=0,_t=Object.entries(ae);xt<_t.length;xt++){var Ft;Lt()}return Bt.current=setInterval(function(){pr.current&&wr()},4e3),function(){clearInterval(Bt.current);var zt=Object(D.a)(gt),It;try{for(zt.s();!(It=zt.n()).done;){var nr=It.value;X.removeKeyMap(nr)}}catch(Ar){zt.e(Ar)}finally{zt.f()}}}},[X]),Object(v.useEffect)(function(){Ot!==sr&&Vr(Ot)},[Ot]),Object(Ye.a)(function(){if(!si&&ci>0){var gt=new Date().getTime(),Lt=window.sessionStorage.getItem(qt);gt>=ci+Be&&(!Lt||Lt!==qe)&&(window.sessionStorage.setItem(qt,qe),Qt(!0))}},Be),Object(v.useEffect)(function(){Vt(Ze)},[X,Ze]),Object(v.useEffect)(function(){X&&(Dt&&X.focus())},[X,Dt]),Object(v.useEffect)(function(){if(Mt&&X){var gt=X.getScrollerElement();function Lt(xt){var _t=xt.target;if(er.current){var Ft=_t.scrollTop/_t.scrollHeight;er.current.scrollTop=er.current.scrollHeight*Ft}}return gt.addEventListener("scroll",Lt),function(){gt.removeEventListener("scroll",Lt)}}},[X,Mt]),Object(v.useEffect)(function(){if(X&&$r){function gt(Lt,xt){$r(Lt,xt)}return X.on("beforeChange",gt),function(){X.off("beforeChange",gt)}}},[X,$r]),Object(v.useEffect)(function(){if(X&&Fr){function gt(){Fr(X.getValue())}return X.on("blur",gt),function(){X.off("blur",gt)}}},[X,Fr]),Object(v.useEffect)(function(){if(X){function gt(Lt){var xt=Lt.getValue();ft(xt),ri(new Date().getTime()),Lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ct&&ct(xt)}return X.on("change",gt),function(){X.off("change",gt)}}},[X,ct]),Object(v.useEffect)(function(){X&&(tt==null?(X.setValue(""),ft("")):tt!==X.getValue()&&(X.setValue(tt),ft(tt),X.setCursor(X.lineCount(),0)))},[X,tt]);var Ki=Object(v.useCallback)(function(gt){var Lt=X.getCursor(),xt=X.getSelection(),_t=xt.split(`
`);switch(gt){case"bold":return X.replaceSelection("**"+xt+"**"),xt===""&&X.setCursor(Lt.line,Lt.ch+2),X.focus();case"italic":return X.replaceSelection("*"+xt+"*"),xt===""&&X.setCursor(Lt.line,Lt.ch+1),X.focus();case"code":return X.replaceSelection("`"+xt+"`"),xt===""&&X.setCursor(Lt.line,Lt.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+xt+"$$`"),xt===""&&X.setCursor(Lt.line,Lt.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+xt+"\n```"),X.setCursor(Lt.line+1,xt.length+1),X.focus();case"line-break":return X.replaceSelection(`
`),X.focus();case"list-ul":return xt===""?X.replaceSelection("- "+xt):X.replaceSelection(_t.map(function(Ft){return Ft===""?"":"- ".concat(Ft)}).join(`
`)),X.focus();case"list-ol":return xt===""?X.replaceSelection("1. "+xt):X.replaceSelection(_t.map(function(Ft,zt){return Ft===""?"":"".concat(zt+1,". ").concat(Ft)}).join(`
`)),X.focus();case"add-null-ch":return xt===""&&X.setCursor(Lt.line,Lt.ch+1),X.replaceSelection(Ke),X.focus();case"inster-template-1":return xt===""&&X.setCursor(Lt.line,Lt.ch),X.replaceSelection(Ee),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return Vt(!Mt),X.focus();case"trigger-full-screen":return Vr(!sr),X.focus();case Ie:Mr(Ie);return;case rt:Mr(rt);return;case Qe:Mr(Qe);return;case et:Mr(et);return;default:throw new Error}},[X,Mt,sr]),vi=Object(v.useCallback)(function(gt){Mr("");switch(Hr){case Ie:var Lt=gt.title,xt=gt.link;return X.replaceSelection("[".concat(Lt,"](").concat(xt,")")),X.focus();case rt:var _t=gt.language,Ft=gt.content;return X.replaceSelection(["```"+_t,Ft,"```"].join(`
`)),X.focus();case Qe:var zt=gt.src,It=gt.alt,nr=gt.name;return zt.indexOf("type=image")>-1?X.replaceSelection(".concat(zt,' "').concat(It||"",'" )')):zt.indexOf("type=application/pdf")>-1?X.replaceSelection('').concat(nr,"")):X.replaceSelection('').concat(nr,"")),X.focus();case et:for(var Ar=gt.row,Pt=gt.col,yi=gt.align,Wt=`
`,ur=0;ur300&&(nr=300);var Ar=ht+nr+"px";Gr(Ar)}}return gt.addEventListener("mousedown",_t),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",Ft),function(){gt.removeEventListener("mousedown",_t),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",Ft)}}},[X,ii]),Object(v.useEffect)(function(){Gr(ht)},[ht]);var fn=ge(kt),Jr=ge(Qr),Vi={width:fn,height:Jr},jn=Object(v.useMemo)(function(){if(ci){var gt=new Date(ci),Lt=gt.getHours(),xt=gt.getMinutes(),_t=gt.getSeconds();return Lt=Lt<10?"0"+Lt:Lt,xt=xt<10?"0"+xt:xt,_t=_t<10?"0"+_t:_t,"".concat(Lt,":").concat(xt,":").concat(_t)}return 0},[ci]);function Oi(){window.sessionStorage.removeItem(qt),Qt(!1),ri(0)}function $a(){Qt(!1),ri(0),X.setValue(window.sessionStorage.getItem(qt))}function da(gt,Lt){var xt=X.getValue();xt=xt.replace(gt,Lt),ft(xt),X==null||X.setValue(xt)}return A.a.createElement(v.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ht},A.a.createElement("div",{className:"markdown-editor-container ".concat(wt," ").concat(Mt?"on-preview":""," ").concat(vt?"mini":""," ").concat(sr?"full-screen":""),style:Vi},A.a.createElement(S,{insertTemp:Er,watch:Mt,fullScreen:sr,showNullButton:mt,onActionCallback:Ki,hidetoolBar:li,uuid:Ut.current,setOpenPhones:function(){pr.current=!0}}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:ir,placeholder:ki})),Mt?A.a.createElement("div",{ref:er,className:"preview-container"},bt==="stex"&&A.a.createElement(k,{value:qe}),bt!=="stex"&&A.a.createElement(f.a,{edit:!0,value:qe,replaces:da})):null))),Br?A.a.createElement("a",{ref:ii,className:"editor-resize"}):null,A.a.createElement(N.a,null,de[Hr]?A.a.createElement(J.a,{centered:!0,title:de[Hr],visible:!0,onCancel:Pr,footer:null},Fn):null))}},SJMd:function(Tt,dt){/**
* @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 le,he,J,D=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var _,G;(function(){var j=window,I=["break,continue,do,else,for,if,return,while"],R=[I,"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"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],A=[v,"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"],M=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],L=[v,"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"],w="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=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="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=[I,"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=[I,"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=[I,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[A,L,M,y,u,o,l,d],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,f="str",k="kwd",x="com",m="typ",g="lit",h="pun",a="pln",E="tag",b="dec",S="src",N="atn",U="atv",K="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function O(xe){for(var Me=0,Pe=!1,je=!1,Ue=0,Ne=xe.length;Ue122||(re<65||ye>90||ot.push([Math.max(65,ye)|32,Math.min(re,90)|32]),re<97||ye>122||ot.push([Math.max(97,ye)&~32,Math.min(re,122)&~32]))}}ot.sort(function(ke,Se){return ke[0]-Se[0]||Se[1]-ke[1]});for(var ie=[],ae=[],Ke=0;Kede[0]&&(de[1]+1>de[0]&&Be.push("-"),Be.push(et(de[1])))}return Be.push("]"),Be.join("")}function st(Xe){for(var _e=Xe.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")),ot=_e.length,at=[],Be=0,Ke=0;Be=2&&ye==="["?_e[Be]=Je(Ee):ye!=="\\"&&(_e[Be]=Ee.replace(/[a-zA-Z]/g,function(ae){var de=ae.charCodeAt(0);return"["+String.fromCharCode(de&~32,de|32)+"]"}))}return _e.join("")}for(var Ye=[],Ue=0,Ne=xe.length;Ue=0;)Pe[Ye.charAt(Xe)]=st;var _e=st[1],ot=""+_e;rt.hasOwnProperty(ot)||(Qe.push(_e),rt[ot]=null)}Qe.push(/[\0-\uffff]/),je=O(Qe)})();var Ue=Me.length,Ne=function(Ie){for(var Qe=Ie.sourceCode,rt=Ie.basePos,et=Ie.sourceNode,Je=[rt,a],st=0,Ye=Qe.match(je)||[],Xe={},_e=0,ot=Ye.length;_e=5&&Be.substring(0,5)==="lang-",Ee&&!(Ke&&typeof Ke[1]=="string")&&(Ee=!1,Be=S),Ee||(Xe[at]=Be)}var re=st;if(st+=at.length,!Ee)Je.push(rt+re,Be);else{var ie=Ke[1],ae=at.indexOf(ie),de=ae+ie.length;Ke[2]&&(de=at.length-Ke[2].length,ae=de-ie.length);var ke=Be.substring(5);$(et,rt+re,at.substring(0,ae),Ne,Je),$(et,rt+re+ae,ie,se(ke,ie),Je),$(et,rt+re+de,at.substring(de),Ne,Je)}}Ie.decorations=Je};return Ne}function Oe(xe){var Me=[],Pe=[];xe.tripleQuotedStrings?Me.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):xe.multiLineStrings?Me.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),xe.verbatimStrings&&Pe.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var je=xe.hashComments;je&&(xe.cStyleComments?(je>1?Me.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Pe.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([x,/^#[^\r\n]*/,null,"#"])),xe.cStyleComments&&(Pe.push([x,/^\/\/[^\r\n]*/,null]),Pe.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ue=xe.regexLiterals;if(Ue){var Ne=Ue>1?"":`
\r`,Ie=Ne?".":"[\\S\\s]",Qe="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";Pe.push(["lang-regex",RegExp("^"+V+"("+Qe+")")])}var rt=xe.types;rt&&Pe.push([m,rt]);var et=(""+xe.keywords).replace(/^ | $/g,"");et.length&&Pe.push([k,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([a,/^\s+/,null,` \r
\xA0`]);var Je="^.[^\\s\\w.$@'\"`/\\\\]*";return xe.regexLiterals&&(Je+="(?!s*/)"),Pe.push([g,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[g,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[h,new RegExp(Je),null]),fe(Me,Pe)}var Ce=Oe({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ae(xe,Me,Pe){for(var je=/(?:^|\s)nocode(?:\s|$)/,Ue=/\r\n?|\n/,Ne=xe.ownerDocument,Ie=Ne.createElement("li");xe.firstChild;)Ie.appendChild(xe.firstChild);var Qe=[Ie];function rt(_e){var ot=_e.nodeType;if(ot==1&&!je.test(_e.className))if(_e.nodeName==="br")et(_e),_e.parentNode&&_e.parentNode.removeChild(_e);else for(var at=_e.firstChild;at;at=at.nextSibling)rt(at);else if((ot==3||ot==4)&&Pe){var Be=_e.nodeValue,Ke=Be.match(Ue);if(Ke){var Ee=Be.substring(0,Ke.index);_e.nodeValue=Ee;var ge=Be.substring(Ke.index+Ke[0].length);if(ge){var ye=_e.parentNode;ye.insertBefore(Ne.createTextNode(ge),_e.nextSibling)}et(_e),Ee||_e.parentNode.removeChild(_e)}}}function et(_e){for(;!_e.nextSibling;)if(_e=_e.parentNode,!_e)return;function ot(Ke,Ee){var ge=Ee?Ke.cloneNode(!1):Ke,ye=Ke.parentNode;if(ye){var re=ot(ye,1),ie=Ke.nextSibling;re.appendChild(ge);for(var ae=ie;ae;ae=ie)ie=ae.nextSibling,re.appendChild(ae)}return ge}for(var at=ot(_e.nextSibling,0),Be;(Be=at.parentNode)&&Be.nodeType===1;)at=Be;Qe.push(at)}for(var Je=0;Je=ye&&(rt+=2),Ne>=re&&(st+=2)}}finally{Be&&(Be.style.display=Ke)}}var be={};function pe(xe,Me){for(var Pe=Me.length;--Pe>=0;){var je=Me[Pe];be.hasOwnProperty(je)?j.console&&console.warn("cannot override language handler %s",je):be[je]=xe}}function se(xe,Me){return xe&&be.hasOwnProperty(xe)||(xe=/^\s*]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^