(window.webpackJsonp=window.webpackJsonp||[]).push([[241,5,6,7,17],{"+NIl":function(ht,at,se){(function(ne){ne(se("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function($,R){"use strict";function Q(w,E){w.cmdState.push(E)}function U(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function _(w){var E=w.cmdState.pop();E&&E.closeBracket()}function j(w){for(var E=w.cmdState,b=E.length-1;b>=0;b--){var u=E[b];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function F(w,E,b){return function(){this.name=w,this.bracketNo=0,this.style=E,this.styles=b,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=F("importmodule","tag",["string","builtin"]),O.documentclass=F("documentclass","tag",["","atom"]),O.usepackage=F("usepackage","tag",["atom"]),O.begin=F("begin","tag",["atom"]),O.end=F("end","tag",["atom"]),O.label=F("label","tag",["atom"]),O.ref=F("ref","tag",["atom"]),O.eqref=F("eqref","tag",["atom"]),O.cite=F("cite","tag",["atom"]),O.bibitem=F("bibitem","tag",["atom"]),O.Bibitem=F("Bibitem","tag",["atom"]),O.RBibitem=F("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(w,E){w.f=E}function c(w,E){var b;if(w.match(/^\\[a-zA-Z@]+/)){var u=w.current().slice(1);return b=O.hasOwnProperty(u)?O[u]:O.DEFAULT,b=new b,Q(E,b),A(E,M),b.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return A(E,function(l,d){return x(l,d,"\\]")}),"keyword";if(w.match("\\("))return A(E,function(l,d){return x(l,d,"\\)")}),"keyword";if(w.match("$$"))return A(E,function(l,d){return x(l,d,"$$")}),"keyword";if(w.match("$"))return A(E,function(l,d){return x(l,d,"$")}),"keyword";var a=w.next();if(a=="%")return w.skipToEnd(),"comment";if(a=="}"||a=="]"){if(b=U(E),b)b.closeBracket(a),A(E,M);else return"error";return"bracket"}else return a=="{"||a=="["?(b=O.DEFAULT,b=new b,Q(E,b),"bracket"):/\d/.test(a)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),b=j(E),b.name=="begin"&&(b.argument=w.current()),b.styleIdentifier())}function x(w,E,b){if(w.eatSpace())return null;if(b&&w.match(b))return A(E,c),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=w.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(w.skipToEnd(),"comment"):"error"}function M(w,E){var b=w.peek(),u;return b=="{"||b=="["?(u=U(E),u.openBracket(b),w.eat(b),A(E,c),"bracket"):/[ \t\r]/.test(b)?(w.eat(b),null):(A(E,c),_(E),c(w,E))}return{startState:function(){var w=R.inMathMode?function(E,b){return x(E,b)}:c;return{cmdState:[],f:w}},copyState:function(w){return{cmdState:w.cmdState.slice(),f:w.f}},token:function(w,E){return E.f(w,E)},blankLine:function(w){w.f=c,w.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"19Vz":function(ht,at,se){(function(ne){ne(se("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(F,O,A){var c=A&&A!=ne.Init;if(O&&!c)F.on("blur",U),F.on("change",_),F.on("swapDoc",_),ne.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){Q(F)}),_(F);else if(!O&&c){F.off("blur",U),F.off("change",_),F.off("swapDoc",_),ne.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),$(F);var x=F.getWrapperElement();x.className=x.className.replace(" CodeMirror-empty","")}O&&!F.hasFocus()&&U(F)});function $(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function R(F){$(F);var O=F.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=F.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var A=F.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),O.appendChild(A),F.display.lineSpace.insertBefore(O,F.display.lineSpace.firstChild)}function Q(F){setTimeout(function(){var O=!1,A=F.getInputField();A.nodeName=="TEXTAREA"?O=!A.value:F.lineCount()==1&&(O=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),O?R(F):$(F)},20)}function U(F){j(F)&&R(F)}function _(F){var O=F.getWrapperElement(),A=j(F);O.className=O.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?R(F):$(F)}function j(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(ht,at,se){(function(ne){ne(se("VrN/"))})(function(ne){"use strict";var $={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(Q,U){var _=Q.indentUnit,j={},F=U.htmlMode?$:R;for(var O in F)j[O]=F[O];for(var O in U)j[O]=U[O];var A,c;function x(o,T){function S(B){return T.tokenize=B,B(o,T)}var y=o.next();if(y=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?S(E("atom","]]>")):null:o.match("--")?S(E("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),S(b(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),T.tokenize=E("meta","?>"),"meta"):(A=o.eat("/")?"closeTag":"openTag",T.tokenize=M,"tag bracket");if(y=="&"){var P;return o.eat("#")?o.eat("x")?P=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):P=o.eatWhile(/[\d]/)&&o.eat(";"):P=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),P?"atom":"error"}else return o.eatWhile(/[^&<]/),null}x.isInText=!0;function M(o,T){var S=o.next();if(S==">"||S=="/"&&o.eat(">"))return T.tokenize=x,A=S==">"?"endTag":"selfcloseTag","tag bracket";if(S=="=")return A="equals",null;if(S=="<"){T.tokenize=x,T.state=d,T.tagName=T.tagStart=null;var y=T.tokenize(o,T);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(S)?(T.tokenize=w(S),T.stringStartCol=o.column(),T.tokenize(o,T)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(o){var T=function(S,y){for(;!S.eol();)if(S.next()==o){y.tokenize=M;break}return"string"};return T.isInAttribute=!0,T}function E(o,T){return function(S,y){for(;!S.eol();){if(S.match(T)){y.tokenize=x;break}S.next()}return o}}function b(o){return function(T,S){for(var y;(y=T.next())!=null;){if(y=="<")return S.tokenize=b(o+1),S.tokenize(T,S);if(y==">")if(o==1){S.tokenize=x;break}else return S.tokenize=b(o-1),S.tokenize(T,S)}return"meta"}}function u(o,T,S){this.prev=o.context,this.tagName=T,this.indent=o.indented,this.startOfLine=S,(j.doNotIndent.hasOwnProperty(T)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function l(o,T){for(var S;;){if(!o.context)return;if(S=o.context.tagName,!j.contextGrabbers.hasOwnProperty(S)||!j.contextGrabbers[S].hasOwnProperty(T))return;a(o)}}function d(o,T,S){return o=="openTag"?(S.tagStart=T.column(),L):o=="closeTag"?f:d}function L(o,T,S){return o=="word"?(S.tagName=T.current(),c="tag",C):j.allowMissingTagName&&o=="endTag"?(c="tag bracket",C(o,T,S)):(c="error",L)}function f(o,T,S){if(o=="word"){var y=T.current();return S.context&&S.context.tagName!=y&&j.implicitlyClosed.hasOwnProperty(S.context.tagName)&&a(S),S.context&&S.context.tagName==y||j.matchClosing===!1?(c="tag",p):(c="tag error",D)}else return j.allowMissingTagName&&o=="endTag"?(c="tag bracket",p(o,T,S)):(c="error",D)}function p(o,T,S){return o!="endTag"?(c="error",p):(a(S),d)}function D(o,T,S){return c="error",p(o,T,S)}function C(o,T,S){if(o=="word")return c="attribute",m;if(o=="endTag"||o=="selfcloseTag"){var y=S.tagName,P=S.tagStart;return S.tagName=S.tagStart=null,o=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(y)?l(S,y):(l(S,y),S.context=new u(S,y,P==S.indented)),d}return c="error",C}function m(o,T,S){return o=="equals"?v:(j.allowMissing||(c="error"),C(o,T,S))}function v(o,T,S){return o=="string"?h:o=="word"&&j.allowUnquoted?(c="string",C):(c="error",C(o,T,S))}function h(o,T,S){return o=="string"?h:C(o,T,S)}return{startState:function(o){var T={tokenize:x,state:d,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(T.baseIndent=o),T},token:function(o,T){if(!T.tagName&&o.sol()&&(T.indented=o.indentation()),o.eatSpace())return null;A=null;var S=T.tokenize(o,T);return(S||A)&&S!="comment"&&(c=null,T.state=T.state(A||S,o,T),c&&(S=c=="error"?S+" error":c)),S},indent:function(o,T,S){var y=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+_;if(y&&y.noIndent)return ne.Pass;if(o.tokenize!=M&&o.tokenize!=x)return S?S.match(/^(\s*)/)[0].length:0;if(o.tagName)return j.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+_*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/$/,blockCommentStart:"",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(o){o.state==v&&(o.state=C)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var T=[],S=o.context;S;S=S.prev)S.tagName&&T.push(S.tagName);return T.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(ht,at,se){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function R(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne($)}var Q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function U(M){return typeof M=="string"&&Q.test(M)}for(var _=U,j=[],F=0;F<256;++F)j.push((F+256).toString(16).substr(1));function O(M){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,E=(j[M[w+0]]+j[M[w+1]]+j[M[w+2]]+j[M[w+3]]+"-"+j[M[w+4]]+j[M[w+5]]+"-"+j[M[w+6]]+j[M[w+7]]+"-"+j[M[w+8]]+j[M[w+9]]+"-"+j[M[w+10]]+j[M[w+11]]+j[M[w+12]]+j[M[w+13]]+j[M[w+14]]+j[M[w+15]]).toLowerCase();if(!_(E))throw TypeError("Stringified UUID is invalid");return E}var A=O;function c(M,w,E){M=M||{};var b=M.random||(M.rng||R)();if(b[6]=b[6]&15|64,b[8]=b[8]&63|128,w){E=E||0;for(var u=0;u<16;++u)w[E+u]=b[u];return w}return A(b)}var x=at.a=c},"7ahc":function(ht,at,se){"use strict";se.d(at,"a",function(){return L});var ne=se("k1fw"),$=se("0Owb"),R=se("+L6B"),Q=se("2/Rp"),U=se("y8nQ"),_=se("Vl3Y"),j=se("tJVT"),F=se("OaEy"),O=se("2fM7"),A=se("q1tI"),c=se.n(A),x=se("VrN/"),M=se.n(x),w=se("p77/"),E=se.n(w),b=se("c5Ni"),u=se.n(b),a=O.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};at.b=function(f){var p=f.callback,D=f.onCancel,C=Object(A.useState)("python"),m=Object(j.a)(C,2),v=m[0],h=m[1];function o(S){h(d[S][1])}function T(S){p(S)}return c.a.createElement(_.a,Object($.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:T}),c.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(O.a,{onChange:o},Object.keys(d).map(function(S){return c.a.createElement(a,{key:S,value:S},d[S][0])}))),c.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(L,{mode:v})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(Q.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function L(f){var p=f.value,D=f.onChange,C=f.mode,m=f.options,v=m===void 0?{}:m,h=Object(A.useRef)(),o=Object(A.useState)(),T=Object(j.a)(o,2),S=T[0],y=T[1];return Object(A.useEffect)(function(){if(S){function P(B){var W=B.getValue();D&&D(W)}return S.on("change",P),function(){S.off("change",P)}}},[S,D]),Object(A.useEffect)(function(){S&&S.setOption("mode",C)},[S,C]),Object(A.useEffect)(function(){S&&((p!==S.getValue()||p==="")&&setTimeout(function(){S.setValue(p||" ")},300))},[S,p]),Object(A.useEffect)(function(){if(h.current&&!S){var P=M.a.fromTextArea(h.current,Object(ne.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));y(P)}},[h.current,S]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:h}))}},"8EBN":function(ht,at,se){(function(ne){ne(se("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var $=0;$-1&&Q.substring(j+1,Q.length);if(F)return ne.findModeByExtension(F)},ne.findModeByName=function(Q){Q=Q.toLowerCase();for(var U=0;U=G.length?J.slice(G.length):J}).join(`
`)}var u=[],a=[""],l=new w.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function L(){u.length=0,a=[""]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(K,s,g,G){if(s>=K.length||K[s].level<=g)return s;var J=K[s];G.push("- "+J.text+""),s++;var z=[];return s=p(K,s,J.level,z),z.length>0&&(G.push("
"),z.forEach(function(ye){G.push(ye)}),G.push("
")),G.push(" "),s=p(K,s,g,G),s}function D(){return p(u,0,0,a),a.push("
"),a.join("")}var C={heading:function(s){var g=d.exec(s);if(g)return{type:"heading",raw:g[0],depth:g[1].length,text:g[2]}},fences:function(s){var g=this.rules.block.fences.exec(s);if(g){var G=g[0],J=b(G,g[3]||""),z=g[2]?g[2].trim():g[2];if(["latex","katex","math"].indexOf(z)>=0){var ye=h(),He=J;J=ye,o[ye]={type:"block",expression:He}}return{type:"code",raw:G,lang:z,text:J}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,h=function(){return"__special_katext_id_".concat(v++,"__")},o={};function T(){return o}function S(){v=0,o={}}function y(K){return K=K.replace(m,function(s,g){var G=h();return o[G]={type:"inline",expression:g},G}),K}var P=l.listitem;l.listitem=function(K){return P(y(K))};var B=l.paragraph;l.paragraph=function(K){return B(y(K))};var W=l.tablecell;l.tablecell=function(K,s){return W(y(K),s)},l.code=function(K,s,g){var G=(s||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"".concat(K,"
"):'
').concat(g?K:Object(E.escape)(K,!0),`
`):''+(g?K:Object(E.escape)(K,!0))+"
"},l.heading=function(K,s,g){var G=this.options.headerPrefix+g.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:G,level:s,text:K}),"'+K+""},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:C,renderer:l});var V=w.a,I=se("SJMd"),N=se("ulZh"),X=se.n(N),ee=se("m3rI"),oe=se("Oy/b"),ce=se("p5ED"),De=se("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ee=function(K,s){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,G){g.__proto__=G}||function(g,G){for(var J in G)Object.prototype.hasOwnProperty.call(G,J)&&(g[J]=G[J])})(K,s)};function Ce(K,s){function g(){this.constructor=K}Ee(K,s),K.prototype=s===null?Object.create(s):(g.prototype=s.prototype,new g)}function Te(K,s,g,G){return new(g||(g=Promise))(function(J,z){function ye(mt){try{_e(G.next(mt))}catch(ze){z(ze)}}function He(mt){try{_e(G.throw(mt))}catch(ze){z(ze)}}function _e(mt){var ze;mt.done?J(mt.value):(ze=mt.value,ze instanceof g?ze:new g(function(wt){wt(ze)})).then(ye,He)}_e((G=G.apply(K,s||[])).next())})}function me(K,s){var g,G,J,z,ye={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return z={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function He(_e){return function(mt){return function(ze){if(g)throw new TypeError("Generator is already executing.");for(;ye;)try{if(g=1,G&&(J=2&ze[0]?G.return:ze[0]?G.throw||((J=G.return)&&J.call(G),0):G.next)&&!(J=J.call(G,ze[1])).done)return J;switch(G=0,J&&(ze=[2&ze[0],J.value]),ze[0]){case 0:case 1:J=ze;break;case 4:return ye.label++,{value:ze[1],done:!1};case 5:ye.label++,G=ze[1],ze=[0];continue;case 7:ze=ye.ops.pop(),ye.trys.pop();continue;default:if(!(J=ye.trys,(J=J.length>0&&J[J.length-1])||ze[0]!==6&&ze[0]!==2)){ye=0;continue}if(ze[0]===3&&(!J||ze[1]>J[0]&&ze[1]',"select"),this.addActionButton(G,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(G,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(G,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(G,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(G,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(G,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(G,'',"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(z){var ye=document.createElement("div");ye.className=""+g.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",z.typeName),ye.innerHTML=z.icon,ye.addEventListener("click",function(){g.markerToolbarButtonClicked(ye,z)}),g.buttons.push(ye),g.markerButtons.push(ye)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'',"render"),this.addActionButton(J,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},K.prototype.addButtonClickListener=function(s){this.buttonClickListeners.push(s)},K.prototype.removeButtonClickListener=function(s){this.buttonClickListeners.indexOf(s)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(s),1)},K.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},K.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var s=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var g=0;g0&&this.buttonClickListeners.forEach(function(G){return G("marker",g)}),this.markerButtonOverflowBlock.style.display="none"},K.prototype.actionToolbarButtonClicked=function(s,g){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",g)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},K.prototype.setActiveButton=function(s){this.resetButtonStyles(),s.className=s.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),s.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},K.prototype.setActiveMarkerButton=function(s){var g=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===s});g&&this.setActiveButton(g)},K.prototype.setCurrentMarker=function(s){var g=this;this.currentMarker=s,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){g.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},K}(),Ie=function(){function K(s,g,G,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=s,this.displayMode=g,this.uiStyleSettings=G,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return K.prototype.addStyles=function(){var s;this.toolboxStyleClass=this.styles.addClass(new xe("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new xe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var g=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new xe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new xe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new xe("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new xe("toolbox-panel-row_colors",`
background-color: `+((s=this.uiStyleSettings.toolboxBackgroundColor)!==null&&s!==void 0?s:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new xe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
padding: `+g+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new xe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new xe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Le("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Le("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},K.prototype.show=function(s){var g;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolboxStyleClass.name+" "+((g=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},K.prototype.setPanelButtons=function(s){var g,G,J=this;this.panels=s,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((g=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var ye;z.uiStyleSettings=J.uiStyleSettings;var He=document.createElement("div");He.className=J.toolboxButtonStyleClass.name+" "+((ye=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:J.toolboxButtonStyleColorsClass.name),He.innerHTML=z.icon,He.title=z.title,He.addEventListener("click",function(){J.panelButtonClick(z)}),J.panelButtons.push(He),J.buttonRow.appendChild(He)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},K.prototype.panelButtonClick=function(s){var g=this,G=-1;if(s!==this.activePanel){G=this.panels.indexOf(s),this.panelRow.innerHTML="";var J=s.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=s}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){g.displayMode==="inline"?g.panelRow.style.display="none":g.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,ye){var He,_e;z.className=g.toolboxButtonStyleClass.name+" "+(ye===G?""+((He=g.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:g.toolboxActiveButtonStyleColorsClass.name):""+((_e=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:g.toolboxButtonStyleColorsClass.name))})},K}(),We=function(K,s){this.title=K,this.icon=s},Fe=function(K){function s(g,G,J,z){var ye=K.call(this,g,z||'')||this;return ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=G,ye.currentColor=J,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return Ce(s,K),s.prototype.getUi=function(){var g=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(J){var z=g.getColorBox(J);G.appendChild(z),g.colorBoxes.push(z)}),G},s.prototype.getColorBox=function(g){var G=this,J=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-J,ye=document.createElement("div");ye.style.display="inline-block",ye.style.boxSizing="content-box",ye.style.width=z-2+"px",ye.style.height=z-2+"px",ye.style.padding="1px",ye.style.marginRight="2px",ye.style.marginBottom="2px",ye.style.borderWidth="2px",ye.style.borderStyle="solid",ye.style.borderRadius=(z+2)/2+"px",ye.style.borderColor=g===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){G.setCurrentColor(g,ye)});var He=document.createElement("div");return He.style.display="inline-block",He.style.width=z-2+"px",He.style.height=z-2+"px",He.style.backgroundColor=g,He.style.borderRadius=z/2+"px",g==="transparent"&&(He.style.fill=this.uiStyleSettings.toolboxAccentColor,He.innerHTML=``),ye.appendChild(He),ye},s.prototype.setCurrentColor=function(g,G){var J=this;this.currentColor=g,this.colorBoxes.forEach(function(z){z.style.borderColor=z===G?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(g)},s}(We),Ne=function(){function K(s,g,G){this._state="new",this._isSelected=!1,this._container=s,this._overlayContainer=g,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(K.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(s){return!1},Object.defineProperty(K.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),K.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},K.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},K.prototype.pointerDown=function(s,g){},K.prototype.dblClick=function(s,g){},K.prototype.manipulate=function(s){},K.prototype.pointerUp=function(s){this.stateChanged()},K.prototype.dispose=function(){},K.prototype.addMarkerVisualToContainer=function(s){this.container.childNodes.length>0?this.container.insertBefore(s,this.container.childNodes[0]):this.container.appendChild(s)},K.prototype.getState=function(){return{typeName:K.typeName,state:this.state,notes:this.notes}},K.prototype.restoreState=function(s){this._state=s.state,this.notes=s.notes},K.prototype.scale=function(s,g){},K.prototype.colorChanged=function(s){this.onColorChanged&&this.onColorChanged(s),this.stateChanged()},K.prototype.fillColorChanged=function(s){this.onFillColorChanged&&this.onFillColorChanged(s),this.stateChanged()},K.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var s=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),s.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(s)&&this.onStateChanged(this)}},K.typeName="MarkerBase",K}(),Ue=function(){function K(){this.findGripByVisual=this.findGripByVisual.bind(this)}return K.prototype.findGripByVisual=function(s){return this.topLeft.ownsTarget(s)?this.topLeft:this.topCenter.ownsTarget(s)?this.topCenter:this.topRight.ownsTarget(s)?this.topRight:this.centerLeft.ownsTarget(s)?this.centerLeft:this.centerRight.ownsTarget(s)?this.centerRight:this.bottomLeft.ownsTarget(s)?this.bottomLeft:this.bottomCenter.ownsTarget(s)?this.bottomCenter:this.bottomRight.ownsTarget(s)?this.bottomRight:void 0},K}(),et=function(){function K(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},K}(),ot=function(){function K(){}return K.toITransformMatrix=function(s){return{a:s.a,b:s.b,c:s.c,d:s.d,e:s.e,f:s.f}},K.toSVGMatrix=function(s,g){return s.a=g.a,s.b=g.b,s.c=g.c,s.d=g.d,s.e=g.e,s.f=g.f,s},K}(),nt=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(ue.createTransform()),z.setupControlBox(),z}return Ce(s,K),Object.defineProperty(s.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visual",{get:function(){return this._visual},set:function(g){this._visual=g;var G=ue.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(g){return!!K.prototype.ownsTarget.call(this,g)||!!(this.controlGrips.findGripByVisual(g)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(g))},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.state==="new"&&(this.left=g.x,this.top=g.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(g);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},s.prototype.pointerUp=function(g){var G=this.state;K.prototype.pointerUp.call(this,g),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(g),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},s.prototype.moveVisual=function(g){this.visual.style.transform="translate("+g.x+"px, "+g.y+"px)"},s.prototype.manipulate=function(g){var G=this.unrotatePoint(g);this.state==="creating"?this.resize(g):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(g)},s.prototype.resize=function(g){var G=this.manipulationStartLeft,J=this.manipulationStartWidth,z=this.manipulationStartTop,ye=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+g.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+g.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+g.y-this.manipulationStartY,ye=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ye=this.manipulationStartHeight+g.y-this.manipulationStartY}J>=0?(this.left=G,this.width=J):(this.left=G+J,this.width=-J),ye>=0?(this.top=z,this.height=ye):(this.top=z+ye,this.height=-ye),this.setSize()},s.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},s.prototype.rotate=function(g){if(Math.abs(g.x-this.centerX)>.1){var G=Math.sign(g.x-this.centerX);this.rotationAngle=180*Math.atan((g.y-this.centerY)/(g.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},s.prototype.applyRotation=function(){var g=this.container.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(g,0)},s.prototype.rotatePoint=function(g){if(this.rotationAngle===0)return g;var G=this.container.getCTM(),J=ue.createPoint(g.x,g.y);return{x:(J=J.matrixTransform(G)).x,y:J.y}},s.prototype.unrotatePoint=function(g){if(this.rotationAngle===0)return g;var G=this.container.getCTM();G=G.inverse();var J=ue.createPoint(g.x,g.y);return{x:(J=J.matrixTransform(G)).x,y:J.y}},s.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var g=ue.createTransform();g.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(g),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 Ue,this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){var g=this.controlBox.transform.baseVal.getItem(0);g.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(g,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},s.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},s.prototype.createGrip=function(){var g=new et;return g.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(g.visual),g},s.prototype.positionGrips=function(){var g=this.controlGrips.topLeft.GRIP_SIZE,G=-g/2,J=G,z=(this.width+this.CB_DISTANCE)/2-g/2,ye=(this.height+this.CB_DISTANCE)/2-g/2,He=this.height+this.CB_DISTANCE-g/2,_e=this.width+this.CB_DISTANCE-g/2;this.positionGrip(this.controlGrips.topLeft.visual,G,J),this.positionGrip(this.controlGrips.topCenter.visual,z,J),this.positionGrip(this.controlGrips.topRight.visual,_e,J),this.positionGrip(this.controlGrips.centerLeft.visual,G,ye),this.positionGrip(this.controlGrips.centerRight.visual,_e,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,G,He),this.positionGrip(this.controlGrips.bottomCenter.visual,z,He),this.positionGrip(this.controlGrips.bottomRight.visual,_e,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,J-3*this.CB_DISTANCE)},s.prototype.positionGrip=function(g,G,J){var z=g.transform.baseVal.getItem(0);z.setTranslate(G,J),g.transform.baseVal.replaceItem(z,0)},s.prototype.hideControlBox=function(){this.controlBox.style.display="none"},s.prototype.showControlBox=function(){this.controlBox.style.display=""},s.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ot.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ot.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},K.prototype.getState.call(this))},s.prototype.restoreState=function(g){K.prototype.restoreState.call(this,g);var G=g;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ot.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ot.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},s.prototype.scale=function(g,G){K.prototype.scale.call(this,g,G);var J=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:J.x*g,y:J.y*G});this.left=z.x,this.top=z.y,this.width=this.width*g,this.height=this.height*G,this.adjustControlBox()},s}(Ne),qe=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.visual)},s.prototype.createVisual=function(){this.visual=ue.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},s.prototype.manipulate=function(g){K.prototype.manipulate.call(this,g)},s.prototype.resize=function(g){K.prototype.resize.call(this,g),this.setSize()},s.prototype.setSize=function(){K.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(g){K.prototype.pointerUp.call(this,g),this.setSize()},s.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},s.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},s.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this))},s.prototype.restoreState=function(g){var G=g;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),K.prototype.restoreState.call(this,g),this.setSize()},s.prototype.scale=function(g,G){K.prototype.scale.call(this,g,G),this.setSize()},s.title="Rectangle marker",s}(nt),st=function(K){function s(g,G,J,z){var ye=K.call(this,g,z||'')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=G,ye.currentWidth=J,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return Ce(s,K),s.prototype.getUi=function(){var g=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(J){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=J===g.currentWidth?g.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){g.setCurrentWidth(J,z)}),G.appendChild(z);var ye=document.createElement("div");ye.innerText=J.toString(),ye.style.marginRight="5px",z.appendChild(ye);var He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.display="flex",He.style.alignItems="center";var _e=document.createElement("hr");_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop=J+"px solid "+g.uiStyleSettings.toolboxColor,_e.style.flexGrow="2",He.appendChild(_e),z.appendChild(He),g.widthBoxes.push(z)}),G},s.prototype.setCurrentWidth=function(g,G){var J=this;this.currentWidth=g,this.widthBoxes.forEach(function(z){z.style.borderColor=z===G?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},s}(We),$e=function(K){function s(g,G,J,z){var ye=K.call(this,g,z||'')||this;return ye.styles=[],ye.styleBoxes=[],ye.styles=G,ye.currentStyle=J,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return Ce(s,K),s.prototype.getUi=function(){var g=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(J){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/g.styles.length-5+"%",z.style.borderColor=J===g.currentStyle?g.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){g.setCurrentStyle(J,z)}),G.appendChild(z);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var He=``;ye.innerHTML=He,z.appendChild(ye),g.styleBoxes.push(z)}),G},s.prototype.setCurrentStyle=function(g,G){var J=this;this.currentStyle=g,this.styleBoxes.forEach(function(z){z.style.borderColor=z===G?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},s}(We),Qe=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.strokeColor=J.defaultColor,z.strokeWidth=J.defaultStrokeWidth,z.strokeDasharray=J.defaultStrokeDasharray,z.strokePanel=new Fe("Line color",J.defaultColorSet,J.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new st("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Ce(s,K),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=K.prototype.getState.call(this);return g.typeName=s.typeName,g},s.typeName="FrameMarker",s.title="Frame marker",s.icon='',s}(qe),Me=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},ut=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!!K.prototype.ownsTarget.call(this,g)||!(!this.grip1.ownsTarget(g)&&!this.grip2.ownsTarget(g))},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.state==="new"&&(this.x1=g.x,this.y1=g.y,this.x2=g.x,this.y2=g.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},s.prototype.pointerUp=function(g){var G=this.state;K.prototype.pointerUp.call(this,g),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(g),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},s.prototype.adjustVisual=function(){},s.prototype.manipulate=function(g){this.state==="creating"?this.resize(g):this.state==="move"?(this.x1=this.manipulationStartX1+g.x-this.manipulationStartX,this.y1=this.manipulationStartY1+g.y-this.manipulationStartY,this.x2=this.manipulationStartX2+g.x-this.manipulationStartX,this.y2=this.manipulationStartY2+g.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(g)},s.prototype.resize=function(g){switch(this.activeGrip){case this.grip1:this.x1=g.x,this.y1=g.y;break;case this.grip2:case void 0:this.x2=g.x,this.y2=g.y}this.adjustVisual(),this.adjustControlBox()},s.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){this.positionGrips()},s.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},s.prototype.createGrip=function(){var g=new et;return g.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(g.visual),g},s.prototype.positionGrips=function(){var g=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-g/2,this.y1-g/2),this.positionGrip(this.grip2.visual,this.x2-g/2,this.y2-g/2)},s.prototype.positionGrip=function(g,G,J){var z=g.transform.baseVal.getItem(0);z.setTranslate(G,J),g.transform.baseVal.replaceItem(z,0)},s.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},K.prototype.getState.call(this))},s.prototype.restoreState=function(g){K.prototype.restoreState.call(this,g);var G=g;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},s.prototype.scale=function(g,G){K.prototype.scale.call(this,g,G),this.x1=this.x1*g,this.y1=this.y1*G,this.x2=this.x2*g,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},s}(Ne),lt=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=J.defaultColor,z.strokeWidth=J.defaultStrokeWidth,z.strokeDasharray=J.defaultStrokeDasharray,z.strokePanel=new Fe("Line color",J.defaultColorSet,J.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new st("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorLine&&g!==this.visibleLine)},s.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},s.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},s.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},s.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},K.prototype.getState.call(this));return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){K.prototype.restoreState.call(this,g);var G=g;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},s.typeName="LineMarker",s.title="Line marker",s.icon='',s}(ut),Be=function(K){function s(g,G,J,z){var ye=K.call(this,g,z||'')||this;return ye.fonts=[],ye.fontBoxes=[],ye.fonts=G,ye.currentFont=J,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return Ce(s,K),s.prototype.getUi=function(){var g=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(J){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/g.fonts.length-5+"%",z.style.borderColor=J===g.currentFont?g.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){g.setCurrentFont(J,z)}),G.appendChild(z);var ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=J,ye.style.overflow="hidden";var He=document.createElement("div");He.style.whiteSpace="nowrap",He.style.overflow="hidden",He.style.textOverflow="ellipsis",He.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(He),z.appendChild(ye),g.fontBoxes.push(z)}),G},s.prototype.setCurrentFont=function(g,G){var J=this;this.currentFont=g,this.fontBoxes.forEach(function(z){z.style.borderColor=z===G?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},s}(We),Ke=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=J.defaultColor,z.fontFamily=J.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new Fe("Color",J.defaultColorSet,J.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new Be("Font",J.defaultFontFamilies,J.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return Ce(s,K),s.prototype.ownsTarget=function(g){if(K.prototype.ownsTarget.call(this,g)||g===this.visual||g===this.textElement||g===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(J){J===g&&(G=!0)}),G},s.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.isMoved=!1,this.pointerDownPoint=g,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},s.prototype.renderText=function(){var g=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(G){g.textElement.appendChild(ue.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},s.prototype.getTextScale=function(){var g=this.textElement.getBBox(),G=1;if(g.width>0&&g.height>0){var J=(1*this.width-this.width*this.padding*2/100)/g.width,z=(1*this.height-this.height*this.padding*2/100)/g.height;G=Math.min(J,z)}return G},s.prototype.getTextPosition=function(g){var G=this.textElement.getBBox(),J=0,z=0;return G.width>0&&G.height>0&&(J=(this.width-G.width*g)/2,z=this.height/2-G.height*g/2),{x:J,y:z}},s.prototype.sizeText=function(){var g=this.textElement.getBBox(),G=this.getTextScale(),J=this.getTextPosition(G);J.y-=g.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},s.prototype.manipulate=function(g){K.prototype.manipulate.call(this,g),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(g.x-this.pointerDownPoint.x)>5||Math.abs(g.y-this.pointerDownPoint.y)>5)},s.prototype.resize=function(g){K.prototype.resize.call(this,g),this.isMoved=!0,this.setSize(),this.sizeText()},s.prototype.setSize=function(){K.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},s.prototype.pointerUp=function(g){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),K.prototype.pointerUp.call(this,g),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},s.prototype.showTextEditor=function(){var g=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(g.textEditor.style.fontSize);g.textEditor.clientWidth>=Number.parseInt(g.textEditor.style.maxWidth)&&G>.9;)G-=.1,g.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var J=G.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(J)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){g.textEditDivClicked(g.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},s.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var g=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),z={x:J.width*g,y:J.height*g};G.x-=z.x/2,G.y-=z.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*g,12)+"px",this.textElement.style.display="none"}},s.prototype.textEditDivClicked=function(g){this.text=g.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},s.prototype.select=function(){K.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},s.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),K.prototype.deselect.call(this)},s.prototype.dblClick=function(g,G){K.prototype.dblClick.call(this,g,G),this.showTextEditor()},s.prototype.setColor=function(g){this.textElement&&ue.setAttributes(this.textElement,[["fill",g]]),this.color=g,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(g)},s.prototype.setFont=function(g){this.textElement&&ue.setAttributes(this.textElement,[["font-family",g]]),this.fontFamily=g,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},s.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},s.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},K.prototype.getState.call(this));return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){var G=g;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),K.prototype.restoreState.call(this,g),this.setSize()},s.prototype.scale=function(g,G){K.prototype.scale.call(this,g,G),this.setSize(),this.sizeText(),this.positionTextEditor()},s.typeName="TextMarker",s.title="Text marker",s.icon='',s}(nt),Se=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=J.defaultColor,z.lineWidth=J.defaultStrokeWidth,z.pixelRatio=J.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new Fe("Color",J.defaultColorSet,J.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new st("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.drawingImage)},s.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var g=ue.createTransform();this.visual.transform.baseVal.appendItem(g),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(g,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(g.x,g.y),this.drawing=!0):K.prototype.pointerDown.call(this,g,G)},s.prototype.manipulate=function(g){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(g.x,g.y),this.canvasContext.stroke()):K.prototype.manipulate.call(this,g)},s.prototype.resize=function(g){K.prototype.resize.call(this,g),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(g){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):K.prototype.pointerUp.call(this,g)},s.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},s.prototype.select=function(){this.state==="creating"&&this.finishCreation(),K.prototype.select.call(this)},s.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),K.prototype.deselect.call(this)},s.prototype.finishCreation=function(){for(var g=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=G[0],z=G[1],ye=G[2],He=G[3],_e=!1,mt=0;mt0&&(_e=!0,mtHe&&(He=mt),ze>ye&&(ye=ze));if(_e){this.left=J/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(ye-J)/this.pixelRatio,this.height=(He-z)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=ye-J,wt.height=He-z,wt.getContext("2d").putImageData(this.canvasContext.getImageData(J,z,ye-J,He-z),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},s.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},s.prototype.setColor=function(g){this.color=g,this.colorChanged(g)},s.prototype.setLineWidth=function(g){this.lineWidth=g},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=Object.assign({drawingImgUrl:this.drawingImgUrl},K.prototype.getState.call(this));return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){this.createVisual(),K.prototype.restoreState.call(this,g),this.drawingImgUrl=g.drawingImgUrl,this.setDrawingImage()},s.prototype.scale=function(g,G){K.prototype.scale.call(this,g,G),this.setDrawingImage()},s.typeName="FreehandMarker",s.title="Freehand marker",s.icon='',s}(nt),ve=function(K){function s(g,G,J){var z=K.call(this,g,J||'')||this;return z.typeBoxes=[],z.currentType=G,z.setCurrentType=z.setCurrentType.bind(z),z}return Ce(s,K),s.prototype.getUi=function(){var g=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var J=function(He){var _e="both";switch(He){case 0:_e="both";break;case 1:_e="start";break;case 2:_e="end";break;case 3:_e="none"}var mt=document.createElement("div");if(mt.style.display="flex",mt.style.flexGrow="2",mt.style.alignItems="center",mt.style.justifyContent="space-between",mt.style.padding="5px",mt.style.borderWidth="2px",mt.style.borderStyle="solid",mt.style.borderColor=_e===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",mt.addEventListener("click",function(){g.setCurrentType(_e,mt)}),G.appendChild(mt),_e==="both"||_e==="start"){var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.innerHTML=``,ze.style.marginLeft="5px",mt.appendChild(ze)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var Nt=document.createElement("hr");if(Nt.style.minWidth="20px",Nt.style.border="0px",Nt.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Nt.style.flexGrow="2",wt.appendChild(Nt),mt.appendChild(wt),_e==="both"||_e==="end"){var Gt=document.createElement("div");Gt.style.display="flex",Gt.style.alignItems="center",Gt.style.minHeight="20px",Gt.innerHTML=``,Gt.style.marginRight="5px",mt.appendChild(Gt)}z.typeBoxes.push(mt)},z=this,ye=0;ye<4;ye++)J(ye);return G},s.prototype.setCurrentType=function(g,G){var J=this;this.currentType=g,this.typeBoxes.forEach(function(z){z.style.borderColor=z===G?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},s}(We),be=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new ve("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.arrow1&&g!==this.arrow2)},s.prototype.getArrowPoints=function(g,G){var J=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return g-J/2+","+(G+z/2)+" "+g+","+(G-z/2)+" "+(g+J/2)+","+(G+z/2)},s.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(K.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",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var g=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(g,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(g+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},s.prototype.setArrowType=function(g){this.arrowType=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=Object.assign({arrowType:this.arrowType},K.prototype.getState.call(this));return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){K.prototype.restoreState.call(this,g);var G=g;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},s.typeName="ArrowMarker",s.title="Arrow marker",s.icon='',s}(lt),re=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.fillColor=J.defaultFillColor,z.strokeWidth=0,z.fillPanel=new Fe("Color",J.defaultColorSet,J.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return Ce(s,K),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=K.prototype.getState.call(this);return g.typeName=s.typeName,g},s.typeName="CoverMarker",s.title="Cover marker",s.icon='',s}(qe),ie=function(K){function s(g,G,J,z){var ye=K.call(this,g,z||'')||this;return ye.opacities=[],ye.opacityBoxes=[],ye.opacities=G,ye.currentOpacity=J,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return Ce(s,K),s.prototype.getUi=function(){var g=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(J){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=J===g.currentOpacity?g.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){g.setCurrentOpacity(J,z)}),G.appendChild(z);var ye=document.createElement("div");ye.innerText=100*J+"%",z.appendChild(ye),g.opacityBoxes.push(z)}),G},s.prototype.setCurrentOpacity=function(g,G){var J=this;this.currentOpacity=g,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===G?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},s}(We),le=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=J.defaultHighlightColor,z.strokeWidth=0,z.opacity=J.defaultHighlightOpacity,z.fillPanel=new Fe("Color",J.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new ie("Opacity",J.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Ce(s,K),s.prototype.setOpacity=function(g){this.opacity=g,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=K.prototype.getState.call(this);return g.typeName=s.typeName,g},s.typeName="HighlightMarker",s.title="Highlight marker",s.icon='',s}(re),he='',ke=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=J.defaultStrokeColor,z.bgColor=J.defaultFillColor,z.fontFamily=J.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new Fe("Text color",J.defaultColorSet,z.color,''),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new Fe("Fill color",J.defaultColorSet,z.bgColor,he),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new Be("Font",J.defaultFontFamilies,J.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new et,z.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return Ce(s,K),s.prototype.ownsTarget=function(g){return K.prototype.ownsTarget.call(this,g)||this.tipGrip.ownsTarget(g)||this.tip===g},s.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},s.prototype.pointerDown=function(g,G){this.state==="new"&&K.prototype.pointerDown.call(this,g,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):K.prototype.pointerDown.call(this,g,G)},s.prototype.pointerUp=function(g){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,K.prototype.pointerUp.call(this,g);else{var G=this.state==="creating";K.prototype.pointerUp.call(this,g),this.setTipPoints(G),this.positionTip()}},s.prototype.manipulate=function(g){if(this.tipMoving){var G=this.unrotatePoint(g);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else K.prototype.manipulate.call(this,g)},s.prototype.setBgColor=function(g){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",g]]),ue.setAttributes(this.tip,[["fill",g]])),this.bgColor=g,this.fillColorChanged(g)},s.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},s.prototype.setTipPoints=function(g){g===void 0&&(g=!1);var G=Math.min(this.height/2,15),J=this.height/5;g&&(this.tipPosition={x:G+J/2,y:this.height+20});var z=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?z',s}(Ke),Pe=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=J.defaultColor,z.strokeWidth=J.defaultStrokeWidth,z.strokeDasharray=J.defaultStrokeDasharray,z.fillColor=J.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new Fe("Line color",pe(J.defaultColorSet,["transparent"]),J.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new Fe("Fill color",pe(J.defaultColorSet,["transparent"]),z.fillColor,he),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new st("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new ie("Opacity",J.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.visual)},s.prototype.createVisual=function(){this.visual=ue.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},s.prototype.manipulate=function(g){K.prototype.manipulate.call(this,g)},s.prototype.resize=function(g){K.prototype.resize.call(this,g),this.setSize()},s.prototype.setSize=function(){K.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},s.prototype.pointerUp=function(g){K.prototype.pointerUp.call(this,g),this.setSize()},s.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},s.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(g),this.stateChanged()},s.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.setOpacity=function(g){this.opacity=g,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this));return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){var G=g;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),K.prototype.restoreState.call(this,g),this.setSize()},s.prototype.scale=function(g,G){K.prototype.scale.call(this,g,G),this.setSize()},s.typeName="EllipseMarker",s.title="Ellipse marker",s.icon='',s}(nt),Xe=function(K){function s(g,G,J){return K.call(this,g,G,J)||this}return Ce(s,K),Object.defineProperty(s.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.tip1&&g!==this.tip2)},s.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var g=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(g,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(g+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=K.prototype.getState.call(this);return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){K.prototype.restoreState.call(this,g),this.createTips(),this.adjustVisual()},s.typeName="MeasurementMarker",s.title="Measurement marker",s.icon='',s}(lt),vt=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.strokePanel.colors=J.defaultColorSet,z.fillColor="transparent",z}return Ce(s,K),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=K.prototype.getState.call(this);return g.typeName=s.typeName,g},s.typeName="EllipseFrameMarker",s.title="Ellipse frame marker",s.icon='',s}(Pe),Dt=function(){function K(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),K.prototype.addUndoStep=function(s){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(s)||(this.undoStack.push(s),JSON.stringify(this.lastRedoStep)!==JSON.stringify(s)&&this.redoStack.splice(0,this.redoStack.length))},K.prototype.replaceLastUndoStep=function(s){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=s)},K.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},K.prototype.undo=function(){if(this.undoStack.length>1){var s=this.undoStack.pop();return s!==void 0&&this.redoStack.push(s),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},K.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},K}(),Ge=function(K){function s(g,G,J){var z=K.call(this,g,G,J)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=J.defaultColor,z.strokeWidth=J.defaultStrokeWidth,z.strokeDasharray=J.defaultStrokeDasharray,z.strokePanel=new Fe("Line color",J.defaultColorSet,J.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new st("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new $e("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Ce(s,K),s.prototype.ownsTarget=function(g){return!(!K.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorCurve&&g!==this.visibleCurve&&!this.curveGrip.ownsTarget(g))},s.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},s.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(g,G){K.prototype.pointerDown.call(this,g,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=g.x,this.curveY=g.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},s.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setupControlBox=function(){K.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},s.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,K.prototype.addControlGrips.call(this)},s.prototype.positionGrips=function(){K.prototype.positionGrips.call(this);var g=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-g/2,this.curveY-g/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},s.prototype.manipulate=function(g){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+g.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+g.y-this.manipulationStartY),K.prototype.manipulate.call(this,g)},s.prototype.resize=function(g){this.activeGrip===this.curveGrip&&(this.curveX=g.x,this.curveY=g.y),K.prototype.resize.call(this,g),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},s.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},s.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},s.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual()},s.prototype.scale=function(g,G){this.curveX=this.curveX*g,this.curveY=this.curveY*G,K.prototype.scale.call(this,g,G)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},K.prototype.getState.call(this));return g.typeName=s.typeName,g},s.prototype.restoreState=function(g){K.prototype.restoreState.call(this,g);var G=g;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},s.typeName="CurveMarker",s.title="Curve marker",s.icon='',s}(ut),Et=function(){function K(s,g){g===void 0&&(g=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=s,this.cancelable=g}return Object.defineProperty(K.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),K.prototype.preventDefault=function(){this._defaultPrevented=!0},K}(),ft=function(K){function s(g,G,J){var z=K.call(this,g,!1)||this;return z.dataUrl=G,z.state=J,z}return Ce(s,K),s}(Et),it=function(K){function s(g,G,J){J===void 0&&(J=!1);var z=K.call(this,g,J)||this;return z.marker=G,z}return Ce(s,K),s}(Et),Rt=function(){function K(){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 K.prototype.addEventListener=function(s,g){this[s].push(g)},K.prototype.removeEventListener=function(s,g){var G=this[s].indexOf(g);G>-1&&this[s].splice(G,1)},K}(),pt=function(){function K(s){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Me,this._isOpen=!1,this.undoRedoManager=new Dt,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 Rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=K.instanceCounter++,this.styles=new we(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=s,this.targetRoot=document.body,this.width=s.clientWidth,this.height=s.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(K.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,Se,be,Ke,vt,Pe,le,ke,Xe,re,lt,Ge]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,Se,be,Ke,Pe,le,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,Se,be,Ke,le]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(s){var g=this;this._availableMarkerTypes.splice(0),s.forEach(function(G){if(typeof G=="string"){var J=g.ALL_MARKER_TYPES.find(function(z){return z.typeName===G});J!==void 0&&g._availableMarkerTypes.push(J)}else g._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(s){this._zoomLevel=s,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),K.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},K.prototype.show=function(){var s=this;this.styles.styleSheetRoot===void 0&&ae.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ae.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(g){return g(new Et(s))})},K.prototype.render=function(){return Te(this,void 0,void 0,function(){var s;return me(this,function(g){switch(g.label){case 0:return this.setCurrentMarker(),(s=new de).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.markersOnly=this.renderMarkersOnly,s.width=this.renderWidth,s.height=this.renderHeight,[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return g.sent(),[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,g.sent()]}})})},K.prototype.close=function(s){var g=this;if(s===void 0&&(s=!1),this.isOpen){var G=!1;s||this.eventListeners.beforeclose.forEach(function(J){var z=new Et(g,!0);J(z),z.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(J){return J(new Et(g))}),this.detachEvents(),this._isOpen=!1)}},K.prototype.addMarkersToToolbar=function(){for(var s,g=[],G=0;Gthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*s:this.editorCanvas.clientWidth,G=g',s.title="Powered by marker.js",s.style.display="grid",s.style.alignItems="center",s.style.justifyItems="center",s.style.padding="3px",s.style.width="20px",s.style.height="20px",this.logoUI.appendChild(s),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},K.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")},K.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"},K.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},K.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Oe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(s),1),s.dispose()},K.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())},K.prototype.toolbarButtonClicked=function(s,g){if(s==="marker"&&g!==void 0)this.createNewMarker(g);else if(s==="action")switch(g){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},K.prototype.deleteSelectedMarker=function(){var s=this;if(this._currentMarker!==void 0){var g=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var z=new it(s,s._currentMarker,!0);J(z),z.defaultPrevented&&(g=!0)}),!g){var G=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(J){return J(new it(s,G))})}}},K.prototype.clear=function(){var s=this,g=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var He=new it(s,void 0,!0);ye(He),He.defaultPrevented&&(g=!0)}),!g)){this.setCurrentMarker();for(var G=function(ye){var He=J.markers[ye];J.setCurrentMarker(J.markers[ye]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(_e){return _e(new it(s,He))})},J=this,z=this.markers.length-1;z>=0;z--)G(z);this.addUndoStep()}},Object.defineProperty(K.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),K.prototype.showNotesEditor=function(){var s;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(s=this._currentMarker.notes)!==null&&s!==void 0?s:"",this.overlayContainer.appendChild(this.notesArea))},K.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)},K.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},K.prototype.addUndoStep=function(){var s=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var g=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===g.width&&G.height===g.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(g),J1&&this.panTo({x:s.clientX,y:s.clientY}))},K.prototype.onPointerUp=function(s){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(s.clientX,s.clientY)),this.isDragging=!1,this.addUndoStep()},K.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},K.prototype.onKeyUp=function(s){this._currentMarker===void 0||this.notesArea!==void 0||s.key!=="Delete"&&s.key!=="Backspace"||this.deleteSelectedMarker()},K.prototype.clientToLocalCoordinates=function(s,g){var G=this.markerImage.getBoundingClientRect();return{x:(s-G.left)/this.zoomLevel,y:(g-G.top)/this.zoomLevel}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},K.prototype.addLicenseKey=function(s){te.addKey(s)},K.prototype.addEventListener=function(s,g){this.eventListeners.addEventListener(s,g)},K.prototype.removeEventListener=function(s,g){this.eventListeners.removeEventListener(s,g)},K.prototype.renderState=function(s){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(s),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(K.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),K.prototype.focus=function(){var s=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(g){return g(new Et(s))}))},K.prototype.blur=function(){var s=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(g){return g(new Et(s))}))},K.instanceCounter=0,K}();/* **********************************
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(K,s){return(At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,G){g.__proto__=G}||function(g,G){for(var J in G)Object.prototype.hasOwnProperty.call(G,J)&&(g[J]=G[J])})(K,s)};function Lt(K,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function g(){this.constructor=K}At(K,s),K.prototype=s===null?Object.create(s):(g.prototype=s.prototype,new g)}function Ze(K,s,g,G){return new(g||(g=Promise))(function(J,z){function ye(mt){try{_e(G.next(mt))}catch(ze){z(ze)}}function He(mt){try{_e(G.throw(mt))}catch(ze){z(ze)}}function _e(mt){var ze;mt.done?J(mt.value):(ze=mt.value,ze instanceof g?ze:new g(function(wt){wt(ze)})).then(ye,He)}_e((G=G.apply(K,s||[])).next())})}function ir(K,s){var g,G,J,z,ye={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return z={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function He(_e){return function(mt){return function(ze){if(g)throw new TypeError("Generator is already executing.");for(;ye;)try{if(g=1,G&&(J=2&ze[0]?G.return:ze[0]?G.throw||((J=G.return)&&J.call(G),0):G.next)&&!(J=J.call(G,ze[1])).done)return J;switch(G=0,J&&(ze=[2&ze[0],J.value]),ze[0]){case 0:case 1:J=ze;break;case 4:return ye.label++,{value:ze[1],done:!1};case 5:ye.label++,G=ze[1],ze=[0];continue;case 7:ze=ye.ops.pop(),ye.trys.pop();continue;default:if(!(J=ye.trys,(J=J.length>0&&J[J.length-1])||ze[0]!==6&&ze[0]!==2)){ye=0;continue}if(ze[0]===3&&(!J||ze[1]>J[0]&&ze[1]0&&g>0){var G=new jr(s,g),J=G.ratio>=1?20:G.getHorizontalLength(20),z=G.ratio<1?20:G.getVerticalLength(20),ye=document.createElementNS("http://www.w3.org/2000/svg","svg");ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),ye.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ye);var He=yt.createDefs();ye.appendChild(He);var _e=yt.createElement("clipPath",[["id","text-bg-clip"]]);He.appendChild(_e);var mt=yt.createPath(yt.getHollowRectanglePath((24-J)/2,(24-z)/2,J,z,(24-J)/2+2,(24-z)/2+2,J-4,z-4));ye.appendChild(mt);var ze=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ze.appendChild(yt.createTSpan(s+":"+g)),ye.appendChild(ze);var wt=ze.getBBox();yt.setAttributes(ze,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var Nt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return _e.appendChild(Nt),yt.setAttributes(mt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ye),ye.outerHTML}return''},K}(),Lr=function(K){function s(g,G,J){var z=K.call(this,g,G)||this;return z.isDropdownOpen=!1,z.onClick=z.dropdownButtonClicked,z.dropdownButtons=J,z}return Lt(s,K),s.prototype.setupDropdown=function(){var g=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(G){G.className=g.className,G.colorsClassName=g.colorsClassName,g.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},s.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},s.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},s.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},s.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},s.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},s}(Bt),Pt=function(){function K(s,g){this.GRIP_SIZE=10,this.color=s,this.fillColor=g,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},K.prototype.setCenter=function(s,g){this.visual.childNodes.forEach(function(G){return yt.setAttributes(G,[["cx",s.toString()],["cy",g.toString()]])})},K}(),Xr=function(){function K(s,g,G,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=s,this.canvasHeight=g,this.margin=G,this.container=J,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(K.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(s){this._aspectRatio=s,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(s){this._zoomFactor=s,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),K.prototype.open=function(){var s=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var g=0;gthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-g.height/2),yt.setAttributes(this.cropRectElement,[["x",g.x.toString()],["y",g.y.toString()],["width",g.width.toString()],["height",g.height.toString()]]);var G=g.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,ye){var He=g.y+G*(ye+1);yt.setAttributes(z,[["x1",""+g.x],["y1",""+He],["x2",""+(g.x+g.width)],["y2",""+He]])});var J=g.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,ye){var He=g.x+J*(ye+1);yt.setAttributes(z,[["x1",""+He],["y1",""+g.y],["x2",""+He],["y2",""+(g.y+g.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,g.x,g.y,g.width,g.height)]]),this.topLeftGrip.setCenter(g.x,g.y),this.topRightGrip.setCenter(g.x+g.width,g.y),this.bottomLeftGrip.setCenter(g.x,g.y+g.height),this.bottomRightGrip.setCenter(g.x+g.width,g.y+g.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},K.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)},K.prototype.clientToLocalCoordinates=function(s,g){var G=this.container.getBoundingClientRect();return{x:s-G.left+this.margin,y:g-G.top+this.margin}},K.prototype.onPointerDown=function(s){this.container.setPointerCapture(s.pointerId),this.previousPoint=this.clientToLocalCoordinates(s.clientX,s.clientY),this.cropRectElement===s.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(s.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(s.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(s.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(s.target)&&(this.activeGrip=this.bottomRightGrip)},K.prototype.onPointerMove=function(s){if(this.isMoving)this.move(this.clientToLocalCoordinates(s.clientX,s.clientY));else if(this.activeGrip){var g=this.clientToLocalCoordinates(s.clientX,s.clientY);this.resize(g)}s.preventDefault()},K.prototype.onPointerUp=function(s){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(s.pointerId)},K.prototype.move=function(s){var g=s.x-this.previousPoint.x,G=s.y-this.previousPoint.y;this.zoomFactor!==1&&(g=-g/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+g),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+G),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=s},K.prototype.resize=function(s){var g=Object.assign({},this.cropRect),G=s.x-this.previousPoint.x,J=s.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:g.x+Gthis.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-g.width),g.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(g.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),g.height=this.aspectRatio.getVerticalLength(g.width)):(g.y+=J,g.height=this.cropRect.y+this.cropRect.height-g.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?g.height=this.aspectRatio.getVerticalLength(g.width):g.height+=J}g.width<10&&(g.x=this.cropRect.x,g.width=10),g.height<10&&(g.y=this.cropRect.y,g.height=10),this.previousPoint=s,g.x>=this.margin&&g.y>=this.margin&&g.x-this.margin+g.width<=this.canvasWidth&&g.y-this.margin+g.height<=this.canvasHeight&&(this.cropRect=g,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},K.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var s=this.cropRect.x+this.cropRect.width/2,g=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);G/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=s-this.cropRect.width/2,this.cropRect.y=g-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},K.prototype.getRescaledRect=function(s,g,G,J,z,ye){var He=G/s,_e=J/g;return{x:(z.x-ye)*He+ye,y:(z.y-ye)*_e+ye,width:z.width*He,height:z.height*_e}},K.prototype.scaleCanvas=function(s,g){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,s,g,this.cropRect,this.margin);this.canvasWidth=s,this.canvasHeight=g,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},K}(),ui=function(){function K(s){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=s,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(K.prototype,"angle",{get:function(){return this._angle},set:function(s){this._angle=s,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),K.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},K.prototype.onPointerDown=function(s){this.controlContainer.setPointerCapture(s.pointerId),this.isDragging=!0,this.previousPoint={x:s.clientX,y:s.clientY}},K.prototype.onPointerMove=function(s){this.isDragging&&(this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.previousPoint.x=s.clientX)},K.prototype.onPointerUp=function(s){this.isDragging&&this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(s.pointerId)},K.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var s=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-s.width)/2).toString()],["y",(this.height/2).toString()]])}},K.prototype.positionScaleShape=function(){if(this.scaleShape){var s=this.scaleShape.transform.baseVal.getItem(0);s.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(s,0)}},K.prototype.getVisual=function(){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",this.width+"px"),s.setAttribute("height",this.height+"px"),s.setAttribute("viewBox","0 0 "+this.width+" "+this.height),s.style.flexShrink="0",document.body.appendChild(s);for(var g="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var J=G%5==0?this.height/3:this.height/6;g+="h4v"+-J+"h1v"+J}g+="v1H0Z",this.scaleShape=yt.createPath(g);var z=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(z),s.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ye=yt.createTSpan("");return ye.innerHTML="°",this.angleLabelElement.appendChild(ye),s.appendChild(this.angleLabelElement),document.body.removeChild(s),s},K}(),gi=function(){function K(){this.naturalSize=!1,this.imageType="image/png"}return K.prototype.rasterize=function(s,g,G,J,z,ye,He){var _e=this;return new Promise(function(mt){var ze=document.createElement("canvas");ze.width=s.width.baseVal.value-2*J,ze.height=s.height.baseVal.value-2*J;var wt=1,Nt=1;_e.naturalSize===!0?(wt=g.naturalWidth/(s.width.baseVal.value-2*J)/ye,Nt=g.naturalHeight/(s.height.baseVal.value-2*J)/He,ze.width=g.naturalWidth/ye,ze.height=g.naturalHeight/He):_e.width!==void 0&&_e.height!==void 0&&(wt=_e.width/G.width,Nt=_e.height/G.height,ze.width*=wt,ze.height*=Nt);var Gt=ze.getContext("2d");Gt.translate(ze.width/2,ze.height/2),Gt.rotate(z*Math.PI/180),Gt.scale(ye,He),Gt.translate(-ze.width/2,-ze.height/2),Gt.drawImage(g,0,0,ze.width,ze.height);var Wr=document.createElement("canvas");Wr.width=G.width*wt,Wr.height=G.height*Nt,Wr.getContext("2d").putImageData(Gt.getImageData((G.x-J)*wt,(G.y-J)*Nt,G.width*wt,G.height*Nt),0,0),mt(Wr.toDataURL(_e.imageType,_e.imageQuality))})},K}(),Ye=function(){function K(s){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=K.instanceCounter++,this.styles=new Wt(this.instanceNo),this.target=s,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(s){this._zoomToCropEnabled=s,s?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"gridLines",{get:function(){return this._gridLines},set:function(s){this._gridLines=s,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(s){this._rotationAngle=s,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"aspectRatio",{get:function(){var s;return(s=this._aspectRatio)!==null&&s!==void 0?s:this.aspectRatios[0]},set:function(s){this._aspectRatio=s},enumerable:!1,configurable:!0}),K.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},K.prototype.show=function(){this.showUI(),this.open()},K.prototype.close=function(s){s===void 0&&(s=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),s||this.closeEventListeners.forEach(function(g){return g()}),this._isOpen=!1)},K.prototype.addRenderEventListener=function(s){this.renderEventListeners.push(s)},K.prototype.removeRenderEventListener=function(s){this.renderEventListeners.indexOf(s)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(s),1)},K.prototype.addCloseEventListener=function(s){this.closeEventListeners.push(s)},K.prototype.removeCloseEventListener=function(s){this.closeEventListeners.indexOf(s)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(s),1)},K.prototype.setupResizeObserver=function(){var s=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},K.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var s=1*this.target.clientWidth/this.target.clientHeight,g=this.contentDiv.clientWidth/s>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*s:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=g+2*this.CANVAS_MARGINs+this.CANVAS_MARGIN?this.target.offsetTop-(s+this.CANVAS_MARGIN):0;this.coverDiv.style.top=g+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},K.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},K.prototype.addTopToolbar=function(){var s=this;this.topToolbar=new Cr,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var g=new Vr;g.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(g);var G=[];this.aspectRatios.forEach(function(Nt){var Gt=new Bt(li.getIcon(Nt.horizontal,Nt.vertical),Nt.horizontal===0&&Nt.vertical===0?"FREE":Nt.horizontal+":"+Nt.vertical);Gt.onClick=function(){return s.ratioButtonClicked(Nt)},G.push(Gt)}),this.aspectRatioButton=new Lr(li.getIcon(0,0),"Aspect ratio",G),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,g.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new Bt('',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){s.isGridVisible=!s.isGridVisible,J.isActive=s.isGridVisible},g.addButton(J);var z=new Bt('',"Zoom to selection");if(z.isActive=this.zoomToCropEnabled,z.onClick=function(){s.zoomToCropEnabled=!s.zoomToCropEnabled,z.isActive=s.zoomToCropEnabled},g.addButton(z),!Zt.isLicensed){var ye=new gt;this.topToolbar.addElementBlock(ye);var He=document.createElement("div");He.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var _e=document.createElement("a");_e.style.color="currentColor",_e.href="https://markerjs.com/products/cropro",_e.target="_blank",_e.innerHTML='',He.appendChild(_e),ye.addElement(He)}var mt=new Vr;mt.minWidth=3*this.toolbarHeight+"px",mt.contentAlign="end",this.topToolbar.addButtonBlock(mt);var ze=new Bt('',"OK");ze.onClick=this.startRenderAndClose,mt.addButton(ze),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ze.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new Bt('',"Close");wt.onClick=this.close,mt.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},K.prototype.addBottomToolbar=function(){var s=this;this.bottomToolbar=new Cr,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var g=new Vr;g.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(g);var G=new Bt('',"Rotate left");G.onClick=this.rotateLeftButtonClicked,g.addButton(G);var J=new Bt('',"Rotate right");J.onClick=this.rotateRightButtonClicked,g.addButton(J);var z=new gt;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new ui("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(mt){s.rotateBy(mt),s.straightener.angle=s.rotationAngle},z.addElement(this.straightener.getUI());var ye=new Vr;ye.minWidth=2*this.toolbarHeight+"px",ye.contentAlign="end",this.bottomToolbar.addButtonBlock(ye);var He=new Bt('',"Flip horizontal");He.onClick=this.flipHorizontallyButtonClicked,ye.addButton(He);var _e=new Bt('',"Flip vertical");_e.onClick=this.flipVerticallyButtonClicked,ye.addButton(_e)},K.prototype.ratioButtonClicked=function(s){this.aspectRatio=s,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},K.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=li.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},K.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new jr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},K.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},K.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},K.prototype.restoreState=function(s){if(s){var g=this.cropLayer.getRescaledRect(s.width,s.height,this.imageWidth,this.imageHeight,s.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(g),this.cropRectChanged(g),this.flippedHorizontally=s.flippedHorizontally,this.flippedVertically=s.flippedVertically,this.applyFlip(),this.rotationAngle=s.rotationAngle,this.applyRotation()}},K.prototype.clientToLocalCoordinates=function(s,g){var G=this.cropImage.getBoundingClientRect();return{x:s-G.left,y:g-G.top}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var s=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},K.prototype.rotateLeftButtonClicked=function(){var s=this.rotationAngle-90;this.rotationAngle%90!=0&&(s+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(s)},K.prototype.rotateRightButtonClicked=function(){var s=this.rotationAngle+90;this.rotationAngle%90!=0&&(s-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(s)},K.prototype.rotateTo=function(s){s=(s=s>180?s-360:s)<=-180?s+360:s,this.rotationAngle=s,this.applyRotation()},K.prototype.rotateBy=function(s){this.rotateTo((this.rotationAngle+s)%360)},K.prototype.applyRotation=function(){var s=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var g=this.editingTargetRotationContainer.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(g,0);var G=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/G.width,this.imageHeight/G.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=s},K.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},K.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},K.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},K.prototype.startRenderAndClose=function(){return Ze(this,void 0,void 0,function(){var s,g;return ir(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return s=G.sent(),g=this.getState(),this.renderEventListeners.forEach(function(J){return J(s,g)}),this.close(!0),[2]}})})},K.prototype.render=function(){return Ze(this,void 0,void 0,function(){var s;return ir(this,function(g){switch(g.label){case 0:return(s=new gi).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.width=this.renderWidth,s.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,s.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return g.sent(),[4,s.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,g.sent()]}})})},K.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ar("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 ar("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ar("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var s=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ar("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*s)+`px;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ar("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ar("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new nr("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new nr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ar("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 ar("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ar("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 ar("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ar("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},K.instanceCounter=0,K}(),Tt=se("8hTe"),ti=se.n(Tt),di=/]*>/g;function hi(K){var s=document.createElement("div");return s.innerHTML=K,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var Ri=at.a=function(K){var s=K.value,g=s===void 0?"":s,G=K.edit,J=G===void 0?!1:G,z=K.className,ye=K.showTextOnly,He=K.showLines,_e=K.replaces,mt=K.zoomImg,ze=K.hasMask,wt=K.style,Nt=wt===void 0?{}:wt,Gt=K.stylesPrev,Wr=Gt===void 0?{}:Gt,Hr=String(g),hr=Object(A.useRef)(),Yr=Object(A.useRef)(),Ki=Object(A.useState)(""),kr=Object(j.a)(Ki,2),Dr=kr[0],ri=kr[1],vi=Object(A.useState)("office"),Qr=Object(j.a)(vi,2),ii=Qr[0],Gr=Qr[1],fn=function(){var Ft=new Ye(Yr.current);Ft.displayMode="popup",Ft.addRenderEventListener(function(){var vr=Object(_.a)(O.a.mark(function jt(yr){var Yt;return O.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return hr.current.style.display="none",lr.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yr}});case 3:Yt=lr.sent,Yt!=null&&Yt.id&&_e(Yr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 5:case"end":return lr.stop()}},jt)}));return function(jt){return vr.apply(this,arguments)}}()),Ft.show()},Vi=function(){var Ft=new pt(Yr.current);Ft.settings.displayMode="popup",Ft.addEventListener("render",function(){var vr=Object(_.a)(O.a.mark(function jt(yr){var Yt;return O.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:if(hr.current.style.display="none",!Yr.current){lr.next=6;break}return lr.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yr.dataUrl}});case 4:Yt=lr.sent,Yt!=null&&Yt.id&&_e(Yr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 6:case"end":return lr.stop()}},jt)}));return function(jt){return vr.apply(this,arguments)}}()),Ft.show(),window.markerArea=Ft},Ir=Object(A.useMemo)(function(){try{var tr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hr=Hr.replace(tr,"("+ee.a.API_SERVER+"/api/attachments/").replace(Ft,'"'+ee.a.API_SERVER+"/api/attachments/").replace(vr,'"'+ee.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Hr=Hr.replace(new RegExp("(?[TOC]
",D()),L()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(yi,lr){var ur=yr[lr],ni=ur.type,bi=ur.expression;return Object(oe.renderToString)(hi(bi)||"",{displayMode:ni==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),S(),ye){var Yt=document.createElement("div");return Yt.innerHTML=jt,Yt.innerText}return setTimeout(function(){return Oi()},500),jt},[Hr]),Nr=Object(A.useRef)();f.WebkitLineClamp=He,He&&(Nt=Object(U.a)(Object(U.a)({},Nt),f));function _i(tr){var Ft=tr.target;if(Ft.tagName.toUpperCase()==="IMG"){if(mt){var vr=Ft.getAttribute("src");ri(vr),Gr("image")}}else if(Ft.tagName.toUpperCase()==="A"){var jt=Ft.getAttribute("href");if(jt.indexOf("office")>-1)tr.preventDefault(),ri(jt),Gr("office");else if(jt.indexOf("application/pdf")>-1)tr.preventDefault(),ri(jt),Gr("pdf");else if(jt.indexOf("type=text")>-1)tr.preventDefault(),ri(jt),Gr("html");else if(jt.startsWith("#")){tr.preventDefault();var yr=document.getElementById(jt.replace("#",""));yr&&yr.scrollIntoView(!0)}}}var Oi=function(){var Ft,vr=(Ft=Nr.current)===null||Ft===void 0?void 0:Ft.querySelectorAll("video");vr==null||vr.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var yr=new X.a;yr.loadSource(jt.src),yr.attachMedia(jt)}}})};Object(A.useEffect)(function(){if(Nr.current&&Ir&&(Ir.match(di)&&window.PR.prettyPrint()),Nr.current)return Nr.current.addEventListener("click",_i),function(){Nr.current.removeEventListener("click",_i),S(),L()}},[Ir,Nr.current,_i]);var Mi=function(Ft){if(!J)return;Ft.target.nodeName==="IMG"?(hr.current.style.display="flex",hr.current.style.width=Ft.target.clientWidth+"px",hr.current.style.height=Ft.target.clientHeight+"px",hr.current.style.top=Ft.target.offsetTop+"px",hr.current.style.left=Ft.target.offsetLeft+"px",Yr.current.src=Ft.target.getAttribute("src")):hr.current.style.display="none"};return c.a.createElement("div",{style:{position:"relative"}},c.a.createElement("div",{ref:Nr,style:Object(U.a)({},Nt),className:"".concat(z||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Mi,dangerouslySetInnerHTML:{__html:Ir}}),c.a.createElement("div",{ref:hr,className:ti.a.button},c.a.createElement($.a,null,c.a.createElement(Q.a,{onClick:function(){return fn()}},"\u88C1\u526A"),c.a.createElement(Q.a,{onClick:function(){return Vi()}},"\u7F16\u8F91"))),c.a.createElement("img",{ref:Yr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),c.a.createElement(ce.a,{close:!0,data:Dr,hasMask:ze,type:Dr!=null&&Dr.length?ii:"",style:Object(U.a)({},Wr),onClose:function(){return ri("")}}))}},"9VGf":function(ht,at,se){"use strict";se.d(at,"a",function(){return R});var ne=se("q1tI"),$=se.n(ne);function R(Q,U){var _=Object(ne.useRef)();Object(ne.useEffect)(function(){_.current=Q}),Object(ne.useEffect)(function(){function j(){_.current()}if(U!==null){var F=setInterval(j,U);return function(){return clearInterval(F)}}},[U])}},BU3w:function(ht,at,se){"use strict";se.d(at,"a",function(){return _});var ne=se("MNnm"),$="rc-util-key";function R(j){if(j.attachTo)return j.attachTo;var F=document.querySelector("head");return F||document.body}function Q(j){var F,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var A=document.createElement("style");if((F=O.csp)===null||F===void 0?void 0:F.nonce){var c;A.nonce=(c=O.csp)===null||c===void 0?void 0:c.nonce}A.innerHTML=j;var x=R(O),M=x.firstChild;return O.prepend&&x.prepend?x.prepend(A):O.prepend&&M?x.insertBefore(A,M):x.appendChild(A),A}var U=new Map;function _(j,F){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=R(O);if(!U.has(A)){var c=Q("",O),x=c.parentNode;U.set(A,x),x.removeChild(c)}var M=Array.from(U.get(A).children).find(function(a){return a.tagName==="STYLE"&&a[$]===F});if(M){var w,E;if(((w=O.csp)===null||w===void 0?void 0:w.nonce)&&M.nonce!==((E=O.csp)===null||E===void 0?void 0:E.nonce)){var b;M.nonce=(b=O.csp)===null||b===void 0?void 0:b.nonce}return M.innerHTML!==j&&(M.innerHTML=j),M}var u=Q(j,O);return u[$]=F,u}},Bd2K:function(ht,at,se){(function(ne){ne(se("VrN/"),se("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(O,A,c){if(c!=ne.Init&&c&&O.removeKeyMap("autoCloseTags"),!A)return;var x={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(x["'/'"]=function(M){return _(M)}),(typeof A!="object"||A.whenOpening!==!1)&&(x["'>'"]=function(M){return Q(M)}),O.addKeyMap(x)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Q(O){if(O.getOption("disableInput"))return ne.Pass;for(var A=O.listSelections(),c=[],x=O.getOption("autoCloseTags"),M=0;Mw.ch&&(l=l.slice(0,l.length-E.end+w.ch));var p=l.toLowerCase();if(!l||E.type=="string"&&(E.end!=w.ch||!/[\"\']/.test(E.string.charAt(E.string.length-1))||E.string.length==1)||E.type=="tag"&&a.close||E.string.indexOf("/")==w.ch-E.start-1||L&&j(L,p)>-1||F(O,b.mode.xmlCurrentContext&&b.mode.xmlCurrentContext(u)||[],l,w,!0))return ne.Pass;var D=typeof x=="object"&&x.emptyTags;if(D&&j(D,l)>-1){c[M]={text:"/>",newPos:ne.Pos(w.line,w.ch+2)};continue}var C=f&&j(f,p)>-1;c[M]={indent:C,text:">"+(C?`
`:"")+""+l+">",newPos:C?ne.Pos(w.line+1,0):ne.Pos(w.line,w.ch+1)}}for(var m=typeof x=="object"&&x.dontIndentOnAutoClose,M=A.length-1;M>=0;M--){var v=c[M];O.replaceRange(v.text,A[M].head,A[M].anchor,"+insert");var h=O.listSelections().slice(0);h[M]={head:v.newPos,anchor:v.newPos},O.setSelections(h),!m&&v.indent&&(O.indentLine(v.newPos.line,null,!0),O.indentLine(v.newPos.line+1,null,!0))}}function U(O,A){for(var c=O.listSelections(),x=[],M=A?"/":"",w=O.getOption("autoCloseTags"),E=typeof w=="object"&&w.dontIndentOnSlash,b=0;b"&&(L+=">"),x[b]=L}if(O.replaceSelections(x),c=O.listSelections(),!E)for(var b=0;b=0&&A[u]==c;u--)++b;x=E.to;for(var u=1;u0){for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:"",A=[],c=0;c=0)continue;if(!Object.prototype.propertyIsEnumerable.call(y,W))continue;B[W]=y[W]}}return B}function _(y,P){if(y==null)return{};var B={},W=Object.keys(y),V,I;for(I=0;I=0)continue;B[V]=y[V]}return B}function j(y,P){if(!(y instanceof P))throw new TypeError("Cannot call a class as a function")}function F(y,P){for(var B=0;B>6),P+=String.fromCharCode(128|W&63)):W<55296||W>=57344?(P+=String.fromCharCode(224|W>>12),P+=String.fromCharCode(128|W>>6&63),P+=String.fromCharCode(128|W&63)):(B++,W=65536+((W&1023)<<10|y.charCodeAt(B)&1023),P+=String.fromCharCode(240|W>>18),P+=String.fromCharCode(128|W>>12&63),P+=String.fromCharCode(128|W>>6&63),P+=String.fromCharCode(128|W&63))}return P}var L={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},f={},p=4,D=.1;function C(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=[];return y.forEach(function(W,V){var I=null;W.forEach(function(N,X){if(!N&&I!==null){B.push("M".concat(I+P," ").concat(V+P,"h").concat(X-I,"v1H").concat(I+P,"z")),I=null;return}if(X===W.length-1){if(!N)return;I===null?B.push("M".concat(X+P,",").concat(V+P," h1v1H").concat(X+P,"z")):B.push("M".concat(I+P,",").concat(V+P," h").concat(X+1-I,"v1H").concat(I+P,"z"));return}N&&I===null&&(I=X)})}),B.join("")}function m(y,P){return y.slice().map(function(B,W){return W=P.y+P.h?B:B.map(function(V,I){return I=P.x+P.w?V:!1})})}function v(y,P){var B=y.imageSettings,W=y.size,V=y.includeMargin;if(B==null)return null;var I=V?p:0,N=P.length+I*2,X=Math.floor(W*D),ee=N/W,oe=(B.width||X)*ee,ce=(B.height||X)*ee,De=B.x==null?P.length/2-oe/2:B.x*ee,Ee=B.y==null?P.length/2-ce/2:B.y*ee,Ce=null;if(B.excavate){var Te=Math.floor(De),me=Math.floor(Ee),pe=Math.ceil(oe+De-Te),ue=Math.ceil(ce+Ee-me);Ce={x:Te,y:me,w:pe,h:ue}}return{x:De,y:Ee,h:ce,w:oe,excavation:Ce}}var h=function(){try{new Path2D().addPath(new Path2D)}catch(y){return!1}return!0}(),o=function(y){M(P,y);function P(){var B,W;j(this,P);for(var V=arguments.length,I=new Array(V),N=0;NSe.length)&&(ve=Se.length);for(var be=0,re=new Array(ve);be=Se.length?{done:!0}:{done:!1,value:Se[re++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return be=Se[Symbol.iterator](),be.next.bind(be)}function _(Se,ve){return ve={exports:{}},Se(ve,ve.exports),ve.exports}var j=_(function(Se){function ve(){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 be(re){Se.exports.defaults=re}Se.exports={defaults:ve(),getDefaults:ve,changeDefaults:be}}),F=j.defaults,O=j.getDefaults,A=j.changeDefaults,c=/[&<>"']/,x=/[&<>"']/g,M=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,E={"&":"&","<":"<",">":">",'"':""","'":"'"},b=function(ve){return E[ve]};function u(Se,ve){if(ve){if(c.test(Se))return Se.replace(x,b)}else if(M.test(Se))return Se.replace(w,b);return Se}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Se){return Se.replace(a,function(ve,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var d=/(^|[^\[])\^/g;function L(Se,ve){Se=Se.source||Se,ve=ve||"";var be={replace:function(ie,le){return le=le.source||le,le=le.replace(d,"$1"),Se=Se.replace(ie,le),be},getRegex:function(){return new RegExp(Se,ve)}};return be}var f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Se,ve,be){if(Se){var re;try{re=decodeURIComponent(l(be)).replace(f,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ve&&!p.test(be)&&(be=o(ve,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(ie){return null}return be}var C={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(Se,ve){C[" "+Se]||(m.test(Se)?C[" "+Se]=Se+"/":C[" "+Se]=P(Se,"/",!0)),Se=C[" "+Se];var be=Se.indexOf(":")===-1;return ve.substring(0,2)==="//"?be?ve:Se.replace(v,"$1")+ve:ve.charAt(0)==="/"?be?ve:Se.replace(h,"$1")+ve:Se+ve}var T={exec:function(){}};function S(Se){for(var ve=1,be,re;ve=0&&ke[Xe]==="\\";)Pe=!Pe;return Pe?"|":" |"}),re=be.split(/ \|/),ie=0;if(re.length>ve)re.splice(ve);else for(;re.length=re.length?ie.slice(re.length):ie}).join(`
`)}var Ee=function(){function Se(be){this.options=be||I}var ve=Se.prototype;return ve.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ve.code=function(re,ie){var le=this.rules.block.code.exec(re);if(le){var he=ie[ie.length-1];if(he&&he.type==="paragraph")return{raw:le[0],text:le[0].trimRight()};var ke=le[0].replace(/^ {4}/gm,"");return{type:"code",raw:le[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:N(ke,`
`)}}},ve.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var le=ie[0],he=De(le,ie[3]||"");return{type:"code",raw:le,lang:ie[2]?ie[2].trim():ie[2],text:he}}},ve.heading=function(re){var ie=this.rules.block.heading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ve.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var le={type:"table",header:X(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(le.header.length===le.align.length){var he=le.align.length,ke;for(ke=0;ke ?/gm,"");return{type:"blockquote",raw:ie[0],text:le}}},ve.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var le=ie[0],he=ie[2],ke=he.length>1,Pe=he[he.length-1]===")",Xe={type:"list",raw:le,ordered:ke,start:ke?+he.slice(0,-1):"",loose:!1,items:[]},vt=ie[0].match(this.rules.block.item),Dt=!1,Ge,Et,ft,it,Rt,pt,At,Lt=vt.length,Ze=0;Ze1||this.options.smartLists&&ft!==he)&&(it=vt.slice(Ze+1).join(`
`),Xe.raw=Xe.raw.substring(0,Xe.raw.length-it.length),Ze=Lt-1)),Rt=Dt||/\n\n(?!\s*$)/.test(Ge),Ze!==Lt-1&&(Dt=Ge.charAt(Ge.length-1)===`
`,Rt||(Rt=Dt)),Rt&&(Xe.loose=!0),pt=/^\[[ xX]\] /.test(Ge),At=void 0,pt&&(At=Ge[1]!==" ",Ge=Ge.replace(/^\[[ xX]\] +/,"")),Xe.items.push({type:"list_item",raw:le,task:pt,checked:At,loose:Rt,text:Ge});return Xe}},ve.html=function(re){var ie=this.rules.block.html.exec(re);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},ve.def=function(re){var ie=this.rules.block.def.exec(re);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var le=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:le,raw:ie[0],href:ie[2],title:ie[3]}}},ve.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var le={type:"table",header:X(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(le.header.length===le.align.length){le.raw=ie[0];var he=le.align.length,ke;for(ke=0;ke/i.test(he[0])&&(ie=!1),!le&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?le=!0:le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(le=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:ie,inRawBlock:le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ee(he[0]):he[0]}},ve.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var le=oe(ie[2],"()");if(le>-1){var he=ie[0].indexOf("!")===0?5:4,ke=he+ie[1].length+le;ie[2]=ie[2].substring(0,le),ie[0]=ie[0].substring(0,ke).trim(),ie[3]=""}var Pe=ie[2],Xe="";if(this.options.pedantic){var vt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Pe);vt?(Pe=vt[1],Xe=vt[3]):Xe=""}else Xe=ie[3]?ie[3].slice(1,-1):"";Pe=Pe.trim().replace(/^<([\s\S]*)>$/,"$1");var Dt=ce(ie,{href:Pe&&Pe.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},ie[0]);return Dt}},ve.reflink=function(re,ie){var le;if((le=this.rules.inline.reflink.exec(re))||(le=this.rules.inline.nolink.exec(re))){var he=(le[2]||le[1]).replace(/\s+/g," ");if(he=ie[he.toLowerCase()],!he||!he.href){var ke=le[0].charAt(0);return{type:"text",raw:ke,text:ke}}var Pe=ce(le,he,le[0]);return Pe}},ve.strong=function(re,ie,le){le===void 0&&(le="");var he=this.rules.inline.strong.start.exec(re);if(he&&(!he[1]||he[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*re.length);var ke=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ke.lastIndex=0;for(var Pe;(he=ke.exec(ie))!=null;)if(Pe=this.rules.inline.strong.middle.exec(ie.slice(0,he.index+3)),Pe)return{type:"strong",raw:re.slice(0,Pe[0].length),text:re.slice(2,Pe[0].length-2)}}},ve.em=function(re,ie,le){le===void 0&&(le="");var he=this.rules.inline.em.start.exec(re);if(he&&(!he[1]||he[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*re.length);var ke=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ke.lastIndex=0;for(var Pe;(he=ke.exec(ie))!=null;)if(Pe=this.rules.inline.em.middle.exec(ie.slice(0,he.index+2)),Pe)return{type:"em",raw:re.slice(0,Pe[0].length),text:re.slice(1,Pe[0].length-1)}}},ve.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var le=ie[2].replace(/\n/g," "),he=/[^ ]/.test(le),ke=le.startsWith(" ")&&le.endsWith(" ");return he&&ke&&(le=le.substring(1,le.length-1)),le=ee(le,!0),{type:"codespan",raw:ie[0],text:le}}},ve.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},ve.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ve.autolink=function(re,ie){var le=this.rules.inline.autolink.exec(re);if(le){var he,ke;return le[2]==="@"?(he=ee(this.options.mangle?ie(le[1]):le[1]),ke="mailto:"+he):(he=ee(le[1]),ke=he),{type:"link",raw:le[0],text:he,href:ke,tokens:[{type:"text",raw:he,text:he}]}}},ve.url=function(re,ie){var le;if(le=this.rules.inline.url.exec(re)){var he,ke;if(le[2]==="@")he=ee(this.options.mangle?ie(le[0]):le[0]),ke="mailto:"+he;else{var Pe;do Pe=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(Pe!==le[0]);he=ee(le[0]),le[1]==="www."?ke="http://"+he:ke=he}return{type:"link",raw:le[0],text:he,href:ke,tokens:[{type:"text",raw:he,text:he}]}}},ve.inlineText=function(re,ie,le){var he=this.rules.inline.text.exec(re);if(he){var ke;return ie?ke=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ee(he[0]):he[0]:ke=ee(this.options.smartypants?le(he[0]):he[0]),{type:"text",raw:he[0],text:ke}}},Se}(),Ce=V.noopTest,Te=V.edit,me=V.merge,pe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Te(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Te(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Te(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=//,pe.html=Te(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Te(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=Te(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=me({},pe),pe.gfm=me({},pe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.nptable=Te(pe.gfm.nptable).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.table=Te(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=me({},pe.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ce,paragraph:Te(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ue.punctuation=Te(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Te(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Te(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Te(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Te(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Te(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Te(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Te(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Te(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Te(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Te(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=Te(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Te(ue.tag).replace("comment",pe._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Te(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Te(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Te(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=me({},ue),ue.pedantic=me({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=me({},ue.normal,{escape:Te(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(re="x"+re.toString(16)),ve+=""+re+";";return ve}var Oe=function(){function Se(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||de,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:ae.normal,inline:we.normal};this.options.pedantic?(re.block=ae.pedantic,re.inline=we.pedantic):this.options.gfm&&(re.block=ae.gfm,this.options.breaks?re.inline=we.breaks:re.inline=we.gfm),this.tokenizer.rules=re}Se.lex=function(re,ie){var le=new Se(ie);return le.lex(re)};var ve=Se.prototype;return ve.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(re,ie,le){ie===void 0&&(ie=[]),le===void 0&&(le=!0),re=re.replace(/^ +$/gm,"");for(var he,ke,Pe,Xe;re;){if(he=this.tokenizer.space(re)){re=re.substring(he.raw.length),he.type&&ie.push(he);continue}if(he=this.tokenizer.code(re,ie)){re=re.substring(he.raw.length),he.type?ie.push(he):(Xe=ie[ie.length-1],Xe.raw+=`
`+he.raw,Xe.text+=`
`+he.text);continue}if(he=this.tokenizer.fences(re)){re=re.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.heading(re)){re=re.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.nptable(re)){re=re.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.hr(re)){re=re.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.blockquote(re)){re=re.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],le),ie.push(he);continue}if(he=this.tokenizer.list(re)){for(re=re.substring(he.raw.length),Pe=he.items.length,ke=0;ke0)for(;(vt=this.tokenizer.rules.inline.reflinkSearch.exec(Xe))!=null;)Dt.includes(vt[0].slice(vt[0].lastIndexOf("[")+1,-1))&&(Xe=Xe.slice(0,vt.index)+"["+"a".repeat(vt[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(vt=this.tokenizer.rules.inline.blockSkip.exec(Xe))!=null;)Xe=Xe.slice(0,vt.index)+"["+"a".repeat(vt[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Pe=this.tokenizer.escape(re)){re=re.substring(Pe.raw.length),ie.push(Pe);continue}if(Pe=this.tokenizer.tag(re,le,he)){re=re.substring(Pe.raw.length),le=Pe.inLink,he=Pe.inRawBlock,ie.push(Pe);continue}if(Pe=this.tokenizer.link(re)){re=re.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,he)),ie.push(Pe);continue}if(Pe=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,he)),ie.push(Pe);continue}if(Pe=this.tokenizer.strong(re,Xe,ke)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],le,he),ie.push(Pe);continue}if(Pe=this.tokenizer.em(re,Xe,ke)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],le,he),ie.push(Pe);continue}if(Pe=this.tokenizer.codespan(re)){re=re.substring(Pe.raw.length),ie.push(Pe);continue}if(Pe=this.tokenizer.br(re)){re=re.substring(Pe.raw.length),ie.push(Pe);continue}if(Pe=this.tokenizer.del(re)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],le,he),ie.push(Pe);continue}if(Pe=this.tokenizer.autolink(re,xe)){re=re.substring(Pe.raw.length),ie.push(Pe);continue}if(!le&&(Pe=this.tokenizer.url(re,xe))){re=re.substring(Pe.raw.length),ie.push(Pe);continue}if(Pe=this.tokenizer.inlineText(re,he,Le)){re=re.substring(Pe.raw.length),ke=Pe.raw.slice(-1),ie.push(Pe);continue}if(re){var Ge="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return ie},$(Se,null,[{key:"rules",get:function(){return{block:ae,inline:we}}}]),Se}(),Ie=j.defaults,We=V.cleanUrl,Fe=V.escape,Ne=function(){function Se(be){this.options=be||Ie}var ve=Se.prototype;return ve.code=function(re,ie,le){var he=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ke=this.options.highlight(re,he);ke!=null&&ke!==re&&(le=!0,re=ke)}return he?''+(le?re:Fe(re,!0))+`
`:""+(le?re:Fe(re,!0))+`
`},ve.blockquote=function(re){return`
`+re+`
`},ve.html=function(re){return re},ve.heading=function(re,ie,le,he){return this.options.headerIds?"
`:""+re+"
`},ve.hr=function(){return this.options.xhtml?`
`:`
`},ve.list=function(re,ie,le){var he=ie?"ol":"ul",ke=ie&&le!==1?' start="'+le+'"':"";return"<"+he+ke+`>
`+re+""+he+`>
`},ve.listitem=function(re){return""+re+`
`},ve.checkbox=function(re){return" "},ve.paragraph=function(re){return""+re+`
`},ve.table=function(re,ie){return ie&&(ie=""+ie+""),`
`},ve.tablerow=function(re){return`
`+re+`
`},ve.tablecell=function(re,ie){var le=ie.header?"th":"td",he=ie.align?"<"+le+' align="'+ie.align+'">':"<"+le+">";return he+re+""+le+`>
`},ve.strong=function(re){return""+re+""},ve.em=function(re){return""+re+""},ve.codespan=function(re){return""+re+""},ve.br=function(){return this.options.xhtml?"
":"
"},ve.del=function(re){return""+re+""},ve.link=function(re,ie,le){if(re=We(this.options.sanitize,this.options.baseUrl,re),re===null)return le;var he='"+le+"",he},ve.image=function(re,ie,le){if(re=We(this.options.sanitize,this.options.baseUrl,re),re===null)return le;var he='
":">",he},ve.text=function(re){return re},Se}(),Ue=function(){function Se(){}var ve=Se.prototype;return ve.strong=function(re){return re},ve.em=function(re){return re},ve.codespan=function(re){return re},ve.del=function(re){return re},ve.html=function(re){return re},ve.text=function(re){return re},ve.link=function(re,ie,le){return""+le},ve.image=function(re,ie,le){return""+le},ve.br=function(){return""},Se}(),et=function(){function Se(){this.seen={}}var ve=Se.prototype;return ve.slug=function(re){var ie=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var le=ie;do this.seen[le]++,ie=le+"-"+this.seen[le];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},Se}(),ot=j.defaults,nt=V.unescape,qe=function(){function Se(be){this.options=be||ot,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new et}Se.parse=function(re,ie){var le=new Se(ie);return le.parse(re)};var ve=Se.prototype;return ve.parse=function(re,ie){ie===void 0&&(ie=!0);var le="",he,ke,Pe,Xe,vt,Dt,Ge,Et,ft,it,Rt,pt,At,Lt,Ze,ir,Zt,yt,Wt=re.length;for(he=0;he0&&Ze.tokens[0].type==="text"?(Ze.tokens[0].text=yt+" "+Ze.tokens[0].text,Ze.tokens[0].tokens&&Ze.tokens[0].tokens.length>0&&Ze.tokens[0].tokens[0].type==="text"&&(Ze.tokens[0].tokens[0].text=yt+" "+Ze.tokens[0].tokens[0].text)):Ze.tokens.unshift({type:"text",text:yt}):Lt+=yt),Lt+=this.parse(Ze.tokens,At),ft+=this.renderer.listitem(Lt,Zt,ir);le+=this.renderer.list(ft,Rt,pt);continue}case"html":{le+=this.renderer.html(it.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(it.tokens));continue}case"text":{for(ft=it.tokens?this.parseInline(it.tokens):it.text;he+1An error occurred:"+Qe(Pe.message+"",!0)+"
";throw Pe}}Be.options=Be.setOptions=function(Se){return st(Be.defaults,Se),ut(Be.defaults),Be},Be.getDefaults=Me,Be.defaults=lt,Be.use=function(Se){var ve=st({},Se);if(Se.renderer&&function(){var re=Be.defaults.renderer||new Ne,ie=function(ke){var Pe=re[ke];re[ke]=function(){for(var Xe=arguments.length,vt=new Array(Xe),Dt=0;Dt`,triples:"",explode:"[]{}"},R=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(E,b,u){u&&u!=ne.Init&&(E.removeKeyMap(U),E.state.closeBrackets=null),b&&(_(Q(b,"pairs")),E.state.closeBrackets=b,E.addKeyMap(U))});function Q(E,b){return b=="pairs"&&typeof E=="string"?E:typeof E=="object"&&E[b]!=null?E[b]:$[b]}var U={Backspace:O,Enter:A};function _(E){for(var b=0;b=0;l--){var L=a[l].head;E.replaceRange("",R(L.line,L.ch-1),R(L.line,L.ch+1),"+delete")}}function A(E){var b=F(E),u=b&&Q(b,"explode");if(!u||E.getOption("disableInput"))return ne.Pass;for(var a=E.listSelections(),l=0;l0;return{anchor:new R(E.anchor.line,E.anchor.ch+(b?-1:1)),head:new R(E.head.line,E.head.ch+(b?1:-1))}}function x(E,b){var u=F(E);if(!u||E.getOption("disableInput"))return ne.Pass;var a=Q(u,"pairs"),l=a.indexOf(b);if(l==-1)return ne.Pass;for(var d=Q(u,"closeBefore"),L=Q(u,"triples"),f=a.charAt(l+1)==b,p=E.listSelections(),D=l%2==0,C,m=0;m=0&&E.getRange(h,R(h.line,h.ch+3))==b+b+b?o="skipThree":o="skip";else if(f&&h.ch>1&&L.indexOf(b)>=0&&E.getRange(R(h.line,h.ch-2),h)==b+b){if(h.ch>2&&/\bstring/.test(E.getTokenTypeAt(R(h.line,h.ch-2))))return ne.Pass;o="addFour"}else if(f){var S=h.ch==0?" ":E.getRange(R(h.line,h.ch-1),h);if(!ne.isWordChar(T)&&S!=b&&!ne.isWordChar(S))o="both";else return ne.Pass}else if(D&&(T.length===0||/\s/.test(T)||d.indexOf(T)>-1))o="both";else return ne.Pass;if(!C)C=o;else if(C!=o)return ne.Pass}var y=l%2?a.charAt(l-1):b,P=l%2?b:a.charAt(l+1);E.operation(function(){if(C=="skip")E.execCommand("goCharRight");else if(C=="skipThree")for(var B=0;B<3;B++)E.execCommand("goCharRight");else if(C=="surround"){for(var W=E.getSelections(),B=0;B0&&(oe.percent=oe.loaded/oe.total*100),V.onProgress(oe)});var N=new FormData;V.data&&Object.keys(V.data).forEach(function(ee){var oe=V.data[ee];if(Array.isArray(oe)){oe.forEach(function(ce){N.append(ee+"[]",ce)});return}N.append(ee,V.data[ee])}),V.file instanceof Blob?N.append(V.filename,V.file,V.file.name):N.append(V.filename,V.file),I.onerror=function(oe){V.onError(oe)},I.onload=function(){return I.status<200||I.status>=300?V.onError(U(V,I),_(I)):V.onSuccess(_(I),I)},I.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var X=V.headers||{};return X["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(X).forEach(function(ee){X[ee]!==null&&I.setRequestHeader(ee,X[ee])}),I.send(N),{abort:function(){I.abort()}}}var F=+new Date,O=0;function A(){return"rc-upload-"+F+"-"+ ++O}function c(V,I){return V.indexOf(I,V.length-I.length)!==-1}var x=function(V,I){if(V&&I){var N=Array.isArray(I)?I:I.split(","),X=V.name||"",ee=V.type||"",oe=ee.replace(/\/.*$/,"");return N.some(function(ce){var De=ce.trim();return De.charAt(0)==="."?c(X.toLowerCase(),De.toLowerCase()):/\/\*$/.test(De)?oe===De.replace(/\/.*$/,""):ee===De})}return!0};function M(V,I){var N=V.createReader(),X=[];function ee(){N.readEntries(function(oe){var ce=Array.prototype.slice.apply(oe);X=X.concat(ce);var De=!ce.length;De?I(X):ee()})}ee()}var w=function(I,N,X){var ee=function oe(ce,De){De=De||"",ce.isFile?ce.file(function(Ee){X(Ee)&&(ce.fullPath&&!Ee.webkitRelativePath&&(Object.defineProperties(Ee,{webkitRelativePath:{writable:!0}}),Ee.webkitRelativePath=ce.fullPath.replace(/^\//,""),Object.defineProperties(Ee,{webkitRelativePath:{writable:!1}})),N([Ee]))}):ce.isDirectory&&M(ce,function(Ee){Ee.forEach(function(Ce){oe(Ce,""+De+ce.name+"/")})})};I.forEach(function(oe){ee(oe.webkitGetAsEntry())})},E=w,b=Object.assign||function(V){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(V,X))continue;N[X]=V[X]}return N}function L(V,I){if(!(V instanceof I))throw new TypeError("Cannot call a class as a function")}function f(V,I){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:V}function p(V,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);V.prototype=Object.create(I&&I.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(V,I):V.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(N,X){return(X.substr(0,5)==="data-"||X.substr(0,5)==="aria-"||X==="role")&&(N[X]=I[X]),N},{})},C=function(V){p(I,V);function I(){var N,X,ee,oe;L(this,I);for(var ce=arguments.length,De=Array(ce),Ee=0;Ee=7&&this.setupTypeNumber(F),this.dataCache==null&&(this.dataCache=_.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,O)},j.setupPositionProbePattern=function(F,O){for(var A=-1;A<=7;A++){if(F+A<=-1||this.moduleCount<=F+A)continue;for(var c=-1;c<=7;c++){if(O+c<=-1||this.moduleCount<=O+c)continue;0<=A&&A<=6&&(c==0||c==6)||0<=c&&c<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=c&&c<=4?this.modules[F+A][O+c]=!0:this.modules[F+A][O+c]=!1}}},j.getBestMaskPattern=function(){for(var F=0,O=0,A=0;A<8;A++){this.makeImpl(!0,A);var c=Q.getLostPoint(this);(A==0||F>c)&&(F=c,O=A)}return O},j.createMovieClip=function(F,O,A){var c=F.createEmptyMovieClip(O,A),x=1;this.make();for(var M=0;M>A&1)==1;this.modules[Math.floor(A/3)][A%3+this.moduleCount-8-3]=c}for(var A=0;A<18;A++){var c=!F&&(O>>A&1)==1;this.modules[A%3+this.moduleCount-8-3][Math.floor(A/3)]=c}},j.setupTypeInfo=function(F,O){for(var A=this.errorCorrectLevel<<3|O,c=Q.getBCHTypeInfo(A),x=0;x<15;x++){var M=!F&&(c>>x&1)==1;x<6?this.modules[x][8]=M:x<8?this.modules[x+1][8]=M:this.modules[this.moduleCount-15+x][8]=M}for(var x=0;x<15;x++){var M=!F&&(c>>x&1)==1;x<8?this.modules[8][this.moduleCount-x-1]=M:x<9?this.modules[8][15-x-1+1]=M:this.modules[8][15-x-1]=M}this.modules[this.moduleCount-8][8]=!F},j.mapData=function(F,O){for(var A=-1,c=this.moduleCount-1,x=7,M=0,w=this.moduleCount-1;w>0;w-=2)for(w==6&&w--;;){for(var E=0;E<2;E++)if(this.modules[c][w-E]==null){var b=!1;M>>x&1)==1);var u=Q.getMask(O,c,w-E);u&&(b=!b),this.modules[c][w-E]=b,x--,x==-1&&(M++,x=7)}if(c+=A,c<0||this.moduleCount<=c){c-=A,A=-A;break}}},_.PAD0=236,_.PAD1=17,_.createData=function(F,O,A){for(var c=$.getRSBlocks(F,O),x=new R,M=0;ME*8)throw new Error("code length overflow. ("+x.getLengthInBits()+">"+E*8+")");for(x.getLengthInBits()+4<=E*8&&x.put(0,4);x.getLengthInBits()%8!=0;)x.putBit(!1);for(;!(x.getLengthInBits()>=E*8);){if(x.put(_.PAD0,8),x.getLengthInBits()>=E*8)break;x.put(_.PAD1,8)}return _.createBytes(x,c)},_.createBytes=function(F,O){for(var A=0,c=0,x=0,M=new Array(O.length),w=new Array(O.length),E=0;E=0?L.get(f):0}}for(var p=0,a=0;a=0;)j^=U.G15<=0;)j^=U.G18<>>=1;return j},getPatternPosition:function(_){return U.PATTERN_POSITION_TABLE[_-1]},getMask:function(_,j,F){switch(_){case Q.PATTERN000:return(j+F)%2==0;case Q.PATTERN001:return j%2==0;case Q.PATTERN010:return F%3==0;case Q.PATTERN011:return(j+F)%3==0;case Q.PATTERN100:return(Math.floor(j/2)+Math.floor(F/3))%2==0;case Q.PATTERN101:return j*F%2+j*F%3==0;case Q.PATTERN110:return(j*F%2+j*F%3)%2==0;case Q.PATTERN111:return(j*F%3+(j+F)%2)%2==0;default:throw new Error("bad maskPattern:"+_)}},getErrorCorrectPolynomial:function(_){for(var j=new $([1],0),F=0;F<_;F++)j=j.multiply(new $([1,R.gexp(F)],0));return j},getLengthInBits:function(_,j){if(1<=j&&j<10)switch(_){case ne.MODE_NUMBER:return 10;case ne.MODE_ALPHA_NUM:return 9;case ne.MODE_8BIT_BYTE:return 8;case ne.MODE_KANJI:return 8;default:throw new Error("mode:"+_)}else if(j<27)switch(_){case ne.MODE_NUMBER:return 12;case ne.MODE_ALPHA_NUM:return 11;case ne.MODE_8BIT_BYTE:return 16;case ne.MODE_KANJI:return 10;default:throw new Error("mode:"+_)}else if(j<41)switch(_){case ne.MODE_NUMBER:return 14;case ne.MODE_ALPHA_NUM:return 13;case ne.MODE_8BIT_BYTE:return 16;case ne.MODE_KANJI:return 12;default:throw new Error("mode:"+_)}else throw new Error("type:"+j)},getLostPoint:function(_){for(var j=_.getModuleCount(),F=0,O=0;O5&&(F+=3+c-5)}for(var O=0;O1&&arguments[1]!==void 0?arguments[1]:1,be=Ue.length,re=0;re1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(N).map(function(ee,oe){if(!U.isValidElement(ee)||!ee.type)return null;var ce=ee.type.isSelectOptGroup,De=ee.key,Ee=ee.props,Ce=Ee.children,Te=Object(j.a)(Ee,["children"]);return X||!ce?C(ee):Object(p.a)(Object(p.a)({key:"__RC_SELECT_GRP__".concat(De===null?oe:De,"__"),label:De},Te),{},{options:m(Ce)})}).filter(function(ee){return ee})}var v=se("2Qr1"),h=se("qNPg"),o=se("U8pU"),T=se("Kwbf"),S=se("WKfj");function y(N){var X=N.mode,ee=N.options,oe=N.children,ce=N.backfill,De=N.allowClear,Ee=N.placeholder,Ce=N.getInputElement,Te=N.showSearch,me=N.onSearch,pe=N.defaultOpen,ue=N.autoFocus,te=N.labelInValue,de=N.value,ae=N.inputValue,we=N.optionLabelProp,Le=X==="multiple"||X==="tags",xe=Te!==void 0?Te:Le||X==="combobox",Oe=ee||m(oe);if(Object(T.a)(X!=="tags"||Oe.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var Ie=Oe.some(function(Ne){return Ne.options?Ne.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(T.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(X!=="combobox"||!we,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(X==="combobox"||!ce,"`backfill` only works with `combobox` mode."),Object(T.a)(X==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(T.b)(X!=="combobox"||!Ce||!De||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!xe&&X!=="combobox"&&X!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!pe||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var We=Object(S.d)(de);Object(T.a)(!te||We.every(function(Ne){return Object(o.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!Le||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Fe=null;Object(D.a)(oe).some(function(Ne){if(!U.isValidElement(Ne)||!Ne.type)return!1;var Ue=Ne.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var et=Object(D.a)(Ne.props.children).every(function(ot){return!U.isValidElement(ot)||!Ne.type||ot.type.isSelectOption?!0:(Fe=ot.type,!1)});return!et}return Fe=Ue,!0}),Fe&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(T.a)(ae===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=y,B=Object(h.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:m,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:P,fillOptionsWithMissingValue:v.a}),W=function(N){Object(R.a)(ee,N);var X=Object(Q.a)(ee);function ee(){var oe;return Object(ne.a)(this,ee),oe=X.apply(this,arguments),oe.selectRef=U.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object($.a)(ee,[{key:"render",value:function(){return U.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(U.Component);W.Option=d,W.OptGroup=f;var V=W,I=at.c=V},M8RZ:function(ht,at,se){"use strict";se.d(at,"a",function(){return O});var ne=se("fWQN"),$=se("mtLc"),R=se("yKVA"),Q=se("879j"),U=se("q1tI"),_=se.n(U),j=se("i8i4"),F=se.n(j),O=function(A){Object(R.a)(x,A);var c=Object(Q.a)(x);function x(M){var w;Object(ne.a)(this,x),w=c.call(this,M);var E=window.document;return w.node=E.createElement("div"),E.body.appendChild(w.node),w}return Object($.a)(x,[{key:"render",value:function(){var w=this.props.children;return Object(j.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),x}(_.a.Component)},Ot1p:function(ht,at,se){"use strict";var ne=se("2qtc"),$=se("kLXV"),R=se("rAM+"),Q=se("miYZ"),U=se("tsqr"),_=se("9og8"),j=se("tJVT"),F=se("jrin"),O=se("WmNS"),A=se.n(O),c=se("q1tI"),x=se.n(c),M=se("VrN/"),w=se.n(M),E=se("bdgK"),b=se("p77/"),u=se("Bd2K"),a=se("ELLl"),l=se("19Vz"),d=se("lZu9"),L=se("+NIl"),f=se("kSUc"),p=se("9Bee"),D=function(Ge){var Et=Ge.value,ft=Et===void 0?"":Et,it=Ge.className,Rt=Ge.showTextOnly,pt=Ge.showLines,At=Ge.style,Lt=At===void 0?{}:At,Ze=Object(c.useMemo)(function(){return""},[ft]);return x.a.createElement(x.a.Fragment,null,x.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ze}}))},C=se("Q9mQ"),m=se("diRs"),v=se("0Owb"),h=se("dejd"),o=se("C+DQ"),T=se("D1Df"),S=se.n(T),y=se("1vsH"),P=se("m3rI"),B=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function W(Ge){var Et=Ge.onActionCallback,ft=Ge.title,it=Ge.icon,Rt=Ge.actionName,pt=Ge.className,At=pt===void 0?"":pt,Lt=Ge.children;function Ze(){Et(Rt)}return x.a.createElement("a",{title:ft,className:At,onClick:Ze},x.a.createElement("i",{className:"md-iconfont ".concat(it)}),Lt)}var V=function(Ge){var Et=Ge.watch,ft=Ge.showNullButton,it=Ge.onActionCallback,Rt=Ge.fullScreen,pt=Ge.insertTemp,At=Ge.hidetoolBar,Lt=Ge.uuid,Ze=Ge.setOpenPhones,ir=Object(y.E)("_educoder_session_login"),Zt=Object(y.E)("_educoder_session"),yt=[].concat(B,[{title:"".concat(Et?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Et?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return x.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&yt.map(function(Wt,nr){return x.a.createElement("li",{key:nr},Wt.actionName?x.a.createElement(W,Object(v.a)({},Wt,{onActionCallback:it})):x.a.createElement("span",{className:"v-line"}))}),ft?x.a.createElement("li",null,x.a.createElement(W,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:it},x.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pt&&x.a.createElement("li",null,x.a.createElement(W,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pt),onActionCallback:it},x.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),x.a.createElement("li",null,x.a.createElement(m.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:x.a.createElement("div",null,x.a.createElement("span",{style:{display:"none"}},location.origin+"/react/build/upload.html?_educoder_session_login="+ir+"&_educoder_session="+Zt+"&key="+Lt+"&api="+encodeURIComponent(P.a.API_SERVER)),x.a.createElement(S.a,{size:150,fgColor:"#000",value:location.origin+"/react/build/upload.html?_educoder_session_login="+ir+"&_educoder_session="+Zt+"&key="+Lt+"&api="+encodeURIComponent(P.a.API_SERVER)}))},x.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return Ze(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),x.a.createElement("li",{className:"btn-full-screen"},x.a.createElement(W,{icon:"".concat(Rt?"icon-shrink":"icon-enlarge"),title:Rt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:it})))},I=se("M8RZ"),N=se("+L6B"),X=se("2/Rp"),ee=se("y8nQ"),oe=se("Vl3Y"),ce=se("5NDa"),De=se("5rEg"),Ee={labelCol:{span:4},wrapperCol:{span:20}},Ce=function(Ge){var Et=Ge.callback,ft=Ge.onCancel;function it(Rt){Et(Rt)}return x.a.createElement(oe.a,Object(v.a)({},Ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:it}),x.a.createElement(oe.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},x.a.createElement(De.a,null)),x.a.createElement(oe.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},x.a.createElement(De.a,null)),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(X.a,{type:"ghost",onClick:ft},"\u53D6\u6D88")))},Te=se("7ahc"),me=se("k1fw"),pe=se("HmJG"),ue=se("BjJ7"),te=oe.a.useForm,de={width:280,marginRight:10},ae={labelCol:{span:5},wrapperCol:{span:19}},we=function(Ge){var Et=Ge.callback,ft=Ge.onCancel,it=te(),Rt=Object(j.a)(it,1),pt=Rt[0],At=Object(c.useRef)();function Lt(Zt){Et(Object(me.a)(Object(me.a)({},Zt),{},{name:At.current}))}function Ze(Zt,yt){pt.setFieldsValue({src:"/api/attachments/".concat(Zt.id,"?type=").concat(Zt.content_type),type:yt.type})}function ir(Zt){var yt=Zt.target.files[0];At.current=yt.name,xe(yt,Ze)}return x.a.createElement(oe.a,Object(v.a)({form:pt},ae,{className:"upload-image-panel",onFinish:Lt}),x.a.createElement(oe.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},x.a.createElement("div",{className:"flex-container"},x.a.createElement(oe.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},x.a.createElement(De.a,{style:de})),x.a.createElement(Le,{onFileChange:ir}))),x.a.createElement(oe.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},x.a.createElement(De.a,{style:{width:264}})),x.a.createElement(oe.a.Item,{style:{textAlign:"right"}},x.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(X.a,{type:"ghost",onClick:ft},"\u53D6\u6D88")))};function Le(Ge){var Et=Ge.onFileChange;return x.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",x.a.createElement("input",{type:"file",onChange:Et}))}function xe(Ge,Et){if(!Ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var ft=new FormData;ft.append("editormd-image-file",Ge),ft.append("file_param_name","editormd-image-file"),ft.append("byxhr","true");var it=new window.XMLHttpRequest;it.withCredentials=!0,it.addEventListener("load",function(Rt){Et(JSON.parse(Rt.target.responseText),Ge)},!1),it.addEventListener("error",function(Rt){console.error(Rt)},!1),it.open("POST","".concat(ue.a,"/api/attachments.json")),it.send(ft)}var Oe=se("giR+"),Ie=se("fyUT"),We=se("7Kak"),Fe=se("9yH6"),Ne=Fe.a.Group,Ue={margin:"0 8px"},et=function(Ge){var Et=Ge.callback,ft=Ge.onCancel;function it(Rt){Et(Rt)}return x.a.createElement(oe.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:it},x.a.createElement("div",{className:"flex-container"},x.a.createElement("span",{style:Ue},"\u5355\u5143\u683C\u6570\uFF1A"),x.a.createElement("span",{style:Ue},"\u884C\u6570"),x.a.createElement(oe.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},x.a.createElement(Ie.a,null)),x.a.createElement("span",{style:Ue},"\u5217\u6570"),x.a.createElement(oe.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},x.a.createElement(Ie.a,null))),x.a.createElement("div",{className:"flex-container",style:{marginTop:12}},x.a.createElement("span",{style:Ue},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),x.a.createElement(oe.a.Item,{name:"align"},x.a.createElement(Ne,null,x.a.createElement(Fe.a,{value:"default"},x.a.createElement("i",{className:"fa fa-align-justify"})),x.a.createElement(Fe.a,{value:"left"},x.a.createElement("i",{className:"fa fa-align-left"})),x.a.createElement(Fe.a,{value:"center"},x.a.createElement("i",{className:"fa fa-align-center"})),x.a.createElement(Fe.a,{value:"right"},x.a.createElement("i",{className:"fa fa-align-right"}))))),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(X.a,{type:"ghost",onClick:ft},"\u53D6\u6D88")))},ot=se("ErOA"),nt=se("7Cbv"),qe="link",st="upload-image",$e="code-block",Qe="add-table",Me="------------",ut={default:Me,left:":".concat(Me),center:":".concat(Me,":"),right:"".concat(Me,":")},lt=se("9VGf"),Be,Ke;function Se(){}var ve=0,be=1e4,re="\u2581",ie=`
**\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 le(Ge){return/^\d+$/.test(Ge)?"".concat(Ge,"px"):Ge}var he=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=he?"Cmd":"Ctrl",Pe=["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"],Xe=(Be={},Object(F.a)(Be,ke+"-B","bold"),Object(F.a)(Be,ke+"-I","italic"),Be),vt=(Ke={},Object(F.a)(Ke,qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Ke,$e,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Ke,st,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Ke,Qe,"\u6DFB\u52A0\u8868\u683C"),Ke),Dt=at.a=function(Ge){var Et=Ge.defaultValue,ft=Et===void 0?"":Et,it=Ge.onChange,Rt=Ge.width,pt=Rt===void 0?"100%":Rt,At=Ge.height,Lt=At===void 0?400:At,Ze=Ge.miniToolbar,ir=Ze===void 0?!1:Ze,Zt=Ge.isFocus,yt=Zt===void 0?!1:Zt,Wt=Ge.watch,nr=Ge.insertTemp,ar=Ge.mode,Cr=ar===void 0?"markdown":ar,Ar=Ge.id,Vr=Ar===void 0?"markdown-editor-id":Ar,Bt=Ge.showResizeBar,gt=Bt===void 0?!1:Bt,jr=Ge.noStorage,li=jr===void 0?!1:jr,Lr=Ge.showNullButton,Pt=Lr===void 0?!1:Lr,Xr=Ge.hidetoolBar,ui=Xr===void 0?!1:Xr,gi=Ge.fullScreen,Ye=gi===void 0?!1:gi,Tt=Ge.onBlur,ti=Ge.onCMBeforeChange,di=Ge.onFullScreen,hi=Ge.className,Ri=hi===void 0?"":hi,K=Ge.disablePaste,s=K===void 0?!1:K,g=Ge.placeholder,G=g===void 0?"":g,J=Ge.values,z=J===void 0?"":J,ye=Object(c.useState)(null),He=Object(j.a)(ye,2),_e=He[0],mt=He[1],ze=Object(c.useState)(ft),wt=Object(j.a)(ze,2),Nt=wt[0],Gt=wt[1],Wr=Object(c.useState)(Wt),Hr=Object(j.a)(Wr,2),hr=Hr[0],Yr=Hr[1],Ki=Object(c.useState)(Ye),kr=Object(j.a)(Ki,2),Dr=kr[0],ri=kr[1],vi=Object(c.useState)(""),Qr=Object(j.a)(vi,2),ii=Qr[0],Gr=Qr[1],fn=Object(c.useState)(0),Vi=Object(j.a)(fn,2),Ir=Vi[0],Nr=Vi[1],_i=Object(c.useState)(Lt),Oi=Object(j.a)(_i,2),Mi=Oi[0],tr=Oi[1],Ft=Object(c.useState)(!1),vr=Object(j.a)(Ft,2),jt=vr[0],yr=vr[1],Yt=Object(c.useRef)(Object(nt.a)()),yi=Object(c.useRef)(!1),lr=Object(c.useRef)(),ur=Object(c.useRef)(),ni=Object(c.useRef)(),bi=Object(c.useRef)(),xi=Object(c.useRef)(),Fn=function(){var bt=Object(_.a)(A.a.mark(function kt(){var St,Ot;return A.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(ot.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Yt.current}});case 2:Ot=zt.sent,Ot!=null&&(St=Ot.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",_e,ur),Ot.attachments.map(function(It){It.content_type.indexOf("image")>-1?_e.replaceSelection(".concat(It.content_type,")")):It.content_type.indexOf("video")>-1?_e.replaceSelection('')):It.content_type.indexOf("pdf")>-1?_e.replaceSelection('').concat(It.name,"")):_e.replaceSelection("[".concat(It.name,"](").concat(P.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}));case 4:case"end":return zt.stop()}},kt)}));return function(){return bt.apply(this,arguments)}}();Object(c.useEffect)(function(){Gt(z),_e==null||_e.setValue(z)},[z]),Object(c.useEffect)(function(){di==null||di(Dr)},[Dr]),Object(c.useEffect)(function(){if(ur.current){var bt=w.a.fromTextArea(ur.current,{mode:Cr,lineNumbers:!ir,lineWrapping:!0,value:ft,autoCloseTags:!0,autoCloseBrackets:!0});yt&&bt.focus();function kt(St,Ot){if(s){Ot.preventDefault();return}var Ut=Ot.clipboardData;if(Ut){var zt=Ut.types.toString(),It=Ut.items;if(zt==="Files"||Ut.types.indexOf("Files")>-1){if(Ot.preventDefault(),Cr=="stex")return;try{var Jt,cr=It[1];((Jt=It[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(cr=It[0]);var Mt=cr.getAsFile(),Pi=Mt.name.split(".").pop();xe(Mt,function(Kt){if(Kt.id){var br,Xt,$r;(Mt==null||((br=Mt.type)===null||br===void 0)?void 0:br.indexOf("image"))>-1?bt.replaceSelection(".concat(Kt.content_type,")")):(Mt==null||((Xt=Mt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?bt.replaceSelection('')):(Mt==null||(($r=Mt.type)===null||$r===void 0)?void 0:$r.indexOf("pdf"))>-1?bt.replaceSelection('').concat(Mt.name,"")):Pe.includes(Pi)?bt.replaceSelection('').concat(Mt.name,"")):bt.replaceSelection("[".concat(Mt.name,"](").concat(P.a.API_SERVER,"/api/attachments/").concat(Kt.id,"?type=").concat(Kt.content_type,")"))}else(Kt==null?void 0:Kt.status)===401&&(document.location.href="/user/login")})}catch(Kt){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return bt.on("paste",kt),bt.on("dragleave",function(St,Ot){ni.current.classList.remove("mouse-hover-md")}),bt.on("dragover",function(St,Ot){ni.current.classList.add("mouse-hover-md")}),bt.on("drop",function(St,Ot){ni.current.classList.add("mouse-hover-md");var Ut;if(Ut=Ot.dataTransfer.files,Ut.length>0){Ot.preventDefault(),Ot.stopPropagation();for(var zt=function(cr){var Mt=Ut[cr],Pi=Mt.name.split(".").pop();xe(Mt,function(Kt){if(Kt.id){var br,Xt,$r;(Mt==null||((br=Mt.type)===null||br===void 0)?void 0:br.indexOf("image"))>-1?bt.replaceSelection(".concat(Kt.content_type,")")):(Mt==null||((Xt=Mt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?bt.replaceSelection('')):(Mt==null||(($r=Mt.type)===null||$r===void 0)?void 0:$r.indexOf("pdf"))>-1?bt.replaceSelection('').concat(Mt.name,"")):Pe.includes(Pi)?bt.replaceSelection('').concat(Mt.name,"")):bt.replaceSelection("[".concat(Mt.name,"](").concat(P.a.API_SERVER,"/api/attachments/").concat(Kt.id,"?type=").concat(Kt.content_type,")"))}else(Kt==null?void 0:Kt.status)===401&&(document.location.href="/user/login")})},It=0;It0||It.target.offsetWidth>0)&&(Zr(),_e.setSize("100%","100%"),_e.refresh())}}catch(Jt){Ut.e(Jt)}finally{Ut.f()}});return St.observe(ur.current.parentElement),St}if(_e){var kt=bt();return function(){kt.unobserve(ur.current.parentElement)}}},[_e,Zr]),Object(c.useEffect)(function(){if(_e){for(var bt=[],kt=function(){var It=Ot[St];Ut=Object(j.a)(It,2);var Jt=Ut[0],cr=Ut[1],Mt=Object(F.a)({},Jt,function(){Xi(cr)});bt.push(Mt),_e.addKeyMap(Mt)},St=0,Ot=Object.entries(Xe);St0){var bt=new Date().getTime(),kt=window.sessionStorage.getItem(Vr);bt>=Ir+be&&(!kt||kt!==Nt)&&(window.sessionStorage.setItem(Vr,Nt),yr(!0))}},be),Object(c.useEffect)(function(){Yr(Wt)},[_e,Wt]),Object(c.useEffect)(function(){_e&&(yt&&_e.focus())},[_e,yt]),Object(c.useEffect)(function(){if(hr&&_e){var bt=_e.getScrollerElement();function kt(St){var Ot=St.target;if(xi.current){var Ut=Ot.scrollTop/Ot.scrollHeight;xi.current.scrollTop=xi.current.scrollHeight*Ut}}return bt.addEventListener("scroll",kt),function(){bt.removeEventListener("scroll",kt)}}},[_e,hr]),Object(c.useEffect)(function(){if(_e&&ti){function bt(kt,St){ti(kt,St)}return _e.on("beforeChange",bt),function(){_e.off("beforeChange",bt)}}},[_e,ti]),Object(c.useEffect)(function(){if(_e&&Tt){function bt(){Tt(_e.getValue())}return _e.on("blur",bt),function(){_e.off("blur",bt)}}},[_e,Tt]),Object(c.useEffect)(function(){if(_e){function bt(kt){var St=kt.getValue();Gt(St),Nr(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),it&&it(St)}return _e.on("change",bt),function(){_e.off("change",bt)}}},[_e,it]),Object(c.useEffect)(function(){_e&&(ft==null?(_e.setValue(""),Gt("")):ft!==_e.getValue()&&(_e.setValue(ft),Gt(ft),_e.setCursor(_e.lineCount(),0)))},[_e,ft]);var Xi=Object(c.useCallback)(function(bt){var kt=_e.getCursor(),St=_e.getSelection(),Ot=St.split(`
`);switch(bt){case"bold":return _e.replaceSelection("**"+St+"**"),St===""&&_e.setCursor(kt.line,kt.ch+2),_e.focus();case"italic":return _e.replaceSelection("*"+St+"*"),St===""&&_e.setCursor(kt.line,kt.ch+1),_e.focus();case"code":return _e.replaceSelection("`"+St+"`"),St===""&&_e.setCursor(kt.line,kt.ch+1),_e.focus();case"inline-latex":return _e.replaceSelection("`$$"+St+"$$`"),St===""&&_e.setCursor(kt.line,kt.ch+3),_e.focus();case"latex":return _e.replaceSelection("```latex\n"+St+"\n```"),_e.setCursor(kt.line+1,St.length+1),_e.focus();case"line-break":return _e.replaceSelection(`
`),_e.focus();case"list-ul":return St===""?_e.replaceSelection("- "+St):_e.replaceSelection(Ot.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(`
`)),_e.focus();case"list-ol":return St===""?_e.replaceSelection("1. "+St):_e.replaceSelection(Ot.map(function(Ut,zt){return Ut===""?"":"".concat(zt+1,". ").concat(Ut)}).join(`
`)),_e.focus();case"add-null-ch":return St===""&&_e.setCursor(kt.line,kt.ch+1),_e.replaceSelection(re),_e.focus();case"inster-template-1":return St===""&&_e.setCursor(kt.line,kt.ch),_e.replaceSelection(ie),_e.focus();case"eraser":return _e.setValue(""),_e.focus();case"trigger-watch":return Yr(!hr),_e.focus();case"trigger-full-screen":return ri(!Dr),_e.focus();case qe:Gr(qe);return;case $e:Gr($e);return;case st:Gr(st);return;case Qe:Gr(Qe);return;default:throw new Error}},[_e,hr,Dr]),Br=Object(c.useCallback)(function(bt){Gr("");switch(ii){case qe:var kt=bt.title,St=bt.link;return _e.replaceSelection("[".concat(kt,"](").concat(St,")")),_e.focus();case $e:var Ot=bt.language,Ut=bt.content;return _e.replaceSelection(["```"+Ot,Ut,"```"].join(`
`)),_e.focus();case st:var zt=bt.src,It=bt.alt,Jt=bt.name;return zt.indexOf("type=image")>-1?_e.replaceSelection(".concat(zt,' "').concat(It||"",'" )')):zt.indexOf("type=application/pdf")>-1?_e.replaceSelection('').concat(Jt,"")):_e.replaceSelection('').concat(Jt,"")),_e.focus();case Qe:for(var cr=bt.row,Mt=bt.col,Pi=bt.align,Kt=`
`,br=0;br300&&(Jt=300);var cr=Lt+Jt+"px";tr(cr)}}return bt.addEventListener("mousedown",Ot),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",Ut),function(){bt.removeEventListener("mousedown",Ot),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",Ut)}}},[_e,bi]),Object(c.useEffect)(function(){tr(Lt)},[Lt]);var Ei=le(pt),ua=le(Mi),da={width:Ei,height:ua},Qa=Object(c.useMemo)(function(){if(Ir){var bt=new Date(Ir),kt=bt.getHours(),St=bt.getMinutes(),Ot=bt.getSeconds();return kt=kt<10?"0"+kt:kt,St=St<10?"0"+St:St,Ot=Ot<10?"0"+Ot:Ot,"".concat(kt,":").concat(St,":").concat(Ot)}return 0},[Ir]);function Za(){window.sessionStorage.removeItem(Vr),yr(!1),Nr(0)}function ha(){yr(!1),Nr(0),_e.setValue(window.sessionStorage.getItem(Vr))}function jn(bt,kt){var St=_e.getValue();St=St.replace(bt,kt),Gt(St),_e==null||_e.setValue(St)}return x.a.createElement(c.Fragment,null,x.a.createElement("div",{className:"markdown-editor-wrapper",ref:ni},x.a.createElement("div",{className:"markdown-editor-container ".concat(Ri," ").concat(hr?"on-preview":""," ").concat(ir?"mini":""," ").concat(Dr?"full-screen":""),style:da},x.a.createElement(V,{insertTemp:nr,watch:hr,fullScreen:Dr,showNullButton:Pt,onActionCallback:Xi,hidetoolBar:ui,uuid:Yt.current,setOpenPhones:function(){yi.current=!0}}),x.a.createElement("div",{className:"markdown-editor-body"},x.a.createElement("div",{className:"codemirror-container"},x.a.createElement("textarea",{ref:ur,placeholder:G})),hr?x.a.createElement("div",{ref:xi,className:"preview-container"},Cr==="stex"&&x.a.createElement(D,{value:Nt}),Cr!=="stex"&&x.a.createElement(p.a,{edit:!0,value:Nt,replaces:jn})):null))),gt?x.a.createElement("a",{ref:bi,className:"editor-resize"}):null,x.a.createElement(I.a,null,vt[ii]?x.a.createElement($.a,{centered:!0,title:vt[ii],visible:!0,onCancel:ci,footer:null},Yi):null))}},SJMd:function(ht,at){/**
* @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 se,ne,$,R=!1,Q,U;window.PR_SHOULD_USE_CONTINUATION=!0;var _,j;(function(){var F=window,O=["break,continue,do,else,for,if,return,while"],A=[O,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],c=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],x=[c,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],M=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[c,"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"],E="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",b=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[O,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[O,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[x,w,M,b,u,a,l,d],f=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",D="kwd",C="com",m="typ",v="lit",h="pun",o="pln",T="tag",S="dec",y="src",P="atn",B="atv",W="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(xe){for(var Oe=0,Ie=!1,We=!1,Fe=0,Ne=xe.length;Fe122||(re<65||be>90||ut.push([Math.max(65,be)|32,Math.min(re,90)|32]),re<97||be>122||ut.push([Math.max(97,be)&~32,Math.min(re,122)&~32]))}}ut.sort(function(ke,Pe){return ke[0]-Pe[0]||Pe[1]-ke[1]});for(var ie=[],le=[],Ke=0;Kehe[0]&&(he[1]+1>he[0]&&Be.push("-"),Be.push(nt(he[1])))}return Be.push("]"),Be.join("")}function st(Qe){for(var Me=Qe.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ut=Me.length,lt=[],Be=0,Ke=0;Be=2&&be==="["?Me[Be]=qe(Se):be!=="\\"&&(Me[Be]=Se.replace(/[a-zA-Z]/g,function(le){var he=le.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Me.join("")}for(var $e=[],Fe=0,Ne=xe.length;Fe=0;)Ie[$e.charAt(Qe)]=st;var Me=st[1],ut=""+Me;ot.hasOwnProperty(ut)||(et.push(Me),ot[ut]=null)}et.push(/[\0-\uffff]/),We=I(et)})();var Fe=Oe.length,Ne=function(Ue){for(var et=Ue.sourceCode,ot=Ue.basePos,nt=Ue.sourceNode,qe=[ot,o],st=0,$e=et.match(We)||[],Qe={},Me=0,ut=$e.length;Me=5&&Be.substring(0,5)==="lang-",Se&&!(Ke&&typeof Ke[1]=="string")&&(Se=!1,Be=y),Se||(Qe[lt]=Be)}var re=st;if(st+=lt.length,!Se)qe.push(ot+re,Be);else{var ie=Ke[1],le=lt.indexOf(ie),he=le+ie.length;Ke[2]&&(he=lt.length-Ke[2].length,le=he-ie.length);var ke=Be.substring(5);X(nt,ot+re,lt.substring(0,le),Ne,qe),X(nt,ot+re+le,ie,ue(ke,ie),qe),X(nt,ot+re+he,lt.substring(he),Ne,qe)}}Ue.decorations=qe};return Ne}function De(xe){var Oe=[],Ie=[];xe.tripleQuotedStrings?Oe.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):xe.multiLineStrings?Oe.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Oe.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),xe.verbatimStrings&&Ie.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var We=xe.hashComments;We&&(xe.cStyleComments?(We>1?Oe.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Oe.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Oe.push([C,/^#[^\r\n]*/,null,"#"])),xe.cStyleComments&&(Ie.push([C,/^\/\/[^\r\n]*/,null]),Ie.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=xe.regexLiterals;if(Fe){var Ne=Fe>1?"":`
\r`,Ue=Ne?".":"[\\S\\s]",et="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+V+"("+et+")")])}var ot=xe.types;ot&&Ie.push([m,ot]);var nt=(""+xe.keywords).replace(/^ | $/g,"");nt.length&&Ie.push([D,new RegExp("^(?:"+nt.replace(/[\s,]+/g,"|")+")\\b"),null]),Oe.push([o,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return xe.regexLiterals&&(qe+="(?!s*/)"),Ie.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[h,new RegExp(qe),null]),ce(Oe,Ie)}var Ee=De({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(xe,Oe,Ie){for(var We=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ne=xe.ownerDocument,Ue=Ne.createElement("li");xe.firstChild;)Ue.appendChild(xe.firstChild);var et=[Ue];function ot(Me){var ut=Me.nodeType;if(ut==1&&!We.test(Me.className))if(Me.nodeName==="br")nt(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var lt=Me.firstChild;lt;lt=lt.nextSibling)ot(lt);else if((ut==3||ut==4)&&Ie){var Be=Me.nodeValue,Ke=Be.match(Fe);if(Ke){var Se=Be.substring(0,Ke.index);Me.nodeValue=Se;var ve=Be.substring(Ke.index+Ke[0].length);if(ve){var be=Me.parentNode;be.insertBefore(Ne.createTextNode(ve),Me.nextSibling)}nt(Me),Se||Me.parentNode.removeChild(Me)}}}function nt(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function ut(Ke,Se){var ve=Se?Ke.cloneNode(!1):Ke,be=Ke.parentNode;if(be){var re=ut(be,1),ie=Ke.nextSibling;re.appendChild(ve);for(var le=ie;le;le=ie)ie=le.nextSibling,re.appendChild(le)}return ve}for(var lt=ut(Me.nextSibling,0),Be;(Be=lt.parentNode)&&Be.nodeType===1;)lt=Be;et.push(lt)}for(var qe=0;qe=be&&(ot+=2),Ne>=re&&(st+=2)}}finally{Be&&(Be.style.display=Ke)}}var me={};function pe(xe,Oe){for(var Ie=Oe.length;--Ie>=0;){var We=Oe[Ie];me.hasOwnProperty(We)?F.console&&console.warn("cannot override language handler %s",We):me[We]=xe}}function ue(xe,Oe){return xe&&me.hasOwnProperty(xe)||(xe=/^\s*]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^