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